diff --git a/.gitmodules b/.gitmodules index abcc806..072c876 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "external/SDL"] path = external/SDL url = https://github.com/libsdl-org/SDL.git +[submodule "external/GameNetworkingSockets"] + path = external/GameNetworkingSockets + url = https://github.com/ValveSoftware/GameNetworkingSockets.git diff --git a/build.cpp b/build.cpp index dab16ca..eda6760 100644 --- a/build.cpp +++ b/build.cpp @@ -8,12 +8,16 @@ CUtlVector all_IncludeDirectories = { "external/cglm/include", "external/stb", "external/SDL/include", + "external/steamworks/public", + "external/GameNetworkingSockets/include", }; auto szTarget = Target_t::DefaultTarget().GetTriplet(); auto szOutputDir = CUtlString("build/funnygame/%s/game",szTarget.GetString()); bool bStaticBuild = false; +bool bSteam = false; +CUtlString steam_lib; extern "C" void Preinit() { @@ -29,6 +33,26 @@ extern "C" void Preinit() all_IncludeDirectories.AppendTail("external/Vulkan-Headers/include"); all_IncludeDirectories.AppendTail("external/VulkanMemoryAllocator/include"); } + switch ( Target_t::DefaultTarget().kernel ) + { + case TARGET_KERNEL_WINDOWS: + bSteam = true; + break; + case TARGET_KERNEL_LINUX: + bSteam = true; + steam_lib = "external/steamworks/redistributable_bin/linux64/libsteam_api.so"; + break; + case TARGET_KERNEL_DARWIN: + bSteam = true; + break; + default: + break; + } + if (bSteam) + { + IFileSystem2::MakeDirectory(CUtlString("%s/bin", szOutputDir.GetString())); + IFileSystem2::CopyFile(CUtlString("%s/bin", szOutputDir.GetString()), steam_lib); + } }; CUtlString tier0_lib; @@ -39,6 +63,8 @@ CUtlString client_lib; #include "tier0/__build.cpp" #include "tier1/__build.cpp" +#include "fgui/__build.cpp" + #include "game/server/__build.cpp" #include "game/client/__build.cpp" diff --git a/engine/__build.cpp b/engine/__build.cpp index a02cf44..db0353c 100644 --- a/engine/__build.cpp +++ b/engine/__build.cpp @@ -15,7 +15,7 @@ CUtlVector engine_CompiledFiles = { /* io */ "engine/input.cpp", - "engine/net.cpp", + "engine/networking.cpp", /* entities */ @@ -62,6 +62,8 @@ int engine_build() compileProject.bFPIC = true; if (bStaticBuild) compileProject.macros.AppendTail((C_Macro_t){"STATIC_BUILD","1"}); + if (bSteam) + compileProject.macros.AppendTail((C_Macro_t){"STEAM_ENABLED","1"}); ldProject = compileProject.Compile(); ldProject.libraries = engine_Libraries; if (bStaticBuild) @@ -69,7 +71,10 @@ int engine_build() else { ldProject.objects.AppendTail((CObject){tier1_lib}); + ldProject.objects.AppendTail((CObject){fgui_lib}); ldProject.objects.AppendTail((CObject){rapier_lib}); + if (bSteam) + ldProject.objects.AppendTail((CObject){steam_lib}); ldProject.linkType = ELINK_DYNAMIC_LIBRARY; } @@ -83,9 +88,6 @@ int engine_build() engine_lib = outputProject; } - - - return 0; }; DECLARE_BUILD_STAGE(engine, engine_build); diff --git a/engine/baseentity.cpp b/engine/baseentity.cpp index dad8c6a..3f67701 100644 --- a/engine/baseentity.cpp +++ b/engine/baseentity.cpp @@ -2,7 +2,7 @@ #include "tier0/platform.h" #include "tier1/utlstring.h" -CUtlSelfReferencingVector g_entities; +CUtlVector g_entities; CUtlVector g_RegisteredEntities; CBaseEntity::CBaseEntity() diff --git a/engine/brush.cpp b/engine/brush.cpp index 67dd56a..36a72f7 100644 --- a/engine/brush.cpp +++ b/engine/brush.cpp @@ -47,6 +47,13 @@ void CBrushEntity::Think( float fDelta ) }; +void CBrushEntity::Sync( void *pData, uint32_t nDataSize ) +{ + +}; + + + void CBrushEntity::ReadParameter( const char *szName, const char *szValue ) { CBaseEntity::ReadParameter(szName, szValue); @@ -143,6 +150,7 @@ void CBrushRendering::Init() void CBrushRendering::Frame( float fDelta ) { IRenderer::ResetState(); + IRenderer::SetDepthMode(DEPTH_MODE_LESS); IRenderer::BindPipeline(g_BrushPipeline); struct { mat4 i; diff --git a/engine/engine.cpp b/engine/engine.cpp index ccdbcd8..255e5e4 100644 --- a/engine/engine.cpp +++ b/engine/engine.cpp @@ -1,4 +1,10 @@ + +#include "fgui/fgui.h" #include "input.h" +#include "networking.h" +#include "steam/isteamgameserver.h" +#include "tier0/network.h" +#include "tier0/platform.h" #include "tier1/commandline.h" #include "tier1/utlstring.h" #include "tier0/lib.h" @@ -10,15 +16,18 @@ #include "server.h" #include "physics.h" #include "signal.h" +#include "steam/steam_api.h" +#include "steam/steam_gameserver.h" +#include "networking.h" double fPrev = 0; double fCurrent = 0; funnyphysics *px; -IIClient g_localClient; +IIClient *g_localClient; -CUtlVector g_clients; +CUtlVector g_clients = {}; //----------------------------------------------------------------------------- // Purpose: Engine entry point @@ -83,25 +92,66 @@ void IEngine::Init() signal(SIGTERM, IEngine_Signal); #endif +#ifdef STEAM_ENABLED + if(SteamAPI_RestartAppIfNecessary(480)) + { + Plat_Exit(0); + } + if (!SteamAPI_Init()) + { + V_printf("failed to init steam\n"); + } + +#endif + IFileSystem::InitFilesystem(); px = px_init(); if (!ICommandLine::CheckParam("-dedicated")) { - g_localClient = { - - }; - IIEngine::ConnectClient(&g_localClient); +#ifdef STEAM_ENABLED + // Log in into steam + if (!SteamUser()->BLoggedOn()) + { + SteamAPI_Shutdown(); + Plat_FatalErrorFunc("User must be logged in to Steam"); + } +#endif + // Run local client + g_localClient = new IIClient(); + IIEngine::ConnectClient(g_localClient); + // Init IO IVideo::Init(); IInput::Init(); IInput::SetMouseMode(MOUSE_MODE_GAME); - } + IFGUI::Init(); + } else { +#ifdef STEAM_ENABLED + // Run dedicated server with steam + SteamGameServer_Init(0, 27015, 27016, eServerModeAuthentication, "0.0.0.0"); + SteamGameServer()->SetProduct("funnygame"); + SteamGameServer()->SetGameDescription("not that funny but ok"); + SteamGameServer()->SetModDir("funnygame"); + SteamGameServer()->SetDedicatedServer(true); + SteamGameServer()->LogOnAnonymous(); + int nMaxPlayers = atoi(ICommandLine::ParamValue("-maxplayers", "128")); + SteamGameServer()->SetMaxPlayerCount(nMaxPlayers); + SteamGameServer()->SetAdvertiseServerActive(true); +#endif + } + + INetworking::Init(); + + // load game IServer::LoadGame("funnygame"); - IVideo::CreatePipelines(); + // create pipelines for rendering + if (!ICommandLine::CheckParam("-dedicated")) + IVideo::CreatePipelines(); + // execute default config IConsole::AddCommand("exec default.cfg;"); IConsole::Execute(); @@ -111,8 +161,16 @@ void IEngine::Init() //----------------------------------------------------------------------------- void IEngine::Frame(float fDelta) { +#ifdef STEAM_ENABLED + SteamAPI_RunCallbacks(); +#endif + INetworking::Frame(); IServer::Think(fDelta); - IVideo::Frame(fDelta); + if (!ICommandLine::CheckParam("-dedicated")) + { + IFGUI::Frame(); + IVideo::Frame(fDelta); + } }; //----------------------------------------------------------------------------- @@ -120,12 +178,15 @@ void IEngine::Frame(float fDelta) //----------------------------------------------------------------------------- void IEngine::Shutdown() { - + INetworking::Deinit(); }; //----------------------------------------------------------------------------- // Purpose: Spawns entity in the world //----------------------------------------------------------------------------- + +uint64_t g_lastServerID = 1; +uint64_t g_lastPredictedID = 1; CBaseEntity *IIEngine::SpawnEntity( const char *szName ) { for (auto &entity: g_RegisteredEntities) @@ -133,7 +194,10 @@ CBaseEntity *IIEngine::SpawnEntity( const char *szName ) if (!V_strcmp(entity->m_szName, szName)) { CBaseEntity *pEnt = entity->m_pfn(); + pEnt->m_id = g_lastPredictedID+=1; g_entities.AppendTail(pEnt); + if (ICommandLine::CheckParam("-dedicated")) + return pEnt; if (entity->m_pClientfn) { pEnt->pClientEntity = entity->m_pClientfn(); @@ -162,13 +226,27 @@ void IIEngine::InitEntity( CBaseEntity *pEntity ) //----------------------------------------------------------------------------- void IIEngine::DestroyEntity( CBaseEntity *pEntity ) { - + uint32_t i = 0; + if (pEntity == NULL) + return; + for (auto &entity: g_entities) + { + if (pEntity == entity) + { + pEntity->Destroy(); + if (pEntity->pClientEntity) + pEntity->pClientEntity->Destroy(); + g_entities.RemoveAt(i); + return; + } + i++; + } }; //----------------------------------------------------------------------------- // Purpose: Connects client to the server //----------------------------------------------------------------------------- -void IIEngine::ConnectClient( IIClient *pClient) +void IIEngine::ConnectClient( IIClient *pClient ) { g_clients.AppendTail(pClient); } @@ -176,7 +254,37 @@ void IIEngine::ConnectClient( IIClient *pClient) //----------------------------------------------------------------------------- // Purpose: Disconnects client from the server //----------------------------------------------------------------------------- -void IIEngine::DisconnectClient( IIClient *pClient) +void IIEngine::DisconnectClient( IIClient *pClient ) { + DisconnectClient(pClient->playerID); } +void IIEngine::DisconnectClient( uint64_t playerID ) +{ + uint32_t i = 0; + for (auto &client: g_clients) + { + if (client->playerID == playerID) + { + g_clients.RemoveAt(i); + break; + } + i++; + } +}; + +void IIEngine::DisconnectClientByHandle( uint32_t playerHandle ) +{ + uint32_t i = 0; + for (auto &client: g_clients) + { + if (client->playerHandle == playerHandle) + { + IIEngine::DestroyEntity((CBaseEntity*)client->pBasePlayer); + g_clients.RemoveAt(i); + break; + } + i++; + } +}; + diff --git a/engine/gamemode.cpp b/engine/gamemode.cpp index b449b0a..71f9215 100644 --- a/engine/gamemode.cpp +++ b/engine/gamemode.cpp @@ -1,8 +1,14 @@ #include "gamemode.h" +#include "engine.h" #include "playerstart.h" +#include "networking.h" + #include "tier1/utlvector.h" +#include "tier1/utlstring.h" CGameMode *pCurrentMode = NULL; +CUtlString szCurrentModeName; +CUtlVector g_RegisteredGameModes; //----------------------------------------------------------------------------- // Round begin handler @@ -26,6 +32,17 @@ void CGameMode::RoundBegin( void ) pSelectedStart->RoundStart(player); i++; } + + for (auto &client: g_clients) + { + CSteamID steamID = CSteamID(); + if ( client->playerID == 0) + V_printf("%s\t", SteamFriends()->GetPlayerNickname((uint64)client->playerID)); + else + V_printf("%s\t", SteamFriends()->GetPersonaName()); + V_printf("%llu\t", client->playerID); + V_printf("%u\n", client->playerHandle); + } } //----------------------------------------------------------------------------- @@ -49,25 +66,35 @@ void IGameModeManager::Init( void ) //----------------------------------------------------------------------------- void IGameModeManager::Frame( void ) { - } //----------------------------------------------------------------------------- // Sets gamemode //----------------------------------------------------------------------------- -void IGameModeManager::StartGameMode(CGameMode *pGameMode) +void IGameModeManager::StartGameMode( const char *szName ) { + V_printf("starting game mode %s\n", szName); if (pCurrentMode) + { pCurrentMode->RoundEnd(); - pCurrentMode = pGameMode; - if (pCurrentMode) - pCurrentMode->RoundBegin(); + delete pCurrentMode; + } + for (auto &mode: g_RegisteredGameModes) + { + if (!V_strcmp(mode->m_szName, szName)) + { + pCurrentMode = mode->m_pfn(); + pCurrentMode->RoundBegin(); + szCurrentModeName = szName; + return; + } + } } //----------------------------------------------------------------------------- // //----------------------------------------------------------------------------- -CGameMode *IGameModeManager::GetCurrentMode( void ) +CGameMode *IGameModeManager::GetCurrentGameModeClass( void ) { return pCurrentMode; } @@ -75,11 +102,33 @@ CGameMode *IGameModeManager::GetCurrentMode( void ) //----------------------------------------------------------------------------- // Restarts the gamemode //----------------------------------------------------------------------------- -void IGameModeManager::RestartCurrentMode( void ) +void IGameModeManager::RestartCurrentGameMode( void ) { if (!pCurrentMode) return; + + if (INetworking::IsServer()) + { + PacketGameMode_t mode = {}; + mode.type = PACKET_TYPE_GAMEMODE_START; + V_memcpy(mode.szName,szCurrentModeName, min(szCurrentModeName.GetLenght(), 255)); + V_printf("%u clients connected\n",g_clients.GetSize()); + for (auto &client: g_clients) + { + INetworking::SendData(&mode, sizeof(mode), client, MESSAGE_MODE_RELIABLE); + V_printf("sending to %u\n",client->playerHandle); + }; + V_printf("restarting game mode\n"); + }; pCurrentMode->RoundEnd(); pCurrentMode->RoundBegin(); } + +CGameModeRegistry::CGameModeRegistry(const char *szName, GameModeRegistryFn pfn) : + m_szName(szName), m_pfn(pfn) +{ + g_RegisteredGameModes.AppendTail(this); +}; + + diff --git a/engine/input.cpp b/engine/input.cpp index b370f68..0326ee6 100644 --- a/engine/input.cpp +++ b/engine/input.cpp @@ -162,11 +162,13 @@ void IInput_Bind( int argc, char **argv ) if (key == KEY_NONE) return; + g_bindings[key] = 0; for ( int i = 2; im_szName, (char*)szEntityType.GetMemory())) - { - CBaseEntity *pEnt = entity->m_pfn(); - g_entities.AppendTail(pEnt); - if (entity->m_pClientfn) - { - pEnt->pClientEntity = entity->m_pClientfn(); - pEnt->pClientEntity->pEntity = pEnt; - } - pEntity = pEnt; - break; - } - } + CBaseEntity *pEntity = IIEngine::SpawnEntity(szEntityType); if (!pEntity) continue; @@ -62,6 +47,7 @@ void ILevel::LoadLevel( const char *szLevelName ) CUtlBuffer szParamName(V_strlen(pData)+1); V_strcpy(szParamName, pData); pData+=szParamName.GetSize(); + CUtlBuffer szParamValue(V_strlen(pData)+1); V_strcpy(szParamValue, pData); pData+=szParamValue.GetSize(); @@ -71,11 +57,10 @@ void ILevel::LoadLevel( const char *szLevelName ) CBrushEntity *pBrush = dynamic_cast(pEntity); if (!pBrush) { - pEntity->Spawn(); - if (pEntity->pClientEntity) - pEntity->pClientEntity->Spawn(); + IIEngine::InitEntity(pEntity); continue; } + pBrush->m_mesh = CUtlVector(0); for ( uint32_t j = 0; jnTriangles; j++ ) { @@ -89,8 +74,6 @@ void ILevel::LoadLevel( const char *szLevelName ) pData+=szTextureName.GetSize(); pBrush->m_mesh.AppendTail(triangle); }; - pBrush->Spawn(); - if (pBrush->pClientEntity) - pBrush->pClientEntity->Spawn(); + IIEngine::InitEntity(pBrush); }; }; diff --git a/engine/ml_video.cpp b/engine/ml_video.cpp index 8531472..440dee8 100644 --- a/engine/ml_video.cpp +++ b/engine/ml_video.cpp @@ -44,6 +44,8 @@ static uint32_t s_nNumAttachments; CUtlVector g_destroyImageBuffer; CUtlVector g_destroyBuffersBuffer; +extern MTL::PixelFormat g_swapchainFormat; + MTL::PixelFormat IRenderer_FormatToMl( EImageFormat format ) { switch (format) @@ -51,6 +53,7 @@ MTL::PixelFormat IRenderer_FormatToMl( EImageFormat format ) case IMAGE_FORMAT_R8G8B8A8: return MTL::PixelFormatRGBA8Unorm; case IMAGE_FORMAT_R16G16B16A16: return MTL::PixelFormatRGBA16Unorm; case IMAGE_FORMAT_DEPTH: return MTL::PixelFormatDepth32Float; + case IMAGE_FORMAT_WINDOW: return g_swapchainFormat; default: return MTL::PixelFormatRGBA8Unorm; } }; @@ -294,6 +297,17 @@ void IRenderer::PushBindings() if (g_pCurrentPipeline->type == PIPELINE_TYPE_RASTERIZATION) { CMlGraphicsPipeline *pPipeline = (CMlGraphicsPipeline*)g_pCurrentPipeline; + bool bHasTextures = false; + for ( int i = 0; i < pPipeline->m_inputs.GetSize(); i++ ) + { + if (pPipeline->m_inputs[i].type == SHADER_INPUT_TYPE_TEXTURES) + { + bHasTextures = true; + break; + } + } + if (!bHasTextures) + return; MTL::ArgumentEncoder *argumentEncoder = 0; for (auto &shader: pPipeline->m_shaders) @@ -345,7 +359,6 @@ void IRenderer::Begin( uint32_t nWidth, uint32_t nHeight, CUtlVectorrenderCommandEncoder(s_pRenderPass); - s_pEncoder->setCullMode(MTL::CullModeFront); } void IRenderer::ResetState() @@ -355,7 +368,23 @@ void IRenderer::ResetState() void IRenderer::SetDepthMode( EDepthMode mode ) { - + MTL::DepthStencilDescriptor* depthStencilDesc = MTL::DepthStencilDescriptor::alloc()->init(); + if (mode == DEPTH_MODE_DISABLED) + { + depthStencilDesc->setDepthWriteEnabled(false); + } else { + depthStencilDesc->setDepthWriteEnabled(true); + switch (mode) + { + case DEPTH_MODE_LESS: + depthStencilDesc->setDepthCompareFunction(MTL::CompareFunctionLess); break; + default: + break; + } + } + auto depthStencilState = g_mlDevice->newDepthStencilState(depthStencilDesc); + s_pEncoder->setDepthStencilState(depthStencilState); + depthStencilDesc->release(); } void IRenderer::Draw( IVertexBuffer *pVertex, IIndexBuffer *pIndex ) @@ -366,11 +395,6 @@ void IRenderer::Draw( IVertexBuffer *pVertex, IIndexBuffer *pIndex ) { } else { - MTL::DepthStencilDescriptor* depthStencilDesc = MTL::DepthStencilDescriptor::alloc()->init(); - depthStencilDesc->setDepthCompareFunction(MTL::CompareFunctionLess); - depthStencilDesc->setDepthWriteEnabled(true); - auto depthStencilState = g_mlDevice->newDepthStencilState(depthStencilDesc); - s_pEncoder->setDepthStencilState(depthStencilState); CMlGraphicsPipeline *pPipeline = (CMlGraphicsPipeline*)g_pCurrentPipeline; @@ -389,8 +413,11 @@ IBuffer *IRenderer::GetCameraMatrix() return g_cameraProperties; } +static CMlImage *pOutputImage = new CMlImage; IImage *IRenderer::GetOutputImage() { + pOutputImage->m_image = g_mlDrawableTexture; + return pOutputImage; } IGraphicsPipeline *IRenderer::CreateGraphicsPipeline( @@ -479,6 +506,9 @@ uint32_t ITextureManager::GetTextureID(ITexture *pTexture) ITexture *ITextureManager::LoadTexture( void *pData, uint32_t X, uint32_t Y, uint32_t numChannels ) { CMlTexture *pTexture = new CMlTexture; + *pTexture = {}; + pTexture->x = X; + pTexture->y = Y; MTL::TextureDescriptor *pCreateInfo = MTL::TextureDescriptor::alloc()->init(); pCreateInfo->setPixelFormat(MTL::PixelFormatRGBA8Unorm_sRGB); @@ -588,7 +618,6 @@ void IMetal::Frame() glm_rotate(perspective, glm_rad(90), (vec4){1,0,0,0}); glm_scale(perspective, (vec4){1,-1,1,1}); glm_rotate(perspective, glm_rad(90), (vec4){0,0,1,0}); - glm_scale(perspective, (vec4){1,1,-1,1}); glm_mat4_mul(perspective,g_cameraDataMap->viewprojection,g_cameraDataMap->viewprojection); if (g_bConfigNotify) diff --git a/engine/ml_videosdl.cpp b/engine/ml_videosdl.cpp index f7c0223..95af6a6 100644 --- a/engine/ml_videosdl.cpp +++ b/engine/ml_videosdl.cpp @@ -34,6 +34,9 @@ MTL::CommandBuffer *g_mlCommandBuffer; NS::AutoreleasePool *g_mlPool; MTL::Texture *g_mlDrawableTexture; +MTL::PixelFormat g_swapchainFormat; + + #if defined(__APPLE__) && defined(__MACH__) #include "TargetConditionals.h" #if TARGET_OS_IPHONE @@ -184,6 +187,7 @@ void IVideo::Init() g_mlLayer->setDevice(g_mlDevice); g_mlLayer->setPixelFormat(MTL::PixelFormatBGRA8Unorm); + g_swapchainFormat = MTL::PixelFormatBGRA8Unorm; g_mlCommandQueue = g_mlDevice->newCommandQueue(); diff --git a/engine/networking.cpp b/engine/networking.cpp new file mode 100644 index 0000000..9bb9271 --- /dev/null +++ b/engine/networking.cpp @@ -0,0 +1,356 @@ +#include "networking.h" +#include "console.h" +#include "engine.h" +#include "gamemode.h" +#include "server.h" +#include "steam/isteamfriends.h" +#include "steam/isteamnetworking.h" +#include "tier0/platform.h" +#include "tier0/lib.h" +#include "tier1/commandline.h" +#include "tier0/network.h" +#include "tier1/utlvector.h" +#include "baseplayer.h" + +#include "steam/steamnetworkingsockets.h" +#include "steam/isteamnetworkingutils.h" +#ifndef STEAMNETWORKINGSOCKETS_OPENSOURCE +#include "steam/steam_api.h" +#endif + +HSteamNetConnection net_connection = 0; +HSteamNetConnection net_server = 0; +HSteamListenSocket net_listenSocket = -1; +CUtlVector net_clients; + +class CNetworkingCallbacks +{ + STEAM_CALLBACK(CNetworkingCallbacks, ClientConnectedCallback, SteamNetConnectionStatusChangedCallback_t); +}; + +void CNetworkingCallbacks::ClientConnectedCallback( SteamNetConnectionStatusChangedCallback_t *pCallback ) +{ + INetworking::ClientConnectedCallback(pCallback); +}; + + +bool net_bIsServer = false; +static CNetworkingCallbacks *pCallbacks; + +void INetworking::Init() +{ + Net_Init(); + + SteamDatagramErrMsg errMsg = {}; +#ifdef STEAMNETWORKINGSOCKETS_OPENSOURCE + GameNetworkingSockets_Init(NULL, &errMsg) +#endif + SteamNetworkingUtils()->SetDebugOutputFunction(k_ESteamNetworkingSocketsDebugOutputType_Msg, + [](ESteamNetworkingSocketsDebugOutputType severity, const char *szMessage) { + V_printf("Steam: %s\n", szMessage); + }); + + if (ICommandLine::CheckParam("-dedicated")) + { + pCallbacks = new CNetworkingCallbacks; + SteamNetworkingIPAddr localAddress = {}; + localAddress.Clear(); + localAddress.SetIPv4(0x7F000001, 27015); + net_listenSocket = SteamNetworkingSockets()->CreateListenSocketIP(localAddress, 0, NULL); + net_bIsServer = true; + } +} +void INetworking::Deinit() +{ + if (net_listenSocket == -1) + return; + if (ICommandLine::CheckParam("-dedicated")) + SteamNetworkingSockets()->CloseListenSocket(net_listenSocket); + else + SteamNetworkingSockets()->CloseConnection(net_listenSocket, 0, NULL, false); +} + +bool INetworking::IsServer() +{ + return net_bIsServer; +} + +bool INetworking::IsClient() +{ + return !net_bIsServer; +} + +bool INetworking::IsConnected() +{ + return (bool)net_server; +} + +void INetworking::Frame() +{ + SteamNetworkingSockets()->RunCallbacks(); + + if (IsServer()) + { + for (auto &client: g_clients) + { + SteamNetworkingMessage_t *pMessages[64]; + while (true) + { + int nMessages = SteamNetworkingSockets()->ReceiveMessagesOnConnection(client->playerHandle, pMessages, 64); + if ( nMessages <= 0 ) + break; + for ( int i = 0; i < nMessages; i++ ) + { + ProcessPacket((void*)pMessages[i]->GetData(), pMessages[i]->GetSize(), client); + } + } + } + } else { + SteamNetworkingMessage_t *pMessages[64]; + while (true) + { + int nMessages = SteamNetworkingSockets()->ReceiveMessagesOnConnection(net_connection, pMessages, 64); + if ( nMessages <= 0 ) + break; + for ( int i = 0; i < nMessages; i++ ) + { + ProcessPacket((void*)pMessages[i]->GetData(), pMessages[i]->GetSize(), NULL); + pMessages[i]->Release(); + } + } + } +} + +void INetworking::SendData( void *pData, uint32_t nSize, IIClient *pClient, EMessageMode messageMode ) +{ + if (!IsConnected() && IsClient()) + return; + int nSendFlags = 0; + switch ( messageMode ) + { + case MESSAGE_MODE_UNRELIABLE: + nSendFlags |= k_nSteamNetworkingSend_Unreliable; + break; + case MESSAGE_MODE_RELIABLE: + nSendFlags |= k_nSteamNetworkingSend_Reliable; + break; + }; + /* Send to server if client is NULL */ + EResult r = k_EResultNone; + if (pClient == NULL) + r = SteamNetworkingSockets()->SendMessageToConnection(net_server, pData, nSize, nSendFlags, NULL); + else + r = SteamNetworkingSockets()->SendMessageToConnection(pClient->playerHandle, pData, nSize, nSendFlags, NULL); +} +void INetworking::SendDataEverybody( void *pData, uint32_t nSize, EMessageMode messageMode ) +{ + for (auto &client: g_clients) + { + SendData(pData, nSize, client, messageMode); + } +} + +void INetworking::SendDataEverybodyExcept( void *pData, uint32_t nSize, IIClient *pClient, EMessageMode messageMode ) +{ + for (auto &client: g_clients) + { + if (client == pClient) + continue; + SendData(pData, nSize, client, messageMode); + } +} + +void INetworking::SendDataEverybodyExcept( void *pData, uint32_t nSize, CBasePlayer *pPlayer, EMessageMode messageMode ) +{ + for (auto &client: g_clients) + { + if (client->pBasePlayer == pPlayer) + continue; + SendData(pData, nSize, client, messageMode); + } +} + +void INetworking::ProcessPacket( void *pData, uint32_t nSize, IIClient *pClient ) +{ + Packet_t *pPacketHeader = (Packet_t*)pData; + if (IsServer() && pPacketHeader->type != PACKET_TYPE_PLAYER_MOVEMENT) + return; + if (nSize < sizeof(Packet_t)) + return; + PacketPlayer_t *pPlayerPacket = (PacketPlayer_t*)pData; + PacketGameMode_t *pGameModePacket = (PacketGameMode_t*)pData; + IIClient *pNewClient; + + switch(pPacketHeader->type) + { + case PACKET_TYPE_PLAYER_MOVEMENT: + if (nSize < sizeof(PacketPlayer_t)) + return; + if (IsServer()) + { + if (pClient->pBasePlayer) + pClient->pBasePlayer->Sync(pData, nSize); + } + for (auto &client: g_clients) + { + if (client->playerHandle == pPlayerPacket->playerHandle) + { + if (!client->pBasePlayer) + return; + client->pBasePlayer->Sync(pData, nSize); + return; + } + } + return; + case PACKET_TYPE_PLAYER_JOIN: + if (nSize != sizeof(PacketPlayer_t)) + return; + // Player join and leave can be processed only by the clients + pNewClient = new IIClient; + *pNewClient = { + .playerID = pPlayerPacket->playerID, + .playerHandle = pPlayerPacket->playerHandle, + }; + IIEngine::ConnectClient(pNewClient); + + for (auto &client: g_clients) + { + CSteamID steamID = CSteamID(); + if ( client->playerID == 0) + V_printf("%s\t", SteamFriends()->GetPlayerNickname((uint64)client->playerID)); + else + V_printf("%s\t", SteamFriends()->GetPersonaName()); + V_printf("%llu\t", client->playerID); + V_printf("%u\n", client->playerHandle); + if (client->playerHandle == 0) + g_localClient = client; + } + return; + case PACKET_TYPE_PLAYER_LEAVE: + IIEngine::DisconnectClientByHandle(pPlayerPacket->playerHandle); + return; + case PACKET_TYPE_GAMEMODE_START: + V_printf("PacketGameMode\n"); + if (nSize != sizeof(PacketGameMode_t)) + return; + IGameModeManager::StartGameMode(pGameModePacket->szName); + return; + default: + return; + } +} + +void INetworking::GetServerInfo() +{ +} + +uint32_t INetworking_IPv4ToUint(const char *szIP) { + if (CUtlString(szIP) == "localhost") + return 0x7F000001; + + struct in_addr ipAdress; + if (inet_pton(AF_INET, szIP, &ipAdress) != 1) { + V_printf("Invalid IPv4 address: %s\n", szIP); + return 0; + } + return ntohl(ipAdress.s_addr); +} + +void INetworking::JoinServer( const char *szIP ) +{ + if (net_connection) + { + g_clients = {}; + SteamNetworkingSockets()->CloseConnection(net_connection, 0, NULL, false); + } + SteamNetworkingIPAddr localAddress = {}; + localAddress.Clear(); + localAddress.SetIPv4(INetworking_IPv4ToUint(szIP), 27015); + net_connection = SteamNetworkingSockets()->ConnectByIPAddress(localAddress, 0, NULL); + net_server = net_connection; +} + +void INetworking::ClientConnectedCallback( SteamNetConnectionStatusChangedCallback_t *pCallback ) +{ + IIClient *pClient = new IIClient; + switch (pCallback->m_info.m_eState) + { + case k_ESteamNetworkingConnectionState_Connecting: + V_printf("Awaiting connection: %llu\n",pCallback->m_info.m_identityRemote.GetSteamID64()); + SteamNetworkingSockets()->AcceptConnection(pCallback->m_hConn); + break; + case k_ESteamNetworkingConnectionState_Connected: + V_printf("Connected: %llu %u\n",pCallback->m_info.m_identityRemote.GetSteamID64(), pCallback->m_hConn); + *pClient = { + .playerID = pCallback->m_info.m_identityRemote.GetSteamID64(), + .playerHandle = pCallback->m_hConn, + }; + // send out to all clients + for (auto &client: g_clients) + { + PacketPlayer_t packet = { + .playerID = pClient->playerID, + .playerHandle = pClient->playerHandle, + }; + packet.type = PACKET_TYPE_PLAYER_JOIN; + SendData(&packet, sizeof(packet), client, MESSAGE_MODE_RELIABLE); + }; + IIEngine::ConnectClient(pClient); + // register all clients on connected one + for (auto &client: g_clients) + { + PacketPlayer_t packet = { + .playerID = client->playerID, + .playerHandle = client->playerHandle, + }; + if (client == pClient) + { + packet.playerID = 0; + packet.playerHandle = 0; + } + packet.type = PACKET_TYPE_PLAYER_JOIN; + SendData(&packet, sizeof(packet), pClient, MESSAGE_MODE_RELIABLE); + }; + + + IGameModeManager::RestartCurrentGameMode(); + break; + case k_ESteamNetworkingConnectionState_ClosedByPeer: + case k_ESteamNetworkingConnectionState_ProblemDetectedLocally: + SteamNetworkingSockets()->CloseConnection(pCallback->m_hConn, 0, NULL, false); + + V_printf("Disconnected: %llu %u\n",pCallback->m_info.m_identityRemote.GetSteamID64(), pCallback->m_hConn); + IIEngine::DisconnectClientByHandle(pCallback->m_hConn); + + // send out to all clients + for (auto &client: g_clients) + { + PacketPlayer_t packet = { + .playerID = pCallback->m_info.m_identityRemote.GetSteamID64(), + .playerHandle = pCallback->m_hConn, + }; + packet.type = PACKET_TYPE_PLAYER_LEAVE; + SendData(&packet, sizeof(packet), client, MESSAGE_MODE_RELIABLE); + }; + + break; + default: + break; + } +} + + +void INetworking_Connect( int argc, char **argv ) +{ + if (ICommandLine::CheckParam("-dedicated")) + return; + if (argc != 2) + { + V_printf("connect \n"); + return; + } + + INetworking::JoinServer(argv[1]); +}; + +ConCommand ConnectCmd("connect", INetworking_Connect); diff --git a/engine/server.cpp b/engine/server.cpp index 7fbe1b8..f4a46d3 100644 --- a/engine/server.cpp +++ b/engine/server.cpp @@ -1,12 +1,14 @@ #include "server.h" +#include "engine.h" #include "input.h" +#include "steam/steam_api_common.h" #include "tier1/commandline.h" #include "tier1/utlstring.h" #include "baseentity.h" #include "console.h" #include "physics.h" #include "input.h" -#include "net.h" +#include "networking.h" void *g_serverdll; ConVar g_tickrate("tickrate","64",FCVAR_PROTECTED); @@ -23,12 +25,14 @@ void IServer::LoadGame( const char *psz ) #ifndef STATIC_BUILD #ifdef __linux__ g_serverdll = Plat_LoadLibrary(CUtlString("%s/bin/libserver.so", psz)); - Plat_LoadLibrary(CUtlString("%s/bin/libclient.so", psz)); + if (!ICommandLine::CheckParam("-dedicated")) + Plat_LoadLibrary(CUtlString("%s/bin/libclient.so", psz)); #endif #ifdef __APPLE__ - g_serverdll = Plat_LoadLibrary(CUtlString("%s/bin/libserver.dysim", psz)); - Plat_LoadLibrary(CUtlString("%s/bin/libclient.dysim", psz)); + g_serverdll = Plat_LoadLibrary(CUtlString("%s/bin/libserver.dylib", psz)); + if (!ICommandLine::CheckParam("-dedicated")) + Plat_LoadLibrary(CUtlString("%s/bin/libclient.dylib", psz)); #endif void (*GameLoadfn)() = (void(*)())Plat_GetProc(g_serverdll, "IGame_Load"); if (!GameLoadfn) @@ -50,13 +54,16 @@ void IServer::Think( float fDelta ) /* tickrate */ while(g_fAccumulator>=fTickrate) { +#ifdef STEAM_ENABLED + SteamGameServer_RunCallbacks(); +#endif IInput::Frame(); IConsole::Execute(); - g_fAccumulator-=fTickrate; for (auto &entity: g_entities) { entity->Think(fTickrate); + entity->Sync(0, 0); } px_frame(px, fTickrate); } @@ -68,6 +75,7 @@ void IServer::Think( float fDelta ) }; void IGame_Exit( int argc, char **argv ) { + IEngine::Shutdown(); Plat_Exit(0); } ConCommand ExitCmd("exit", IGame_Exit, 0); diff --git a/engine/sv_light.cpp b/engine/sv_light.cpp index c3baba7..d81b336 100644 --- a/engine/sv_light.cpp +++ b/engine/sv_light.cpp @@ -9,6 +9,7 @@ public: virtual void ReadParameter( const char *szName, const char *szValue ) override; virtual void Destroy( void ) override; virtual void Think( float fDelta ) override; + virtual void Sync( void *pData, uint32_t nDataSize ) override; }; void CLight::Precache() @@ -33,7 +34,10 @@ void CLight::Destroy() } void CLight::Think( float fDelta ) { +}; +void CLight::Sync( void *pData, uint32_t nDataSize ) +{ }; DECLARE_ENTITY(light, CLight) diff --git a/engine/sv_playerstart.cpp b/engine/sv_playerstart.cpp index 509bde6..9fdb0ea 100644 --- a/engine/sv_playerstart.cpp +++ b/engine/sv_playerstart.cpp @@ -4,7 +4,7 @@ #include "tier1/utlvector.h" -CUtlVector g_PlayerStarts; +CUtlVector g_PlayerStarts = {}; void CPlayerStart::Precache() { @@ -22,6 +22,16 @@ void CPlayerStart::ReadParameter( const char *szName, const char *szValue ) void CPlayerStart::Destroy() { + uint32_t i = 0; + for (auto &start: g_PlayerStarts) + { + if (start == this) + { + g_PlayerStarts.RemoveAt(i); + break; + } + i++; + } } void CPlayerStart::Think( float fDelta ) @@ -51,4 +61,9 @@ void CPlayerStart::RoundStart(IIClient *pClient) pClient->pBasePlayer = pOwningPlayer; }; +void CPlayerStart::Sync( void *pData, uint32_t nDataSize ) +{ + +}; + DECLARE_ENTITY(info_player_start, CPlayerStart); diff --git a/engine/sv_worldspawn.cpp b/engine/sv_worldspawn.cpp index 7d71ae6..9427fb9 100644 --- a/engine/sv_worldspawn.cpp +++ b/engine/sv_worldspawn.cpp @@ -9,6 +9,7 @@ public: virtual void ReadParameter( const char *szName, const char *szValue ) override; virtual void Destroy( void ) override; virtual void Think( float fDelta ) override; + virtual void Sync( void *pData, uint32_t nDataSize ) override; }; void CWorldSpawn::Precache() @@ -36,4 +37,9 @@ void CWorldSpawn::Think( float fDelta ) CBrushEntity::Think(fDelta); } +void CWorldSpawn::Sync( void *pData, uint32_t nDataSize ) +{ + +}; + DECLARE_ENTITY(worldspawn, CWorldSpawn) diff --git a/engine/vk_helper.h b/engine/vk_helper.h index 8e9b9df..61eb7c5 100644 --- a/engine/vk_helper.h +++ b/engine/vk_helper.h @@ -57,7 +57,7 @@ extern VkImageView g_swapchainImageView; extern VkImage g_swapchainImage; extern VkFormat g_swapchainFormat; -extern bool g_bConfigNotify; +extern char g_bConfigNotify; extern uint32_t g_nWindowWidth; extern uint32_t g_nWindowHeight; diff --git a/engine/vk_video.cpp b/engine/vk_video.cpp index 5cbc3d9..e1b0983 100644 --- a/engine/vk_video.cpp +++ b/engine/vk_video.cpp @@ -75,6 +75,7 @@ VkFormat IRenderer_FormatToVk( EImageFormat format ) case IMAGE_FORMAT_R8G8B8A8: return VK_FORMAT_R8G8B8A8_UNORM; case IMAGE_FORMAT_R16G16B16A16: return VK_FORMAT_R16G16B16A16_UNORM; case IMAGE_FORMAT_DEPTH: return VK_FORMAT_D32_SFLOAT; + case IMAGE_FORMAT_WINDOW: return g_swapchainFormat; default: return VK_FORMAT_R8G8B8A8_UNORM; } }; @@ -173,6 +174,7 @@ void IVulkan::Init() }; void IVulkan::CreatePipelines() { + V_printf("Created %i pipelines\n",g_StepMeshRendering.GetSize()); for (auto &step: g_StepPrepass) step.pPipeline->Init(); for (auto &step: g_StepMeshRendering) @@ -231,15 +233,15 @@ void IVulkan::Frame() IRenderer::Begin(g_nWindowWidth, g_nWindowHeight, { { - 0, g_meshColor, + 0, ATTACHMENT_LOAD_MODE_CLEAR, ATTACHMENT_STORE_MODE_STORE, } }, { - 0, g_meshDepth, + 0, ATTACHMENT_LOAD_MODE_CLEAR, ATTACHMENT_STORE_MODE_STORE, }); @@ -640,6 +642,8 @@ ITexture *ITextureManager::LoadTexture( void *pData, uint32_t X, uint32_t Y, uin { CVkTexture *pTexture = new CVkTexture; *pTexture = {}; + pTexture->x = X; + pTexture->y = Y; VkDeviceSize imageSize = X*Y*4; vk_buffer_t gpu_buffer = {}; gpu_buffer.Create(imageSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT); @@ -1059,7 +1063,7 @@ void IRenderer::Begin( uint32_t nWidth, uint32_t nHeight, CUtlVectorm_image.m_imageView; @@ -1094,13 +1100,14 @@ void IRenderer::Begin( uint32_t nWidth, uint32_t nHeight, CUtlVector accessors where appropriate. + +ISteamTimeline +* Added this new interface to allow games to provide information that supports the new Game Recording feature. See the [url=https://partner.steamgames.com/doc/features/timeline]Timeline[/url] documentation for more information. + +ISteamUGC +* Added 64 bit m_ulTotalFilesSize to SteamUGCDetails_t which is the correct size of the content for Workshop items are larger than 2,147,483,647 bytes. +* Added GetNumSupportedGameVersions() and GetSupportedGameVersionData() which can be used to determine what game beta branches a Workshop item supports/is valid for. +* Added SetAdminQuery() to allow ISteamUGC to be used in a tools like environment for users who have the appropriate privileges for the calling appid. + +ISteamApps +* Added API to allow the game to manage active beta branches. + + +---------------------------------------------------------------- +v1.59 9th February 2024 +---------------------------------------------------------------- +General +* Added new initialization method, SteamAPI_InitFlat + +ISteamUtils +* Added DismissGamepadTextInput + +ISteamAppList +* This interface has been removed from the SDK + +---------------------------------------------------------------- +v1.58a 26th October 2023 +---------------------------------------------------------------- +Fixes to steam_api_flat.h + +---------------------------------------------------------------- +v1.58 15th September 2023 +---------------------------------------------------------------- +ISteamRemotePlay +* Added BStartRemotePlayTogether to start Remote Play Together and optionally show the UI in the overlay + +ISteamUGC +* The function SetItemTags now takes in a parameter to allow the modification of admin tags through the SDK if the logged-in user has the appropriate permissions +* Added GetUserContentDescriptorPreferences, which can be used to show the user their current set of preferences and then direct them to Steam to modify them at https://store.steampowered.com/account/preferences/ + +Misc. +* Added SteamAPI_InitEx and SteamGameServer_InitEx, which will return k_ESteamAPIInitResult_OK upon success or an error code specified in in ESteamAPIInitResult. An optional, non-localized error message can also be returned. +* SteamAPI_Init() will now return false if the installed Steam client needs to be updated to support the game’s version of the SDK +* Improved handling of corrupted tickets via updated sdkencryptedappticket.lib + +---------------------------------------------------------------- +v1.57 28th April 2022 +---------------------------------------------------------------- +User +* Updated ISteamUser::GetAuthTicketForWebApi(), To create a ticket for use by the AuthenticateUserTicket Web API +* Updated ISteamUser::GetAuthSessionTicket(), No longer to be used to create a ticket for use by the AuthenticateUserTicket Web API + +---------------------------------------------------------------- +v1.56 30th March 2023 +---------------------------------------------------------------- +User +* Updated ISteamUser::GetAuthSessionTicket(), Add parameter SteamNetworkingIdentity + +---------------------------------------------------------------- +v1.55 29th July 2022 +---------------------------------------------------------------- + +ISteamInput +* Added SetDualSenseTriggerEffect and corresponding header isteamdualsense.h for setting the adaptive trigger effect on DualSense controllers + +Spacewar example: +* Added an example of using SetDualSenseTriggerEffect + +---------------------------------------------------------------- +v1.54 16th June 2022 +---------------------------------------------------------------- + +ISteamFriends +* Added various functions to retrieve equipped Steam Community profile items and their properties +** RequestEquippedProfileItems – requests information on what Steam Community profile items a user has equipped. Will send callback EquippedProfileItems_t. +** BHasEquippedProfileItem – after calling RequestEquippedProfileItems, returns true/false depending on whether a user has a ECommunityProfileItemType equipped or not +** GetProfileItemPropertyString – returns a string property given a ECommunityProfileItemType and ECommunityProfileItemProperty +** GetProfileItemPropertyUint – returns an unsigned integer property given a ECommunityProfileItemType and ECommunityProfileItemProperty +* Added callback EquippedProfileItemsChanged_t for when a user's equipped Steam Community profile items have changed. This will be sent for the current user and for their friends. + +Spacewar example: +* Added examples for how to interact with various overlay related functions (e.g. ActivateGameOverlay, ActivateGameOverlayToUser, ActivateGameOverlayToWebPage, ActivateGameOverlayToStore, ActivateGameOverlayInviteDialogConnectString) +* Fixed Steam Input example code not working on Linux + +---------------------------------------------------------------- +v1.53a 11th December 2021 +---------------------------------------------------------------- + +macOS +* Fixed libsdkencryptedappticket.dylib to include arm64 support + +---------------------------------------------------------------- +v1.53 23th November 2021 +---------------------------------------------------------------- + +SteamNetworkingSockets: +* Added support for connections to have multiple streams of messages, known as "lanes," with mechanisms to control bandwidth utilization and head-of-line blocking between lanes. +* Added the "FakeIP" system, which can be useful to add P2P networking or Steam Datagram Relay support to games while retaining the assumption that network hosts are identified by an IPv4 address. Added steamnetworkingfakeip.h and ISteamNetworkingFakeUDPPort +* Simplified interface for iterating config values. +* Added SteamNetConnectionInfo_t::m_nFlags, which have misc info about a connection. + +ISteamInput +* Added Steam Deck values to the EInputActionOrigin and ESteamInputType origins + +ISteamUGC: +* Added SetTimeCreatedDateRange and SetTimeUpdatedDateRange + +ISteamUtils: +* Added DismissFloatingGamepadTextInput + +Flat Interface: +* For each interface accessor, there is now an inline, unversioned accessor that calls the versioned accessor exported by the .dll. This reduces the number of changes that need to be made when updating the SDK and accessing the flat interface directly, while still retaining version safety. + +General: +* Removed definitions for many internal callback IDs that are not needed by general users of the SDK. + +Spacewar example: +* Added CItemStore, which demonstrates how to interact with an in-game store + +---------------------------------------------------------------- +v1.52 14th September 2021 +---------------------------------------------------------------- + +ISteamInput +* Added support for bundling Steam Input API configurations w/ game depots. Allows developers to use the same configuration file across public/private AppIDs, check configurations into their revision control systems, more easily juggle changes between beta branches, and ensure game/config changes are done in-sync. +* Added new glyph API support for SVG glyphs and multiple sizes of PNG files. Note: these images will be added in a subsequent Steam Beta Client release. +* Added support for callbacks for action state changes, controller connect/disconnect, and controller mapping changes. +* Added BNewDataAvailable function to reduce need to manually compare action data between frames. +* Added BWaitForData helper function to wait on an event set when controller data is updated. +* Added functions for getting the localized string for action names (GetStringForDigitalActionName and GetStringForAnalogActionName). +* Added function to poll current Steam Input enable settings by controller type (GetSessionInputConfigurationSettings). + +ISteamGameServer +* Renamed EnableHeartbeats to SetAdvertiseServerActive. +* Deprecated the following methods (they have been renamed to *_DEPRECATED and will be removed in a future SDK update): +** SendUserConnectAndAuthenticate +** SendUserDisconnect +** SetMasterServerHeartbeatInterval +** ForceMasterServerHeartbeat + +ISteamRemoteStorage +* Added GetLocalFileChangeCount and GetLocalFileChange which allows for iterating over Steam Cloud files that have changed locally after the initial sync on app start, when supported by the app. The callback notification is RemoteStorageLocalFileChange_t. +* Added BeginFileWriteBatch and EndFileWriteBatch to hint to Steam that a set of files should be written to Steam Cloud together (e.g. a game save that requires updating more than one file). +* Removed the following unused callbacks: RemoteStorageAppSyncedClient_t, RemoteStorageAppSyncedServer_t, RemoteStorageAppSyncProgress_t, and RemoteStorageAppSyncStatusCheck_t. + +ISteamUGC +* Added ability to sort by "time last updated" (k_EUGCQuery_RankedByLastUpdatedDate). +* Added ShowWorkshopEULA and GetWorkshopEULAStatus, which allows a game to have a separate EULA for the Steam Workshop. +* Added UserSubscribedItemsListChanged_t callback. +* Added WorkshopEULAStatus_t callback, which will be sent asynchronously after calling GetWorkshopEULAStatus. + +ISteamUser +* Deprecated InitiateGameConnection and TerminateGameConnection (renamed to *_DEPRECATED). Please migrate to BeginAuthSession and EndAuthSession. + +ISteamUtils +* Added IsSteamRunningOnSteamDeck - Can be used to optimize the experience of the game on Steam Deck, such as scaling the UI appropriately, applying performance related settings, etc. +* Added SetGameLauncherMode - In game launchers that don't have controller support you can call this to have Steam Input translate the controller input into mouse/kb to navigate the launcher. +* Added AppResumingFromSuspend_t callback - Sent after the device returns from sleep/suspend mode. +* Added ShowFloatingGamepadTextInput - Activates the modal gamepad input keyboard which pops up over game content and sends OS keyboard keys directly to the game. Note: Currently this is only implemented in the Steam Deck UI. +* Added FloatingGamepadTextInputDismissed_t callback - Sent after the floating gamepad input keyboard displayed via ShowFloatingGamepadTextInput has been dismissed. + +macOS +* Added i386/x86_64/arm64 universal builds of libsdkencryptedappticket.dylib and libsteam_api.dylib + +Steamworks Example Project +* Updated project to illustrate new Steam Input changes +* Updated to build properly with macOS 11 SDK for arm64 +* Updated Windows project files to Visual Studio 2015 +* Windows project files now target Windows 8.1 +* Windows project files now set include and library path using DXSDK_DIR + +Misc. +* ISteamAppList - Added m_iInstallFolderIndex to SteamAppInstalled_t and SteamAppUninstalled_t callbacks. +* ISteamApps - Removed unused SteamGameServerApps() accessor. +* CSteamGameServerAPIContext - removed SteamApps() accessor. +* Cleanup of types and enums that were unnecessarily in the SDK. + + +---------------------------------------------------------------- +v1.51 8th January 2021 +---------------------------------------------------------------- +ISteamUGC +* Added GetQueryUGCNumTags(), GetQueryUGCTag(), and GetQueryUGCTagDisplayName() for access to an item's tags and the display names (e.g. localized versions) of those tags +* A previous SDK update added (but failed to call out) AddRequiredTagGroup() which allows for matching at least one tag from the group (logical "or") + +ISteamInput & ISteamController +* Added PS5 Action Origins + +ISteamFriends +* Added ActivateGameOverlayInviteDialogConnectString - Activates the game overlay to open an invite dialog that will send the provided Rich Presence connect string to selected friends + +Steamworks Example +* Updated to use latest SteamNetworkingSockets API + +Content Builder +* Updated upload example to use a single script file to upload a simple depot + +---------------------------------------------------------------- +v1.50 29th August 2020 +---------------------------------------------------------------- +* Added ISteamUtils::InitFilterText() and ISteamUtils::FilterText() which allow a game to filter content and user-generated text to comply with China legal requirements, and reduce profanity and slurs based on user settings. +* Added ISteamNetworkingMessages, a new non-connection-oriented API, similar to UDP. This interface is intended to make it easy to port existing UDP code while taking advantage of the features provided by ISteamNetworkingSockets, especially Steam Datagram Relay (SDR). +* Added poll groups to ISteamNetworkingSockets. Poll groups are a way to receive messages from many different connections at a time. +* ISteamNetworkingSockets::ReceiveMessagesOnListenSocket has been removed. (Use poll groups instead.) +* Added symmetric connect mode to ISteamNetworkingSockets. This can be used to solve the coordination problem of establishing a single connection between two peers, when both peers may initiating the connection at the same time and neither peer is the “server” or “client”. +* ISteamNetworking is deprecated and may be removed in a future version of the SDK. Please use ISteamNetworkingSockets or ISteamNetworkingMessages instead. + + +---------------------------------------------------------------- +v1.49 12th June 2020 +---------------------------------------------------------------- +* Added ISteamApps::BIsTimedTrial() which allows a game to check if user only has limited playtime +* Added ISteamFriends::RegisterProtocolInOverlayBrowser() which will enable dispatching callbacks when the overlay web browser navigates to a registered custom protocol, such as “mygame://” +* Added ISteamuserStats::GetAchievementProgressLimits() which lets the game query at run-time the progress-based achievement’s bounds as set by the developers in the Steamworks application settings +* Added tool to demonstrate processing the steam.signatures file that comes in the steam client package. + + +---------------------------------------------------------------- +v1.48a 26th March 2020 +---------------------------------------------------------------- + +macOS +* Fixed notarization issues caused by missing code signature of libsdkencryptedappticket.dylib + + +---------------------------------------------------------------- +v1.48 12th February 2020 +---------------------------------------------------------------- + +ISteamNetworkingSockets +* Added the concept of a "poll group", which is a way to receive messages from many connections at once, efficiently. +* ReceiveMessagesOnListenSocket was deleted. To get the same functionality, create a poll group, and then add connections to this poll group when accepting the connection. + +Flat interface redesign +* Fixed many missing interfaces and types. +* All versions of overloaded functions are now available, using distinct names. +* There are now simple, global versioned functions to fetch the interfaces. No more need to mess with HSteamPipes or HSteamUsers directly. +* The json file now has much more detailed information and several errors have been fixed. +* steam_api_interop.cs has been removed and will no longer be supported. +* There is a new manual dispatch API for callbacks, which works similarly to a windows event loop. This is a replacement for the existing callback registeration and dispatch mechanisms, which which are nice in C++ but awkward to use outside of C++. + + +---------------------------------------------------------------- +v1.47 3rd December 2019 +---------------------------------------------------------------- + +macOS +* Updated steamcmd binaries to be 64-bit + +ISteamNetworkingSockets +* Added API to set configuration options atomically, at time of creation of the listen socket or connection +* Added API to send multiple messages efficiently, without copying the message payload +* Added API for relayed P2P connections where signaling/rendezvous goes through your own custom backend instead of the Steam servers + +ISteamRemotePlay +* Added a function to invite friends to play via Remote Play Together + + +---------------------------------------------------------------- +v1.46 26th July 2019 +---------------------------------------------------------------- + +ISteamRemotePlay +* Added a new interface to get information about Steam Remote Play sessions + +ISteamInput +* Added the GetRemotePlaySessionID function to find out whether a controller is associated with a Steam Remote Play session + + +---------------------------------------------------------------- +v1.45 25th June 2019 +---------------------------------------------------------------- + +Steam Input and Steam Controller Interfaces +* Added the GetDeviceBindingRevision function which allows developers of Steam Input API games to detect out of date user configurations. Configurations w/ out of date major revisions should be automatically updated by Steam to the latest official configuration, but configurations w/ out of date minor revisions will be left in-place. + +ISteamUser +* Add duration control APIs to support anti-indulgence regulations in some territories. This includes callbacks when gameplay time thresholds have been passed, and an API to fetch the same data on the fly. + +ISteamUtils +* Add basic text filtering API. + +---------------------------------------------------------------- +v1.44 13th March 2019 +---------------------------------------------------------------- + +ISteamNetworkingSockets +* Socket-style API that relays traffic on the Valve network + +ISteamNetworkingUtils +* Tools for instantly estimating ping time between two network hosts + +---------------------------------------------------------------- +v1.43 20th February 2019 +---------------------------------------------------------------- + +ISteamParties +* This API can be used to selectively advertise your multiplayer game session in a Steam chat room group. Tell Steam the number of player spots that are available for your party, and a join-game string, and it will show a beacon in the selected group and allow that many users to “follow” the beacon to your party. Adjust the number of open slots if other players join through alternate matchmaking methods. + +ISteamController +* This interface will be deprecated and replaced with ISteamInput. For ease in upgrading the SDK ISteamController currently has feature parity with ISteamInput, but future features may not be ported back. Please use ISteamInput for new projects. +* Added GetActionOriginFromXboxOrigin, GetStringForXboxOrigin and GetGlyphForXboxOrigin to allow Xinput games to easily query glyphs for devices coming in through Steam Input’s Xinput emulation, ex: “A button”->”Cross button” on a PS4 controller. This is a simple translation of the button and does not take user remapping into account – the full action based API is required for that. +* Added TranslateActionOrigin which allows Steam Input API games to which are using look up tables to translate action origins from an recognized device released after the game was last built into origins they recognize. +* Added count and max_possible fields to current enums to make using lookup tables easier + +ISteamInput +* This new interface replaces ISteamController to better reflect the fact this API supports not just the Steam Controller but every controller connected to Steam – including Xbox Controllers, Playstation Controllers and Nintendo Switch controllers. ISteamController currently has feature parity with the new features added in ISteamInput but new feature may not be ported back. Please use this interface instead of ISteamController for any new projects. +* Migrating to ISteamInput from ISteamController should mostly be a search-replace operation but any action origin look up tables will need to be adjusted as some of the enum orders have changed. +* Added GetActionOriginFromXboxOrigin, GetStringForXboxOrigin and GetGlyphForXboxOrigin to allow Xinput games to easily query glyphs for devices coming in through Steam Input’s Xinput emulation, ex: “A button”->”Cross button” on a PS4 controller. This is a simple translation of the button and does not take user remapping into account – the full action based API is required for that. +* Added TranslateActionOrigin which allows Steam Input API games to which are using look up tables to translate action origins from an recognized device released after the game was last built into origins they recognize. +* Added count and max_possible fields to current enums to make using lookup tables easier + +ISteamFriends +* ActivateGameOverlayToWebPage – Added a new parameter to control how the created web browser window is displayed within the Steam Overlay. The default mode will create a new browser tab next to all other overlay windows that the user already has open. The new modal mode will create a new browser window and activate the Steam Overlay, showing only that window. When the browser window is closed, the Steam Overlay is automatically closed as well. + +ISteamInventory +* GetItemsWithPrices and GetItemPrice - Added the ability to get the “base price” for a set of items, which you can use to markup in your own UI that items are “on sale” + +ISteamUGC +* SetAllowLegacyUpload - Call to force the use of Steam Cloud for back-end storage (instead of Steam Pipe), which is faster and more efficient for uploading and downloading small files (less than 100MB). +* CreateQueryAllUGCRequest - Added ability to page through query results using a “cursor” instead of a page number. This is more efficient and supports “deep paging” beyond page 1000. The old version of CreateQueryAllUGCRequest() that takes a page parameter is deprecated and cannot query beyond page 1000. Note that you will need to keep track of the “previous” cursor in order to go to a previous page. + +ISteamApps +* GetLaunchCommandLine - Get command line if game was launched via Steam URL, e.g. steam://run////. If you get NewUrlLaunchParameters_t callback while running, call again to get new command line +* BIsSubscribedFromFamilySharing - Check if subscribed app is temporarily borrowed via Steam Family Sharing + +Steam API +* Refactored headers to minimize the number of headers that need to be included to use a single ISteam interface. +* Renamed some macros with STEAM_ prefix to minimize conflicts in the global namespace + + + +---------------------------------------------------------------- +v1.42 3rd January 2018 +---------------------------------------------------------------- + +ISteamInventory +* Added ability to start a purchase process through the Steam Client via the StartPurchase call and a given set of item definition ids and quantities. Users will be prompted in the Steam Client overlay to complete the purchase, including funding their Steam Wallet if necessary. Returns a SteamInventoryStartPurchaseResult_t call result if the user authorizes the purchase. +* Added ability to retrieve item definition prices via the RequestPrices call. Once the call result SteamInventoryRequestPricesResult_t is returned, GetNumItemsWithPrices, GetItemsWithPrices, and GetItemPrice can be called to retrieve the item definition prices in the user's local currency. +* Added ability to modify whitelisted per item dynamic properties. The usage pattern is to call StartUpdateProperties, SetProperty or RemoveProperty, and finally SubmitUpdateProperties. The SteamInventoryCallback_t will be fired with the appropriate result handle on success or failure. +* Deprecated TradeItems + +ISteamController +* Added Action Set Layers – Action Set Layers are optional sets of action bindings which can be overlaid upon an existing set of controls. In contrast to Action Sets, layers draw their actions from the Action Set they exist within and do not wholesale replace what is already active when applied, but apply small modifications. These can consist of setting changes as well as adding or removing bindings from the base action set. More than one layer can be applied at a time and will be applied consecutively, so an example might be the Sniper Class layer which includes tweaks or bindings specific to snipers in addition to the Scoped-In layer which alters look sensitivity. +* Added ActivateActionSetLayer – Activates the specified Layer. +* Added DeactivateActionSetLayer – Deactivates the specified Layer. +* Added DeactivateAllActionSetLayers – Deactivates all layers, resetting the mapping to the action base Action Set. +* Added GetActiveActionSetLayers – Returns all currently active Action Set Layers. +* Added GetInputTypeForHandle - Returns the input type for a particular handle, such as Steam Controller, PS4 Controller, Xbox One or 360. + +ISteamHTMLSurface +* Added HTML_BrowserRestarted_t callback which is fired when the browser has restarted due to an internal failure + +ISteamFriends +* Added IsClanPublic +* Added IsClanOfficialGameGroup + +Steam API +* Removed the ISteamUnifiedMessages interface. It is no longer intended for public usage. + + +---------------------------------------------------------------- +v1.41 13th July 2017 +---------------------------------------------------------------- + +ISteamClient +* Exposed ISteamParentalSettings interface. You can use this to determine if the user has parental settings turned on and for what high-level Steam features. + +* ISteamHTMLSurface +* Added SetDPIScalingFactor - Scale the output display space by this factor, this is useful when displaying content on high dpi devices. + +ISteamUGC +* Added ability to mark a piece of UGC as requiring a set of DLC (AppID). These relationships are managed via new AddAppDependency, RemoveAppDependency, and GetAppDependencies calls. +* Ported over ability to delete UGC from ISteamRemoteStorage and called it DeleteItem. Note that this does *not* prompt the user in any way. +* Added m_nPublishedFileId to SubmitItemUpdateResult_t so that it is easier to keep track of what item was updated. + + +---------------------------------------------------------------- +v1.40 25th April 2017 +---------------------------------------------------------------- + +ISteamInventory +* Update API documentation +* GetResultItemProperty - Retrieve dynamic properties for a given item returned in the result set. + +ISteamUtils +* IsVRHeadsetStreamingEnabled - Returns true if the HMD content will be streamed via Steam In-Home Streaming +* SetVRHeadsetStreamingEnabled - Set whether the HMD content will be streamed via Steam In-Home Streaming + +ISteamUser +* GetAvailableVoice and GetVoice - Some parameters have become deprecated and now have default values. + +ISteamUGC +* SetReturnPlaytimeStats - Set the number of days of playtime stats to return for a piece of UGC. +* AddDependency and RemoveDependency - Useful for parent-child relationship or dependency management + +ISteamVideo +* Added GetOPFSettings and GetOPFStringForApp for retrieving Open Projection Format data used in Steam 360 Video playback. +* GetOPFSettings - Handle the GetOPFSettingsResult_t callback which is called when the OPF related data for the passed in AppID is ready for retrieval. +* GetOPFStringForApp - Using the AppID returned in GetOPFSettingsResult_t pass in an allocated string buffer to get the OPF data. + +SteamPipe GUI Tool +* A simple GUI wrapper for Steamcmd/SteamPipe has been added to the SDK in the tools\ContentBuilder folder. More details can be found here: http://steamcommunity.com/groups/steamworks/discussions/0/412449508292646864 + + +---------------------------------------------------------------- +v1.39 6th January 2017 +---------------------------------------------------------------- + +ISteamController + +The two new Origin helper functions in this interface allow you to query a description and a glyph for types of controllers and inputs that are in the current SDK header, but also any type of controller that might be supported by the Steam client in the future. To achieve this, pass origin values directly returned from Get*ActionOrigin() functions into GetStringForActionOrigin() and GetGlyphForActionOrigin() and display the results programmatically without checking against the range of the Origin enumerations. + +* TriggerVibration - Trigger a vibration event on supported controllers +* SetLEDColor - Set the controller LED color on supported controllers +* GetStringForActionOrigin - Returns a localized string (from Steam's language setting) for the specified origin +* GetGlyphForActionOrigin - Get a local path to art for on-screen glyph for a particular origin +* Updated Spacewar example to include example usage + +ISteamFriends +* Removed k_EFriendFlagSuggested, since it was unused + +ISteamInventory +* Updated and corrected documentation in the API +* RequestEligiblePromoItemDefinitionsIDs - Request the list of "eligible" promo items that can be manually granted to the given user. These are promo items of type "manual" that won't be granted automatically. An example usage of this is an item that becomes available every week. +* GetEligiblePromoItemDefinitionIDs - After handling a SteamInventoryEligiblePromoItemDefIDs_t call result, use this function to pull out the list of item definition ids that the user can be manually granted via the AddPromoItems() call. + + +---------------------------------------------------------------- +v1.38 14th October 2016 +---------------------------------------------------------------- + +ISteamUGC +* Added ability to track the playtime of Workshop items. Call StartPlaytimeTracking() and StopPlaytimeTracking() when appropriate. On application shutdown all playtime tracking will stop, but StopPlaytimeTrackingForAllItems() can also be used. +* Added ability to query Workshop items by total playtime in a given period, total lifetime playtime, average playtime in a given period, lifetime average playtime, number of play sessions in a given period, and number of lifetime play sessions. +* Added ability to retrieve item statistics for number of seconds played, number of play sessions, and number of comments. +* Added SetReturnOnlyIDs() for queries. This is useful for retrieving the list of items a user has subscribed to or favorited without having to get all the details for those items. +* Modified GetQueryUGCStatistic() to take in a uint64 instead of a uint32 to support larger values + +ISteamUser +* Added BIsPhoneIdentifying() +* Added BIsPhoneRequiringVerification() + +ISteamScreenshots +* Added IsScreenshotsHooked() if the application has hooked the screenshot +* Added ability to add a VR screenshot that was saved to disk to the user's library + +ISteamRemoteStorage +* Modified GetQuota() to take in uint64 from int32, since Steam Cloud can now support quotas above 2GB +* Removed RemoteStorageConflictResolution_t callback + +ISteamApps +* Added GetFileDetails() which will return FileDetailsResult_t through a call result. The FileDetailsResult_t struct contains information on the original file's size, SHA1, etc. + +ISteamFriends +* Deprecated k_EFriendRelationshipSuggested relationship type that was originally used by Facebook linking feature + +---------------------------------------------------------------- +v1.37 23rd May 2016 +---------------------------------------------------------------- + +Starting with this release, SDK forward-compatibility has been improved. All executables and libraries built using the official C++ headers from this SDK will continue to work even when paired with runtime DLLs from future SDKs. This will eventually allow for the mixing of dynamic libraries (such as third-party plug-ins) built with different versions of Steamworks. + +The VERSION_SAFE_STEAM_API_INTERFACES compile-time flag is no longer necessary for cross-version compatibility, and the SteamAPI_InitSafe and SteamGameServer_InitSafe functions have been removed. Applications which currently use these InitSafe functions should be changed to use the normal Init functions instead. + + +ISteamRemoteStorage +* Removed unsed UGCHandle_t m_hFile from RemoteStoragePublishedFileUpdated_t + +ISteamUGC +* Added ability to add additional preview types to UGC such as standard images, YouTube videos, Sketchfab models, etc. + +ISteamUser +* Added BIsPhoneVerified() +* Added BIsTwoFactorEnabled() + +ISteamUtils +* Added IsSteamInBigPictureMode() +* Added StartVRDashboard(), which asks Steam to create and render the OpenVR Dashboard + +ISteamApps +* Added RequestAllProofOfPurchaseKeys + + +---------------------------------------------------------------- +v1.36 9th February 2016 +---------------------------------------------------------------- + +ISteamController: +* added new function TriggerRepeatedHapticPulse() + + +Revision History: + +---------------------------------------------------------------- +v1.35 21st September 2015 +---------------------------------------------------------------- + +ISteamController: + * The controller API has been redesigned to work with production Steam Controllers and take advantage of the configuration panel inside of Steam. The documentation on the partner site has a full overview of the new API. + +ISteamRemoteStorage: + * Added asynchronous file read and write methods. These methods will not block your calling thread for the duration of the disk IO. Additionally, the IO is performed in a worker thread in the Steam engine, so they will not impact other Steam API calls. + - FileWriteAsync: Similar in use to FileWrite, however it returns a SteamAPICall_t handle. Use the RemoteStorageFileWriteAsyncComplete_t structure with your asynchronous Steam API handler, and that will indicate the results of the write. The data buffer passed in to FileWriteAsync is immediately copied, so you do not have to ensure it is valid throughout the entire asynchronous process. + - FileReadAsync: This function queues an asynchronous read on the file specified, and also returns a SteamAPICall_t handle. The completion event uses the new RemoteStorageFileReadAsyncComplete_t structure. Upon successful completion, you can use the new FileReadAsyncComplete function to read the data -- passing in the original call handle, a pointer to a buffer for the data, and the amount to read (which generally should be equal to the amount read as specified by the callback structure, which generally will be equal to the amount requested). Additionally, the FileReadAsync function lets you specify an offset to read at, so it is no longer necessary to read the entire file in one call. + + +---------------------------------------------------------------- +v1.34 28th July 2015 +---------------------------------------------------------------- +ISteamUGC: + +* Added ability to set and retrieve key-value tags on an item. There can be multiple values for each key. +* Added ability to query all UGC that have matching key-value tags. +* Added ability to specify a title and description on an item for a specific language (defaults to English). +* Added ability to query for items and return the title and description in a preferred language. +* Added ability to vote on an item and retrieve the current user's vote on a given item (duplicated from ISteamRemoteStorage). + + +---------------------------------------------------------------- +v1.33 6th May 2015 +---------------------------------------------------------------- + +UGC: +* Added DownloadItem(), which will force download a piece of UGC (it will be cached based on usage). This can be used by stand-alone game servers. +* Renamed GetItemUpdateInfo() => GetItemDownloadInfo() and added GetItemState() which can be used to determine whether an item is currently being downloaded, has already been downloaded, etc. +* Added ability to set and retrieve developer metadata for an item +* Added ability to modify a user's favorites list +* Added ability to retrieve preview image & video URLs +* Added ability to retrieve "children" for an item (e.g. for collections) +* Added ability to retrieve stats, such as current number of subscribers, lifetime unique subscribers, etc. + +SteamVR +* steamvr.h has been removed. You can use the OpenVR SDK to access those interfaces: https://github.com/ValveSoftware/openvr + +SteamVideo +* Added ability to check if a user is currently broadcasting + + +---------------------------------------------------------------- +v1.32 5th February 2015 +---------------------------------------------------------------- + +General: +* Added an auto-generated "flat" C-style API for common Steamworks features (steam_api_flat.h) +* Added an auto-generated C# binding for common Steamworks features (steam_api_interop.cs) +* Expanded the ISteamFriends interface to include steam levels and friends groups +* Expanded the ISteamHTTP interface to include cookie handling, SSL certificate verification, and network timeouts +* Fixed typos in ISteamHTMLSurface interface constants + +Inventory: +* Added the initial version of ISteamInventory, a developer-preview release of our new Steam Inventory Service for managing and tracking a Steam-compatible inventory of in-game items. Please see the documentation for the Inventory Service on the partner website for more details. + + + +---------------------------------------------------------------- +v1.31 8th September 2014 +---------------------------------------------------------------- + +UGC: +* The Workshop item content API in ISteamUGC now supports legacy workshop items uploaded via the ISteamRemoteStorage interface. ISteamUGC::GetItemInstallInfo(). This will return whether the item was a legacy item or a new item. If it is a legacy item, then the pchFolder variable will be the full path to the file. + +HTML: +* Added initial version of ISteamHTMLSurface API, which allows games to get textures for html pages and interact with them. There is also a sample implementation in the SteamworksExample. + +Virtual Reality: +* Added VR_IsHmdPresent, which returns true if an HMD appears to be present but does not initialize the VR API. This is useful when enabling/disabling UI elements to offer VR mode to a user. +* Added VR_GetStringForHmdError which turns an HmdError enum value into a string. + +SteamPipe +* The example Steampipe batch file (run_build.bat) now uses run_app_build_http instead of run_app_build by default. + +ContentPrep.app +* Updated wxPython requirements for this app (version 2.7 and 2.8 supported). App will prompt with updated URL to download compatible packages if necessary. + + + +---------------------------------------------------------------- +v1.30 10th July 2014 +---------------------------------------------------------------- + +General: +* Added a new Workshop item content API in ISteamUGC that is easy to use and allows multiple files per item without any size limits. It uses the same + content system that handles regular content depots, resulting in faster and smaller downloads due to delta patching. Subscribed workshop items will + be placed in unique subfolders in the install folder, so the game doesn't need to fetch them using ISteamRemoteStorage anymore. The new API is not + backwards compatible with old items created with ISteamRemoteStorage. Added Workshop feature to steamworksexample using ISteamUGC. + + +Steam VR: +* VR_Init now requires that you call SteamAPI_Init first. + + +---------------------------------------------------------------- +v1.29 24th April 2014 +---------------------------------------------------------------- + +General: +* Adjust game server login to use a token instead of username/password. Tokens are randomly generated at account creation time and can be reset. +* Added existing text param to ISteamUtils::ShowGamepadTextInput() so games can prepopulate control before displaying to user. +* Updated retail disc installer to use a single multi-language steamsetup.exe replacing all Steam install MSI packages. +* Removed redistributable Steam libraries for dedicated servers. Standalone dedicated server should use shared "Steamworks SDK Redist" depots. +* steamcmd is now included for Linux and OSX. + +Music: +* Introducing API to control the Steam Music Player from external software. As an example this gives games the opportunity to pause the music or lower the volume, when an important cut scene is shown, and start playing afterwards. +* Added menu and code to the Steamworks Example to demonstrate this API. +* This feature is currently limited to users in the Steam Music Player Beta. It will have no effect on other users. + +UGC: +* ISteamUGC - Add m_bCachedData to SteamUGCQueryCompleted_t and SteamUGCRequestUGCDetailsResult_t which can be used to determine if the data was retrieved from the cache. +* ISteamUGC - Allow clients to get cached responses for ISteamUGC queries. This is so client code doesn't have to build their own caching layer on top of ISteamUGC. +* ISteamRemoteStorage - add the name of the shared file to RemoteStorageFileShareResult_t so it can be matched up to the request if a game has multiple outstanding FileShare requests going on at the same time + +Steam VR: +* Renamed GetEyeMatrix to GetHeadFromEyePose and made it return an HmdMatrix34t. This doesn't actually change the values it was returning, it just updates the name to match the values that were already being returned. Changed the driver interface too. +* Renamed GetWorldFromHeadPose to GetTrackerFromHeadPose to avoid confusion about the game's world space vs. the tracker's coordinate system. +* Also renamed GetLastWorldFromHeadPose to GetLastTrackerFromHeadPose. +* Added GetTrackerZeroPose method to get the tracker zero pose. +* Added VR support to the Linux/SDL version of the Steamworks Example. + +---------------------------------------------------------------- +v1.28 28th January 2014 +---------------------------------------------------------------- + +* Added Steamworks Virtual Reality API via steamvr.h. +* Added ISteamUtils::IsSteamRunningInVRMode, which returns true if the Steam Client is running in VR mode. +* Deprecated ISteamGameserver::GetGameplayStats and ISteamGameserver::GetServerReputation. These calls already return no data and will be removed in a future SDK update. +* Added result code k_EResultRateLimitExceeded, which can now be returned if a user has too many outstanding friend requests. + +---------------------------------------------------------------- +v1.26a 14th November 2013 +---------------------------------------------------------------- + +* Fix missing accessor function in steam_api.h for SteamUGC() + +---------------------------------------------------------------- +v1.26 6th November 2013 +---------------------------------------------------------------- +* Includes libsteam_api.so for 64-bit Linux. +* Callbacks ValidateAuthTicketResponse_t and GSClientApprove_t now contain the SteamID of the owner of current game. If the game is borrowed, this is different than the player's SteamID. +* Added ISteamFriends::GetPlayerNickname, which returns the nickname the current user has set for the specified player. +* Fix p2p networking apis on Linux so they work with dedicated servers +* Fix command line argument handling bug in SteamAPI_RestartAppIfNecessary on Linux and OSX. +* Added ISteamApps::GetLaunchQueryParam, which will get the value associated with the given key if a game is launched via a url with query paramaters, such as steam://run///?param1=value1;param2=value2;param3=value3. If the game is already running when such a url is executed, instead it will receive a NewLaunchQueryParameters_t callback. +* Added EUGCReadAction parameter to ISteamRemoteStorage:UGCRead that allows the game to keep the file open if it needs to seek around the file for arbitrary data, rather than always closing the file when the last byte is read. +* Added new ISteamUGC interface that is used for querying for lists of UGC details (e.g. Workshop items, screenshots, videos, artwork, guides, etc.). The ISteamUGC interface should be used instead of ISteamRemoteStorage, which contains similar, but less flexible and powerful functionality. +* Removed tools for deprecated content system + + +---------------------------------------------------------------- +v1.25 1st October 2013 +---------------------------------------------------------------- +* Fixed a crash in the 1.24 SDK update when attempting to call ISteamRemoteStorage::GetPublishedFileDetails by adding a missing parameter unMaxSecondsOld, which allows a game to request potentially-cached details (passing a value of 0 retains the previous behavior). + +---------------------------------------------------------------- +v1.24 17th July 2013 +---------------------------------------------------------------- + +User: +* Added ISteamUser::GetBadgeLevel and ISteamUser::GetPlayerSteamLevel functions + +Friends: +* Games can now initiate Steam Friend requests, removals, request -accepts and request-ignores via ISteamFriends’ ActivateGameOverlayToUser API. This prompts the user for confirmation before action is taken. + +Mac: +* Updated the OS X Content Prep tool and game wrapper for improved compatibility with OS X 10.8 (Mountain Lion). + +Linux: +* Added install script for the Steam Linux Runtime tools (run "bash tools/linux/setup.sh" to install), see tools/linux/README.txt for details. +* SteamworksExample is now available on Linux + +---------------------------------------------------------------- +v1.23a 25th February 2013 +---------------------------------------------------------------- + +Windows: +* Fix passing command-line parameters across SteamApi_RestartAppIfNeccessary() + +---------------------------------------------------------------- +v1.23 19th February 2013 +---------------------------------------------------------------- + +Cloud: +* Added ISteamScreenshots::TagPublishedFile() which allows tagging workshop content that is visible or active when a screenshot is taken. +* Added ISteamRemoteStorage::UGCDownloadToLocation() which allows a developer to specify a location on disk to download workshop content. + +Setup tool: +* Added Arabic to the supported languages for the PC Gold Master Setup Tool +* Fixed regression in localized EULA support in Mac OS X Gold Master Setup Tool + +Windows: +* Fix SteamAPI_RestartAppIfNecessary() on 64 bit Windows +* When launching a game's development build from outside of Steam, fixed using steam_appid.txt in the Steam Overlay and for authorizing microtransactions (broken in the SDK 1.22) + +Mac: +* Fixed many Steam callbacks not working for 64 bit OS X games due to mismatched structure alignment between the SDK and the Steam client +* Implemented SteamAPI_RestartAppIfNecessary() + +Linux: +* Removed the need to redistribute libtier0_s.so and libvstdlib_s.so +* Fixed finding and loading steamclient.so, so LD_LIBRARY_PATH does not need to be set for game to talk with Steam +* Implemented SteamAPI_RestartAppIfNecessary() + + +---------------------------------------------------------------- +v1.22 12th December 2012 +---------------------------------------------------------------- + +Apps +* Added new API call ISteamApps::MarkContentCorrupt() so a game can hint Steam that some of it's local content seems corrupt. Steam will verify the content next time the game is started. +* Added new API call ISteamApps::GetCurrentBetaName() so a game can get the current content beta branch name if the user chose to opt-in to a content beta. + +Cloud +* Added an offset parameter to ISteamRemoteStorage::UGCRead() to allow reading files in chunks, and increased the limit from 100MB to 200MB when downloading files this way. + +HTTP +* Added support for streaming HTTP requests with ISteamHTTP::SendHTTPRequestAndStreamResponse() and ISteamHTTP::GetHTTPStreamingResponseBodyData() + +Linux +* Updated libsteam_api.so to find Steam in its new install location + + +---------------------------------------------------------------- +v1.21 25th October 2012 +---------------------------------------------------------------- + +Big Picture +* Added ISteamUtils::ShowGamepadTextInput() to enable usage of the Big Picture gamepad text input control in-game. UI is rendered by the Steam Overlay. +* Added ISteamUtils::GetEnteredGamepadTextLength() and ISteamUtils::GetEnteredGamepadTextInput() to retrieve entered gamepad text. +* Added GamepadTextInputDismissed_t callback to detect when the user has entered gamepad data. + + +---------------------------------------------------------------- +v1.20 30th August 2012 +---------------------------------------------------------------- + +SteamPipe +* Added local server and builder tools for new content system. + +Mac +* OSX Supports 64 bit build targets. +* Spacewar has been updated to be buildable as a 64 bit OSX sample application. + +Friends +* Added a callback for the result of ISteamFriends::SetPersonaName(). +* Changed ISteamFriends::ActivateGameOverlayToStore() to take an additional parameter so app can be directly added to the cart. + +Cloud +* Added ISteamRemoteStorage::FileWriteStreamOpen(), FileWriteStreamWriteChunk(), FileWriteStreamClose() and FileWriteStreamCancel() for streaming operations. +* Changed parameters to ISteamRemoteStorage::PublisheVideo(). +* Added file type to ISteamRemoteStorage::GetPublishedFileDetails() callback result (RemoteStorageGetPublishedFileDetailsResult_t). +* Added a callback to indicate that a published file that a user owns was deleted (RemoteStoragePublishedFileDeleted_t). + +ISteamUserStats +* Added ISteamUserStats::GetNumAchievements() and ISteamUserStats::GetAchievementName(). + + +---------------------------------------------------------------- +v1.19 22nd March 2012 +---------------------------------------------------------------- + +Friends +* Added ISteamFriends::GetFollowerCount() +* Added ISteamFriends::IsFollowing() +* Added ISteamFriends::EnumerateFollowingList() + +Cloud +* Added ISteamRemoteStorage::UpdatePublishedFileSetChangeDescription() +* Added ISteamRemoteStorage::GetPublishedItemVoteDetails() +* Added ISteamRemoteStorage::UpdateUserPublishedItemVote() +* Added ISteamRemoteStorage::GetUserPublishedItemVoteDetails() +* Added ISteamRemoteStorage::EnumerateUserSharedWorkshopFiles() +* Added ISteamRemoteStorage::PublishVideo() +* Added ISteamRemoteStorage::SetUserPublishedFileAction() +* Added ISteamRemoteStorage::EnumeratePublishedFilesByUserAction() +* Added ISteamRemoteStorage::EnumeratePublishedWorkshopFiles() + +ISteamGameServer +* Updated callback for SteamGameServer::ComputeNewPlayerCompatibility to include the steam id the compatibility was calculated for + + +---------------------------------------------------------------- +v1.18 7th February 2012 +---------------------------------------------------------------- + +Cloud +* Removed ISteamRemoteStorage::PublishFile() and consolidated the API to PublishWorkshopFile() +* Updated ISteamRemoteStorage::PublishWorkshopFile() to better define the type of workshop file being published +* Replaced ISteamRemoteStorage::UpdatePublishedFile() with a new mechanism to update existing files through CreatePublishedFileUpdateRequest() UpdatePublishedFile[Property](), and CommitPublishedFileUpdate() +* Increased the description field for a workshop file from 256 -> 8000 characters +* Added ISteamRemoteStorage::GetUGCDownloadProgress() +* Added file size limit of 100MB to ISteamRemoteStorage::FileWrite() + +Apps: +* Added ISteamApps::RequestAppProofOfPurchaseKey + +---------------------------------------------------------------- +v1.17 2nd November 2011 +---------------------------------------------------------------- + +Cloud +* Added ISteamRemoteStorage::PublishFile(), PublishWorkshopFile(), UpdatePublishedFile(), DeletePublishedFile() which enables sharing, updating, and unsharing of cloud content with the Steam community +* Added ISteamRemoteStorage::EnumerateUserPublishedFiles to enumerate content that a user has shared with the Steam community +* Added ISteamRemoteStorage::GetPublishedFileDetails() which gets the metadata associated with a piece of community shared content +* Added ISteamRemoteStorage::SubscribePublishedFile(), EnumerateUserSubscribedFiles(), and UnsubscribePublishedFiles() which allow for management of community content that a user is interested in and marked as a favorite + +User +* Updated ISteamUser::GetAuthSessionTicket(), When creating a ticket for use by the AuthenticateUserTicket Web API, the calling application should wait for the callback GetAuthSessionTicketResponse_t generated by the API call before attempting to use the ticket to ensure that the ticket has been communicated to the server. If this callback does not come in a timely fashion ( 10 - 20 seconds ), your client is not connected to Steam, and the AuthenticeUserTicket will fail because it can not authenticate the user. + +Friends +* Added ISteamFriends::RequestFriendRichPresence, which allows requesting rich presence keys for any Steam user playing the same game as you +* Added a set of functions to ISteamFriends which allow games to integrate with Steam Chat. Games can both join group chats, as well as get friends chats and show them in-line in the game. This API isn’t currently used in a game, so there may be some rough edges around the user experience to work out, and some experimentation is required. + +Game Servers +* Removed the ISteamMasterServerUpdater interface. It has been merged into the ISteamGameServer interface, which is used to communicate all game server state changes. +* Significant changes to the game server init sequence. (See the comments for SteamGameServer_Init and the ISteamGameServer interface.) +* Removed interface to legacy master server mode +* Groundwork for implementing named steam accounts for game servers +* Old player auth system is deprecated. It may be removed in a future version of the SDK. + +Tools +* Added tool for automated DRM submissions in /sdk/tools/drm/ + +---------------------------------------------------------------- +v1.16 29th July 2011 +---------------------------------------------------------------- + +HTTP +* added ISteamHTTP::SetHTTPRequestRawPostBody() to set the raw body of a POST request +Screenshots +* added ISteamScreenshots interface, which enables adding screenshots to the user's screenshot library and tagging them with location data or relevant players that are visible in the screenshot. A game can provide screenshots based on game events using WriteScreenshot, AddScreenshotToLibrary, or TriggerScreenshot. A game can also choose to provide its own screenshots when the Steam screenshot hotkey is pressed by calling HookScreenshots() and listening for the ScreenshotRequested_t callback. + +---------------------------------------------------------------- +v1.15 1st June 2011 +---------------------------------------------------------------- + +Bug fixes +* Fixed exposing HTTP interface +* Fixed setting AppID for game processes started outside of Steam or which require administrative privileges + + +---------------------------------------------------------------- +v1.14 16th May 2011 +---------------------------------------------------------------- + +Stats and Achievements +* Added a set of functions for accessing global achievement unlock percentages +** RequestGlobalAchievementPercentages() to request the completion percentages from the backend +** GetMostAchievedAchievementInfo() and GetNextMostAchievedAchievementInfo() to iterate achievement completion percentages +** GetAchievementAchievedPercent() to query the global unlock percentage for a specific achievement +* Added a set of functions for accessing global stats values. To enable a global stats set stats as "aggregated" from the Steamworks admin page. +** RequestGlobalStats() to request the global stats data from the backend +** GetGlobalStat() to get the global total for a stat +** GetGlobalStatHistory() to get per day totals for a stat + +HTTP +* added ISteamHTTP::GetHTTPDownloadProgressPct() get the progress of an HTTP request + + +---------------------------------------------------------------- +v1.13 26th April 2011 +---------------------------------------------------------------- + +Rich Presence +* added a new Rich Presence system to allow for sharing game specific per user data between users +* ISteamFriends::SetRichPresense() can be used to set key/value presence data for the current user +* ISteamFriends::GetFriendRichPresence() and related functions can be used to retrieve presence data for a particular user +* Two special presence keys exist: +** the "connect" key can be set to specify a custom command line used by friends when joining that user +** the "status" key can be set to specify custom text that will show up in the 'view game info' dialog in the Steam friends list + +HTTP +* added ISteamHTTP, which exposes methods for making HTTP requests + +Downloadable Content +* added ISteamApps::GetDLCCount() and ISteamApps::BGetDLCDataByIndex() to allow for enumerating DLC content for the current title +* added ISteamApps::InstallDLC() and ISteamApps::UninstallDLC() to control installing optional content + +P2P Networking +* added ISteamNetworking::CloseP2PChannelWithUser(), to allow for closing a single channel to a user. When all channels are closed, the connection to that user is automatically closed. +* added ISteamNetworking::AllowP2PPacketRelay(), which can be used to prevent allowing P2P connections from falling back to relay + +Voice +* ISteamUser::GetAvailableVoice() & ISteamUser::GetVoice() now take the desired sample rate to determine the number of uncompressed bytes to return +* added ISteamUser::GetVoiceOptimalSampleRate() to return the frequency of the voice data as it's stored internally + +Friends +* added ISteamFriends methods to retrieve the list of users the player has recently played with + +Content Tool +* all files are now encrypted by default +* add command line option to app creation wizard +* add command line edit option by right clicking on app +* update cache size in CDDB after each build +* look for install scripts at build time and automatically add CDDB flag +* fix language names for chinese +* add menu button to easily rev version +* warn if rebuilding existing version +* allow specifying subfolder when ftp-ing depots to valve +* better error messaging if ftp fails +* clean up various small display bugs +* don't trash ValidOSList tag when updating CDDB + +OSX DirectX to OpenGL +* added the graphics layer used to port Valve games to OSX which can now be used by all Steamworks developers +* included in the Steamworks Example application. Can be enabled by building with DX9MODE=1 + + +---------------------------------------------------------------- +v1.12 10th November 2010 +---------------------------------------------------------------- + +Cloud +* added a set of function to handle publishing User Generated Content (UGC) files to the backend, and to download others users UGC files. This enables games to have users easily publish & share content with each other. +* Added ISteamRemoteStorage::FileForget() which tells a file to remain on disk but to be removed from the backend. This can be used to manage which files should be synchronized if you have more files to store than your quota allows. +* Added ISteamRemoteStorage::FilePersisted() to tell if the file is set to be synchronized with the backend. +* Added ISteamRemoteStorage::FileDelete() which tells a file to be deleted locally, from cloud, and from other clients that have the file. This can be used to properly delete a save file rather than writing a 1-byte file as a sentinel. +* Added ISteamRemoteStorage::SetSyncPlatforms(), GetSyncPlatforms() to tell steam which platforms a file should be synchronized to. This allows OSX not to download PC-specific files, or vice-versa. +* Added ISteamRemoteStorage::IsCloudEnabledForAccount(), IsCloudEnabledForApp(), and SetCloudEnabledForApp(). When cloud is disabled the APIs still work as normal and an alternate location on disk is not needed. It just means the files will not be synchronized with the backend. + +Leaderboards +* added ISteamUserStats::DownloadLeaderboardEntriesForUsers(), which downloads scores for an arbitrary set of users +* added ISteamUserStats::AttachLeaderboardUGC(), to attach a clouded file to a leaderboard entry + +Friends +* added ISteamFriends::RequestUserInformation(), to asynchronously request a users persona name & avatar by steamID +* added ISteamFriends::RequestClanOfficerList(), to asynchronously download the set of officers for a clan. GetClanOwner(), GetClanOfficerCount(), and GetClanOfficerByIndex() can then be used to access the data. + +Matchmaking +* added k_ELobbyTypePrivate option to creating lobbies - this means that the lobby won't show up to friends or be returned in searches +* added LobbyDataUpdate_t::m_bSuccess, to easily check if a RequestLobbyData() call failed to find the specified lobby + +Authentication +* added ISteamApps::GetEarliestPurchaseUnixTime(), for games that want to reward users who have played for a long time +* added ISteamApps::BIsSubscribedFromFreeWeekend(), so games can show different offers or information for users who currently only have rights to play the game due to a free weekend promotion +* added ISteamGameServer::GetAuthSessionTicket(), BeginAuthSession(), EndAuthSession(), and CancelAuthTicket(), matching what exists in ISteamUser. This allows game servers and clients to authenticate each other in a unified manner. + +OSX +* The Steamworks Spacewar example now builds/runs on OS X +* The OSX retail install setup application is now contained in goldmaster\disk_assets\SteamRetailInstaller.dmg + +PS3 +* added several functions regarding PS3 support. This is still a work in progress, and no PS3 binaries are included. + + +---------------------------------------------------------------- +v1.11 23rd August 2010 +---------------------------------------------------------------- + +Networking +* added virtual ports to the P2P networking API to help with routing messages to different systems +* added ISteamUser::BIsBehindNAT() to detect when a user is behind a NAT + +Friends / Matchmaking +* added support for retrieving large (184x184) avatars +* added ISteamUser::AdvertiseGame() which can be used send join game info to friends without using the game server APIs + +64-bit support +* 64-bit windows binaries are included in the sdk/redistributable_bin/ folder +* VAC and CEG are not yet supported + +Authentication +* added ticket based remote authentication library + +Other +* added ISteamUser::CheckFileSignature which can be used in conjunction with the signing tab on the partner site to verify that an executable has not been modified + + +---------------------------------------------------------------- +v1.10 20th July 2010 +---------------------------------------------------------------- + +Friends / Matchmaking +* added function ISteamFriends::GetClanTag(), which returns the abbreviation set for a group +* added "stats" and "achievements" options to ISteamFriends::ActivateGameOverlayToUser() +* added function ISteamFriends::ActivateGameOverlayInviteDialog() to open the invite dialog for a specific lobby +* renamed ISteamMatchmaking::SetGameType() to the more correct SetGameTags() + +Authentication +* added ISteamUtils::CheckFileSignature(), which can be used to verify that a binary has a valid signature + +Other +* added #pragma pack() in several places around structures in headers + + +---------------------------------------------------------------- +v1.09 12th May 2010 +---------------------------------------------------------------- + +Mac Steamworks! +* new binaries in the sdk/redistributable_bin/osx/ folder + +Other +* explicit pragma( pack, 8 ) added around all callbacks and structures, for devs who have use a different default packing +* renamed function ISteamGameServer::SetGameType() to the more accurate ISteamGameServer::SetGameTags() + + +---------------------------------------------------------------- +v1.08 27st January 2010 +---------------------------------------------------------------- + +Matchmaking +* added function ISteamMatching::AddRequestLobbyListDistanceFilter(), to specify how far geographically you want to search for other lobbies +* added function ISteamMatching::AddRequestLobbyListResultCountFilter(), to specify how the maximum number of lobby you results you need (less is faster) + +Stats & Achievements +* added interface ISteamGameServerStats, which enables access to stats and achievements for users to the game server +* removed function ISteamGameServer::BGetUserAchievementStatus(), now handled by ISteamGameServerStats +* added ISteamUserStats::GetAchievementAndUnlockTime(), which returns if and when a user unlocked an achievement + +Other +* added new constant k_cwchPersonaNameMax (32), which is the maximum number of unicode characters a users name can be +* removed ISteamRemoteStorage::FileDelete() - NOTE: it will be back, it's only removed since it hadn't been implemented on the back-end yet +* added function ISteamGameServer::GetServerReputation(), gives returns a game server reputation score based on how long users typically play on the server + + +---------------------------------------------------------------- +v1.07 16th December 2009 +---------------------------------------------------------------- + +* Replaced SteamAPI_RestartApp() with SteamAPI_RestartAppIfNecessary(). This new function detects if the process was started through Steam, and starts the current game through Steam if necessary. +* Added ISteamUtils::BOverlayNeedsPresent() so games with event driven rendering can determine when the Steam overlay needs to draw + + +---------------------------------------------------------------- +v1.06 30th September 2009 +---------------------------------------------------------------- + +Voice +* ISteamUser::GetCompressedVoice() has been replaced with ISteamUser::GetVoice which can be used to retrieve compressed and uncompressed voice data +* Added ISteamUser::GetAvailableVoice() to retrieve the amount of captured audio data that is available + +Matchmaking +* Added a new callback LobbyKicked_t that is sent when a user has been disconnected from a lobby +* Through ISteamMatchmakingServers, multiple server list requests of the same type can now be outstanding at the same time + +Steamworks Setup Application: +* Streamlined configuration process +* Now supports EULAs greater than 32k bytes + +Content Tool +* Added DLC checkbox to depot creation wizard + +Other +* Added SteamAPI_IsSteamRunning() +* Added SteamAPI_RestartApp() so CEG users can restart their game through Steam if launched through Windows Games Explorer + + + +---------------------------------------------------------------- +v1.05 11th June 2009 +---------------------------------------------------------------- + +Matchmaking +* Added the SteamID of the gameserver to the gameserveritem_t structure (returned only by newer game servers) +* Added ISteamUserStats::GetNumberOfCurrentPlayers(), asyncronously returns the number users currently running this game +* Added k_ELobbyComparisonNotEqual comparision functions for filters +* Added option to use comparison functions for string filters +* Added ISteamMatchmaking::AddRequestLobbyListFilterSlotsAvailable( int nSlotsAvailable ) filter function, so you can find a lobby for a group of users to join +* Extended ISteamMatchmaking::CreateLobby() to take the max number of users in the lobby +* Added ISteamMatchmaking::GetLobbyDataCount(), ISteamMatchmaking::GetLobbyDataByIndex() so you can iterate all the data set on a lobby +* Added ISteamMatchmaking::DeleteLobbyData() so you can clear a key from a lobby +* Added ISteamMatchmaking::SetLobbyOwner() so that ownership of a lobby can be transferred +* Added ISteamMatchmaking::SetLobbyJoinable() +* Added ISteamGameServer::SetGameData(), so game server can set more information that can be filtered for in the server pinging API + +Networking +* Added a set of connectionless networking functions for easy use for making peer-to-peer (NAT traversal) connections. Includes supports for windowed reliable sendsand fragementation/re-assembly of large packets. See ISteamNetworking.h for more details. + +Leaderboards +* Added enum ELeaderboardUploadScoreMethod and changed ISteamUserStats::UploadLeaderboardScore() to take this - lets you force a score to be changed even if it's worse than the prior score + +Callbacks +* Added CCallbackManual<> class to steam_api.h, a version of CCallback<> that doesn't register itself automatically in it's the constructor + +Downloadable Content +* Added ISteamUser::UserHasLicenseForApp() and ISteamGameServer::UserHasLicenseForApp() to enable checking if a user owns DLC in multiplayer. See the DLC documentation for more info. + +Game Overlay +* ISteamFriends::ActivateGameOverlay() now accepts "Stats" and "Achievements" + + + +---------------------------------------------------------------- +v1.04 9th Mar 2009 +---------------------------------------------------------------- + +Added Peer To Peer Multi-Player Authentication/Authorization: +* Allows each peer to verify the unique identity of the peers ( by steam account id ) in their game and determine if that user is allowed access to the game. +* Added to the ISteamUser interface: GetAuthSessionTicket(), BeginAuthSession(), EndAuthSession() and CancelAuthTicket() +* Additional information can be found in the API Overview on the Steamworks site + +Added support for purchasing downloadable content in game: +* Added ISteamApps::BIsDlcInstalled() and the DlcInstalled_t callback, which enable a game to check if downloadable content is owned and installed +* Added ISteamFriends::ActivateGameOverlayToStore(), which opens the Steam game overlay to the store page for an appID (can be a game or DLC) + +Gold Master Creation: +* It is no longer optional to encrypt depots on a GM +* The GM configuration file now supports an included_depots key, which along with the excluded_depots key, allows you to specify exactly which depots are placed on a GM +* Simplified the configuration process for the setup application +* The documentation for creating a Gold Master has been rewritten and extended. See the Steamworks site for more information. + +Added Leaderboards: +* 10k+ leaderboards can now be created programmatically per game, and queried globally or compared to friends +* Added to ISteamUserStats interface +* See SteamworksExample for a usage example + +Other: +* Added SteamShutdown_t callback, which will alert the game when Steam wants to shut down +* Added ISteamUtils::IsOverlayEnabled(), which can be used to detect if the user has disabled the overlay in the Steam settings +* Added ISteamUserStats::ResetAllStats(), which can be used to reset all stats (and optionally achievements) for a user +* Moved SetWarningMessageHook() from ISteamClient to ISteamUtils +* Added SteamAPI_SetTryCatchCallbacks, sets whether or not Steam_RunCallbacks() should do a try {} catch (...) {} around calls to issuing callbacks +* In CCallResult callback, CCallResult::IsActive() will return false and can now reset the CCallResult +* Added support for zero-size depots +* Properly strip illegal characters from depot names + + + +---------------------------------------------------------------- +v1.03 16th Jan 2009 +---------------------------------------------------------------- + +Major changes: +* ISteamRemoteStorage interface has been added, which contains functions to store per-user data in the Steam Cloud back-end. +** To use this, you must first use the partner web site to enable Cloud for your game. +** The current setting is allowing 1MB of storage per-game per-user (we hope to increase this over time). + +Lobby & Matchmaking related changes: +* ISteamFriends::GetFriendGamePlayed() now also return the steamID of the lobby the friend is in, if any. It now takes a pointer to a new FriendGameInfo_t struct, which it fills +* Removed ISteamFriends::GetFriendsLobbies(), since this is now redundant to ISteamFriends::GetFriendGamePlayed() +* Added enum ELobbyComparison, to set the comparison operator in ISteamMatchmaking::AddRequestLobbyListNumericalFilter() +* Changed ISteamMatchmaking::CreateLobby(), JoinLobby() and RequestLobbyList() to now return SteamAPICall_t handles, so you can easily track if a particular call has completed (see below) +* Added ISteamMatchmaking::SetLobbyType(), which can switch a lobby between searchable (public) and friends-only +* Added ISteamMatchmaking::GetLobbyOwner(), which returns the steamID of the user who is currently the owner of the lobby. The back-end ensures that one and only one user is ever the owner. If that user leaves the lobby, another user will become the owner. + +Steam game-overlay interaction: +* Added a new callback GameLobbyJoinRequested_t, which is sent to the game if the user selects 'Join friends game' from the Steam friends list, and that friend is in a lobby. The game should initiate connection to that lobby. +* Changed ISteamFriends::ActivateGameOverlay() can now go to "Friends", "Community", "Players", "Settings", "LobbyInvite", "OfficialGameGroup" +* Added ISteamFriends::ActivateGameOverlayToUser(), which can open a either a chat dialog or another users Steam community profile +* Added ISteamFriends::ActivateGameOverlayToWebPage(), which opens the Steam game-overlay web browser to the specified url + +Stats system changes: +* Added ISteamUserStats::RequestUserStats(), to download the current game stats of another user +* Added ISteamUserStats::GetUserStat() and ISteamUserStats::GetUserAchievement() to access the other users stats, once they've been downloaded + +Callback system changes: +* Added new method for handling asynchronous call results, currently used by CreateLobby(), JoinLobby(), RequestLobbyList(), and RequestUserStats(). Each of these functions returns a handle, SteamAPICall_t, that can be used to track the completion state of a call. +* Added new object CCallResult<>, which can map the completion of a SteamAPICall_t to a function, and include the right data. See SteamworksExample for a usage example. +* Added ISteamUtils::IsAPICallCompleted(), GetAPICallFailureReason(), and GetAPICallResult(), which can be used to track the state of a SteamAPICall_t (although it is recommended to use CCallResult<>, which wraps these up nicely) + +Other: +* Added ISteamGameServer::GetPublicIP(), which is the IP address of a game server as seen by the Steam back-end +* Added "allow relay" parameter to ISteamNetworking::CreateP2PConnectionSocket() and CreateListenSocket(), which specified if being bounced through Steam relay servers is OK if a direct p2p connection fails (will have a much higher latency, but increases chance of making a connection) +* Added IPCFailure_t callback, which will be posted to the game if Steam itself has crashed, or if Steam_RunCallbacks() hasn't been called in a long time + + + +---------------------------------------------------------------- +v1.02 4th Sep 2008 +---------------------------------------------------------------- + +The following interfaces have been updated: + +ISteamUser + + // Starts voice recording. Once started, use GetCompressedVoice() to get the data + virtual void StartVoiceRecording( ) = 0; + + // Stops voice recording. Because people often release push-to-talk keys early, the system will keep recording for + // a little bit after this function is called. GetCompressedVoice() should continue to be called until it returns + // k_eVoiceResultNotRecording + virtual void StopVoiceRecording( ) = 0; + + // Gets the latest voice data. It should be called as often as possible once recording has started. + // nBytesWritten is set to the number of bytes written to pDestBuffer. + virtual EVoiceResult GetCompressedVoice( void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten ) = 0; + + // Decompresses a chunk of data produced by GetCompressedVoice(). nBytesWritten is set to the + // number of bytes written to pDestBuffer. The output format of the data is 16-bit signed at + // 11025 samples per second. + virtual EVoiceResult DecompressVoice( void *pCompressed, uint32 cbCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten ) = 0; + +virtual int InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure ) = 0; + +This has been extended to be usable for games that don't use the other parts of Steamworks matchmaking. This allows any multiplayer game to easily notify the Steam client of the IP:Port of the game server the user is connected to, so that their friends can join them via the Steam friends list. Empty values are taken for auth blob. + + virtual bool GetUserDataFolder( char *pchBuffer, int cubBuffer ) = 0; + +This function returns a hint as a good place to store per- user per-game data. + + + +ISteamMatchmaking + +Added a set of server-side lobby filters, as well as voice chat, lobby member limits, and a way of quickly accessing the list of lobbies a users friends are in. + + // filters for lobbies + // this needs to be called before RequestLobbyList() to take effect + // these are cleared on each call to RequestLobbyList() + virtual void AddRequestLobbyListFilter( const char *pchKeyToMatch, const char *pchValueToMatch ) = 0; + // numerical comparison - 0 is equal, -1 is the lobby value is less than nValueToMatch, 1 is the lobby value is greater than nValueToMatch + virtual void AddRequestLobbyListNumericalFilter( const char *pchKeyToMatch, int nValueToMatch, int nComparisonType /* 0 is equal, -1 is less than, 1 is greater than */ ) = 0; + // sets RequestLobbyList() to only returns lobbies which aren't yet full - needs SetLobbyMemberLimit() called on the lobby to set an initial limit + virtual void AddRequestLobbyListSlotsAvailableFilter() = 0; + + // returns the details of a game server set in a lobby - returns false if there is no game server set, or that lobby doesn't exist + virtual bool GetLobbyGameServer( CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, CSteamID *psteamIDGameServer ) = 0; + + // set the limit on the # of users who can join the lobby + virtual bool SetLobbyMemberLimit( CSteamID steamIDLobby, int cMaxMembers ) = 0; + // returns the current limit on the # of users who can join the lobby; returns 0 if no limit is defined + virtual int GetLobbyMemberLimit( CSteamID steamIDLobby ) = 0; + + // asks the Steam servers for a list of lobbies that friends are in + // returns results by posting one RequestFriendsLobbiesResponse_t callback per friend/lobby pair + // if no friends are in lobbies, RequestFriendsLobbiesResponse_t will be posted but with 0 results + // filters don't apply to lobbies (currently) + virtual bool RequestFriendsLobbies() = 0; + + +ISteamUtils + // Sets the position where the overlay instance for the currently calling game should show notifications. + // This position is per-game and if this function is called from outside of a game context it will do nothing. + virtual void SetOverlayNotificationPosition( ENotificationPosition eNotificationPosition ) = 0; + + +ISteamFriends + virtual int GetFriendAvatar( CSteamID steamIDFriend, int eAvatarSize ) = 0; + +This function now takes an eAvatarSize parameter, which can be k_EAvatarSize32x32 or k_EAvatarSize64x64 (previously it always just returned a handle to the 32x32 image) + + +---------------------------------------------------------------- +v1.01 8th Aug 2008 +---------------------------------------------------------------- + +The Steamworks SDK has been updated to simplfy game server authentication and better expose application state + + +---------------------------------------------------------------- +v1.0: +---------------------------------------------------------------- + +- Initial Steamworks SDK release diff --git a/external/steamworks/glmgr/cglmbuffer.cpp b/external/steamworks/glmgr/cglmbuffer.cpp new file mode 100644 index 0000000..1eb9eb2 --- /dev/null +++ b/external/steamworks/glmgr/cglmbuffer.cpp @@ -0,0 +1,367 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ +// +// cglmbuffer.cpp +// +//=============================================================================== + +#include "glmgr.h" +#include "glmdisplay.h" +#include "cglmbuffer.h" + +#ifdef OSX +// Debugger - 10.8 +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + +// void BindBufferARB(enum target, uint buffer); +// void DeleteBuffersARB(sizei n, const uint *buffers); +// void GenBuffersARB(sizei n, uint *buffers); +// boolean IsBufferARB(uint buffer); +// +// void BufferDataARB(enum target, sizeiptrARB size, const void *data, +// enum usage); +// void BufferSubDataARB(enum target, intptrARB offset, sizeiptrARB size, +// const void *data); +// void GetBufferSubDataARB(enum target, intptrARB offset, +// sizeiptrARB size, void *data); +// +// void *MapBufferARB(enum target, enum access); +// boolean UnmapBufferARB(enum target); +// +// void GetBufferParameterivARB(enum target, enum pname, int *params); +// void GetBufferPointervARB(enum target, enum pname, void **params); +// +//New Tokens +// +// Accepted by the parameters of BindBufferARB, BufferDataARB, +// BufferSubDataARB, MapBufferARB, UnmapBufferARB, +// GetBufferSubDataARB, GetBufferParameterivARB, and +// GetBufferPointervARB: +// +// ARRAY_BUFFER_ARB 0x8892 +// ELEMENT_ARRAY_BUFFER_ARB 0x8893 +// +// Accepted by the parameter of GetBooleanv, GetIntegerv, +// GetFloatv, and GetDoublev: +// +// ARRAY_BUFFER_BINDING_ARB 0x8894 +// ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +// VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +// NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +// COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +// INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +// TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +// EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +// SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +// FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +// WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +// +// Accepted by the parameter of GetVertexAttribivARB: +// +// VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +// +// Accepted by the parameter of BufferDataARB: +// +// STREAM_DRAW_ARB 0x88E0 +// STREAM_READ_ARB 0x88E1 +// STREAM_COPY_ARB 0x88E2 +// STATIC_DRAW_ARB 0x88E4 +// STATIC_READ_ARB 0x88E5 +// STATIC_COPY_ARB 0x88E6 +// DYNAMIC_DRAW_ARB 0x88E8 +// DYNAMIC_READ_ARB 0x88E9 +// DYNAMIC_COPY_ARB 0x88EA +// +// Accepted by the parameter of MapBufferARB: +// +// READ_ONLY_ARB 0x88B8 +// WRITE_ONLY_ARB 0x88B9 +// READ_WRITE_ARB 0x88BA +// +// Accepted by the parameter of GetBufferParameterivARB: +// +// BUFFER_SIZE_ARB 0x8764 +// BUFFER_USAGE_ARB 0x8765 +// BUFFER_ACCESS_ARB 0x88BB +// BUFFER_MAPPED_ARB 0x88BC +// +// Accepted by the parameter of GetBufferPointervARB: +// +// BUFFER_MAP_POINTER_ARB 0x88BD + +// http://www.opengl.org/registry/specs/ARB/pixel_buffer_object.txt +// Accepted by the parameters of BindBuffer, BufferData, +// BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, +// GetBufferParameteriv, and GetBufferPointerv: +// PIXEL_PACK_BUFFER_ARB 0x88EB +// PIXEL_UNPACK_BUFFER_ARB 0x88EC + + + // gl_bufmode: zero means we mark all vertex/index buffers static + + // non zero means buffers are initially marked static.. + // ->but can shift to dynamic upon first 'discard' (orphaning) + +//ConVar gl_bufmode( "gl_bufmode", "1" ); +int gl_bufmode = 1; + +CGLMBuffer::CGLMBuffer( GLMContext *ctx, EGLMBufferType type, uint size, uint options ) +{ + m_ctx = ctx; + m_type = type; + switch(m_type) + { + case kGLMVertexBuffer: m_buffGLTarget = GL_ARRAY_BUFFER_ARB; break; + case kGLMIndexBuffer: m_buffGLTarget = GL_ELEMENT_ARRAY_BUFFER_ARB; break; + case kGLMUniformBuffer: m_buffGLTarget = GL_UNIFORM_BUFFER_EXT; break; + case kGLMPixelBuffer: m_buffGLTarget = GL_PIXEL_UNPACK_BUFFER_ARB; break; + + default: //Assert(!"Unknown buffer type" ); + break; + } + m_size = size; + m_bound = false; + m_mapped = false; + m_lastMappedAddress = NULL; + + m_enableAsyncMap = false; + m_enableExplicitFlush = false; + m_dirtyMinOffset = m_dirtyMaxOffset = 0; // adjust/grow on lock, clear on unlock + + m_ctx->CheckCurrent(); + m_revision = rand(); + + // make a decision about pseudo mode + // this looked like it didn't help much or was actually slower, so leave it available but only as opt-in. + // a more clever implementation would be able to select pseudo buf storage for small batches only.. + m_pseudo = false; // (m_type==kGLMIndexBuffer) && (CommandLine()->FindParm("-gl_enable_pseudobufs")); + if (m_pseudo) + { + m_name = 0; + m_pseudoBuf = (char*)malloc( size ); + + m_ctx->BindBufferToCtx( m_type, NULL ); // exit with no buffer bound + } + else + { + glGenBuffersARB( 1, &m_name ); + GLMCheckError(); + + m_ctx->BindBufferToCtx( m_type, this ); // causes glBindBufferARB + + // buffers start out static, but if they get orphaned and gl_bufmode is non zero, + // then they will get flipped to dynamic. + + GLenum hint = GL_STATIC_DRAW_ARB; + switch(m_type) + { + case kGLMVertexBuffer: hint = (options & GLMBufferOptionDynamic) ? GL_DYNAMIC_DRAW_ARB : GL_STATIC_DRAW_ARB; break; + case kGLMIndexBuffer: hint = (options & GLMBufferOptionDynamic) ? GL_DYNAMIC_DRAW_ARB : GL_STATIC_DRAW_ARB; break; + case kGLMUniformBuffer: hint = GL_DYNAMIC_DRAW_ARB; break; // "fwiw" - shrug + case kGLMPixelBuffer: hint = (options & GLMBufferOptionDynamic) ? GL_DYNAMIC_DRAW_ARB : GL_STATIC_DRAW_ARB; break; + + default: //Assert(!"Unknown buffer type" ); + break; + } + + glBufferDataARB( m_buffGLTarget, m_size, NULL, hint ); // may ultimately need more hints to set the usage correctly (esp for streaming) + + this->SetModes( false, true, true ); + + m_ctx->BindBufferToCtx( m_type, NULL ); // unbind me + } +} + +CGLMBuffer::~CGLMBuffer( ) +{ + m_ctx->CheckCurrent(); + + if (m_pseudo) + { + free (m_pseudoBuf); + m_pseudoBuf = NULL; + } + else + { + glDeleteBuffersARB( 1, &m_name ); + GLMCheckError(); + } + + m_ctx = NULL; + m_name = 0; + m_bound = 0; + + m_lastMappedAddress = NULL; +} + +void CGLMBuffer::SetModes ( bool asyncMap, bool explicitFlush, bool force ) +{ + // assumes buffer is bound. called by constructor and by Lock. + + if (m_pseudo) + { + // ignore it... + } + else + { + if (force || (m_enableAsyncMap != asyncMap) ) + { + // note the sense of the parameter, it's TRUE if you *want* serialization, so for async you turn it to false. + glBufferParameteriAPPLE( this->m_buffGLTarget, GL_BUFFER_SERIALIZED_MODIFY_APPLE, asyncMap==false ); + m_enableAsyncMap = asyncMap; + } + + if (force || (m_enableExplicitFlush != explicitFlush) ) + { + // note the sense of the parameter, it's TRUE if you *want* auto-flush-on-unmap, so for explicit-flush, you turn it to false. + glBufferParameteriAPPLE( this->m_buffGLTarget, GL_BUFFER_FLUSHING_UNMAP_APPLE, explicitFlush==false ); + m_enableExplicitFlush = explicitFlush; + } + } +} + +void CGLMBuffer::FlushRange ( uint offset, uint size ) +{ + if (m_pseudo) + { + // nothing to do + } + else + { + // assumes buffer is bound. + glFlushMappedBufferRangeAPPLE(this->m_buffGLTarget, (GLintptr)offset, (GLsizeiptr)size); + } +} + +//ConVar gl_buffer_alignment_quantum ( "gl_buffer_alignment_quantum", "32" ); // the alignment we use pre-SLGU +//ConVar gl_buffer_alignment_quantum_slgu( "gl_buffer_alignment_quantum_slgu", "2" ); // alignment used post-SLGU + +int gl_buffer_alignment_quantum = 32; +int gl_buffer_alignment_quantum_slgu = 2; + +void CGLMBuffer::Lock( GLMBuffLockParams *params, char **addressOut ) +{ + char *resultPtr = NULL; + + //Assert( !m_mapped); + + m_ctx->CheckCurrent(); + GLMCheckError(); + + if (params->m_offset >= m_size) + Debugger(); + + if (params->m_offset + params->m_size > m_size) + Debugger(); + + // bind (yes, even for pseudo - this binds name 0) + m_ctx->BindBufferToCtx( this->m_type, this ); + + if (m_pseudo) + { + // discard is a no-op + + // async map modes are a no-op + + // latch last mapped address (silly..) + m_lastMappedAddress = (float*)m_pseudoBuf; + + // calc lock address + resultPtr = m_pseudoBuf + params->m_offset; + + // dirty range is a no-op + } + else + { + // perform discard if requested + if (params->m_discard) + { + // observe gl_bufmode on any orphan event. + // if orphaned and bufmode is nonzero, flip it to dynamic. + GLenum hint = gl_bufmode /*.GetInt()*/ ? GL_DYNAMIC_DRAW_ARB : GL_STATIC_DRAW_ARB; + glBufferDataARB( m_buffGLTarget, m_size, NULL, hint ); + + m_lastMappedAddress = NULL; + + m_revision++; // revision grows on orphan event + } + + // adjust async map option appropriately, leave explicit flush unchanged + this->SetModes( params->m_nonblocking, m_enableExplicitFlush ); + + // map + char *mapPtr = (char*)glMapBufferARB( this->m_buffGLTarget, GL_READ_WRITE_ARB ); + + if (!mapPtr) + { + Debugger(); + } + + if (m_lastMappedAddress) + { + // just check if it moved + //Assert (m_lastMappedAddress == (float*)mapPtr); + } + + m_lastMappedAddress = (float*)mapPtr; + + // calculate offset location + resultPtr = mapPtr + params->m_offset; + + // adjust dirty range + if (m_dirtyMinOffset != m_dirtyMaxOffset) + { + // grow range + m_dirtyMinOffset = std::min( m_dirtyMinOffset, params->m_offset ); + m_dirtyMaxOffset = std::min( m_dirtyMaxOffset, params->m_offset+params->m_size ); + } + else + { + // set range + m_dirtyMinOffset = params->m_offset; + m_dirtyMaxOffset = params->m_offset+params->m_size; + } + + // pad and clamp dirty range to choice of boundary + uint quantum = (m_ctx->Caps().m_hasPerfPackage1) ? gl_buffer_alignment_quantum_slgu /*.GetInt()*/ : gl_buffer_alignment_quantum /*.GetInt()*/ ; + uint quantum_mask = quantum - 1; + + m_dirtyMinOffset = m_dirtyMinOffset & (~quantum_mask); + m_dirtyMaxOffset = (m_dirtyMaxOffset + quantum_mask) & (~quantum_mask); + m_dirtyMaxOffset = std::min( m_dirtyMaxOffset, m_size ); + } + + m_mapped = true; + + *addressOut = resultPtr; +} + +void CGLMBuffer::Unlock( void ) +{ + m_ctx->CheckCurrent(); + + //Assert (m_mapped); + + if (m_pseudo) + { + // nothing to do actually + } + else + { + m_ctx->BindBufferToCtx( this->m_type, this ); + + // time to do explicit flush + if (m_enableExplicitFlush) + { + this->FlushRange( m_dirtyMinOffset, m_dirtyMaxOffset - m_dirtyMinOffset ); + } + + // clear dirty range no matter what + m_dirtyMinOffset = m_dirtyMaxOffset = 0; // adjust/grow on lock, clear on unlock + + glUnmapBuffer( this->m_buffGLTarget ); + + } + + m_mapped = false; +} diff --git a/external/steamworks/glmgr/cglmbuffer.h b/external/steamworks/glmgr/cglmbuffer.h new file mode 100644 index 0000000..9c2220e --- /dev/null +++ b/external/steamworks/glmgr/cglmbuffer.h @@ -0,0 +1,91 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ +// +// cglmprogram.h +// GLMgr buffers (index / vertex) +// ... maybe add PBO later as well +//=============================================================================== + +#ifndef CGLMBUFFER_H +#define CGLMBUFFER_H + +#pragma once + +// ext links + +// http://www.opengl.org/registry/specs/ARB/vertex_buffer_object.txt + +//=============================================================================== + +// forward declarations + +class GLMContext; + +enum EGLMBufferType +{ + kGLMVertexBuffer, + kGLMIndexBuffer, + kGLMUniformBuffer, // for bindable uniform + kGLMPixelBuffer, // for PBO + + kGLMNumBufferTypes +}; + + // pass this in "options" to constructor to make a dynamic buffer +#define GLMBufferOptionDynamic 0x00000001 + +struct GLMBuffLockParams +{ + uint m_offset; + uint m_size; + bool m_nonblocking; + bool m_discard; +}; + +class CGLMBuffer +{ + +public: + void Lock( GLMBuffLockParams *params, char **addressOut ); + void Unlock( void ); + +//protected: + friend class GLMContext; // only GLMContext can make CGLMBuffer objects + friend class GLMTester; + friend struct IDirect3D9; + friend struct IDirect3DDevice9; + + CGLMBuffer ( GLMContext *ctx, EGLMBufferType type, uint size, uint options ); + ~CGLMBuffer ( ); + + void SetModes ( bool asyncMap, bool explicitFlush, bool force = false ); + void FlushRange ( uint offset, uint size ); + + GLMContext *m_ctx; // link back to parent context + EGLMBufferType m_type; + uint m_size; + GLenum m_buffGLTarget; // GL_ARRAY_BUFFER_ARB / GL_ELEMENT_BUFFER_ARB + GLuint m_name; // name of this program in the context + uint m_revision; // bump anytime the size changes or buffer is orphaned + bool m_enableAsyncMap; // mirror of the buffer state + bool m_enableExplicitFlush; // mirror of the buffer state + + bool m_bound; // true if bound to context + bool m_mapped; // is it currently mapped + uint m_dirtyMinOffset; // when equal, range is empty + uint m_dirtyMaxOffset; + + float *m_lastMappedAddress; + + // --------------------- pseudo-VBO support below here (explicitly for dynamic index buffers) + bool m_pseudo; // true if the m_name is 0, and the backing is plain RAM + + // in pseudo mode, there is just one RAM buffer that acts as the backing. + // expectation is that this mode would only be used for dynamic indices. + // since indices have to be consumed (copied to command stream) prior to return from a drawing call, + // there's no need to do any fencing or multibuffering. orphaning in particular becomes a no-op. + + char *m_pseudoBuf; // storage for pseudo buffer +}; + + +#endif diff --git a/external/steamworks/glmgr/cglmfbo.cpp b/external/steamworks/glmgr/cglmfbo.cpp new file mode 100644 index 0000000..06a5e95 --- /dev/null +++ b/external/steamworks/glmgr/cglmfbo.cpp @@ -0,0 +1,356 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ +// +// cglmfbo.cpp +// +//=============================================================================== + +#include "glmgr.h" +#include "cglmfbo.h" +// #include "../shaderapidx9/dxabstract.h" + +#ifdef OSX +// Debugger - 10.8 +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + +CGLMFBO::CGLMFBO( GLMContext *ctx ) +{ + m_ctx = ctx; + m_ctx->CheckCurrent(); + + glGenFramebuffersEXT( 1, &m_name ); + GLMCheckError(); + + memset( m_attach, 0, sizeof( m_attach ) ); + + m_sizeX = m_sizeY = 0; +} + + +CGLMFBO::~CGLMFBO( ) +{ + m_ctx->CheckCurrent(); + + // detach all known attached textures first... necessary ? + for( int index = 0; index < kAttCount; index++) + { + if (m_attach[ index ].m_tex) + { + TexDetach( (EGLMFBOAttachment)index ); + GLMCheckError(); + } + } + + glDeleteFramebuffersEXT( 1, &m_name ); + GLMCheckError(); + + m_name = 0; + m_ctx = NULL; +} + +// the tex attach path should also select a specific slice of the texture... +// and we need a way to make renderbuffers.. + +static GLenum EncodeAttachmentFBO( EGLMFBOAttachment index ) +{ + if (index < kAttDepth) + { + return GL_COLOR_ATTACHMENT0_EXT + (int) index; + } + else + { + switch( index ) + { + case kAttDepth: + return GL_DEPTH_ATTACHMENT_EXT; + break; + + case kAttStencil: + return GL_STENCIL_ATTACHMENT_EXT; + break; + + case kAttDepthStencil: + return GL_DEPTH_STENCIL_ATTACHMENT_EXT; + break; + + default: + GLMStop(); // bad news + return 0; + break; + } + } +} + +void CGLMFBO::TexAttach( GLMFBOTexAttachParams *params, EGLMFBOAttachment attachIndex, GLenum fboBindPoint ) +{ + // force our parent context to be current + m_ctx->MakeCurrent(); + + // bind to context (will cause FBO object creation on first use) + m_ctx->BindFBOToCtx( this, fboBindPoint ); + + // it's either a plain 2D, a 2D face of a cube map, or a slice of a 3D. + CGLMTex *tex = params->m_tex; + + // always detach what is currently there, if anything + this->TexDetach( attachIndex, fboBindPoint ); + + if (!tex) + { + // andif they pass NULL to us, then we are done. + return; + } + + GLMTexLayout *layout = tex->m_layout; + GLenum target = tex->m_layout->m_key.m_texGLTarget; + + GLenum attachIndexGL = EncodeAttachmentFBO( attachIndex ); + + switch( target ) + { + case GL_TEXTURE_2D: + { + // we will attach the underlying RBO on a multisampled tex, iff the tex hasone, **and** we're not being asked to attach it to the read buffer. + // if we get a req to attach an MSAA tex to the read buffer, chances are it's BlitTex calling, andit has already resolved the tex, so in those + // cases you really do want to attach the texture and not the RBO to the FBO in question. + + bool useRBO = false; // initial state + + if (layout->m_key.m_texFlags & kGLMTexMultisampled) + { + // it is an MSAA tex + if (fboBindPoint == GL_READ_FRAMEBUFFER_EXT) + { + // I think you just want to read a resolved tex. + // But I will check that it is resolved first.. + Assert( tex->m_rboDirty == false ); + } + else + { + // you want to draw into it. You get the RBO bound instead of the tex. + useRBO = true; + } + } + + if (useRBO) + { + // MSAA path - attach the RBO, not the texture, and mark the RBO dirty + if (attachIndexGL==GL_DEPTH_STENCIL_ATTACHMENT_EXT) + { + // you have to attach it both places... + // http://www.opengl.org/wiki/GL_EXT_framebuffer_object + + // bind the RBO to the GL_RENDERBUFFER_EXT target + glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, tex->m_rboName ); + GLMCheckError(); + + // attach the GL_RENDERBUFFER_EXT target to the depth and stencil attach points + glFramebufferRenderbufferEXT( fboBindPoint, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, tex->m_rboName); + GLMCheckError(); + + glFramebufferRenderbufferEXT( fboBindPoint, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, tex->m_rboName); + GLMCheckError(); + + // no need to leave the RBO hanging on + glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, 0 ); + GLMCheckError(); + } + else + { + // color attachment (likely 0) + glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, tex->m_rboName ); + GLMCheckError(); + + glFramebufferRenderbufferEXT( fboBindPoint, attachIndexGL, GL_RENDERBUFFER_EXT, tex->m_rboName); + GLMCheckError(); + + glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, 0 ); + GLMCheckError(); + } + tex->m_rboDirty = true; + } + else + { + // regular path - attaching a texture2d + + if (attachIndexGL==GL_DEPTH_STENCIL_ATTACHMENT_EXT) + { + // you have to attach it both places... + // http://www.opengl.org/wiki/GL_EXT_framebuffer_object + + glFramebufferTexture2DEXT( fboBindPoint, GL_DEPTH_ATTACHMENT_EXT, target, tex->m_texName, params->m_mip ); + GLMCheckError(); + + glFramebufferTexture2DEXT( fboBindPoint, GL_STENCIL_ATTACHMENT_EXT, target, tex->m_texName, params->m_mip ); + GLMCheckError(); + } + else + { + glFramebufferTexture2DEXT( fboBindPoint, attachIndexGL, target, tex->m_texName, params->m_mip ); + GLMCheckError(); + } + } + } + break; + + case GL_TEXTURE_3D: + { + glFramebufferTexture3DEXT( fboBindPoint, attachIndexGL, target, tex->m_texName, params->m_mip, params->m_zslice ); + GLMCheckError(); + } + break; + + case GL_TEXTURE_CUBE_MAP: + { + // adjust target to steer to the proper face of the cube map + target = GL_TEXTURE_CUBE_MAP_POSITIVE_X + params->m_face; + + glFramebufferTexture2DEXT( fboBindPoint, attachIndexGL, target, tex->m_texName, params->m_mip ); + GLMCheckError(); + } + break; + } + + // log the attached tex + m_attach[ attachIndex ] = *params; + + // indicate that the tex has been bound to an RT + tex->m_rtAttachCount++; +} + +void CGLMFBO::TexDetach( EGLMFBOAttachment attachIndex, GLenum fboBindPoint ) +{ + // force our parent context to be current + m_ctx->MakeCurrent(); + + // bind to context (will cause FBO object creation on first use) + m_ctx->BindFBOToCtx( this, fboBindPoint ); + + if (m_attach[ attachIndex ].m_tex) + { + CGLMTex *tex = m_attach[ attachIndex ].m_tex; + GLMTexLayout *layout = tex->m_layout; + GLenum target = tex->m_layout->m_key.m_texGLTarget; + + GLenum attachIndexGL = EncodeAttachmentFBO( attachIndex ); + + switch( target ) + { + case GL_TEXTURE_2D: + { + if (layout->m_key.m_texFlags & kGLMTexMultisampled) + { + // MSAA path - detach the RBO, not the texture + // (is this the right time to resolve? probably better to wait until someone tries to sample the texture) + + glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, 0 ); + GLMCheckError(); + + if (attachIndexGL==GL_DEPTH_STENCIL_ATTACHMENT_EXT) + { + // detach the GL_RENDERBUFFER_EXT target at depth and stencil attach points + glFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0); + GLMCheckError(); + + glFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0); + GLMCheckError(); + } + else + { + // color attachment (likely 0) + glFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT, attachIndexGL, GL_RENDERBUFFER_EXT, 0); + GLMCheckError(); + } + } + else + { + // plain tex detach + if (attachIndexGL==GL_DEPTH_STENCIL_ATTACHMENT_EXT) + { + // you have to detach it both places... + // http://www.opengl.org/wiki/GL_EXT_framebuffer_object + + glFramebufferTexture2DEXT( fboBindPoint, GL_DEPTH_ATTACHMENT_EXT, 0,0,0 ); + glFramebufferTexture2DEXT( fboBindPoint, GL_STENCIL_ATTACHMENT_EXT, 0,0,0 ); + } + else + { + glFramebufferTexture2DEXT( fboBindPoint, attachIndexGL, 0, 0, 0 ); + } + } + } + break; + + case GL_TEXTURE_3D: + { + glFramebufferTexture3DEXT( fboBindPoint, attachIndexGL, 0, 0, 0, 0 ); + GLMCheckError(); + } + break; + + case GL_TEXTURE_CUBE_MAP: + { + glFramebufferTexture2DEXT( fboBindPoint, attachIndexGL, 0, 0, 0 ); + GLMCheckError(); + } + break; + } + + // un-log the attached tex + memset( &m_attach[ attachIndex ], 0, sizeof( m_attach[0] ) ); + + // drop the RT attach count + tex->m_rtAttachCount--; + } + else + { + //Debugger(); // odd, but not harmful - typ comes from D3D code passing NULL into SetRenderTarget + } +} + +void CGLMFBO::TexScrub( CGLMTex *tex ) +{ + // see if it's attached anywhere + for( int attachIndex = 0; attachIndex < kAttCount; attachIndex++ ) + { + if (m_attach[ attachIndex ].m_tex == tex) + { + // blammo + TexDetach( (EGLMFBOAttachment)attachIndex, GL_DRAW_FRAMEBUFFER_EXT ); + } + } +} + + +bool CGLMFBO::IsReady( void ) +{ + bool result = false; + + // ensure our parent context is current + m_ctx->CheckCurrent(); + + // bind to context (will cause FBO object creation on first use) + m_ctx->BindFBOToCtx( this ); + + GLenum status; + status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + switch(status) + { + case GL_FRAMEBUFFER_COMPLETE_EXT: + result = true; + break; + + case GL_FRAMEBUFFER_UNSUPPORTED_EXT: + result = false; + Debugger(); + /* choose different formats */ + break; + + default: + result = false; + Debugger(); + /* programming error; will fail on all hardware */ + break; + } + return result; +} diff --git a/external/steamworks/glmgr/cglmfbo.h b/external/steamworks/glmgr/cglmfbo.h new file mode 100644 index 0000000..8a32fd7 --- /dev/null +++ b/external/steamworks/glmgr/cglmfbo.h @@ -0,0 +1,91 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ +// +// cglmfbo.h +// GLMgr FBO's (render targets) +// +//=============================================================================== + +#ifndef CGLMFBO_H +#define CGLMFBO_H + +#pragma once + +#include "cglmtex.h" + +// good FBO references / recaps +// http://www.songho.ca/opengl/gl_fbo.html +// http://www.gamedev.net/reference/articles/article2331.asp + +// ext links + +// http://www.opengl.org/registry/specs/EXT/framebuffer_object.txt +// http://www.opengl.org/registry/specs/EXT/framebuffer_multisample.txt + +//=============================================================================== + +// tokens not in the SDK headers + +#ifndef GL_DEPTH_STENCIL_ATTACHMENT_EXT + #define GL_DEPTH_STENCIL_ATTACHMENT_EXT 0x84F9 +#endif + +//=============================================================================== + +// forward declarations + +class GLMContext; + +// implicitly 16 maximum color attachments possible +enum EGLMFBOAttachment { + kAttColor0, kAttColor1, kAttColor2, kAttColor3, + kAttColor4, kAttColor5, kAttColor6, kAttColor7, + kAttColor8, kAttColor9, kAttColor10, kAttColor11, + kAttColor12, kAttColor13, kAttColor14, kAttColor15, + kAttDepth, kAttStencil, kAttDepthStencil, + kAttCount +}; + +struct GLMFBOTexAttachParams +{ + CGLMTex *m_tex; + int m_face; // keep zero if not cube map + int m_mip; // keep zero if notmip mapped + int m_zslice; // keep zero if not a 3D tex +}; + +class CGLMFBO +{ + +public: + +protected: + friend class GLMContext; // only GLMContext can make CGLMFBO objects + friend class GLMTester; + friend class CGLMTex; + + friend struct IDirect3D9; + friend struct IDirect3DDevice9; + + CGLMFBO( GLMContext *ctx ); + ~CGLMFBO( ); + + void TexAttach( GLMFBOTexAttachParams *params, EGLMFBOAttachment attachIndex, GLenum fboBindPoint = GL_FRAMEBUFFER_EXT ); + void TexDetach( EGLMFBOAttachment attachIndex, GLenum fboBindPoint = GL_FRAMEBUFFER_EXT ); + // you can also pass GL_READ_FRAMEBUFFER_EXT or GL_DRAW_FRAMEBUFFER_EXT to selectively bind the receiving FBO to one or the other. + + void TexScrub( CGLMTex *tex ); + // search and destroy any attachment for the named texture + + bool IsReady( void ); // aka FBO completeness check - ready to draw + + GLMContext *m_ctx; // link back to parent context + + GLuint m_name; // name of this FBO in the context + + GLMFBOTexAttachParams m_attach[ kAttCount ]; // indexed by EGLMFBOAttachment + + int m_sizeX,m_sizeY; +}; + + +#endif diff --git a/external/steamworks/glmgr/cglmprogram.cpp b/external/steamworks/glmgr/cglmprogram.cpp new file mode 100644 index 0000000..b045cd8 --- /dev/null +++ b/external/steamworks/glmgr/cglmprogram.cpp @@ -0,0 +1,1448 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ +// +// cglmprogram.cpp +// +//=============================================================================== + +#include "glmgr.h" +#include "cglmprogram.h" +#include "dxabstract.h" + +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wunused-variable" +#endif + +#ifdef OSX +// Debugger - 10.8 +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + +//=============================================================================== + +#if 0 + ConVar gl_shaderpair_cacherows_lg2( "gl_paircache_rows_lg2", "10"); // 10 is minimum + ConVar gl_shaderpair_cacheways_lg2( "gl_paircache_ways_lg2", "5"); // 5 is minimum + ConVar gl_shaderpair_cachelog( "gl_shaderpair_cachelog", "0" ); +#else + int gl_shaderpair_cacherows_lg2 = 10; + int gl_shaderpair_cacheways_lg2 = 5; + int gl_shaderpair_cachelog = 0; +#endif + +//=============================================================================== + + +GLenum GLMProgTypeToARBEnum( EGLMProgramType type ) +{ + GLenum result = 0; + switch(type) + { + case kGLMVertexProgram: result = GL_VERTEX_PROGRAM_ARB; break; + case kGLMFragmentProgram: result = GL_FRAGMENT_PROGRAM_ARB; break; + default: Assert( !"bad program type"); result = 0; break; + } + return result; +} + +GLenum GLMProgTypeToGLSLEnum( EGLMProgramType type ) +{ + GLenum result = 0; + switch(type) + { + case kGLMVertexProgram: result = GL_VERTEX_SHADER_ARB; break; + case kGLMFragmentProgram: result = GL_FRAGMENT_SHADER_ARB; break; + default: Assert( !"bad program type"); result = 0; break; + } + return result; +} + +static uint g_shader_serial = 1000000; + +CGLMProgram::CGLMProgram( GLMContext *ctx, EGLMProgramType type ) +{ + m_ctx = ctx; + m_ctx->CheckCurrent(); + + m_type = type; + m_serial = g_shader_serial++; + m_text = NULL; // no text yet + +#if GLMDEBUG + m_editable = NULL; +#endif + + memset( &m_descs, 0, sizeof( m_descs ) ); + + m_samplerMask = 0; // dxabstract sets this field later + + // create an ARB vp/fp program object name. No need to bind it yet. + GLMShaderDesc *arbDesc = &m_descs[ kGLMARB ]; + glGenProgramsARB( 1, &arbDesc->m_object.arb ); + + // create a GLSL shader object. + GLMShaderDesc *glslDesc = &m_descs[ kGLMGLSL ]; + GLenum glslStage = GLMProgTypeToGLSLEnum( m_type ); + + glslDesc->m_object.glsl = glCreateShaderObjectARB( glslStage );; + + // no text has arrived yet. That's done in SetProgramText. +} + +CGLMProgram::~CGLMProgram( ) +{ + m_ctx->CheckCurrent(); + + // if there is an arb program, delete it + GLMShaderDesc *arbDesc = &m_descs[ kGLMARB ]; + if (arbDesc->m_object.arb) + { + glDeleteProgramsARB( 1, &arbDesc->m_object.arb ); + GLMCheckError(); + arbDesc->m_object.arb = 0; + } + + // if there is a GLSL shader, delete it + GLMShaderDesc *glslDesc = &m_descs[kGLMGLSL]; + if (glslDesc->m_object.glsl) + { + glDeleteShader( (uintptr_t)glslDesc->m_object.glsl ); // why do I need a cast here again ? + GLMCheckError(); + glslDesc->m_object.glsl = 0; + } + +#if GLMDEBUG + if (m_editable) + { + delete m_editable; + m_editable = NULL; + } +#endif + + if (m_text) + { + free( m_text ); + m_text = NULL; + } + m_ctx = NULL; +} + +enum EShaderSection +{ + kGLMARBVertex, kGLMARBVertexDisabled, + kGLMARBFragment, kGLMARBFragmentDisabled, + kGLMGLSLVertex, kGLMGLSLVertexDisabled, + kGLMGLSLFragment, kGLMGLSLFragmentDisabled, + +}; + +const char *g_shaderSectionMarkers[] = // match ordering of enum +{ + "!!ARBvp", "-!!ARBvp", // enabled and disabled markers. so you can have multiple flavors in a blob and activate the one you want. + "!!ARBfp", "-!!ARBfp", + "//GLSLvp", "-//GLSLvp", + "//GLSLfp", "-//GLSLfp", + NULL +}; + +void CGLMProgram::SetProgramText( char *text ) +{ + // free old text if any + // clone new text + // scan newtext to find sections + // walk sections, and mark descs to indicate where text is at + + if (m_text) + { + free( m_text ); + m_text = NULL; + } + + // scrub desc text references + for( int i=0; im_textPresent = false; + desc->m_textOffset = 0; + desc->m_textLength = 0; + } + + m_text = strdup( text ); + Assert( m_text != NULL ); + + #if 0 // disabled in sample for now GLMDEBUG + // create editable text item, if it does not already exist + if (!m_editable) + { + char *suffix = ""; + + switch(m_type) + { + case kGLMVertexProgram: suffix = ".vsh"; break; + case kGLMFragmentProgram: suffix = ".fsh"; break; + default: GLMDebugger(); + } + + m_editable = new CGLMEditableTextItem( m_text, strlen(m_text), false, "/debugshaders/", suffix ); + + // pull our string back from the editable (it has probably munged it) + if (m_editable->HasData()) + { + ReloadStringFromEditable(); + } + } + #endif + + + // scan the text and find sections + CGLMTextSectioner sections( m_text, strlen( m_text ), g_shaderSectionMarkers ); + + int sectionCount = sections.Count(); + for( int i=0; i < sectionCount; i++ ) + { + uint subtextOffset = 0; + uint subtextLength = 0; + int markerIndex = 0; + + sections.GetSection( i, &subtextOffset, &subtextLength, &markerIndex ); + + // act on the section + GLMShaderDesc *desc = NULL; + switch( m_type ) + { + case kGLMVertexProgram: + switch( markerIndex ) + { + case kGLMARBVertex: + case kGLMGLSLVertex: + desc = &m_descs[ (markerIndex==kGLMARBVertex) ? kGLMARB : kGLMGLSL]; + + // these steps are generic across both langs + desc->m_textPresent = true; + desc->m_textOffset = subtextOffset; + desc->m_textLength = subtextLength; + desc->m_compiled = false; + desc->m_valid = false; + break; + + case kGLMARBVertexDisabled: + case kGLMGLSLVertexDisabled: + // ignore quietly + break; + + default: Assert(!"Mismatched section marker seen in SetProgramText (VP)"); break; + } + break; + + case kGLMFragmentProgram: + switch( markerIndex ) + { + case kGLMARBFragment: + case kGLMGLSLFragment: + desc = &m_descs[ (markerIndex==kGLMARBFragment) ? kGLMARB : kGLMGLSL]; + + // these steps are generic across both langs + desc->m_textPresent = true; + desc->m_textOffset = subtextOffset; + desc->m_textLength = subtextLength; + desc->m_compiled = false; + desc->m_valid = false; + break; + + case kGLMARBFragmentDisabled: + case kGLMGLSLFragmentDisabled: + // ignore quietly + break; + + default: Assert(!"Mismatched section marker seen in SetProgramText (VP)"); break; + } + break; + + default: + break; + } + } +} + +bool CGLMProgram::CompileActiveSources ( void ) +{ + bool result = true; // assume success + + // compile everything we have text for + for( int i=0; im_object.arb ); // object created or just re-bound + GLMCheckError(); + + char *section = m_text + arbDesc->m_textOffset; + char *lastCharOfSection = section + arbDesc->m_textLength; // actually it's one past the last textual character + + #if GLMDEBUG + if(noisy) + { + GLMPRINTF((">-D- CGLMProgram::Compile submitting following text for ARB %s program (name %d) ---------------------", + arbTarget == GL_FRAGMENT_PROGRAM_ARB ? "fragment" : "vertex", + arbDesc->m_object.arb )); + + // we don't have a "print this many chars" call yet + // just temporarily null terminate the text we want to print + + char saveChar = *lastCharOfSection; + + *lastCharOfSection= 0; + GLMPRINTTEXT(( section, eDebugDump )); + *lastCharOfSection= saveChar; + + GLMPRINTF(("<-D- CGLMProgram::Compile ARB EOT--" )); + } + #endif + + glProgramStringARB( arbTarget, GL_PROGRAM_FORMAT_ASCII_ARB, arbDesc->m_textLength, section ); + GLMCheckError( true, false ); + arbDesc->m_compiled = true; // compiled but not necessarily valid + + CheckValidity( lang ); + GLMCheckError(); + // leave it bound n enabled, don't care (draw will sort it all out) + + result = arbDesc->m_valid; + } + break; + + case kGLMGLSL: + { + GLMShaderDesc *glslDesc; + + glslDesc = &m_descs[ kGLMGLSL ]; + + GLenum glslStage = GLMProgTypeToGLSLEnum( m_type ); + + // there's no binding to do for GLSL. but make sure no ARB stuff is bound for tidiness. + glSetEnable( GL_VERTEX_PROGRAM_ARB, false ); + glSetEnable( GL_FRAGMENT_PROGRAM_ARB, false ); // add check errors on these + + glBindProgramARB( GL_VERTEX_PROGRAM_ARB, 0 ); + glBindProgramARB( GL_FRAGMENT_PROGRAM_ARB, 0 ); + + // no GLSL program either + glUseProgram(0); + + // pump text into GLSL shader object + + char *section = m_text + glslDesc->m_textOffset; + char *lastCharOfSection = section + glslDesc->m_textLength; // actually it's one past the last textual character + + #if GLMDEBUG + if(noisy) + { + GLMPRINTF((">-D- CGLMProgram::Compile submitting following text for GLSL %s program (name %d) ---------------------", + glslStage == GL_FRAGMENT_SHADER_ARB ? "fragment" : "vertex", + glslDesc->m_object.glsl )); + + // we don't have a "print this many chars" call yet + // just temporarily null terminate the text we want to print + + char saveChar = *lastCharOfSection; + + *lastCharOfSection= 0; + GLMPRINTTEXT(( section, eDebugDump )); + *lastCharOfSection= saveChar; + + GLMPRINTF(("<-D- CGLMProgram::Compile GLSL EOT--" )); + } + #endif + + glShaderSourceARB( glslDesc->m_object.glsl, 1, (const GLchar **)§ion, &glslDesc->m_textLength); + GLMCheckError( true, false ); + + // compile + glCompileShaderARB( glslDesc->m_object.glsl ); + glslDesc->m_compiled = true; // compiled but not necessarily valid + GLMCheckError( true, false ); + + CheckValidity( lang ); + GLMCheckError(); + + if (loglevel>=2) + { + char tempname[128]; + int tempindex = -1; + int tempcombo = -1; + + //GetLabelIndexCombo( tempname, sizeof(tempname), &tempindex, &tempcombo ); + //printf("\ncompile: - [ %s/%d/%d ] on GL name %d ", tempname, tempindex, tempcombo, glslDesc->m_object.glsl ); + + + GetComboIndexNameString( tempname, sizeof(tempname) ); + printf("\ncompile: %s on GL name %p ", tempname, glslDesc->m_object.glsl ); + } + + result = glslDesc->m_valid; + } + break; + + default: + break; + } + return result; +} + +#if GLMDEBUG + + bool CGLMProgram::PollForChanges( void ) + { + bool result = false; + if (m_editable) + { + result = m_editable->PollForChanges(); + } + return result; + } + + void CGLMProgram::ReloadStringFromEditable( void ) + { + uint dataSize=0; + char *data=NULL; + + m_editable->GetCurrentText( &data, &dataSize ); + + char *buf = (char *)malloc( dataSize+1 ); // we will NULL terminate it, since the mirror copy might not be + memcpy( buf, data, dataSize ); + buf[dataSize] = 0; + + SetProgramText( buf ); + + free( buf ); + } + + bool CGLMProgram::SyncWithEditable( void ) + { + bool result = false; + + if (m_editable->PollForChanges()) + { + ReloadStringFromEditable(); + + CompileActiveSources(); + + // invalidate shader pair cache entries using this shader.. + m_ctx->m_pairCache->PurgePairsWithShader( this ); + + result = true; // result true means "it changed" + } + return result; + } + +#endif + + +// attributes which are general to both stages +// VP and FP: +// +// 0x88A0 PROGRAM_INSTRUCTIONS_ARB VP FP +// 0x88A1 MAX_PROGRAM_INSTRUCTIONS_ARB VP FP +// 0x88A2 PROGRAM_NATIVE_INSTRUCTIONS_ARB VP FP +// 0x88A3 MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB VP FP +// +// 0x88A4 PROGRAM_TEMPORARIES_ARB VP FP +// 0x88A5 MAX_PROGRAM_TEMPORARIES_ARB VP FP +// 0x88A6 PROGRAM_NATIVE_TEMPORARIES_ARB VP FP +// 0x88A7 MAX_PROGRAM_NATIVE_TEMPORARIES_ARB VP FP +// +// 0x88A8 PROGRAM_PARAMETERS_ARB VP FP +// 0x88A9 MAX_PROGRAM_PARAMETERS_ARB VP FP +// 0x88AA PROGRAM_NATIVE_PARAMETERS_ARB VP FP +// 0x88AB MAX_PROGRAM_NATIVE_PARAMETERS_ARB VP FP +// +// 0x88AC PROGRAM_ATTRIBS_ARB VP FP +// 0x88AD MAX_PROGRAM_ATTRIBS_ARB VP FP +// 0x88AE PROGRAM_NATIVE_ATTRIBS_ARB VP FP +// 0x88AF MAX_PROGRAM_NATIVE_ATTRIBS_ARB VP FP +// +// 0x88B4 MAX_PROGRAM_LOCAL_PARAMETERS_ARB VP FP +// 0x88B5 MAX_PROGRAM_ENV_PARAMETERS_ARB VP FP +// 0x88B6 PROGRAM_UNDER_NATIVE_LIMITS_ARB VP FP +// +// VP only: +// +// 0x88B0 PROGRAM_ADDRESS_REGISTERS_ARB VP +// 0x88B1 MAX_PROGRAM_ADDRESS_REGISTERS_ARB VP +// 0x88B2 PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB VP +// 0x88B3 MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB VP +// +// FP only: +// +// 0x8805 PROGRAM_ALU_INSTRUCTIONS_ARB FP +// 0x880B MAX_PROGRAM_ALU_INSTRUCTIONS_ARB FP +// 0x8808 PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB FP +// 0x880E MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB FP + +// 0x8806 PROGRAM_TEX_INSTRUCTIONS_ARB FP +// 0x880C MAX_PROGRAM_TEX_INSTRUCTIONS_ARB FP +// 0x8809 PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB FP +// 0x880F MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB FP + +// 0x8807 PROGRAM_TEX_INDIRECTIONS_ARB FP +// 0x880D MAX_PROGRAM_TEX_INDIRECTIONS_ARB FP +// 0x880A PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB FP +// 0x8810 MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB FP + +struct GLMShaderLimitDesc +{ + GLenum m_valueEnum; + GLenum m_limitEnum; + const char *m_debugName; + const char m_flags; + // m_flags - 0x01 for VP, 0x02 for FP, or set both if applicable to both +}; + +// macro to help make the table of what to check +#ifndef LMD +#define LMD( val, flags ) { GL_PROGRAM_##val##_ARB, GL_MAX_PROGRAM_##val##_ARB, #val, flags } +#else +#error you need to use a different name for this macro. +#endif + +GLMShaderLimitDesc g_glmShaderLimitDescs[] = +{ + // VP and FP.. + LMD( INSTRUCTIONS, 3 ), + LMD( NATIVE_INSTRUCTIONS, 3 ), + LMD( NATIVE_TEMPORARIES, 3 ), + LMD( PARAMETERS, 3 ), + LMD( NATIVE_PARAMETERS, 3 ), + LMD( ATTRIBS, 3 ), + LMD( NATIVE_ATTRIBS, 3 ), + + // VP only.. + LMD( ADDRESS_REGISTERS, 1 ), + LMD( NATIVE_ADDRESS_REGISTERS, 1 ), + + // FP only.. + LMD( ALU_INSTRUCTIONS, 2 ), + LMD( NATIVE_ALU_INSTRUCTIONS, 2 ), + LMD( TEX_INSTRUCTIONS, 2 ), + LMD( NATIVE_TEX_INSTRUCTIONS, 2 ), + LMD( TEX_INDIRECTIONS, 2 ), + LMD( NATIVE_TEX_INDIRECTIONS, 2 ), + + { 0, 0, NULL, 0 } +}; + +#undef LMD + +bool CGLMProgram::CheckValidity( EGLMProgramLang lang ) +{ + static const char *targnames[] = { "vertex", "fragment" }; + + switch(lang) + { + case kGLMARB: + { + GLMShaderDesc *arbDesc; + arbDesc = &m_descs[ kGLMARB ]; + + GLenum arbTarget = GLMProgTypeToARBEnum( m_type ); + + Assert( arbDesc->m_compiled ); + + arbDesc->m_valid = true; // assume success til we see otherwise + + // assume program is bound. is there anything wrong with it ? + + GLint isNative=0; + glGetProgramivARB( arbTarget, GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &isNative ); + GLMCheckError(); + + // If the program is over the hardware's limits, print out some information + if (isNative!=1) + { + arbDesc->m_valid = false; + + // check everything we can check + char checkmask = (1<m_valueEnum !=0; desc++ ) + { + if ( desc->m_flags & checkmask ) + { + // test it + GLint value = 0; + GLint limit = 0; + glGetProgramivARB(arbTarget, desc->m_valueEnum, &value); + GLMCheckError(); + + glGetProgramivARB(arbTarget, desc->m_limitEnum, &limit); + GLMCheckError(); + + if (value > limit) + { + GLMPRINTF(("-D- Invalid %s program: program has %d %s; limit is %d", targnames[ m_type ], value, desc->m_debugName, limit )); + } + } + } + } + + // syntax error check + GLint errorLine; + glGetIntegerv( GL_PROGRAM_ERROR_POSITION_ARB, &errorLine ); + GLMCheckError(); + + if ( errorLine!=-1 ) + { + const GLubyte* errorString = glGetString(GL_PROGRAM_ERROR_STRING_ARB); + GLMPRINTF(( "-D- Syntax error in ARB %s program: %s",targnames[ m_type ], errorString )); + arbDesc->m_valid = false; + } + if (!arbDesc->m_valid) + { + char *temp = strdup(m_text); + temp[ arbDesc->m_textOffset + arbDesc->m_textLength ] = 0; + GLMPRINTF(("-D- ----- ARB compile failed; bad source follows -----" )); + GLMPRINTTEXT(( temp + arbDesc->m_textOffset, eDebugDump, GLMPRINTTEXT_NUMBEREDLINES )); + GLMPRINTF(("-D- -----end-----" )); + free( temp ); + } + + return arbDesc->m_valid; + } + break; + + case kGLMGLSL: + { + GLMShaderDesc *glslDesc; + glslDesc = &m_descs[ kGLMGLSL ]; + + GLenum glslStage = GLMProgTypeToGLSLEnum( m_type ); + + Assert( glslDesc->m_compiled ); + + glslDesc->m_valid = true; // assume success til we see otherwise + + // GLSL error check + int compiled = 0, length = 0, laux = 0; + + glGetObjectParameterivARB( (GLhandleARB)glslDesc->m_object.glsl, GL_OBJECT_COMPILE_STATUS_ARB, &compiled); + glGetObjectParameterivARB( (GLhandleARB)glslDesc->m_object.glsl, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); + GLcharARB *logString = (GLcharARB *)malloc(length * sizeof(GLcharARB)); + glGetInfoLogARB((GLhandleARB)glslDesc->m_object.glsl, length, &laux, logString); + + // we may not be able to check "native limits" stuff until link time. meh + + if (!compiled) + { + glslDesc->m_valid = false; + } + + if (!glslDesc->m_valid) + { + char *temp = strdup(m_text); + temp[ glslDesc->m_textOffset + glslDesc->m_textLength ] = 0; + GLMPRINTF(("-D- ----- GLSL compile failed: \n %s \n",logString )); + GLMPRINTTEXT(( temp + glslDesc->m_textOffset, eDebugDump, GLMPRINTTEXT_NUMBEREDLINES )); + GLMPRINTF(("-D- -----end-----" )); + free( temp ); + } + + free( logString ); + + return glslDesc->m_valid; + } + break; + + default: + break; + } + + return false; +} + +void CGLMProgram::LogSlow( EGLMProgramLang lang ) +{ + // find the desc, see if it's marked + GLMShaderDesc *desc = &m_descs[ lang ]; + + if (!desc->m_slowMark) + { + // log it + printf( "\n-------------- Slow %s ( CGLMProgram @ %p, lang %s, name %d ) : \n%s \n", + m_type==kGLMVertexProgram ? "VS" : "FS", + this, + lang==kGLMGLSL ? "GLSL" : "ARB", + (int)(uintptr_t)(lang==kGLMGLSL ? (uintptr_t)desc->m_object.glsl : (uintptr_t)desc->m_object.arb), + m_text + ); + } + else // complain on a decreasing basis (powers of two) + { + if ( (desc->m_slowMark & (desc->m_slowMark-1)) == 0 ) + { + // short blurb + printf( "\n Slow %s ( CGLMProgram @ %p, lang %s, name %d ) (%d times)", + m_type==kGLMVertexProgram ? "VS" : "FS", + this, + lang==kGLMGLSL ? "GLSL" : "ARB", + (int)(lang==kGLMGLSL ? (uintptr_t)desc->m_object.glsl : (uintptr_t)desc->m_object.arb), + desc->m_slowMark+1 + ); + } + } + + // mark it + desc->m_slowMark++; + + +} + +void CGLMProgram::GetLabelIndexCombo ( char *labelOut, int labelOutMaxChars, int *indexOut, int *comboOut ) +{ + // find the label string + // example: + // trans#2871 label:vs-file vertexlit_and_unlit_generic_vs20 vs-index 294912 vs-combo 1234 + + *labelOut = 0; + *indexOut = -1; + + char *lineStr = strstr( m_text, "// trans#" ); + if (lineStr) + { + char temp1[1024]; + int temp2,temp3; + int scratch=-1; + temp1[0] = 0; + temp2 = -1; + temp3 = -1; + + if (this->m_type==kGLMVertexProgram) + { + sscanf( lineStr, "// trans#%d label:vs-file %s vs-index %d vs-combo %d", &scratch, temp1, &temp2, &temp3 ); + } + else + { + sscanf( lineStr, "// trans#%d label:ps-file %s ps-index %d ps-combo %d", &scratch, temp1, &temp2, &temp3 ); + } + + if ( (strlen(temp1)!=0) ) + { + strncpy( labelOut, temp1, labelOutMaxChars ); + *indexOut = temp2; + *comboOut = temp3; + } + } +} + +void CGLMProgram::GetComboIndexNameString ( char *stringOut, int stringOutMaxChars ) // mmmmmmmm-nnnnnnnn-filename +{ + // find the label string + // example: + // trans#2871 label:vs-file vertexlit_and_unlit_generic_vs20 vs-index 294912 vs-combo 1234 + + *stringOut = 0; + + char *lineStr = strstr( m_text, "// trans#" ); + if (lineStr) + { + char temp1[1024]; + int temp2,temp3; + int scratch=-1; + + temp1[0] = 0; + temp2 = -1; + temp3 = -1; + + if (this->m_type==kGLMVertexProgram) + { + sscanf( lineStr, "// trans#%d label:vs-file %s vs-index %d vs-combo %d", &scratch, temp1, &temp2, &temp3 ); + } + else + { + sscanf( lineStr, "// trans#%d label:ps-file %s ps-index %d ps-combo %d", &scratch, temp1, &temp2, &temp3 ); + } + + int len = strlen(temp1); + + if ( (len+20) < stringOutMaxChars ) + { + // output formatted version + sprintf( stringOut, "%08X-%08X-%s", temp3, temp2, temp1 ); + } + } +} + +//=============================================================================== + + +CGLMShaderPair::CGLMShaderPair( GLMContext *ctx ) +{ + m_ctx = ctx; + m_ctx->MakeCurrent(); + + m_vertexProg = m_fragmentProg = NULL; + + m_program = glCreateProgramObjectARB(); + GLMCheckError(); + + m_locVertexParams = -1; + m_locVertexInteger0 = -1; // "i0" + m_locVertexBool0 = -1; // "b0" + m_locVertexBool1 = -1; // "b1" + m_locVertexBool2 = -1; // "b2" + m_locVertexBool3 = -1; // "b3" + + m_locFragmentParams = -1; + m_locFragmentFakeSRGBEnable = -1; + m_fakeSRGBEnableValue = -1.0f; + + memset( m_locSamplers, 0xFF, sizeof( m_locSamplers ) ); + + m_valid = false; + m_samplersFixed = false; // fix them at draw time, and only do it once. + m_revision = 0; // bumps to 1 once linked +} + +CGLMShaderPair::~CGLMShaderPair( ) +{ + if (m_program) + { + glDeleteObjectARB( (GLhandleARB)m_program ); + m_program = 0; + } +} + +bool CGLMShaderPair::SetProgramPair ( CGLMProgram *vp, CGLMProgram *fp ) +{ + m_valid = false; // assume failure + + // true result means successful link and query + bool vpgood = (vp!=NULL) && (vp->m_descs[ kGLMGLSL ].m_valid); + bool fpgood = (fp!=NULL) && (fp->m_descs[ kGLMGLSL ].m_valid); + + if (!fpgood) + { + // fragment side allowed to be "null". + fp = m_ctx->m_nullFragmentProgram; + } + + if (vpgood && fpgood) + { + // attempt link. but first, detach any previously attached programs + if (m_vertexProg) + { + glDetachObjectARB(m_program, m_vertexProg->m_descs[kGLMGLSL].m_object.glsl); + GLMCheckError(); + m_vertexProg = NULL; + } + + if (m_fragmentProg) + { + glDetachObjectARB(m_program, m_fragmentProg->m_descs[kGLMGLSL].m_object.glsl); + GLMCheckError(); + m_fragmentProg = NULL; + } + + // now attach + + glAttachObjectARB(m_program, vp->m_descs[kGLMGLSL].m_object.glsl); + m_vertexProg = vp; + GLMCheckError(); + + glAttachObjectARB(m_program, fp->m_descs[kGLMGLSL].m_object.glsl); + m_fragmentProg = fp; + GLMCheckError(); + + // force the locations for input attributes v0-vN to be at locations 0-N + // use the vertex attrib map to know which slots are live or not... oy! we don't have that map yet... but it's OK. + // fallback - just force v0-v15 to land in locations 0-15 as a standard. + + if (vp->m_descs[kGLMGLSL].m_valid) + { + for( int i=0; i < 16; i++) + { + char tmp[16]; + sprintf(tmp, "v%d", i); // v0 v1 v2 ... et al + + glBindAttribLocationARB( m_program, i, tmp ); + GLMCheckError(); + } + } + + // now link + glLinkProgramARB( m_program ); + GLMCheckError(); + + // check for success + GLint result = 0; + glGetObjectParameterivARB(m_program,GL_OBJECT_LINK_STATUS_ARB,&result); // want GL_TRUE + + if (result == GL_TRUE) + { + // success + + m_valid = true; + m_revision++; + } + else + { + GLint length = 0; + GLint laux = 0; + + // do some digging + glGetObjectParameterivARB(m_program,GL_OBJECT_INFO_LOG_LENGTH_ARB,&length); + + GLcharARB *logString = (GLcharARB *)malloc(length * sizeof(GLcharARB)); + glGetInfoLogARB(m_program, length, &laux, logString); + + char *vtemp = strdup(vp->m_text); + vtemp[ vp->m_descs[kGLMGLSL].m_textOffset + vp->m_descs[kGLMGLSL].m_textLength ] = 0; + + char *ftemp = strdup(fp->m_text); + ftemp[ fp->m_descs[kGLMGLSL].m_textOffset + fp->m_descs[kGLMGLSL].m_textLength ] = 0; + + GLMPRINTF(("-D- ----- GLSL link failed: \n %s ",logString )); + + GLMPRINTF(("-D- ----- GLSL vertex program selected: %08x (handle %08x)", vp, vp->m_descs[kGLMGLSL].m_object.glsl )); + GLMPRINTTEXT(( vtemp + vp->m_descs[kGLMGLSL].m_textOffset, eDebugDump, GLMPRINTTEXT_NUMBEREDLINES )); + + GLMPRINTF(("-D- ----- GLSL fragment program selected: %08x (handle %08x)", fp, vp->m_descs[kGLMGLSL].m_object.glsl )); + GLMPRINTTEXT(( ftemp + fp->m_descs[kGLMGLSL].m_textOffset, eDebugDump, GLMPRINTTEXT_NUMBEREDLINES )); + + GLMPRINTF(("-D- -----end-----" )); + + free( ftemp ); + free( vtemp ); + free( logString ); + } + } + else + { + // fail + Assert(!"Can't link these programs"); + } + + if (m_valid) + { + m_locVertexParams = glGetUniformLocationARB( m_program, "vc"); + GLMCheckError(); + + m_locVertexInteger0 = glGetUniformLocationARB( m_program, "i0"); + GLMCheckError(); + + m_locVertexBool0 = glGetUniformLocationARB( m_program, "b0"); + GLMCheckError(); + m_locVertexBool1 = glGetUniformLocationARB( m_program, "b1"); + GLMCheckError(); + m_locVertexBool2 = glGetUniformLocationARB( m_program, "b2"); + GLMCheckError(); + m_locVertexBool3 = glGetUniformLocationARB( m_program, "b3"); + GLMCheckError(); + + m_locFragmentParams = glGetUniformLocationARB( m_program, "pc"); + GLMCheckError(); + + m_locFragmentFakeSRGBEnable = glGetUniformLocationARB( m_program, "flSRGBWrite"); + GLMCheckError(); + m_fakeSRGBEnableValue = -1.0f; + + for( int sampler=0; sampler<16; sampler++) + { + char tmp[16]; + sprintf(tmp, "sampler%d", sampler); // sampler0 .. sampler1.. etc + + m_locSamplers[sampler] = glGetUniformLocationARB( m_program, tmp ); + GLMCheckError(); + } + } + else + { + m_locVertexParams = -1; + + m_locVertexInteger0 = -1; + m_locVertexBool0 = -1; + m_locVertexBool1 = -1; + m_locVertexBool2 = -1; + m_locVertexBool3 = -1; + + m_locFragmentParams = -1; + m_locFragmentFakeSRGBEnable = -1; + m_fakeSRGBEnableValue = -999; + + memset( m_locSamplers, 0xFF, sizeof( m_locSamplers ) ); + + m_revision = 0; + } + + return m_valid; +} + + +bool CGLMShaderPair::RefreshProgramPair ( void ) +{ + // re-link and re-query the uniforms. + + // since SetProgramPair knows how to detach previously attached shader objects, just pass the same ones in again. + CGLMProgram *vp = m_vertexProg; + CGLMProgram *fp = m_fragmentProg; + + bool vpgood = (vp!=NULL) && (vp->m_descs[ kGLMGLSL ].m_valid); + bool fpgood = (fp!=NULL) && (fp->m_descs[ kGLMGLSL ].m_valid); + + if (vpgood && fpgood) + { + return SetProgramPair( vp, fp ); + } + else + { + Debugger(); + return false; + } +} + + +//=============================================================================== + +CGLMShaderPairCache::CGLMShaderPairCache( GLMContext *ctx ) +{ + m_ctx = ctx; + + m_mark = 1; + + m_rowsLg2 = gl_shaderpair_cacherows_lg2/* .GetInt() */; + if (m_rowsLg2 < 10) + m_rowsLg2 = 10; + m_rows = 1<Purge(); + Assert( !purgeResult ); + + if (m_entries) + { + free( m_entries ); + m_entries = NULL; + } + + if (m_evictions) + { + free( m_evictions ); + m_evictions = NULL; + } + + if (m_hits) + { + free( m_hits ); + m_hits = NULL; + } +} + + +#if 0 //turning off all the shader pair caching stuff for simplicity + +// Set this convar internally to build or add to the shader pair cache file (link hints) +// We really only expect this to work on POSIX +static ConVar glm_cacheprograms( "glm_cacheprograms", "0", FCVAR_DEVELOPMENTONLY ); + +#define PROGRAM_CACHE_FILE "program_cache.cfg" + +static void WriteToProgramCache( CGLMShaderPair *pair ) +{ + KeyValues *pProgramCache = new KeyValues( "programcache" ); + pProgramCache->LoadFromFile( g_pFullFileSystem, PROGRAM_CACHE_FILE, "MOD" ); + + if ( !pProgramCache ) + { + Warning( "Could not write to program cache file!\n" ); + return; + } + + // extract values of interest which represent a pair of shaders + + char vprogramName[128]; + int vprogramStaticIndex = -1; + int vprogramDynamicIndex = -1; + pair->m_vertexProg->GetLabelIndexCombo( vprogramName, sizeof(vprogramName), &vprogramStaticIndex, &vprogramDynamicIndex ); + + + char pprogramName[128]; + int pprogramStaticIndex = -1; + int pprogramDynamicIndex = -1; + pair->m_fragmentProg->GetLabelIndexCombo( pprogramName, sizeof(pprogramName), &pprogramStaticIndex, &pprogramDynamicIndex ); + + // make up a key - this thing is really a list of tuples, so need not be keyed by anything particular + KeyValues *pProgramKey = pProgramCache->CreateNewKey(); + Assert( pProgramKey ); + + pProgramKey->SetString ( "vs", vprogramName ); + pProgramKey->SetString ( "ps", pprogramName ); + + pProgramKey->SetInt ( "vs_static", vprogramStaticIndex ); + pProgramKey->SetInt ( "ps_static", pprogramStaticIndex ); + + pProgramKey->SetInt ( "vs_dynamic", vprogramDynamicIndex ); + pProgramKey->SetInt ( "ps_dynamic", pprogramDynamicIndex ); + + pProgramCache->SaveToFile( g_pFullFileSystem, PROGRAM_CACHE_FILE, "MOD" ); + pProgramCache->deleteThis(); +} +#endif + + +CGLMShaderPair *CGLMShaderPairCache::SelectShaderPair( CGLMProgram *vp, CGLMProgram *fp, uint extraKeyBits ) +{ + CGLMShaderPair *result = NULL; + + int loglevel = gl_shaderpair_cachelog/* .GetInt() */; + char vtempname[128]; + int vtempindex = -1; + int vtempcombo = -1; + + char ptempname[128]; + int ptempindex = -1; + int ptempcombo = -1; + + + // select row where pair would be found if it exists + uint rowIndex = HashRowIndex( vp, fp, extraKeyBits ); + + CGLMPairCacheEntry *row = HashRowPtr( rowIndex ); + + // probe row and see if we get a hit + int hitway = -1;int emptyway = -1; int oldestway = -1; + + HashRowProbe( row, vp, fp, extraKeyBits, &hitway, &emptyway, &oldestway ); + + if (hitway >=0) + { + // found it. mark it and return + CGLMPairCacheEntry *hit = row + hitway; + hit->m_lastMark = m_mark; + + m_mark = m_mark+1; + if (!m_mark) // somewhat unlikely this will ever be reached.. but we need to avoid zero as a mark value + { + m_mark = 1; + } + + // count the hit + m_hits[ rowIndex ] ++; + + if (loglevel >= 3) // hits logged at level 3 and higher + { + printf("\nSSP: hit - row %05d - pair $%p (%d'th hit on row)",rowIndex, hit->m_pair, m_hits[ rowIndex ] ); + } + + result = hit->m_pair; + } + else + { + // we missed. if there is no empty way, then somebody's getting evicted. + int destway = -1; + + if (emptyway>=0) + { + destway = emptyway; + + if (loglevel >= 2) // misses logged at level 3 and higher + { + printf("\nSSP: miss - row %05d - ", rowIndex ); + } + } + else + { + // evict the oldest way + Assert( oldestway >= 0); // better not come back negative + + CGLMPairCacheEntry *evict = row + oldestway; + + Assert( evict->m_pair != NULL ); + Assert( evict->m_pair != m_ctx->m_boundPair ); // just check + + ///////////////////////FIXME may need to do a shoot-down if the pair being evicted is currently active in the context + + m_evictions[ rowIndex ]++; + + // log eviction if desired + if (loglevel >= 2) // misses logged at level 3 and higher + { + //evict->m_vertexProg->GetLabelIndexCombo( vtempname, sizeof(vtempname), &vtempindex, &vtempcombo ); + //evict->m_fragmentProg->GetLabelIndexCombo( ptempname, sizeof(ptempname), &ptempindex, &ptempcombo ); + //printf("\nSSP: miss - row %05d - [ %s/%d/%d %s/%d/%d ]'s %d'th eviction - ", rowIndex, vtempname, vtempindex, vtempcombo, ptempname, ptempindex, ptempcombo, m_evictions[ rowIndex ] ); + + evict->m_vertexProg->GetComboIndexNameString( vtempname, sizeof(vtempname) ); + evict->m_fragmentProg->GetComboIndexNameString( ptempname, sizeof(ptempname) ); + printf("\nSSP: miss - row %05d - [ %s + %s ]'s %d'th eviction - ", rowIndex, vtempname, ptempname, m_evictions[ rowIndex ] ); + } + + delete evict->m_pair; evict->m_pair = NULL; + memset( evict, 0, sizeof(*evict) ); + + destway = oldestway; + } + + // make the new entry + CGLMPairCacheEntry *newentry = row + destway; + + newentry->m_lastMark = m_mark; + newentry->m_vertexProg = vp; + newentry->m_fragmentProg = fp; + newentry->m_extraKeyBits = extraKeyBits; + newentry->m_pair = new CGLMShaderPair( m_ctx ); + newentry->m_pair->SetProgramPair( vp, fp ); + + if (loglevel >= 2) // say a little bit more + { + //newentry->m_vertexProg->GetLabelIndexCombo( vtempname, sizeof(vtempname), &vtempindex, &vtempcombo ); + //newentry->m_fragmentProg->GetLabelIndexCombo( ptempname, sizeof(ptempname), &ptempindex, &ptempcombo ); + //printf("new [ %s/%d/%d %s/%d/%d ]", vtempname, vtempindex, vtempcombo, ptempname, ptempindex, ptempcombo ); + + newentry->m_vertexProg->GetComboIndexNameString( vtempname, sizeof(vtempname) ); + newentry->m_fragmentProg->GetComboIndexNameString( ptempname, sizeof(ptempname) ); + printf("new [ %s + %s ]", vtempname, ptempname ); + } + + m_mark = m_mark+1; + if (!m_mark) // somewhat unlikely this will ever be reached.. but we need to avoid zero as a mark value + { + m_mark = 1; + } + + result = newentry->m_pair; + + /* + if (glm_cacheprograms.GetInt()) + { + WriteToProgramCache( newentry->m_pair ); + } + */ + } + + return result; +} + +void CGLMShaderPairCache::QueryShaderPair( int index, GLMShaderPairInfo *infoOut ) +{ + if ( (index<0) || ( index >= (m_rows*m_ways) ) ) + { + // no such location + memset( infoOut, 0, sizeof(*infoOut) ); + + infoOut->m_status = -1; + } + else + { + // locate the entry, and see if an active pair is present. + // if so, extract info and return with m_status=1. + // if not, exit with m_status = 0. + + CGLMPairCacheEntry *entry = &m_entries[index]; + + if (entry->m_pair) + { + // live + // extract values of interest for caller + + entry->m_pair->m_vertexProg->GetLabelIndexCombo ( infoOut->m_vsName, sizeof(infoOut->m_vsName), &infoOut->m_vsStaticIndex, &infoOut->m_vsDynamicIndex ); + entry->m_pair->m_fragmentProg->GetLabelIndexCombo ( infoOut->m_psName, sizeof(infoOut->m_psName), &infoOut->m_psStaticIndex, &infoOut->m_psDynamicIndex ); + + infoOut->m_status = 1; + } + else + { + // not + memset( infoOut, 0, sizeof(*infoOut) ); + infoOut->m_status = 0; + } + } +} + +bool CGLMShaderPairCache::PurgePairsWithShader( CGLMProgram *prog ) +{ + bool result = false; + + // walk all rows*ways + int limit = m_rows * m_ways; + for( int i=0; i < limit; i++) + { + CGLMPairCacheEntry *entry = &m_entries[i]; + + if (entry->m_pair) + { + //scrub it, if not currently bound, and if the supplied shader matches either stage + if ( (entry->m_vertexProg==prog) || (entry->m_fragmentProg==prog) ) + { + // found it, but does it conflict with bound pair ? + if (entry->m_pair == m_ctx->m_boundPair) + { + m_ctx->m_boundPair = NULL; + } + delete entry->m_pair; + memset( entry, 0, sizeof(*entry) ); + } + } + } + return result; +} + +bool CGLMShaderPairCache::Purge( void ) +{ + bool result = false; + + // walk all rows*ways + int limit = m_rows * m_ways; + for( int i=0; i < limit; i++) + { + CGLMPairCacheEntry *entry = &m_entries[i]; + + if (entry->m_pair) + { + //scrub it, unless the pair is the currently bound pair in our parent glm context + if (entry->m_pair != m_ctx->m_boundPair) + { + delete entry->m_pair; + memset( entry, 0, sizeof(*entry) ); + } + else + { + result = true; + } + } + } + return result; +} + +void CGLMShaderPairCache::DumpStats ( void ) +{ + printf("\n------------------\npair cache stats"); + int total = 0; + for( int row=0; row < m_rows; row++ ) + { + if ( (m_evictions[row] != 0) || (m_hits[row] != 0) ) + { + printf("\n row %d : %d evictions, %d hits",row,m_evictions[row], m_hits[row]); + total += m_evictions[row]; + } + } + printf("\n\npair cache evictions: %d\n-----------------------\n",total ); +} + + //=============================== + +uint CGLMShaderPairCache::HashRowIndex ( CGLMProgram *vp, CGLMProgram *fp, uint extraKeyBits ) +{ + // calculate row index for this pair + uint vp_hash = vp->m_serial * 47; + uint fp_hash = fp->m_serial; + + uint hash_row_index = ((vp_hash * fp_hash) + (vp_hash ^ fp_hash) + (extraKeyBits * 7) ) & (m_rows-1); + + return hash_row_index; +} + +CGLMPairCacheEntry* CGLMShaderPairCache::HashRowPtr ( uint hashRowIndex ) +{ + return &m_entries[ hashRowIndex * m_ways ]; +} + +void CGLMShaderPairCache::HashRowProbe ( CGLMPairCacheEntry *row, CGLMProgram *vp, CGLMProgram *fp, uint extraKeyBits, int *hitwayOut, int *emptywayOut, int *oldestwayOut ) +{ + // scan this row to see if the desired pair is present + CGLMPairCacheEntry *cursor = row; + int hitway = -1; + int emptyway = -1; + int oldestway = -1; + long long oldestmark = 0xFFFFFFFFFFFFFFFFLL; + + for( int way = 0; (way < m_ways) && (hitway<0); way++) + { + if (cursor->m_lastMark != 0) // occupied slot + { + if ( (cursor->m_vertexProg == vp) && (cursor->m_fragmentProg == fp) && (cursor->m_extraKeyBits == extraKeyBits) ) // match? + { + // found it + hitway = way; + } + + // check if this is the oldest one on the row - only occupied slots are checked + if (cursor->m_lastMark < oldestmark) + { + oldestway = way; + oldestmark = cursor->m_lastMark; + } + } + else + { + // empty way, log it if first one seen + if (emptyway<0) + { + emptyway = way; + } + } + cursor++; + } + + if (hitwayOut) *hitwayOut = hitway; + if (emptywayOut) *emptywayOut = emptyway; + if (oldestwayOut) *oldestwayOut = oldestway; +} + diff --git a/external/steamworks/glmgr/cglmprogram.h b/external/steamworks/glmgr/cglmprogram.h new file mode 100644 index 0000000..158e8c8 --- /dev/null +++ b/external/steamworks/glmgr/cglmprogram.h @@ -0,0 +1,291 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ +// +// cglmprogram.h +// GLMgr programs (ARBVP/ARBfp) +// +//=============================================================================== + +#ifndef CGLMPROGRAM_H +#define CGLMPROGRAM_H + +#include + +#pragma once + +// good ARB program references +// http://petewarden.com/notes/archives/2005/05/fragment_progra_2.html +// http://petewarden.com/notes/archives/2005/06/fragment_progra_3.html + +// ext links + +// http://www.opengl.org/registry/specs/ARB/vertex_program.txt +// http://www.opengl.org/registry/specs/ARB/fragment_program.txt +// http://www.opengl.org/registry/specs/EXT/gpu_program_parameters.txt + + +//=============================================================================== + +// tokens not in the SDK headers + +//#ifndef GL_DEPTH_STENCIL_ATTACHMENT_EXT +// #define GL_DEPTH_STENCIL_ATTACHMENT_EXT 0x84F9 +//#endif + +//=============================================================================== + +// forward declarations + +class GLMContext; +class CGLMShaderPair; +class CGLMShaderPairCache; + +// CGLMProgram can contain two flavors of the same program, one in assembler, one in GLSL. +// these flavors are pretty different in terms of the API's that are used to activate them - +// for example, assembler programs can just get bound to the context, whereas GLSL programs +// have to be linked. To some extent we try to hide that detail inside GLM. + +// for now, make CGLMProgram a container, it does not set policy or hold a preference as to which +// flavor you want to use. GLMContext has to handle that. + +enum EGLMProgramType +{ + kGLMVertexProgram, + kGLMFragmentProgram, + + kGLMNumProgramTypes +}; + +enum EGLMProgramLang +{ + kGLMARB, + kGLMGLSL, + + kGLMNumProgramLangs +}; + +struct GLMShaderDesc +{ + union + { + GLuint arb; // ARB program object name + GLhandleARB glsl; // GLSL shader object handle (void*) + } m_object; + + // these can change if shader text is edited + bool m_textPresent; // is this flavor(lang) of text present in the buffer? + int m_textOffset; // where is it + int m_textLength; // how big + + bool m_compiled; // has this text been through a compile attempt + bool m_valid; // and if so, was the compile successful + + int m_slowMark; // has it been flagged during a non native draw batch before. increment every time it's slow. + + int m_highWater; // vount of vec4's in the major uniform array ("vc" on vs, "pc" on ps) + // written by dxabstract.... gross! +}; + +GLenum GLMProgTypeToARBEnum( EGLMProgramType type ); // map vert/frag to ARB asm bind target +GLenum GLMProgTypeToGLSLEnum( EGLMProgramType type ); // map vert/frag to ARB asm bind target + +class CGLMProgram +{ +public: + friend class CGLMShaderPairCache; + friend class CGLMShaderPair; + friend class GLMContext; // only GLMContext can make CGLMProgram objects + friend class GLMTester; + friend struct IDirect3D9; + friend struct IDirect3DDevice9; + + //=============================== + + // constructor is very light, it just makes one empty program object per flavor. + CGLMProgram( GLMContext *ctx, EGLMProgramType type ); + ~CGLMProgram( ); + + void SetProgramText ( char *text ); // import text to GLM object - invalidate any prev compiled program + + bool CompileActiveSources ( void ); // compile only the flavors that were provided. + bool Compile ( EGLMProgramLang lang ); + bool CheckValidity ( EGLMProgramLang lang ); + + void LogSlow ( EGLMProgramLang lang ); // detailed spew when called for first time; one liner or perhaps silence after that + + void GetLabelIndexCombo ( char *labelOut, int labelOutMaxChars, int *indexOut, int *comboOut ); + void GetComboIndexNameString ( char *stringOut, int stringOutMaxChars ); // mmmmmmmm-nnnnnnnn-filename + +#if GLMDEBUG + bool PollForChanges( void ); // check mirror for changes. + void ReloadStringFromEditable( void ); // populate m_string from editable item (react to change) + bool SyncWithEditable( void ); +#endif + + //=============================== + + // common stuff + + GLMContext *m_ctx; // link back to parent context + + EGLMProgramType m_type; // vertex or pixel + + uint m_serial; // serial number for hashing + + char *m_text; // copy of text passed into constructor. Can change if editable shaders is enabled. + // note - it can contain multiple flavors, so use CGLMTextSectioner to scan it and locate them +#if GLMDEBUG + CGLMEditableTextItem *m_editable; // editable text item for debugging +#endif + + GLMShaderDesc m_descs[ kGLMNumProgramLangs ]; + + uint m_samplerMask; // (1< + +//=============================================================================== + +extern int gl_errorcheckall; +extern int gl_errorcheckqueries; +extern int gl_errorchecknone; + +// how many microseconds to wait after a failed query-available test +// presently on MTGL this doesn't happen, but it could change, keep this handy +//ConVar gl_nullqueries( "gl_nullqueries", "0" ); +int gl_nullqueries = 0; + +GLenum GetQueryError( void ) +{ + if ( ( GLMDEBUG || (gl_errorcheckall != 0) || (gl_errorcheckqueries != 0) ) && (gl_errorchecknone == 0) ) + { + return glGetError(); + } + else + { + return (GLenum) 0; // whistle past graveyard + } +} + +//=============================================================================== + +CGLMQuery::CGLMQuery( GLMContext *ctx, GLMQueryParams *params ) +{ + // make sure context is current + // get the type of query requested + // generate name(s) needed + // set initial state appropriately + ctx->MakeCurrent(); + + m_ctx = ctx; + m_params = *params; + + m_name = 0; + + m_started = m_stopped = m_done = false; + + m_nullQuery = false; + // assume value of convar at start time + // does not change during individual query lifetime + // started null = stays null + // started live = stays live + + switch(m_params.m_type) + { + case EOcclusion: + { + //make an occlusion query (and a fence to go with it) + glGenQueriesARB( 1, &m_name ); + GLMPRINTF(("-A- CGLMQuery(OQ) created name %d", m_name)); + + GLenum errorcode = GetQueryError(); + if (errorcode) + { + const char *decodedStr = GLMDecode( eGL_ERROR, errorcode ); + printf( "\nCGLMQuery::CGLMQuery (OQ) saw %s error (%d) from glGenQueriesARB", decodedStr, errorcode ); + m_name = 0; + } + } + break; + + case EFence: + { + //make a fence - no aux fence needed + glGenFencesAPPLE(1, &m_name ); + GLMPRINTF(("-A- CGLMQuery(fence) created name %d", m_name)); + + GLenum errorcode = GetQueryError(); + if (errorcode) + { + const char *decodedStr = GLMDecode( eGL_ERROR, errorcode ); + printf( "\nCGLMQuery::CGLMQuery (fence) saw %s error (%d) from glGenFencesAPPLE", decodedStr, errorcode ); + m_name = 0; + } + } + break; + + default: + break; + } + +} + +CGLMQuery::~CGLMQuery() +{ + GLMPRINTF(("-A-> ~CGLMQuery")); + + // make sure query has completed (might not be necessary) + // delete the name(s) + + m_ctx->MakeCurrent(); + + switch(m_params.m_type) + { + case EOcclusion: + { + // do a finish occlusion query ? + GLMPRINTF(("-A- ~CGLMQuery(OQ) deleting name %d", m_name)); + glDeleteQueries(1, &m_name ); + + GLenum errorcode = GetQueryError(); + if (errorcode) + { + const char *decodedStr = GLMDecode( eGL_ERROR, errorcode ); + printf( "\nCGLMQuery::~CGLMQuery (OQ) saw %s error (%d) from glDeleteQueries", decodedStr, errorcode ); + } + } + break; + + case EFence: + { + // do a finish fence ? + GLMPRINTF(("-A- ~CGLMQuery(fence) deleting name %d", m_name)); + glDeleteFencesAPPLE(1, &m_name ); + + GLenum errorcode = GetQueryError(); + if (errorcode) + { + const char *decodedStr = GLMDecode( eGL_ERROR, errorcode ); + printf( "\nCGLMQuery::~CGLMQuery (fence) saw %s error (%d) from glDeleteFencesAPPLE", decodedStr, errorcode ); + } + } + break; + + default: + break; + } + + m_name = 0; + + GLMPRINTF(("-A-< ~CGLMQuery")); +} + + + + +void CGLMQuery::Start( void ) // "start counting" +{ + m_ctx->MakeCurrent(); + + // on occlusion query: + // glBeginQueryARB on the OQ name. counting starts. + + // on fence: glSetFence on m_name. + + // note, fences finish themselves via command progress - OQ's do not. + + Assert(!m_started); + Assert(!m_stopped); + Assert(!m_done); + + m_nullQuery = (gl_nullqueries != 0); // latch value for remainder of query life + + switch(m_params.m_type) + { + case EOcclusion: + { + if (m_nullQuery) + { + // do nothing.. + } + else + { + glBeginQueryARB( GL_SAMPLES_PASSED_ARB, m_name ); + GLenum errorcode = GetQueryError(); + if (errorcode) + { + const char *decodedStr = GLMDecode( eGL_ERROR, errorcode ); + printf( "\nCGLMQuery::Start(OQ) saw %s error (%d) from glBeginQueryARB (GL_SAMPLES_PASSED_ARB) name=%d", decodedStr, errorcode, m_name ); + } + } + } + break; + + case EFence: + { + glSetFenceAPPLE( m_name ); + + GLenum errorcode = GetQueryError(); + if (errorcode) + { + const char *decodedStr = GLMDecode( eGL_ERROR, errorcode ); + printf( "\nCGLMQuery::Start(fence) saw %s error (%d) from glSetFenceAPPLE name=%d", decodedStr, errorcode, m_name ); + } + + m_stopped = true; // caller should not call Stop on a fence, it self-stops + } + break; + + default: + break; + } + + m_started = true; +} + +void CGLMQuery::Stop( void ) // "stop counting" +{ + m_ctx->MakeCurrent(); + + Assert(m_started); + Assert(!m_stopped); // this will assert if you try to call Stop on a fence that is started + Assert(!m_done); + + switch(m_params.m_type) + { + case EOcclusion: + { + if (m_nullQuery) + { + // do nothing.. + } + else + { + glEndQueryARB( GL_SAMPLES_PASSED_ARB ); // we are only putting the request-to-stop-counting into the cmd stream. + + GLenum errorcode = GetQueryError(); + if (errorcode) + { + const char *decodedStr = GLMDecode( eGL_ERROR, errorcode ); + printf( "\nCGLMQuery::Stop(OQ) saw %s error (%d) from glEndQueryARB( GL_SAMPLES_PASSED_ARB ) name=%d", decodedStr, errorcode, m_name ); + } + } + } + break; + + case EFence: + { + // nop - you don't "end" a fence, you just test it and/or finish it out in Complete + } + break; + + default: + break; + } + + m_stopped = true; +} + +bool CGLMQuery::IsDone( void ) +{ + m_ctx->MakeCurrent(); + + Assert(m_started); + Assert(m_stopped); + + if(!m_done) // you can ask more than once, but we only check until it comes back as done. + { + // on occlusion: glGetQueryObjectivARB - large cost on pre SLGU, cheap after + // on fence: glTestFenceAPPLE on the fence + switch(m_params.m_type) + { + case EOcclusion: // just test the fence that was set after the query begin + { + if (m_nullQuery) + { + // do almost nothing.. but claim work is complete + m_done = true; + } + else + { + // prepare to pay a big price on drivers prior to 10.6.4+SLGU + + GLint available = 0; + glGetQueryObjectivARB(m_name, GL_QUERY_RESULT_AVAILABLE_ARB, &available ); + + GLenum errorcode = GetQueryError(); + if (errorcode) + { + const char *decodedStr = GLMDecode( eGL_ERROR, errorcode ); + printf( "\nCGLMQuery::IsDone saw %s error (%d) from glGetQueryObjectivARB(a2) name=%d", decodedStr, errorcode, m_name ); + } + + m_done = (available != 0); + } + } + break; + + case EFence: + { + m_done = glTestFenceAPPLE( m_name ); + GLenum errorcode = GetQueryError(); + if (errorcode) + { + const char *decodedStr = GLMDecode( eGL_ERROR, errorcode ); + printf( "\nCGLMQuery::IsDone saw %s error (%d) from glTestFenceAPPLE(b) name=%d", decodedStr, errorcode, m_name ); + } + + if (m_done) + { + glFinishFenceAPPLE( m_name ); // no set fence goes un-finished + + errorcode = GetQueryError(); + if (errorcode) + { + const char *decodedStr = GLMDecode( eGL_ERROR, errorcode ); + printf( "\nCGLMQuery::IsDone saw %s error (%d) from glFinishFenceAPPLE(b) name=%d", decodedStr, errorcode, m_name ); + } + } + } + break; + + default: + break; + } + } + + return m_done; +} + +void CGLMQuery::Complete( uint *result ) +{ + m_ctx->MakeCurrent(); + + uint resultval = 0; + GLint available = 0; + + // blocking call if not done + Assert(m_started); + Assert(m_stopped); + + switch(m_params.m_type) + { + case EOcclusion: + { + if (m_nullQuery) + { + m_done = true; + resultval = 0; // we did say "null queries..." + } + else + { + // accept that the query is going to drain pipe in 10.6.4 and prior. + // check the error on the spot. + glGetQueryObjectivARB(m_name, GL_QUERY_RESULT_AVAILABLE_ARB, &available ); + GLenum errorcode = GetQueryError(); + + if (errorcode) + { + const char *decodedStr = GLMDecode( eGL_ERROR, errorcode ); + printf( "\nCGLMQuery::Complete saw %s error (%d) from glGetQueryObjectivARB GL_QUERY_RESULT_AVAILABLE_ARB name=%d", decodedStr, errorcode, m_name ); + + resultval=0; + } + else + { + if (!available) + { + // this does happen with some very modest frequency. + if (!m_ctx->Caps().m_hasPerfPackage1) + { + glFlush(); // ISTR some deadlock cases on pre-SLGU drivers if you didn't do this to kick the queue along.. + } + } + + glGetQueryObjectuivARB( m_name, GL_QUERY_RESULT_ARB, &resultval); + + errorcode = GetQueryError(); + if (errorcode) + { + const char *decodedStr = GLMDecode( eGL_ERROR, errorcode ); + printf( "\nCGLMQuery::Complete saw %s error (%d) from glGetQueryObjectivARB GL_QUERY_RESULT_ARB name=%d", decodedStr, errorcode, m_name ); + + resultval=0; + } + else + { + // resultval is legit + } + } + m_done = true; + } + } + break; + + case EFence: + { + if(!m_done) + { + glFinishFenceAPPLE( m_name ); + + GLenum errorcode = GetQueryError(); + if (errorcode) + { + const char *decodedStr = GLMDecode( eGL_ERROR, errorcode ); + printf( "\nCGLMQuery::Complete saw %s error (%d) from glFinishFenceAPPLE (EFence) name=%d", decodedStr, errorcode, m_name ); + } + + m_done = true; // for clarity or if they try to Complete twice + } + } + break; + + default: + break; + } + + Assert( m_done ); + + // reset state for re-use - i.e. you have to call Complete if you want to re-use the object + m_started = m_stopped = m_done = false; + + if (result) // caller may pass NULL if not interested in result, for example to clear a fence + { + *result = resultval; + } +} + + + + // accessors for the started/stopped state +bool CGLMQuery::IsStarted ( void ) +{ + return m_started; +} + +bool CGLMQuery::IsStopped ( void ) +{ + return m_stopped; +} + diff --git a/external/steamworks/glmgr/cglmquery.h b/external/steamworks/glmgr/cglmquery.h new file mode 100644 index 0000000..c117e4d --- /dev/null +++ b/external/steamworks/glmgr/cglmquery.h @@ -0,0 +1,84 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ +// +// cglmquery.h +// GLMgr queries +// +//=============================================================================== + +#ifndef CGLMQUERY_H +#define CGLMQUERY_H + +#pragma once + +#ifdef OSX +#include "glmgrbasics.h" +#endif + +//=============================================================================== + +// forward declarations + +class GLMContext; +class CGLMQuery; + +//=============================================================================== + +enum EGLMQueryType +{ + EOcclusion, + EFence, + EGLMQueryCount +}; + +struct GLMQueryParams +{ + EGLMQueryType m_type; +}; + +class CGLMQuery +{ + // leave everything public til it's running +public: + friend class GLMContext; // only GLMContext can make CGLMTex objects + friend struct IDirect3DDevice9; + friend struct IDirect3DQuery9; + + GLMContext *m_ctx; // link back to parent context + GLMQueryParams m_params; // params created with + + GLuint m_name; // name of the query object per se - could be fence, could be query object + + bool m_started; + bool m_stopped; + bool m_done; + + bool m_nullQuery; // was gl_nullqueries true at Start time - if so, continue to act like a null query through Stop/IsDone/Complete time + // restated - only Start should examine the convar. + + CGLMQuery( GLMContext *ctx, GLMQueryParams *params ); + ~CGLMQuery( ); + + // for an occlusion query: + // Start = BeginQuery query-start goes into stream + // Stop = EndQuery query-end goes into stream - a fence is also set so we can probe for completion + // IsDone = TestFence use the added fence to ask if query-end has passed (i.e. will Complete block?) + // Complete = GetQueryObjectuivARB(uint id, enum pname, uint *params) - extract the sample count + + // for a fence query: + // Start = SetFence fence goes into command stream + // Stop = NOP fences are self finishing - no need to call Stop on a fence + // IsDone = TestFence ask if fence passed + // Complete = FinishFence + + void Start ( void ); + void Stop ( void ); + bool IsDone ( void ); + void Complete ( uint *result ); + + // accessors for the started/stopped state + bool IsStarted ( void ); + bool IsStopped ( void ); +}; + + +#endif diff --git a/external/steamworks/glmgr/cglmtex.cpp b/external/steamworks/glmgr/cglmtex.cpp new file mode 100644 index 0000000..ae1b5ee --- /dev/null +++ b/external/steamworks/glmgr/cglmtex.cpp @@ -0,0 +1,1816 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ +// +// cglmtex.cpp +// +//=============================================================================== + +#include "glmgr.h" +#include "cglmtex.h" +#include "dxabstract.h" + +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wunused-variable" +#endif + +#ifdef OSX +// Debugger - 10.8 +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + +//=============================================================================== + +#define TEXSPACE_LOGGING 0 + +// encoding layout to an index where the bits read +// 4 : 1 if compressed +// 2 : 1 if not power of two +// 1 : 1 if mipmapped + +bool pwroftwo (int val ) +{ + return (val & (val-1)) == 0; +} + +int sEncodeLayoutAsIndex( GLMTexLayoutKey *key ) +{ + int index = 0; + + if (key->m_texFlags & kGLMTexMipped) + { + index |= 1; + } + + if ( ! ( pwroftwo(key->m_xSize) && pwroftwo(key->m_ySize) && pwroftwo(key->m_zSize) ) ) + { + // if not all power of two + index |= 2; + } + + if (GetFormatDesc( key->m_texFormat )->m_chunkSize >1 ) + { + index |= 4; + } + + return index; +} + +static unsigned long g_texGlobalBytes[8]; + +//=============================================================================== + +const GLMTexFormatDesc g_formatDescTable[] = +{ + // not yet handled by this table: + // D3DFMT_INDEX16, D3DFMT_VERTEXDATA // D3DFMT_INDEX32, + // WTF { D3DFMT_R5G6R5 ???, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 1, 2 }, + // WTF { D3DFMT_A ???, GL_ALPHA8, GL_ALPHA, GL_UNSIGNED_BYTE, 1, 1 }, + // ??? D3DFMT_V8U8, + // ??? D3DFMT_Q8W8V8U8, + // ??? D3DFMT_X8L8V8U8, + // ??? D3DFMT_R32F, + // ??? D3DFMT_D24X4S4 unsure how to handle or if it is ever used.. + // ??? D3DFMT_D15S1 ever used ? + // ??? D3DFMT_D24X8 ever used? + + // summ-name d3d-format gl-int-format gl-int-format-srgb gl-data-format gl-data-type chunksize, bytes-per-sqchunk + { "_D16", D3DFMT_D16, GL_DEPTH_COMPONENT16, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 1, 2 }, + { "_D24X8", D3DFMT_D24X8, GL_DEPTH_COMPONENT24, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 1, 4 }, // ??? unsure on this one + { "_D24S8", D3DFMT_D24S8, GL_DEPTH24_STENCIL8_EXT, 0, GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, 1, 4 }, + + { "_A8R8G8B8", D3DFMT_A8R8G8B8, GL_RGBA8, GL_SRGB8_ALPHA8_EXT, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 1, 4 }, + { "_A4R4G4B4", D3DFMT_A4R4G4B4, GL_RGBA4, 0, GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV, 1, 2 }, + { "_X8R8G8B8", D3DFMT_X8R8G8B8, GL_RGB8, GL_SRGB8_EXT, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 1, 4 }, + + { "_X1R5G5B5", D3DFMT_X1R5G5B5, GL_RGB5, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 1, 2 }, + { "_A1R5G5B5", D3DFMT_A1R5G5B5, GL_RGB5_A1, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 1, 2 }, + + { "_L8", D3DFMT_L8, GL_LUMINANCE8, GL_SLUMINANCE8_EXT, GL_LUMINANCE, GL_UNSIGNED_BYTE, 1, 1 }, + { "_A8L8", D3DFMT_A8L8, GL_LUMINANCE8_ALPHA8, GL_SLUMINANCE8_ALPHA8_EXT, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 1, 2 }, + + { "_DXT1", D3DFMT_DXT1, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_COMPRESSED_SRGB_S3TC_DXT1_EXT, GL_RGB, GL_UNSIGNED_BYTE, 4, 8 }, + { "_DXT3", D3DFMT_DXT3, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, GL_RGBA, GL_UNSIGNED_BYTE, 4, 16 }, + { "_DXT5", D3DFMT_DXT5, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, GL_RGBA, GL_UNSIGNED_BYTE, 4, 16 }, + + { "_A16B16G16R16F", D3DFMT_A16B16G16R16F, GL_RGBA16F_ARB, 0, GL_RGBA, GL_HALF_FLOAT_ARB, 1, 8 }, + { "_A16B16G16R16", D3DFMT_A16B16G16R16, GL_RGBA16, 0, GL_RGBA, GL_UNSIGNED_SHORT, 1, 8 }, // 16bpc integer tex + + { "_A32B32G32R32F", D3DFMT_A32B32G32R32F, GL_RGBA32F_ARB, 0, GL_RGBA, GL_FLOAT, 1, 16 }, + + { "_R8G8B8", D3DFMT_R8G8B8, GL_RGB8, GL_SRGB8_EXT, GL_BGR, GL_UNSIGNED_BYTE, 1, 3 }, + + { "_A8", D3DFMT_A8, GL_ALPHA8, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 1, 1 }, + { "_R5G6B5", D3DFMT_R5G6B5, GL_RGB, GL_SRGB_EXT, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 1, 2 }, + + // fakey tex formats: the stated GL format and the memory layout may not agree (U8V8 for example) + + // _Q8W8V8U8 we just pass through as RGBA bytes. Shader does scale/bias fix + { "_Q8W8V8U8", D3DFMT_Q8W8V8U8, GL_RGBA8, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 1, 4 }, // straight ripoff of D3DFMT_A8R8G8B8 + + // U8V8 is exposed to the client as 2-bytes per texel, but we download it as 3-byte RGB. + // WriteTexels needs to do that conversion from rg8 to rgb8 in order to be able to download it correctly + { "_V8U8", D3DFMT_V8U8, GL_RGB8, 0, GL_RG, GL_BYTE, 1, 2 }, + + /* + // NV shadow depth tex + D3DFMT_NV_INTZ = 0x5a544e49, // MAKEFOURCC('I','N','T','Z') + D3DFMT_NV_RAWZ = 0x5a574152, // MAKEFOURCC('R','A','W','Z') + + // NV null tex + D3DFMT_NV_NULL = 0x4c4c554e, // MAKEFOURCC('N','U','L','L') + + // ATI shadow depth tex + D3DFMT_ATI_D16 = 0x36314644, // MAKEFOURCC('D','F','1','6') + D3DFMT_ATI_D24S8 = 0x34324644, // MAKEFOURCC('D','F','2','4') + + // ATI 1N and 2N compressed tex + D3DFMT_ATI_2N = 0x32495441, // MAKEFOURCC('A', 'T', 'I', '2') + D3DFMT_ATI_1N = 0x31495441, // MAKEFOURCC('A', 'T', 'I', '1') + */ +}; + +int g_formatDescTableCount = sizeof(g_formatDescTable) / sizeof( g_formatDescTable[0] ); + +const GLMTexFormatDesc *GetFormatDesc( D3DFORMAT format ) +{ + for( int i=0; i= range) Debugger(); + + *valuebuf = (*valuebuf << width) | scaled; +} + +// return true if successful +bool GLMGenTexels( GLMGenTexelParams *params ) +{ + unsigned char chunkbuf[256]; // can't think of any chunk this big.. + + const GLMTexFormatDesc *format = GetFormatDesc( params->m_format ); + + if (!format) + { + return FALSE; // fail + } + + // this section just generates one square chunk in the desired format + unsigned long *temp32 = (unsigned long*)chunkbuf; + unsigned int chunksize = 0; // we can sanity check against the format table with this + + switch( params->m_format ) + { + // comment shows byte order in RAM + // lowercase is bit arrangement in a byte + + case D3DFMT_A8R8G8B8: // B G R A + InsertTexelComponentFixed( params->a, 8, temp32 ); // A is inserted first and winds up at most significant bits after insertions follow + InsertTexelComponentFixed( params->r, 8, temp32 ); + InsertTexelComponentFixed( params->g, 8, temp32 ); + InsertTexelComponentFixed( params->b, 8, temp32 ); + chunksize = 4; + break; + + case D3DFMT_A4R4G4B4: // [ggggbbbb] [aaaarrrr] RA (nibbles) + InsertTexelComponentFixed( params->a, 4, temp32 ); + InsertTexelComponentFixed( params->r, 4, temp32 ); + InsertTexelComponentFixed( params->g, 4, temp32 ); + InsertTexelComponentFixed( params->b, 4, temp32 ); + chunksize = 2; + break; + + case D3DFMT_X8R8G8B8: // B G R X + InsertTexelComponentFixed( 0.0, 8, temp32 ); + InsertTexelComponentFixed( params->r, 8, temp32 ); + InsertTexelComponentFixed( params->g, 8, temp32 ); + InsertTexelComponentFixed( params->b, 8, temp32 ); + chunksize = 4; + break; + + case D3DFMT_X1R5G5B5: // [gggbbbbb] [xrrrrrgg] + InsertTexelComponentFixed( 0.0, 1, temp32 ); + InsertTexelComponentFixed( params->r, 5, temp32 ); + InsertTexelComponentFixed( params->g, 5, temp32 ); + InsertTexelComponentFixed( params->b, 5, temp32 ); + chunksize = 2; + break; + + case D3DFMT_A1R5G5B5: // [gggbbbbb] [arrrrrgg] + InsertTexelComponentFixed( params->a, 1, temp32 ); + InsertTexelComponentFixed( params->r, 5, temp32 ); + InsertTexelComponentFixed( params->g, 5, temp32 ); + InsertTexelComponentFixed( params->b, 5, temp32 ); + chunksize = 2; + break; + + case D3DFMT_L8: // L // caller, use R for L + InsertTexelComponentFixed( params->r, 8, temp32 ); + chunksize = 1; + break; + + case D3DFMT_A8L8: // L A // caller, use R for L and A for A + InsertTexelComponentFixed( params->a, 8, temp32 ); + InsertTexelComponentFixed( params->r, 8, temp32 ); + chunksize = 2; + break; + + case D3DFMT_R8G8B8: // B G R + InsertTexelComponentFixed( params->r, 8, temp32 ); + InsertTexelComponentFixed( params->g, 8, temp32 ); + InsertTexelComponentFixed( params->b, 8, temp32 ); + chunksize = 3; + break; + + case D3DFMT_A8: // A + InsertTexelComponentFixed( params->a, 8, temp32 ); + chunksize = 1; + break; + + case D3DFMT_R5G6B5: // [gggbbbbb] [rrrrrggg] + InsertTexelComponentFixed( params->r, 5, temp32 ); + InsertTexelComponentFixed( params->g, 6, temp32 ); + InsertTexelComponentFixed( params->b, 5, temp32 ); + chunksize = 2; + break; + + case D3DFMT_DXT1: + { + memset( temp32, 0, 8 ); // zap 8 bytes + + // two 565 RGB words followed by 32 bits of 2-bit interp values for a 4x4 block + // we write the same color to both slots and all zeroes for the mask (one color total) + + unsigned long dxt1_color = 0; + + // generate one such word and clone it + InsertTexelComponentFixed( params->r, 5, &dxt1_color ); + InsertTexelComponentFixed( params->g, 6, &dxt1_color ); + InsertTexelComponentFixed( params->b, 5, &dxt1_color ); + + // dupe + dxt1_color = dxt1_color | (dxt1_color<<16); + + // write into chunkbuf + *(unsigned long*)&chunkbuf[0] = dxt1_color; + + // color mask bits after that are already set to all zeroes. chunk is done. + chunksize = 8; + } + break; + + case D3DFMT_DXT3: + { + memset( temp32, 0, 16 ); // zap 16 bytes + + // eight bytes of alpha (16 4-bit alpha nibbles) + // followed by a DXT1 block + + unsigned long dxt3_alpha = 0; + for( int i=0; i<8; i++) + { + // splat same alpha through block + InsertTexelComponentFixed( params->a, 4, &dxt3_alpha ); + } + + unsigned long dxt3_color = 0; + + // generate one such word and clone it + InsertTexelComponentFixed( params->r, 5, &dxt3_color ); + InsertTexelComponentFixed( params->g, 6, &dxt3_color ); + InsertTexelComponentFixed( params->b, 5, &dxt3_color ); + + // dupe + dxt3_color = dxt3_color | (dxt3_color<<16); + + // write into chunkbuf + *(unsigned long*)&chunkbuf[0] = dxt3_alpha; + *(unsigned long*)&chunkbuf[4] = dxt3_alpha; + *(unsigned long*)&chunkbuf[8] = dxt3_color; + *(unsigned long*)&chunkbuf[12] = dxt3_color; + + chunksize = 16; + } + break; + + case D3DFMT_DXT5: + { + memset( temp32, 0, 16 ); // zap 16 bytes + + // DXT5 has 8 bytes of compressed alpha, then 8 bytes of compressed RGB like DXT1. + + // the 8 alpha bytes are 2 bytes of endpoint alpha values, then 16x3 bits of interpolants. + // so to write a single alpha value, just figure out the value, store it in both the first two bytes then store zeroes. + + InsertTexelComponentFixed( params->a, 8, (unsigned long*)&chunkbuf[0] ); + InsertTexelComponentFixed( params->a, 8, (unsigned long*)&chunkbuf[0] ); + // rest of the alpha mask was already zeroed. + + // now do colors + unsigned long dxt5_color = 0; + + // generate one such word and clone it + InsertTexelComponentFixed( params->r, 5, &dxt5_color ); + InsertTexelComponentFixed( params->g, 6, &dxt5_color ); + InsertTexelComponentFixed( params->b, 5, &dxt5_color ); + + // dupe + dxt5_color = dxt5_color | (dxt5_color<<16); + + // write into chunkbuf + *(unsigned long*)&chunkbuf[8] = dxt5_color; + *(unsigned long*)&chunkbuf[12] = dxt5_color; + + chunksize = 16; + } + break; + + + case D3DFMT_A32B32G32R32F: + { + *(float*)&chunkbuf[0] = params->r; + *(float*)&chunkbuf[4] = params->g; + *(float*)&chunkbuf[8] = params->b; + *(float*)&chunkbuf[12] = params->a; + + chunksize = 16; + } + break; + + case D3DFMT_A16B16G16R16: + memset( chunkbuf, 0, 8 ); + // R and G wind up in the first 32 bits + // B and A wind up in the second 32 bits + + InsertTexelComponentFixed( params->a, 16, (unsigned long*)&chunkbuf[4] ); // winds up as MSW of second word (note [4]) - thus last in RAM + InsertTexelComponentFixed( params->b, 16, (unsigned long*)&chunkbuf[4] ); + + InsertTexelComponentFixed( params->g, 16, (unsigned long*)&chunkbuf[0] ); + InsertTexelComponentFixed( params->r, 16, (unsigned long*)&chunkbuf[0] ); // winds up as LSW of first word, thus first in RAM + + chunksize = 8; + break; + + // not done yet + + + //case D3DFMT_D16: + //case D3DFMT_D24X8: + //case D3DFMT_D24S8: + + //case D3DFMT_A16B16G16R16F: + + default: + return FALSE; // fail + break; + } + + // once the chunk buffer is filled.. + + // sanity check the reported chunk size. + if (chunksize != format->m_bytesPerSquareChunk) + { + Debugger(); + return FALSE; + } + + // verify that the amount you want to write will not exceed the limit byte count + unsigned long destByteCount = chunksize * params->m_chunkCount; + + if (destByteCount > params->m_byteCountLimit) + { + Debugger(); + return FALSE; + } + + // write the bytes. + unsigned char *destP = (unsigned char*)params->m_dest; + for( int chunk=0; chunk < params->m_chunkCount; chunk++) + { + for( int byteindex = 0; byteindex < chunksize; byteindex++) + { + *destP++ = chunkbuf[byteindex]; + } + } + params->m_bytesWritten = destP - (unsigned char*)params->m_dest; + + return TRUE; +} + + +//=============================================================================== + +CGLMTexLayoutTable::CGLMTexLayoutTable() +{ +} + +GLMTexLayout *CGLMTexLayoutTable::NewLayoutRef( GLMTexLayoutKey *key ) +{ + // look up 'key' in the map and see if it's a hit, if so, bump the refcount and return + // if not, generate a completed layout based on the key, add to map, set refcount to 1, return that + + const GLMTexFormatDesc *formatDesc = GetFormatDesc( key->m_texFormat ); + if (!formatDesc) + { + GLMStop(); // bad news + } + bool compression = (formatDesc->m_chunkSize > 1); + + GLMTexLayoutKeyMap::iterator p = m_layoutMap.find( *key ); + if (p != m_layoutMap.end()) + { + // found it + //printf(" -hit- "); + GLMTexLayout *ptr = (*p).second; + + // bump ref count + ptr->m_refCount++; + + return ptr; + } + else + { + //printf(" -miss- "); + // need to make a new one + // to allocate it, we need to know how big to make it (slice count) + + // figure out how many mip levels are in play + int mipCount = 1; + if (key->m_texFlags & kGLMTexMipped) + { + int largestAxis = key->m_xSize; + + if (key->m_ySize > largestAxis) + largestAxis = key->m_ySize; + + if (key->m_zSize > largestAxis) + largestAxis = key->m_zSize; + + mipCount = 0; + while( largestAxis > 0 ) + { + mipCount ++; + largestAxis >>= 1; + } + } + + int faceCount = 1; + if (key->m_texGLTarget == GL_TEXTURE_CUBE_MAP) + { + faceCount = 6; + } + + int sliceCount = mipCount * faceCount; + + if (key->m_texFlags & kGLMTexMultisampled) + { + Assert( (key->m_texGLTarget == GL_TEXTURE_2D) ); + Assert( sliceCount == 1 ); + + // assume non mipped + Assert( (key->m_texFlags & kGLMTexMipped) == 0 ); + Assert( (key->m_texFlags & kGLMTexMippedAuto) == 0 ); + + // assume renderable and srgb + Assert( (key->m_texFlags & kGLMTexRenderable) !=0 ); + //Assert( (key->m_texFlags & kGLMTexSRGB) !=0 ); //FIXME don't assert on making depthstencil surfaces which are non srgb + + // double check sample count (FIXME need real limit check here against device/driver) + Assert( (key->m_texSamples==2) || (key->m_texSamples==4) || (key->m_texSamples==6) || (key->m_texSamples==8) ); + } + + // now we know enough to allocate and populate the new tex layout. + + // malloc the new layout + int layoutSize = sizeof( GLMTexLayout ) + (sliceCount * sizeof( GLMTexLayoutSlice )); + GLMTexLayout *layout = (GLMTexLayout *)malloc( layoutSize ); + memset( layout, 0, layoutSize ); + + // clone the key in there + memset( &layout->m_key, 0x00, sizeof(layout->m_key) ); + layout->m_key = *key; + + // set refcount + layout->m_refCount = 1; + + // save the format desc + layout->m_format = (GLMTexFormatDesc *)formatDesc; + + // we know the mipcount from before + layout->m_mipCount = mipCount; + + // we know the face count too + layout->m_faceCount = faceCount; + + // slice count is the product + layout->m_sliceCount = mipCount * faceCount; + + // we can now fill in the slices. + GLMTexLayoutSlice *slicePtr = &layout->m_slices[0]; + int storageOffset = 0; + + bool compressed = (formatDesc->m_chunkSize > 1); // true if DXT + + for( int mip = 0; mip < mipCount; mip ++ ) + { + for( int face = 0; face < faceCount; face++ ) + { + // note application of chunk size which is 1 for uncompressed, and 4 for compressed tex (DXT) + // note also that the *dimensions* must scale down to 1 + // but that the *storage* cannot go below 4x4. + // we introduce the "storage sizes" which are clamped, to compute the storage footprint. + + int storage_x,storage_y,storage_z; + + slicePtr->m_xSize = layout->m_key.m_xSize >> mip; + slicePtr->m_xSize = std::max( slicePtr->m_xSize, 1 ); // dimension can't go to zero + storage_x = std::max( slicePtr->m_xSize, formatDesc->m_chunkSize ); // storage extent can't go below chunk size + + slicePtr->m_ySize = layout->m_key.m_ySize >> mip; + slicePtr->m_ySize = std::max( slicePtr->m_ySize, 1 ); // dimension can't go to zero + storage_y = std::max( slicePtr->m_ySize, formatDesc->m_chunkSize ); // storage extent can't go below chunk size + + slicePtr->m_zSize = layout->m_key.m_zSize >> mip; + slicePtr->m_zSize = std::max( slicePtr->m_zSize, 1 ); // dimension can't go to zero + storage_z = std::max( slicePtr->m_zSize, 1); // storage extent for Z cannot go below '1'. + + //if (compressed) NO NO NO do not lie about the dimensionality, just fudge the storage. + //{ + // // round up to multiple of 4 in X and Y axes + // slicePtr->m_xSize = (slicePtr->m_xSize+3) & (~3); + // slicePtr->m_ySize = (slicePtr->m_ySize+3) & (~3); + //} + + int xchunks = (storage_x / formatDesc->m_chunkSize ); + int ychunks = (storage_y / formatDesc->m_chunkSize ); + + slicePtr->m_storageSize = (xchunks * ychunks * formatDesc->m_bytesPerSquareChunk) * storage_z; + slicePtr->m_storageOffset = storageOffset; + + storageOffset += slicePtr->m_storageSize; + storageOffset = ( (storageOffset+0x0F) & (~0x0F)); // keep each MIP starting on a 16 byte boundary. + + slicePtr++; + } + } + + layout->m_storageTotalSize = storageOffset; + //printf("\n size %08x for key (x=%d y=%d z=%d, fmt=%08x, bpsc=%d)", layout->m_storageTotalSize, key->m_xSize, key->m_ySize, key->m_zSize, key->m_texFormat, formatDesc->m_bytesPerSquareChunk ); + + // generate summary + // "target, format, +/- mips, base size" + char scratch[1024]; + + const char *targetname; + switch( key->m_texGLTarget ) + { + case GL_TEXTURE_2D: targetname = "2D "; break; + case GL_TEXTURE_3D: targetname = "3D "; break; + case GL_TEXTURE_CUBE_MAP: targetname = "CUBE"; break; + } + + sprintf( scratch, "[%s %s %dx%dx%d mips=%d slices=%d flags=%02lX%s]", + targetname, + formatDesc->m_formatSummary, + layout->m_key.m_xSize, layout->m_key.m_ySize, layout->m_key.m_zSize, + mipCount, + sliceCount, + layout->m_key.m_texFlags, + (layout->m_key.m_texFlags & kGLMTexSRGB) ? " SRGB" : "" + ); + layout->m_layoutSummary = strdup( scratch ); + //GLMPRINTF(("-D- new tex layout [ %s ]", scratch )); + + // then insert into map. disregard returned index. + m_layoutMap[ layout->m_key ] = layout; + + return layout; + } +} + +void CGLMTexLayoutTable::DelLayoutRef( GLMTexLayout *layout ) +{ + // locate layout in hash, drop refcount + + GLMTexLayoutKeyMap::iterator p = m_layoutMap.find( layout->m_key ); + if (p != m_layoutMap.end()) + { + // found it + GLMTexLayout *ptr = (*p).second; + + // drop ref count + ptr->m_refCount--; + } +} + +void CGLMTexLayoutTable::DumpStats( ) +{ + for( GLMTexLayoutKeyMap::iterator p = m_layoutMap.begin(); p != m_layoutMap.end(); p++ ) + { + GLMTexLayout *layout = (*p).second; + + // print it out + printf("\n%05d instances %08d bytes %08d totbytes %s", layout->m_refCount, layout->m_storageTotalSize, (layout->m_refCount*layout->m_storageTotalSize), layout->m_layoutSummary ); + } +} + +#if 0 + ConVar gl_texclientstorage( "gl_texclientstorage", "1" ); // default 1 for L4D2 + ConVar gl_texmsaalog ( "gl_texmsaalog", "0"); + ConVar gl_rt_forcergba ( "gl_rt_forcergba", "1" ); // on teximage of a renderable tex, pass GL_RGBA in place of GL_BGRA + ConVar gl_minimize_rt_tex ( "gl_minimize_rt_tex", "0" ); // if 1, set the GL_TEXTURE_MINIMIZE_STORAGE_APPLE texture parameter to cut off mipmaps for RT's + ConVar gl_minimize_all_tex ( "gl_minimize_all_tex", "1" ); // if 1, set the GL_TEXTURE_MINIMIZE_STORAGE_APPLE texture parameter to cut off mipmaps for textures which are unmipped + ConVar gl_minimize_tex_log ( "gl_minimize_tex_log", "0" ); // if 1, printf the names of the tex that got minimized +#else + int gl_texclientstorage = 1; + int gl_texmsaalog = 0; + int gl_rt_forcergba = 1; + int gl_minimize_rt_tex = 0; + int gl_minimize_all_tex =1; + int gl_minimize_tex_log =0; +#endif + + +CGLMTex::CGLMTex( GLMContext *ctx, GLMTexLayout *layout, GLMTexSamplingParams *sampling, const char *debugLabel ) +{ + // caller has responsibility to make 'ctx' current, but we check to be sure. + ctx->CheckCurrent(); + + // note layout requested + m_layout = layout; + m_maxActiveMip = -1; //index of highest mip that has been written - increase as each mip arrives + m_minActiveMip = 999; //index of lowest mip that has been written - lower it as each mip arrives + + // note sampling (copy values) + m_sampling = *sampling; + + // note context owner + m_ctx = ctx; + + // clear the bind point flags + m_bindPoints = 0; // was ClearAll() with bitvec + + // clear the RT attach count + m_rtAttachCount = 0; + + // come up with a GL name for this texture. + // for MTGL friendliness, we should generate our own names at some point.. + glGenTextures( 1, &m_texName ); + + //sense whether to try and apply client storage upon teximage/subimage + m_texClientStorage = (gl_texclientstorage/* .GetInt() */ != 0); + + // flag that we have not yet been explicitly kicked into VRAM.. + m_texPreloaded = false; + + // clone the debug label if there is one. + m_debugLabel = debugLabel ? strdup(debugLabel) : NULL; + + // if tex is MSAA renderable, make an RBO, else zero the RBO name and dirty bit + if (layout->m_key.m_texFlags & kGLMTexMultisampled) + { + glGenRenderbuffersEXT( 1, &m_rboName ); + m_rboDirty = false; + + // so we have enough info to go ahead and bind the RBO and put storage on it? + // try it. + glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, m_rboName ); + GLMCheckError(); + + // quietly clamp if sample count exceeds known limit for the device + int sampleCount = layout->m_key.m_texSamples; + + if (sampleCount > ctx->Caps().m_maxSamples) + { + sampleCount = ctx->Caps().m_maxSamples; // clamp + } + + GLenum msaaFormat = (layout->m_key.m_texFlags & kGLMTexSRGB) ? layout->m_format->m_glIntFormatSRGB : layout->m_format->m_glIntFormat; + glRenderbufferStorageMultisampleEXT( GL_RENDERBUFFER_EXT, + sampleCount, // not "layout->m_key.m_texSamples" + msaaFormat, + layout->m_key.m_xSize, + layout->m_key.m_ySize ); + GLMCheckError(); + + if (gl_texmsaalog/* .GetInt() */) + { + printf( "\n == MSAA Tex %p %s : MSAA RBO is intformat %s (%x)", this, m_debugLabel?m_debugLabel:"", GLMDecode( eGL_ENUM, msaaFormat ), msaaFormat ); + } + + glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, 0 ); + GLMCheckError(); + } + else + { + m_rboName = 0; + m_rboDirty = false; + } + + + // at this point we have the complete description of the texture, and a name for it, but no data and no actual GL object. + // we know this name has bever seen duty before, so we're going to hard-bind it to TMU 0, displacing any other tex that might have been bound there. + // any previously bound tex will be unbound and appropriately marked as a result. + // the active TMU will be set as a side effect. + ctx->BindTexToTMU( this, 0 ); + + // OK, our texture now exists and is bound on the active TMU. Not drawable yet though. + + // impose the sampling params we were given, unconditionally + ApplySamplingParams( sampling, true ); + + // if not an RT, create backing storage and fill it + if ( !(layout->m_key.m_texFlags & kGLMTexRenderable) ) + { + m_backing = (char *)malloc( m_layout->m_storageTotalSize ); + memset( m_backing, 0, m_layout->m_storageTotalSize ); + + // track bytes allocated for non-RT's + int formindex = sEncodeLayoutAsIndex( &layout->m_key ); + + g_texGlobalBytes[ formindex ] += m_layout->m_storageTotalSize; + + #if TEXSPACE_LOGGING + printf( "\n Tex %s added %d bytes in form %d which is now %d bytes", m_debugLabel ? m_debugLabel : "-", m_layout->m_storageTotalSize, formindex, g_texGlobalBytes[ formindex ] ); + printf( "\n\t\t[ %d %d %d %d %d %d %d %d ]", + g_texGlobalBytes[ 0 ],g_texGlobalBytes[ 1 ],g_texGlobalBytes[ 2 ],g_texGlobalBytes[ 3 ], + g_texGlobalBytes[ 4 ],g_texGlobalBytes[ 5 ],g_texGlobalBytes[ 6 ],g_texGlobalBytes[ 7 ] + ); + #endif + } + else + { + m_backing = NULL; + + m_texClientStorage = false; + } + + // init lock count + // lock reqs are tracked by the owning context + m_lockCount = 0; + + m_sliceFlags.resize( m_layout->m_sliceCount ); + for( int i=0; i< m_layout->m_sliceCount; i++) + { + m_sliceFlags[i] = 0; + // kSliceValid = false (we have not teximaged each slice yet) + // kSliceStorageValid = false (the storage allocated does not reflect what is in the tex) + // kSliceLocked = false (the slices are not locked) + // kSliceFullyDirty = false (this does not come true til first lock) + } + + // texture minimize parameter keeps driver from allocing mips when it should not, by being explicit about the ones that have no mips. + + bool setMinimizeParameter = false; + bool minimize_rt = (gl_minimize_rt_tex/* .GetInt() */!=0); + bool minimize_all = (gl_minimize_all_tex/* .GetInt() */!=0); + + if (layout->m_key.m_texFlags & kGLMTexRenderable) + { + // it's an RT. if mips were not explicitly requested, and "gl_minimize_rt_tex" is true, set the minimize parameter. + if ( (minimize_rt || minimize_all) && ( !(layout->m_key.m_texFlags & kGLMTexMipped) ) ) + { + setMinimizeParameter = true; + } + } + else + { + // not an RT. if mips were not requested, and "gl_minimize_all_tex" is true, set the minimize parameter. + if ( minimize_all && ( !(layout->m_key.m_texFlags & kGLMTexMipped) ) ) + { + setMinimizeParameter = true; + } + } + + if (setMinimizeParameter) + { + if (gl_minimize_tex_log/* .GetInt() */) + { + printf("\n minimizing storage for tex '%s' [%s] ", m_debugLabel?m_debugLabel:"-", m_layout->m_layoutSummary ); + } + glTexParameteri( m_layout->m_key.m_texGLTarget, GL_TEXTURE_MINIMIZE_STORAGE_APPLE, 1 ); + } + + // after a lot of pain with texture completeness... + // always push black into all slices of all newly created textures. + + #if 0 + bool pushRenderableSlices = (m_layout->m_key.m_texFlags & kGLMTexRenderable) != 0; + bool pushTexSlices = true; // just do it everywhere (m_layout->m_mipCount>1) && (m_layout->m_format->m_chunkSize !=1) ; + if (pushTexSlices) + { + // fill storage with mostly-opaque purple + + GLMGenTexelParams genp; + memset( &genp, 0, sizeof(genp) ); + + genp.m_format = m_layout->m_format->m_d3dFormat; + const GLMTexFormatDesc *format = GetFormatDesc( genp.m_format ); + + genp.m_dest = m_backing; // dest addr + genp.m_chunkCount = m_layout->m_storageTotalSize / format->m_bytesPerSquareChunk; // fill the whole slab + genp.m_byteCountLimit = m_layout->m_storageTotalSize; // limit writes to this amount + + genp.r = 1.0; + genp.g = 0.0; + genp.b = 1.0; + genp.a = 0.75; + + GLMGenTexels( &genp ); + } + #endif + + //if (pushRenderableSlices || pushTexSlices) + if (1) + { + for( int face=0; face m_faceCount; face++) + { + for( int mip=0; mip m_mipCount; mip++) + { + // we're not really going to lock, we're just going to write the blank data from the backing store we just made + GLMTexLockDesc desc; + + desc.m_req.m_tex = this; + desc.m_req.m_face = face; + desc.m_req.m_mip = mip; + + desc.m_sliceIndex = CalcSliceIndex( face, mip ); + + GLMTexLayoutSlice *slice = &m_layout->m_slices[ desc.m_sliceIndex ]; + + desc.m_req.m_region.xmin = desc.m_req.m_region.ymin = desc.m_req.m_region.zmin = 0; + desc.m_req.m_region.xmax = slice->m_xSize; + desc.m_req.m_region.ymax = slice->m_ySize; + desc.m_req.m_region.zmax = slice->m_zSize; + + desc.m_sliceBaseOffset = slice->m_storageOffset; // doesn't really matter... we're just pushing zeroes.. + desc.m_sliceRegionOffset = 0; + + this->WriteTexels( &desc, true, (layout->m_key.m_texFlags & kGLMTexRenderable)!=0 ); // write whole slice - but disable data source if it's an RT, as there's no backing + } + } + } + GLMPRINTF(("-A- -**TEXNEW '%-60s' name=%06d size=%09d storage=%08x label=%s ", m_layout->m_layoutSummary, m_texName, m_layout->m_storageTotalSize, m_backing, m_debugLabel ? m_debugLabel : "-" )); +} + +CGLMTex::~CGLMTex( ) +{ + if ( !(m_layout->m_key.m_texFlags & kGLMTexRenderable) ) + { + int formindex = sEncodeLayoutAsIndex( &m_layout->m_key ); + + g_texGlobalBytes[ formindex ] -= m_layout->m_storageTotalSize; + + #if TEXSPACE_LOGGING + printf( "\n Tex %s freed %d bytes in form %d which is now %d bytes", m_debugLabel ? m_debugLabel : "-", m_layout->m_storageTotalSize, formindex, g_texGlobalBytes[ formindex ] ); + printf( "\n\t\t[ %d %d %d %d %d %d %d %d ]", + g_texGlobalBytes[ 0 ],g_texGlobalBytes[ 1 ],g_texGlobalBytes[ 2 ],g_texGlobalBytes[ 3 ], + g_texGlobalBytes[ 4 ],g_texGlobalBytes[ 5 ],g_texGlobalBytes[ 6 ],g_texGlobalBytes[ 7 ] + ); + #endif + } + + GLMPRINTF(("-A- -**TEXDEL '%-60s' name=%06d size=%09d storage=%08x label=%s ", m_layout->m_layoutSummary, m_texName, m_layout->m_storageTotalSize, m_backing, m_debugLabel ? m_debugLabel : "-" )); + // check first to see if we were still bound anywhere or locked... these should be failures. + + // if all that is OK, then delete the underlying tex + glDeleteTextures( 1, &m_texName ); + GLMCheckError(); + m_texName = 0; + + if(m_rboName) + { + glDeleteRenderbuffersEXT( 1, &m_rboName ); + GLMCheckError(); + m_rboName = 0; + m_rboDirty = false; + } + + + // release our usage of the layout + m_ctx->m_texLayoutTable->DelLayoutRef( m_layout ); + m_layout = NULL; + + if (m_backing) + { + free( m_backing ); + m_backing = NULL; + } + + if (m_debugLabel) + { + free( m_debugLabel ); + m_debugLabel = NULL; + } + + m_ctx = NULL; +} + +int CGLMTex::CalcSliceIndex( int face, int mip ) +{ + // faces of the same mip level are adjacent. "face major" storage + int index = (mip * m_layout->m_faceCount) + face; + + return index; +} + +void CGLMTex::CalcTexelDataOffsetAndStrides( int sliceIndex, int x, int y, int z, int *offsetOut, int *yStrideOut, int *zStrideOut ) +{ + int offset = 0; + int yStride = 0; + int zStride = 0; + + GLMTexFormatDesc *format = m_layout->m_format; + if (format->m_chunkSize==1) + { + // figure out row stride and layer stride + yStride = format->m_bytesPerSquareChunk * m_layout->m_slices[sliceIndex].m_xSize; // bytes per texel row (y stride) + zStride = yStride * m_layout->m_slices[sliceIndex].m_ySize; // bytes per texel layer (if 3D tex) + + offset = x * format->m_bytesPerSquareChunk; // lateral offset + offset += (y * yStride); // scanline offset + offset += (z * zStride); // should be zero for 2D tex + } + else + { + yStride = format->m_bytesPerSquareChunk * (m_layout->m_slices[sliceIndex].m_xSize / format->m_chunkSize); + zStride = yStride * (m_layout->m_slices[sliceIndex].m_ySize / format->m_chunkSize); + + // compressed format. scale the x,y,z values into chunks. + // assert if any of them are not multiples of a chunk. + int chunkx = x / format->m_chunkSize; + int chunky = y / format->m_chunkSize; + int chunkz = z / format->m_chunkSize; + + if ( (chunkx * format->m_chunkSize) != x) + { + GLMStop(); + } + + if ( (chunky * format->m_chunkSize) != y) + { + GLMStop(); + } + + if ( (chunkz * format->m_chunkSize) != z) + { + GLMStop(); + } + + offset = chunkx * format->m_bytesPerSquareChunk; // lateral offset + offset += (chunky * yStride); // chunk row offset + offset += (chunkz * zStride); // should be zero for 2D tex + } + + *offsetOut = offset; + *yStrideOut = yStride; + *zStrideOut = zStride; +} + +void CGLMTex::ApplySamplingParams( GLMTexSamplingParams *params, bool noCheck ) +{ + #define DIFF(fff) (noCheck || (params->fff != m_sampling.fff)) + + GLenum target = m_layout->m_key.m_texGLTarget; + + // if the texture is compressed, and has a maxActiveMip that is >=0 but less than the mip count, + // (i.e. they supplied *some* but not *all* mips needed)... + // generate them, and fix the max mip count. + + + //if ( /*(m_layout->m_format->m_chunkSize !=1) &&*/ (m_layout->m_mipCount>3) ) + //{ + // m_maxActiveMip = m_layout->m_mipCount-3; // pull back three levels + // glTexParameteri( target, GL_TEXTURE_MAX_LEVEL, m_maxActiveMip); + // GLMCheckError(); + //} + + if (DIFF(m_addressModes[0])) + { + m_sampling.m_addressModes[0] = params->m_addressModes[0]; + glTexParameteri( target, GL_TEXTURE_WRAP_S, m_sampling.m_addressModes[0]); + GLMCheckError(); + } + + if (DIFF(m_addressModes[1])) + { + m_sampling.m_addressModes[1] = params->m_addressModes[1]; + glTexParameteri( target, GL_TEXTURE_WRAP_T, m_sampling.m_addressModes[1]); + GLMCheckError(); + } + + if (DIFF(m_addressModes[2])) + { + m_sampling.m_addressModes[2] = params->m_addressModes[2]; + glTexParameteri( target, GL_TEXTURE_WRAP_R, m_sampling.m_addressModes[2]); + GLMCheckError(); + } + + if ( noCheck || memcmp( params->m_borderColor, m_sampling.m_borderColor, sizeof(m_sampling.m_borderColor) ) ) + { + memcpy( m_sampling.m_borderColor, params->m_borderColor, sizeof(params->m_borderColor) ); + glTexParameterfv( target, GL_TEXTURE_BORDER_COLOR, params->m_borderColor ); + GLMCheckError(); + } + + if (DIFF(m_magFilter)) + { + m_sampling.m_magFilter = params->m_magFilter; + glTexParameteri( target, GL_TEXTURE_MAG_FILTER, params->m_magFilter); + GLMCheckError(); + } + + if (DIFF(m_minFilter)) + { + m_sampling.m_minFilter = params->m_minFilter; + glTexParameteri( target, GL_TEXTURE_MIN_FILTER, params->m_minFilter); + GLMCheckError(); + } + + if (DIFF(m_mipmapBias)) + { + m_sampling.m_mipmapBias = params->m_mipmapBias; + //glTexParameterf( target, GL_TEXTURE_LOD_BIAS, params->m_mipmapBias ); + GLMCheckError(); + } + + if (DIFF(m_minMipLevel)) + { + // don't let minmiplevel go below min active mip level + m_sampling.m_minMipLevel = std::max( m_minActiveMip, params->m_minMipLevel ); + glTexParameteri( target, GL_TEXTURE_MIN_LOD, m_sampling.m_minMipLevel); + GLMCheckError(); + } + + if (DIFF(m_maxMipLevel)) + { + // do not let max selectable LOD exceed the max submitted mip + + m_sampling.m_maxMipLevel = std::min( m_maxActiveMip, params->m_maxMipLevel); + glTexParameteri( target, GL_TEXTURE_MAX_LOD, m_sampling.m_maxMipLevel); + GLMCheckError(); + } + + if (m_layout->m_mipCount > 1) // only apply aniso setting to mipped tex + { + if (DIFF(m_maxAniso)) + { + m_sampling.m_maxAniso = params->m_maxAniso >= 1.0f ? params->m_maxAniso : 1.0f; + glTexParameteri( target, GL_TEXTURE_MAX_ANISOTROPY_EXT, params->m_maxAniso ); + GLMCheckError(); + } + } + + if (DIFF(m_compareMode)) + { + m_sampling.m_compareMode = params->m_compareMode; + glTexParameteri( target, GL_TEXTURE_COMPARE_MODE_ARB, params->m_compareMode ); + GLMCheckError(); + + if (params->m_compareMode == GL_COMPARE_R_TO_TEXTURE_ARB) + { + glTexParameteri( target, GL_TEXTURE_COMPARE_FUNC_ARB, GL_LEQUAL ); + GLMCheckError(); + } + } + + if (DIFF(m_srgb)) + { + m_sampling.m_srgb = params->m_srgb; // we might have to re-DL the tex if the SRGB read status changes.. + } + + #undef DIFF +} + +void CGLMTex::ReadTexels( GLMTexLockDesc *desc, bool readWholeSlice ) +{ + GLMRegion readBox; + + if (readWholeSlice) + { + readBox.xmin = readBox.ymin = readBox.zmin = 0; + + readBox.xmax = m_layout->m_slices[ desc->m_sliceIndex ].m_xSize; + readBox.ymax = m_layout->m_slices[ desc->m_sliceIndex ].m_ySize; + readBox.zmax = m_layout->m_slices[ desc->m_sliceIndex ].m_zSize; + } + else + { + readBox = desc->m_req.m_region; + } + + m_ctx->BindTexToTMU( this, 0, false ); // SelectTMU(n) is a side effect + + if (readWholeSlice) + { + // make this work first.... then write the partial path + // (Hmmmm, I don't think we will ever actually need a partial path - + // since we have no notion of a partially valid slice of storage + + GLMTexFormatDesc *format = m_layout->m_format; + GLenum target = m_layout->m_key.m_texGLTarget; + + void *sliceAddress = m_backing + m_layout->m_slices[ desc->m_sliceIndex ].m_storageOffset; // this would change for PBO + int sliceSize = m_layout->m_slices[ desc->m_sliceIndex ].m_storageSize; + + // interestingly enough, we can use the same path for both 2D and 3D fetch + + switch( target ) + { + case GL_TEXTURE_CUBE_MAP: + + // adjust target to steer to the proper face, then fall through to the 2D texture path. + target = GL_TEXTURE_CUBE_MAP_POSITIVE_X + desc->m_req.m_face; + + case GL_TEXTURE_2D: + case GL_TEXTURE_3D: + { + // check compressed or not + if (format->m_chunkSize != 1) + { + // compressed path + // http://www.opengl.org/sdk/docs/man/xhtml/glGetCompressedTexImage.xml + + glGetCompressedTexImage( target, // target + desc->m_req.m_mip, // level + sliceAddress ); // destination + GLMCheckError(); + } + else + { + // uncompressed path + // http://www.opengl.org/sdk/docs/man/xhtml/glGetTexImage.xml + + glGetTexImage( target, // target + desc->m_req.m_mip, // level + format->m_glDataFormat, // dataformat + format->m_glDataType, // datatype + sliceAddress ); // destination + GLMCheckError(); + } + } + break; + } + } + else + { + GLMStop(); + } +} + +// defaulting the subimage support off, since it's breaking Ep2 at startup on some NV 9400 and friends +// defaulting it back to "1" for L4D2 and see if it flies +int gl_enabletexsubimage = 1; +//ConVar gl_enabletexsubimage( "gl_enabletexsubimage", "1" ); + +void CGLMTex::WriteTexels( GLMTexLockDesc *desc, bool writeWholeSlice, bool noDataWrite ) +{ + GLMRegion writeBox; + + bool needsExpand = false; + char *expandTemp = NULL; + + switch( m_layout->m_format->m_d3dFormat) + { + case D3DFMT_V8U8: + { + needsExpand = true; + writeWholeSlice = true; + + // shoot down client storage if we have to generate a new flavor of the data + m_texClientStorage = false; + } + break; + + default: + break; + } + + if (writeWholeSlice) + { + writeBox.xmin = writeBox.ymin = writeBox.zmin = 0; + + writeBox.xmax = m_layout->m_slices[ desc->m_sliceIndex ].m_xSize; + writeBox.ymax = m_layout->m_slices[ desc->m_sliceIndex ].m_ySize; + writeBox.zmax = m_layout->m_slices[ desc->m_sliceIndex ].m_zSize; + } + else + { + writeBox = desc->m_req.m_region; + } + + // first thing is to get the GL texture bound to a TMU, or just select one if already bound + // to get this running we will just always slam TMU 0 and let the draw time code fix it back + // a later optimization would be to hoist the bind call to the caller, do it exactly once + + m_ctx->BindTexToTMU( this, 0, false ); // SelectTMU(n) is a side effect + + GLMTexFormatDesc *format = m_layout->m_format; + + GLenum target = m_layout->m_key.m_texGLTarget; + GLenum glDataFormat = format->m_glDataFormat; // this could change if expansion kicks in + GLenum glDataType = format->m_glDataType; + + GLMTexLayoutSlice *slice = &m_layout->m_slices[ desc->m_sliceIndex ]; + void *sliceAddress = m_backing ? (m_backing + slice->m_storageOffset) : NULL; // this would change for PBO + + // allow use of subimage if the target is texture2D and it has already been teximage'd + bool mayUseSubImage = false; + if ( (target==GL_TEXTURE_2D) && (m_sliceFlags[ desc->m_sliceIndex ] & kSliceValid) ) + { + mayUseSubImage = gl_enabletexsubimage/* .GetInt() */; + } + + // check flavor, 2D, 3D, or cube map + // we also have the choice to use subimage if this is a tex already created. (open question as to benefit) + + + // SRGB select. At this level (writetexels) we firmly obey the m_texFlags. + // (mechanism not policy) + + GLenum intformat = (m_layout->m_key.m_texFlags & kGLMTexSRGB) ? format->m_glIntFormatSRGB : format->m_glIntFormat; + if (0 /* CommandLine()->FindParm("-disable_srgbtex") */) + { + // force non srgb flavor - experiment to make ATI r600 happy on 10.5.8 (maybe x1600 too!) + intformat = format->m_glIntFormat; + } + + Assert( intformat != 0 ); + + if (m_layout->m_key.m_texFlags & kGLMTexSRGB) + { + Assert( m_layout->m_format->m_glDataFormat != GL_DEPTH_COMPONENT ); + Assert( m_layout->m_format->m_glDataFormat != GL_DEPTH_STENCIL_EXT ); + Assert( m_layout->m_format->m_glDataFormat != GL_ALPHA ); + } + + // adjust min and max mip written + if (desc->m_req.m_mip > m_maxActiveMip) + { + m_maxActiveMip = desc->m_req.m_mip; + + glTexParameteri( target, GL_TEXTURE_MAX_LEVEL, desc->m_req.m_mip); + GLMCheckError(); + } + + if (desc->m_req.m_mip < m_minActiveMip) + { + m_minActiveMip = desc->m_req.m_mip; + + glTexParameteri( target, GL_TEXTURE_BASE_LEVEL, desc->m_req.m_mip); + GLMCheckError(); + } + + if (needsExpand) + { + int expandSize = 0; + + switch( m_layout->m_format->m_d3dFormat) + { + case D3DFMT_V8U8: + { + // figure out new size based on 3byte RGB format + // easy, just take the two byte size and grow it by 50% + expandSize = (slice->m_storageSize * 3) / 2; + expandTemp = (char*)malloc( expandSize ); + + char *src = (char*)sliceAddress; + char *dst = expandTemp; + + // transfer RG's to RGB's + while(expandSize>0) + { + *dst = *src++; // move first byte + *dst = *src++; // move second byte + *dst = 0xBB; // pad third byte + + expandSize -= 3; + } + + // move the slice pointer + sliceAddress = expandTemp; + + // change the data format we tell GL about + glDataFormat = GL_RGB; + } + break; + + default: Assert(!"Don't know how to expand that format.."); + } + + } + + // set up the client storage now, one way or another + glPixelStorei( GL_UNPACK_CLIENT_STORAGE_APPLE, m_texClientStorage ); + GLMCheckError(); + + switch( target ) + { + case GL_TEXTURE_CUBE_MAP: + + // adjust target to steer to the proper face, then fall through to the 2D texture path. + target = GL_TEXTURE_CUBE_MAP_POSITIVE_X + desc->m_req.m_face; + + case GL_TEXTURE_2D: + { + // check compressed or not + if (format->m_chunkSize != 1) + { + Assert( writeWholeSlice ); //subimage not implemented in this path yet + + // compressed path + // http://www.opengl.org/sdk/docs/man/xhtml/glCompressedTexImage2D.xml + glCompressedTexImage2D( target, // target + desc->m_req.m_mip, // level + intformat, // internalformat - don't use format->m_glIntFormat because we have the SRGB select going on above + slice->m_xSize, // width + slice->m_ySize, // height + 0, // border + slice->m_storageSize, // imageSize + sliceAddress ); // data + GLMCheckError(); + + + } + else + { + if (mayUseSubImage) + { + // go subimage2D if it's a replacement, not a creation + + + glPixelStorei( GL_UNPACK_ROW_LENGTH, slice->m_xSize ); // in pixels + glPixelStorei( GL_UNPACK_SKIP_PIXELS, writeBox.xmin ); // in pixels + glPixelStorei( GL_UNPACK_SKIP_ROWS, writeBox.ymin ); // in pixels + GLMCheckError(); + + glTexSubImage2D( target, + desc->m_req.m_mip, // level + writeBox.xmin, // xoffset into dest + writeBox.ymin, // yoffset into dest + writeBox.xmax - writeBox.xmin, // width (was slice->m_xSize) + writeBox.ymax - writeBox.ymin, // height (was slice->m_ySize) + glDataFormat, // format + glDataType, // type + sliceAddress // data (will be offsetted by the SKIP_PIXELS and SKIP_ROWS - let GL do the math to find the first source texel) + ); + GLMCheckError(); + + glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 ); + glPixelStorei( GL_UNPACK_SKIP_PIXELS, 0 ); + glPixelStorei( GL_UNPACK_SKIP_ROWS, 0 ); + GLMCheckError(); + + /* + //http://www.opengl.org/sdk/docs/man/xhtml/glTexSubImage2D.xml + glTexSubImage2D( target, + desc->m_req.m_mip, // level + 0, // xoffset + 0, // yoffset + slice->m_xSize, // width + slice->m_ySize, // height + glDataFormat, // format + glDataType, // type + sliceAddress // data + ); + GLMCheckError(); + */ + } + else + { + if (m_layout->m_key.m_texFlags & kGLMTexRenderable) + { + if (gl_rt_forcergba/* .GetInt() */) + { + if (glDataFormat == GL_BGRA) + { + // change it + glDataFormat = GL_RGBA; + } + } + } + + // uncompressed path + // http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/teximage2d.html + glTexImage2D( target, // target + desc->m_req.m_mip, // level + intformat, // internalformat - don't use format->m_glIntFormat because we have the SRGB select going on above + slice->m_xSize, // width + slice->m_ySize, // height + 0, // border + glDataFormat, // dataformat + glDataType, // datatype + noDataWrite ? NULL : sliceAddress ); // data (optionally suppressed in case ResetSRGB desires) + + if (m_layout->m_key.m_texFlags & kGLMTexMultisampled) + { + if (gl_texmsaalog/* .GetInt() */) + { + printf( "\n == MSAA Tex %p %s : glTexImage2D for flat tex using intformat %s (%x)", this, m_debugLabel?m_debugLabel:"", GLMDecode( eGL_ENUM, intformat ), intformat ); + printf( "\n" ); + } + } + + m_sliceFlags[ desc->m_sliceIndex ] |= kSliceValid; // for next time, we can subimage.. + } + } + } + break; + + case GL_TEXTURE_3D: + { + // check compressed or not + if (format->m_chunkSize != 1) + { + // compressed path + // http://www.opengl.org/sdk/docs/man/xhtml/glCompressedTexImage3D.xml + + glCompressedTexImage3D( target, // target + desc->m_req.m_mip, // level + format->m_glIntFormat, // internalformat + slice->m_xSize, // width + slice->m_ySize, // height + slice->m_zSize, // depth + 0, // border + slice->m_storageSize, // imageSize + sliceAddress ); // data + GLMCheckError(); + } + else + { + // uncompressed path + // http://www.opengl.org/sdk/docs/man/xhtml/glTexImage3D.xml + glTexImage3D( target, // target + desc->m_req.m_mip, // level + format->m_glIntFormat, // internalformat + slice->m_xSize, // width + slice->m_ySize, // height + slice->m_zSize, // depth + 0, // border + glDataFormat, // dataformat + glDataType, // datatype + noDataWrite ? NULL : sliceAddress ); // data (optionally suppressed in case ResetSRGB desires) + GLMCheckError(); + } + } + break; + } + + glPixelStorei( GL_UNPACK_CLIENT_STORAGE_APPLE, GL_FALSE ); + GLMCheckError(); + + if ( expandTemp ) + { + free( expandTemp ); + } +} + + +void CGLMTex::Lock( GLMTexLockParams *params, char** addressOut, int* yStrideOut, int *zStrideOut ) +{ + // locate appropriate slice in layout record + int sliceIndex = CalcSliceIndex( params->m_face, params->m_mip ); + + GLMTexLayoutSlice *slice = &m_layout->m_slices[sliceIndex]; + + // obtain offset + int sliceBaseOffset = slice->m_storageOffset; + + // cross check region req against slice bounds - figure out if it matches, exceeds, or is less than the whole slice. + char exceed = (params->m_region.xmin < 0) || (params->m_region.xmax > slice->m_xSize) || + (params->m_region.ymin < 0) || (params->m_region.ymax > slice->m_ySize) || + (params->m_region.zmin < 0) || (params->m_region.zmax > slice->m_zSize); + + char partial = (params->m_region.xmin > 0) || (params->m_region.xmax < slice->m_xSize) || + (params->m_region.ymin > 0) || (params->m_region.ymax < slice->m_ySize) || + (params->m_region.zmin > 0) || (params->m_region.zmax < slice->m_zSize); + + bool copyout = false; // set if a readback of the texture slice from GL is needed + + if (exceed) + { + // illegal rect, out of bounds + GLMStop(); + } + + // on return, these things need to be true + + // a - there needs to be storage allocated, which we will return an address within + // b - the region corresponding to the slice being locked, will have valid data there for the whole slice. + // c - the slice is marked as locked + // d - the params of the lock request have been saved in the lock table (in the context) + + // so step 1 is unambiguous. If there's no backing storage, make some. + if (!m_backing) + { + m_backing = (char *)malloc( m_layout->m_storageTotalSize ); + memset( m_backing, 0, m_layout->m_storageTotalSize ); + + // clear the kSliceStorageValid bit on all slices + for( int i=0; im_sliceCount; i++) + { + m_sliceFlags[i] &= ~kSliceStorageValid; + } + } + + // work on this slice now + + // storage is known to exist at this point, but we need to check if its contents are valid for this slice. + // this is tracked per-slice so we don't hoist all the texels back out of GL across all slices if caller only + // wanted to lock some of them. + + // (i.e. if we just alloced it, it's blank) + // if storage is invalid, but the texture itself is valid, hoist the texels back to the storage and mark it valid. + // if storage is invalid, and texture itself is also invalid, go ahead and mark storage as valid and fully dirty... to force teximage. + + // ???????????? we need to go over this more carefully re "slice valid" (it has been teximaged) vs "storage valid" (it has been copied out). + + unsigned char *sliceFlags = &m_sliceFlags[ sliceIndex ]; + + if (params->m_readback) + { + // caller is letting us know that it wants to readback the real texels. + *sliceFlags |= kSliceStorageValid; + *sliceFlags |= kSliceValid; + *sliceFlags &= ~(kSliceFullyDirty); + copyout = true; + } + else + { + // caller is pushing texels. + if (! (*sliceFlags & kSliceStorageValid) ) + { + // storage is invalid. check texture state + if ( *sliceFlags & kSliceValid ) + { + // kSliceValid set: the texture itself has a valid slice, but we don't have it in our backing copy, so copy it out. + copyout = true; + } + else + { + // kSliceValid not set: the texture does not have a valid slice to copy out - it hasn't been teximage'd yet. + // set the "full dirty" bit to make sure we teximage the whole thing on unlock. + *sliceFlags |= kSliceFullyDirty; + + // assert if they did not ask to lock the full slice size on this go-round + if (partial) + { + // choice here - + // 1 - stop cold, we don't know how to subimage yet. + // 2 - grin and bear it, mark whole slice dirty (ah, we already did... so, do nothing). + // choice 2: // GLMStop(); + } + } + + // one way or another, upon reaching here the slice storage is valid for read. + *sliceFlags |= kSliceStorageValid; + } + } + + + // when we arrive here, there is storage, and the content of the storage for this slice is valid + // (or zeroes if it's the first lock) + + // log the lock request in the context. + GLMTexLockDesc newdesc; + + newdesc.m_req = *params; + newdesc.m_active = true; + newdesc.m_sliceIndex = sliceIndex; + newdesc.m_sliceBaseOffset = m_layout->m_slices[sliceIndex].m_storageOffset; + + // to calculate the additional offset we need to look at the rect's min corner + // combined with the per-texel size and Y/Z stride + // also cross check it for 4x multiple if there is compression in play + + int offsetInSlice = 0; + int yStride = 0; + int zStride = 0; + + CalcTexelDataOffsetAndStrides( sliceIndex, params->m_region.xmin, params->m_region.ymin, params->m_region.zmin, &offsetInSlice, &yStride, &zStride ); + + // for compressed case... + // since there is presently no way to texsubimage a DXT when the rect does not cover the whole width, + // we will probably need to inflate the dirty rect in the recorded lock req so that the entire span is + // pushed across at unlock time. + + newdesc.m_sliceRegionOffset = offsetInSlice + newdesc.m_sliceBaseOffset; + + if (copyout) + { + // read the whole slice + // (odds are we'll never request anything but a whole slice to be read..) + ReadTexels( &newdesc, true ); + } // this would be a good place to fill with scrub value if in debug... + + *addressOut = m_backing + newdesc.m_sliceRegionOffset; + *yStrideOut = yStride; + *zStrideOut = zStride; + + m_ctx->m_texLocks.push_back( newdesc ); + + m_lockCount++; +} + +void CGLMTex::Unlock( GLMTexLockParams *params ) +{ + // look for an active lock request on this face and mip (doesn't necessarily matter which one, if more than one) + // and mark it inactive. + // --> if you can't find one, fail. first line of defense against mismatched locks/unlocks.. + + int i=0; + bool found = false; + while( !found && (im_texLocks.size()) ) + { + GLMTexLockDesc *desc = &m_ctx->m_texLocks[i]; + + // is lock at index 'i' targeted at the texture/face/mip in question? + if ( (desc->m_req.m_tex == this) && (desc->m_req.m_face == params->m_face) & (desc->m_req.m_mip == params->m_mip) && (desc->m_active) ) + { + // matched and active, so retire it + desc->m_active = false; + + // stop searching + found = true; + } + i++; + } + + if (!found) + { + GLMStop(); // bad news + } + + // found - so drop lock count + m_lockCount--; + + if (m_lockCount <0) + { + GLMStop(); // bad news + } + + if (m_lockCount==0) + { + // there should not be any active locks remaining on this texture. + + // motivation to defer all texel pushing til *all* open locks are closed out - + // if/when we back the texture with a PBO, we will need to unmap that PBO before teximaging from it; + // by waiting for all the locks to clear this gives us an unambiguous signal to act on. + + // scan through all the retired locks for this texture and push the texels for each one. + // after each one is dispatched, remove it from the pile. + + int j=0; + while( jm_texLocks.size() ) + { + GLMTexLockDesc *desc = &m_ctx->m_texLocks[j]; + + if ( desc->m_req.m_tex == this ) + { + // if it's active, something is wrong + if (desc->m_active) + { + GLMStop(); + } + + // write the texels + bool fullyDirty = false; + + fullyDirty |= ((m_sliceFlags[ desc->m_sliceIndex ] & kSliceFullyDirty) != 0); + + // this is not optimal and will result in full downloads on any dirty. + // we're papering over the fact that subimage isn't done yet. + // but this is safe if the slice of storage is all valid. + + // at some point we'll need to actually compare the lock box against the slice bounds. + + // fullyDirty |= (m_sliceFlags[ desc->m_sliceIndex ] & kSliceStorageValid); + + WriteTexels( desc, fullyDirty ); + + // logical place to trigger preloading + // only do it for an RT tex, if it is not yet attached to any FBO. + // also, only do it if the slice number is the last slice in the tex. + if ( desc->m_sliceIndex == (m_layout->m_sliceCount-1) ) + { + if ( !(m_layout->m_key.m_texFlags & kGLMTexRenderable) || (m_rtAttachCount==0) ) + { + m_ctx->PreloadTex( this ); + // printf("( slice %d of %d )", desc->m_sliceIndex, m_layout->m_sliceCount ); + } + } + + m_ctx->m_texLocks.erase( m_ctx->m_texLocks.begin() + j ); // remove from the pile, don't advance index + } + else + { + j++; // move on to next one + } + } + + // clear the locked and full-dirty flags for all slices + for( int slice=0; slice < m_layout->m_sliceCount; slice++) + { + m_sliceFlags[slice] &= ~( kSliceLocked | kSliceFullyDirty ); + } + } +} + + +void CGLMTex::ResetSRGB( bool srgb, bool noDataWrite ) +{ + // see if requested SRGB state differs from the known one + bool wasSRGB = (m_layout->m_key.m_texFlags & kGLMTexSRGB); + GLMTexLayout *oldLayout = m_layout; // need to m_ctx->m_texLayoutTable->DelLayoutRef on this one if we flip + + if (srgb != wasSRGB) + { + // we're going to need a new layout (though the storage size should be the same - check it) + GLMTexLayoutKey newKey = m_layout->m_key; + + newKey.m_texFlags &= (~kGLMTexSRGB); // turn off that bit + newKey.m_texFlags |= srgb ? kGLMTexSRGB : 0; // turn on that bit if it should be so + + // get new layout + GLMTexLayout *newLayout = m_ctx->m_texLayoutTable->NewLayoutRef( &newKey ); + + + // if SRGB requested, verify that the layout we just got can do it. + // if it can't, delete the new layout ref and bail. + if (srgb && (newLayout->m_format->m_glIntFormatSRGB == 0)) + { + Assert( !"Can't enable SRGB mode on this format" ); + m_ctx->m_texLayoutTable->DelLayoutRef( newLayout ); + return; + } + + // check sizes and fail if no match + if( newLayout->m_storageTotalSize != oldLayout->m_storageTotalSize ) + { + Assert( !"Bug: layout sizes don't match on SRGB change" ); + m_ctx->m_texLayoutTable->DelLayoutRef( newLayout ); + return; + } + + // commit to new layout + m_layout = newLayout; + + // check same size + Assert( m_layout->m_storageTotalSize == oldLayout->m_storageTotalSize ); + + // release old + m_ctx->m_texLayoutTable->DelLayoutRef( oldLayout ); + oldLayout = NULL; + + // force texel re-DL + + // note this messes with TMU 0 as side effect of WriteTexels + // so we save and restore the TMU 0 binding first + + // since we're likely to be called in dxabstract when it is syncing sampler state, we can't go trampling the bindings. + // a refinement would be to have each texture make a note of which TMU they're bound on, and just use that active TMU for DL instead of 0. + CGLMTex *tmu0save = m_ctx->m_samplers[0].m_drawTex; + + for( int face=0; face m_faceCount; face++) + { + for( int mip=0; mip m_mipCount; mip++) + { + // we're not really going to lock, we're just going to rewrite the orig data + GLMTexLockDesc desc; + + desc.m_req.m_tex = this; + desc.m_req.m_face = face; + desc.m_req.m_mip = mip; + + desc.m_sliceIndex = CalcSliceIndex( face, mip ); + + GLMTexLayoutSlice *slice = &m_layout->m_slices[ desc.m_sliceIndex ]; + + desc.m_req.m_region.xmin = desc.m_req.m_region.ymin = desc.m_req.m_region.zmin = 0; + desc.m_req.m_region.xmax = slice->m_xSize; + desc.m_req.m_region.ymax = slice->m_ySize; + desc.m_req.m_region.zmax = slice->m_zSize; + + desc.m_sliceBaseOffset = slice->m_storageOffset; // doesn't really matter... we're just pushing zeroes.. + desc.m_sliceRegionOffset = 0; + + this->WriteTexels( &desc, true, noDataWrite ); // write whole slice. and avoid pushing real bits if the caller requests (RT's) + } + } + + // put it back + m_ctx->BindTexToTMU( tmu0save, 0, true ); + } +} diff --git a/external/steamworks/glmgr/cglmtex.h b/external/steamworks/glmgr/cglmtex.h new file mode 100644 index 0000000..af50ac0 --- /dev/null +++ b/external/steamworks/glmgr/cglmtex.h @@ -0,0 +1,291 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ +// +// cglmtex.h +// GLMgr textures +// +//=============================================================================== + +#ifndef CGLMTEX_H +#define CGLMTEX_H + +#pragma once + +#ifdef OSX +#include "glmgrbasics.h" +#endif + +//=============================================================================== + +// forward declarations + +class GLMContext; +class GLMTester; +class CGLMTexLayoutTable; +class CGLMTex; +class CGLMFBO; + +struct IDirect3DSurface9; + +//=============================================================================== + +struct GLMTexFormatDesc +{ + const char *m_formatSummary; // for debug visibility + + D3DFORMAT m_d3dFormat; // what D3D knows it as; see public/bitmap/imageformat.h + + GLenum m_glIntFormat; // GL internal format + GLenum m_glIntFormatSRGB; // internal format if SRGB flavor + GLenum m_glDataFormat; // GL data format + GLenum m_glDataType; // GL data type + + int m_chunkSize; // 1 or 4 - 4 is used for compressed textures + int m_bytesPerSquareChunk; // how many bytes for the smallest quantum (m_chunkSize x m_chunkSize) + // this description lets us calculate size cleanly without conditional logic for compression +}; +const GLMTexFormatDesc *GetFormatDesc( D3DFORMAT format ); + +//=============================================================================== + +// utility function for generating slabs of texels. mostly for test. +typedef struct +{ + // in + D3DFORMAT m_format; + void *m_dest; // dest address + int m_chunkCount; // square chunk count (single texels or compressed blocks) + int m_byteCountLimit; // caller expectation of max number of bytes to write out + float r,g,b,a; // color desired + + // out + int m_bytesWritten; +} GLMGenTexelParams; + +// return true if successful +bool GLMGenTexels( GLMGenTexelParams *params ); + + +//=============================================================================== + +struct GLMTexLayoutSlice +{ + int m_xSize,m_ySize,m_zSize; //texel dimensions of this slice + int m_storageOffset; //where in the storage slab does this slice live + int m_storageSize; //how much storage does this slice occupy +}; + +enum EGLMTexFlags +{ + kGLMTexMipped = 0x01, + kGLMTexMippedAuto = 0x02, + kGLMTexRenderable = 0x04, + kGLMTexIsStencil = 0x08, + kGLMTexIsDepth = 0x10, + kGLMTexSRGB = 0x20, + kGLMTexMultisampled = 0x40, // has an RBO backing it. Cannot combine with Mipped, MippedAuto. One slice maximum, only targeting GL_TEXTURE_2D. + // actually not 100% positive on the mipmapping, the RBO itself can't be mipped, but the resulting texture could + // have mipmaps generated. +}; + +//=============================================================================== + +struct GLMTexLayoutKey +{ + // input values: held const, these are the hash key for the form map + GLenum m_texGLTarget; // flavor of texture: GL_TEXTURE_2D, GL_TEXTURE_3D, GLTEXTURE_CUBE_MAP + D3DFORMAT m_texFormat; // D3D texel format + unsigned long m_texFlags; // mipped, autogen mips, render target, ... ? + unsigned long m_texSamples; // zero for a plain tex, 2/4/6/8 for "MSAA tex" (RBO backed) + int m_xSize,m_ySize,m_zSize; // size of base mip +}; + +struct LessThan_GLMTexLayoutKey +{ + bool operator()(const GLMTexLayoutKey &a, const GLMTexLayoutKey &b) const + { + #define DO_LESS(fff) if (a.fff != b.fff) { return (a.fff< b.fff); } + + DO_LESS(m_texGLTarget); + DO_LESS(m_texFormat); + DO_LESS(m_texFlags); + DO_LESS(m_xSize); + DO_LESS(m_ySize) + DO_LESS(m_zSize); + + #undef DO_LESS + + return false; // they are equal + } +}; + +#define GLM_TEX_MAX_MIPS 14 +#define GLM_TEX_MAX_FACES 6 +#define GLM_TEX_MAX_SLICES (GLM_TEX_MAX_MIPS * GLM_TEX_MAX_FACES) + +struct GLMTexLayout +{ + char *m_layoutSummary; // for debug visibility + + // const inputs used for hashing + GLMTexLayoutKey m_key; + + // refcount + int m_refCount; + + // derived values: + GLMTexFormatDesc *m_format; // format specific info + int m_mipCount; // derived by starying at base size and working down towards 1x1 + int m_faceCount; // 1 for 2d/3d, 6 for cubemap + int m_sliceCount; // product of faces and mips + int m_storageTotalSize; // size of storage slab required + + // slice array + GLMTexLayoutSlice m_slices[0]; // dynamically allocated 2-d array [faces][mips] +}; + +typedef std::map< GLMTexLayoutKey, GLMTexLayout*, LessThan_GLMTexLayoutKey > GLMTexLayoutKeyMap; +class CGLMTexLayoutTable +{ +public: + CGLMTexLayoutTable(); + + GLMTexLayout *NewLayoutRef( GLMTexLayoutKey *key ); // pass in a pointer to layout key - receive ptr to completed layout + void DelLayoutRef( GLMTexLayout *layout ); // pass in pointer to completed layout. refcount is dropped. + + void DumpStats( void ); +protected: + GLMTexLayoutKeyMap m_layoutMap; +}; + +//=============================================================================== + +// a sampler specifies desired state for drawing on a given sampler index +// this is the combination of a texture choice and a set of sampler parameters +// see http://msdn.microsoft.com/en-us/library/bb172602(VS.85).aspx + + +struct GLMTexSamplingParams +{ + GLenum m_addressModes[3]; // S, T, R + GLfloat m_borderColor[4]; // R,G,B,A + + GLenum m_magFilter; + GLenum m_minFilter; + + GLfloat m_mipmapBias; + GLint m_minMipLevel; + GLint m_maxMipLevel; + GLint m_maxAniso; + GLenum m_compareMode; // only used for depth and stencil type textures + bool m_srgb; // srgb texture read... +}; + +struct GLMTexLockParams +{ + // input params which identify the slice of interest + CGLMTex *m_tex; + int m_face; + int m_mip; + + // identifies the region of the slice + GLMRegion m_region; + + // tells GLM to force re-read of the texels back from GL + // i.e. "I know I stepped on those texels with a draw or blit - the GLM copy is stale" + bool m_readback; +}; + +struct GLMTexLockDesc +{ + GLMTexLockParams m_req; // form of the lock request + + bool m_active; // set true at lock time. cleared at unlock time. + + int m_sliceIndex; // which slice in the layout + int m_sliceBaseOffset; // where is that in the texture data + int m_sliceRegionOffset; // offset to the start (lowest address corner) of the region requested +}; + +//=============================================================================== + +#define GLM_SAMPLER_COUNT 16 + +typedef unsigned short CTexBindMask; // 16 bits, who needs bitvec... + +enum EGLMTexSliceFlag +{ + kSliceValid = 0x01, // slice has been teximage'd in whole at least once - set to 0 initially + kSliceStorageValid = 0x02, // if backing store is available, this slice's data is a valid copy - set to 0 initially + kSliceLocked = 0x04, // are one or more locks outstanding on this slice + kSliceFullyDirty = 0x08, // does the slice need to be fully downloaded at unlock time (disregard dirty rects) +}; + +class CGLMTex +{ + +public: + + void Lock( GLMTexLockParams *params, char** addressOut, int* yStrideOut, int *zStrideOut ); + void Unlock( GLMTexLockParams *params ); + +protected: + friend class GLMContext; // only GLMContext can make CGLMTex objects + friend class GLMTester; + friend class CGLMFBO; + + friend struct IDirect3DDevice9; + friend struct IDirect3DBaseTexture9; + friend struct IDirect3DTexture9; + friend struct IDirect3DSurface9; + friend struct IDirect3DCubeTexture9; + friend struct IDirect3DVolumeTexture9; + + CGLMTex( GLMContext *ctx, GLMTexLayout *layout, GLMTexSamplingParams *sampling, const char *debugLabel = NULL ); + ~CGLMTex( ); + + int CalcSliceIndex( int face, int mip ); + void CalcTexelDataOffsetAndStrides( int sliceIndex, int x, int y, int z, int *offsetOut, int *yStrideOut, int *zStrideOut ); + + void ApplySamplingParams( GLMTexSamplingParams *params, bool noCheck=FALSE ); + + void ReadTexels( GLMTexLockDesc *desc, bool readWholeSlice=true ); + void WriteTexels( GLMTexLockDesc *desc, bool writeWholeSlice=true, bool noDataWrite=false ); + // last param lets us send NULL data ptr (only legal with uncompressed formats, beware) + // this helps out ResetSRGB. + + void ResetSRGB( bool srgb, bool noDataWrite ); + // re-specify texture format to match desired sRGB form + // noWrite means send NULL for texel source addresses instead of actual data - ideal for RT's + + GLMTexLayout *m_layout; // layout of texture (shared across all tex with same layout) + int m_minActiveMip;//index of lowest mip that has been written. used to drive setting of GL_TEXTURE_MAX_LEVEL. + int m_maxActiveMip;//index of highest mip that has been written. used to drive setting of GL_TEXTURE_MAX_LEVEL. + + GLMTexSamplingParams m_sampling; // mirror of sampling params currently embodied in the texture + // (consult this at draw time, in order to know if changes need to be made) + + GLMContext *m_ctx; // link back to parent context + + GLuint m_texName; // name of this texture in the context + bool m_texClientStorage; // was CS selecetd for texture + bool m_texPreloaded; // has it been kicked into VRAM with GLMContext::PreloadTex yet + + GLuint m_rboName; // name of MSAA RBO backing the tex if MSAA enabled (or zero) + bool m_rboDirty; // has RBO been drawn on - i.e. needs to be blitted back to texture if texture is going to be sampled from + + CTexBindMask m_bindPoints; // true for each place in the parent ctx where currently + // bound (indexed via EGLMTexCtxBindingIndex) + + int m_rtAttachCount; // how many RT's have this texture attached somewhere + + char *m_backing; // backing storage if available + + int m_lockCount; // lock reqs are stored in the GLMContext for tracking + + std::vector m_sliceFlags; + + char *m_debugLabel; // strdup() of debugLabel passed in, or NULL +}; + + +#endif diff --git a/external/steamworks/glmgr/dx9asmtogl2.cpp b/external/steamworks/glmgr/dx9asmtogl2.cpp new file mode 100644 index 0000000..b4eae05 --- /dev/null +++ b/external/steamworks/glmgr/dx9asmtogl2.cpp @@ -0,0 +1,3524 @@ +//------------------------------------------------------------------------------ +// DX9AsmToGL2.cpp +//------------------------------------------------------------------------------ + +#include "dxabstract.h" +#include "dx9asmtogl2.h" + +#ifdef OSX +// Debugger - 10.8 +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + + +void Error( const char *fmt, ... ) +{ +} + +#define DST_REGISTER 0 +#define SRC_REGISTER 1 + +// Tracking and naming sampler dimensions +#define SAMPLER_TYPE_2D 0 +#define SAMPLER_TYPE_CUBE 1 +#define SAMPLER_TYPE_3D 2 +#define SAMPLER_TYPE_UNUSED 3 + +// Flags to PrintUsageAndIndexToString. +#define SEMANTIC_OUTPUT 0x01 +#define SEMANTIC_INPUT 0x02 + +#define UNDECLARED_OUTPUT 0xFFFFFFFF + +#ifndef POSIX +#define Debugger() Assert(0) +#endif + +static const char *g_szVecZeros[] = { NULL, "0.0", "vec2( 0.0, 0.0 )", "vec3( 0.0, 0.0, 0.0 )", "vec4( 0.0, 0.0, 0.0, 0.0 )" }; +static const char *g_szVecOnes[] = { NULL, "1.0", "vec2( 1.0, 1.0 )", "vec3( 1.0, 1.0, 1.0 )", "vec4( 1.0, 1.0, 1.0, 1.0 )" }; +static const char *g_szDefaultSwizzle = "xyzw"; +static const char *g_szSamplerStrings[] = { "2D", "CUBE", "3D" }; + +static const char *g_pAtomicTempVarName = "atomic_temp_var"; +static const char *g_pTangentAttributeName = "g_tangent"; + +int __cdecl SortInts( const int *a, const int *b ) +{ + if ( *a < *b ) + return -1; + else if ( *a > *b ) + return 1; + else + return 0; +} + +void StripExtraTrailingZeros( char *pStr ) +{ + int len = (int)V_strlen( pStr ); + while ( len >= 2 && pStr[len-1] == '0' && pStr[len-2] != '.' ) + { + pStr[len-1] = 0; + --len; + } +} + +void PrintToBuf( CUtlBuffer &buf, const char *pFormat, ... ) +{ + va_list marker; + va_start( marker, pFormat ); + + char szTemp[1024]; + V_vsnprintf( szTemp, sizeof( szTemp ), pFormat, marker ); + va_end( marker ); + + strcat_s( (char*)buf.Base(), buf.Size(), szTemp ); +} + +void PrintToBuf( char *pOut, int nOutSize, const char *pFormat, ... ) +{ + (void)nOutSize; + + int nStrlen = V_strlen( pOut ); + pOut += nStrlen; + nOutSize -= nStrlen; + + va_list marker; + va_start( marker, pFormat ); + V_vsnprintf( pOut, nOutSize, pFormat, marker ); + va_end( marker ); +} + +// Return the number of letters following the dot. +// Returns 4 if there is no dot. +// (So "r0.xy" returns 2 and "r0" returns 4). +int GetNumWriteMaskEntries( const char *pParam ) +{ + const char *pDot = strchr( pParam, '.' ); + if ( pDot ) + return V_strlen( pDot + 1 ); + else + return 4; +} + +const char* GetSwizzleDot( const char *pParam ) +{ + const char *pDot = strrchr( pParam, '.' ); + + // The test against ')' here is for stuff like vec4( gl_Normal, 0.0 ) - we want to treat that as a whole param name. + if ( pDot && strrchr( pParam, ')' ) < pDot && strrchr( pParam, ']' ) < pDot ) + return pDot; + else + return NULL; +} + +int GetNumSwizzleComponents( const char *pParam ) +{ + // Special scalar output which won't accept a swizzle + if ( !V_stricmp( pParam, "gl_FogFragCoord" ) ) + return 1; + + // Special scalar output which won't accept a swizzle + if ( !V_stricmp( pParam, "gl_FragDepth" ) ) + return 1; + + // Special scalar output which won't accept a swizzle + if ( !V_stricmp( pParam, "a0" ) ) + return 1; + + const char *pDot = GetSwizzleDot( pParam ); + if ( pDot ) + return V_strlen( pDot + 1 ); + else + return 0; +} + +char GetSwizzleComponent( const char *pParam, int n ) +{ + Assert( n < 4 ); + + const char *pDot = GetSwizzleDot( pParam ); + if ( pDot ) + { + ++pDot; + int nComponents = (int)V_strlen( pDot ); + Assert( nComponents > 0 ); + + if ( n < nComponents ) + return pDot[n]; + else + return pDot[nComponents-1]; + } + + return g_szDefaultSwizzle[n]; +} + +// Replace the parameter name and leave the swizzle intact. +// So "somevar.xyz" becomes "othervar.xyz". +void ReplaceParamName( const char *pSrc, const char *pNewParamName, char *pOut, int nOutLen ) +{ + // Start with the new parameter name. + V_strncpy( pOut, pNewParamName, nOutLen ); + + // Now add the swizzle if necessary. + const char *pDot = GetSwizzleDot( pSrc ); + if ( pDot ) + { + strncat( pOut, pDot, nOutLen - strlen( pOut ) - 1 ); + } +} + +void GetParamNameWithoutSwizzle( const char *pParam, char *pOut, int nOutLen ) +{ + const char *pDot = GetSwizzleDot( pParam ); + + // The test against ')' here is for stuff like vec4( gl_Normal, 0.0 ) - we want to treat that as a whole param name. + if ( pDot ) + { + int nToCopy = std::min( nOutLen-1, pDot - pParam ); + memcpy( pOut, pParam, nToCopy ); + pOut[nToCopy] = 0; + } + else + { + V_strncpy( pOut, pParam, nOutLen ); + } +} + +bool DoParamNamesMatch( const char *pParam1, const char *pParam2 ) +{ + char szTemp[2][256]; + GetParamNameWithoutSwizzle( pParam1, szTemp[0], sizeof( szTemp[0] ) ); + GetParamNameWithoutSwizzle( pParam2, szTemp[1], sizeof( szTemp[1] ) ); + return ( V_stricmp( szTemp[0], szTemp[1] ) == 0 ); +} + + + +// Extract the n'th component of the swizzle mask. +// If n would exceed the length of the swizzle mask, then it looks up into "xyzw". +void WriteParamWithSingleMaskEntry( const char *pParam, int n, char *pOut, int nOutLen ) +{ + GetParamNameWithoutSwizzle( pParam, pOut, nOutLen ); + PrintToBuf( pOut, nOutLen, "." ); + PrintToBuf( pOut, nOutLen, "%c", GetSwizzleComponent( pParam, n ) ); +} + + +float uint32ToFloat( uint32 dw ) +{ + return *((float*)&dw); +} + +CUtlString EnsureNumSwizzleComponents( const char *pStr, int nComponents ) +{ + int nExisting = GetNumSwizzleComponents( pStr ); + if ( nExisting == nComponents ) + return pStr; + + char szReg[256]; + GetParamNameWithoutSwizzle( pStr, szReg, sizeof( szReg ) ); + if ( nComponents == 0 ) + return szReg; + + PrintToBuf( szReg, sizeof( szReg ), "." ); + if ( nExisting > nComponents ) + { + // DX ASM will sometimes have statements like "NRM r0.xyz, r1.yzww", where it just doesn't use the last part of r1. So we won't either. + for ( int i=0; i < nComponents; i++ ) + { + PrintToBuf( szReg, sizeof( szReg ), "%c", GetSwizzleComponent( pStr, i ) ); + } + } + else + { + if ( nExisting == 0 ) + { + // We've got something like r0 and need N more components, so add as much of "xyzw" is needed. + for ( int i=0; i < nComponents; i++ ) + PrintToBuf( szReg, sizeof( szReg ), "%c", g_szDefaultSwizzle[i] ); + } + else + { + // We've got something like r0.x and need N more components, so replicate the X so it looks like r0.xxx + V_strncpy( szReg, pStr, sizeof( szReg ) ); + char cLast = pStr[ V_strlen( pStr ) - 1 ]; + for ( int i=nExisting; i < nComponents; i++ ) + { + PrintToBuf( szReg, sizeof( szReg ), "%c", cLast ); + } + } + } + + return szReg; +} + +D3DToGL::D3DToGL() +{ +} + +uint32 D3DToGL::GetNextToken( void ) +{ + uint32 dwToken = *m_pdwNextToken; + m_pdwNextToken++; + return dwToken; +} + +void D3DToGL::SkipTokens( uint32 numToSkip ) +{ + m_pdwNextToken += numToSkip; +} + +uint32 D3DToGL::Opcode( uint32 dwToken ) +{ + return ( dwToken & D3DSI_OPCODE_MASK ); +} + +uint32 D3DToGL::OpcodeSpecificData (uint32 dwToken) +{ + return ( ( dwToken & D3DSP_OPCODESPECIFICCONTROL_MASK ) >> D3DSP_OPCODESPECIFICCONTROL_SHIFT ); +} + +uint32 D3DToGL::TextureType ( uint32 dwToken ) +{ + return ( dwToken & D3DSP_TEXTURETYPE_MASK ); // Note this one doesn't shift due to weird D3DSAMPLER_TEXTURE_TYPE enum +} + + + +// Print GLSL intrinsic corresponding to particular instruction +bool D3DToGL::OpenIntrinsic( uint32 inst, char* buff, int nBufLen, uint32 destDimension, uint32 nArgumentDimension ) +{ + // Some GLSL intrinsics need type conversion, which we do in this routine + // As a result, the caller must sometimes close both parentheses, not just one + bool bDoubleClose = false; + + if ( nArgumentDimension == 0 ) + { + nArgumentDimension = 4; + } + + switch ( inst ) + { + case D3DSIO_RSQ: + V_snprintf( buff, nBufLen, "inversesqrt( " ); + break; + case D3DSIO_DP3: + case D3DSIO_DP4: + if ( destDimension == 1 ) + { + V_snprintf( buff, nBufLen, "dot( " ); + } + else + { + V_snprintf( buff, nBufLen, "vec%d( dot( ", destDimension ); + bDoubleClose = true; + } + break; + case D3DSIO_MIN: + V_snprintf( buff, nBufLen, "min( " ); + break; + case D3DSIO_MAX: + V_snprintf( buff, nBufLen, "max( " ); + break; + case D3DSIO_SLT: + if ( nArgumentDimension == 1 ) + { + V_snprintf( buff, nBufLen, "float( " ); // lessThan doesn't have a scalar version + } + else + { + V_snprintf( buff, nBufLen, "vec%d( lessThan( ", nArgumentDimension ); + bDoubleClose = true; + } + break; + case D3DSIO_SGE: + if ( nArgumentDimension == 1 ) + { + V_snprintf( buff, nBufLen, "float( " ); // greaterThanEqual doesn't have a scalar version + } + else + { + V_snprintf( buff, nBufLen, "vec%d( greaterThanEqual( ", nArgumentDimension ); + bDoubleClose = true; + } + break; + case D3DSIO_EXP: + V_snprintf( buff, nBufLen, "exp( " ); // exp2 ? + break; + case D3DSIO_LOG: + V_snprintf( buff, nBufLen, "log( " ); // log2 ? + break; + case D3DSIO_LIT: + Assert(0); + V_snprintf( buff, nBufLen, "lit( " ); // gonna have to write this one + break; + case D3DSIO_DST: + Assert(0); + V_snprintf( buff, nBufLen, "dst( " ); // gonna have to write this one + break; + case D3DSIO_LRP: + Assert( !m_bVertexShader ); + V_snprintf( buff, nBufLen, "mix( " ); + break; + case D3DSIO_FRC: + V_snprintf( buff, nBufLen, "fract( " ); + break; + case D3DSIO_M4x4: + Assert(0); + V_snprintf( buff, nBufLen, "m4x4" ); + break; + case D3DSIO_M4x3: + case D3DSIO_M3x4: + case D3DSIO_M3x3: + case D3DSIO_M3x2: + case D3DSIO_CALL: + case D3DSIO_CALLNZ: + case D3DSIO_LOOP: + case D3DSIO_RET: + case D3DSIO_ENDLOOP: + case D3DSIO_LABEL: + case D3DSIO_DCL: + Assert(0); + break; + case D3DSIO_POW: + V_snprintf( buff, nBufLen, "pow( " ); + break; + case D3DSIO_CRS: + V_snprintf( buff, nBufLen, "cross( " ); + break; + case D3DSIO_SGN: + Assert(0); + V_snprintf( buff, nBufLen, "sign( " ); + break; + case D3DSIO_ABS: + V_snprintf( buff, nBufLen, "abs( " ); + break; + case D3DSIO_NRM: + Assert( 0 ); + V_snprintf( buff, nBufLen, "normalize( " ); + break; + case D3DSIO_SINCOS: + Assert( 0 ); + V_snprintf( buff, nBufLen, "sincos( " ); // gonna have to write this one + break; + case D3DSIO_REP: + case D3DSIO_ENDREP: + case D3DSIO_IF: + case D3DSIO_IFC: + case D3DSIO_ELSE: + case D3DSIO_ENDIF: + case D3DSIO_BREAK: + case D3DSIO_BREAKC: // TODO: these are the reason we even need GLSL...gotta make these work + Assert(0); + break; + case D3DSIO_DEFB: + case D3DSIO_DEFI: + Assert(0); + break; + case D3DSIO_TEXCOORD: + V_snprintf( buff, nBufLen, "texcoord" ); + break; + case D3DSIO_TEXKILL: + V_snprintf( buff, nBufLen, "kill( " ); // wrap the discard instruction? + break; + case D3DSIO_TEX: + Assert(0); + V_snprintf( buff, nBufLen, "TEX" ); // We shouldn't get here + break; + case D3DSIO_TEXBEM: + case D3DSIO_TEXBEML: + case D3DSIO_TEXREG2AR: + case D3DSIO_TEXREG2GB: + case D3DSIO_TEXM3x2PAD: + case D3DSIO_TEXM3x2TEX: + case D3DSIO_TEXM3x3PAD: + case D3DSIO_TEXM3x3TEX: + case D3DSIO_TEXM3x3SPEC: + case D3DSIO_TEXM3x3VSPEC: + Assert(0); + break; + case D3DSIO_EXPP: + V_snprintf( buff, nBufLen, "exp( " ); + break; + case D3DSIO_LOGP: + V_snprintf( buff, nBufLen, "log( " ); + break; + case D3DSIO_CND: + Assert(0); + break; + case D3DSIO_DEF: + Assert(0); + V_snprintf( buff, nBufLen, "DEF" ); + break; + case D3DSIO_TEXREG2RGB: + case D3DSIO_TEXDP3TEX: + case D3DSIO_TEXM3x2DEPTH: + case D3DSIO_TEXDP3: + case D3DSIO_TEXM3x3: + Assert(0); + break; + case D3DSIO_TEXDEPTH: + V_snprintf( buff, nBufLen, "texdepth" ); + break; + case D3DSIO_CMP: + Assert(0); + Assert( !m_bVertexShader ); + V_snprintf( buff, nBufLen, "CMP" ); + break; + case D3DSIO_BEM: + Assert(0); + break; + case D3DSIO_DP2ADD: + Assert(0); + break; + case D3DSIO_DSX: + case D3DSIO_DSY: + Assert(0); + break; + case D3DSIO_TEXLDD: + V_snprintf( buff, nBufLen, "texldd" ); + break; + case D3DSIO_SETP: + Assert(0); + break; + case D3DSIO_TEXLDL: + V_snprintf( buff, nBufLen, "texldl" ); + break; + case D3DSIO_BREAKP: + case D3DSIO_PHASE: + Assert(0); + break; + } + + return bDoubleClose; +} + + +const char* D3DToGL::GetGLSLOperatorString( uint32 inst ) +{ + if ( inst == D3DSIO_ADD ) + return "+"; + else if ( inst == D3DSIO_SUB ) + return "-"; + else if ( inst == D3DSIO_MUL ) + return "*"; + + Error( "GetGLSLOperatorString: unknown operator" ); + return "zzzz"; +} + + +// Print ASM opcode +void D3DToGL::PrintOpcode( uint32 inst, char* buff, int nBufLen ) +{ + switch ( inst ) + { + case D3DSIO_NOP: + V_snprintf( buff, nBufLen, "NOP" ); + Assert(0); + break; + case D3DSIO_MOV: + V_snprintf( buff, nBufLen, "MOV" ); + break; + case D3DSIO_ADD: + V_snprintf( buff, nBufLen, "ADD" ); + break; + case D3DSIO_SUB: + V_snprintf( buff, nBufLen, "SUB" ); + break; + case D3DSIO_MAD: + V_snprintf( buff, nBufLen, "MAD" ); + break; + case D3DSIO_MUL: + V_snprintf( buff, nBufLen, "MUL" ); + break; + case D3DSIO_RCP: + V_snprintf( buff, nBufLen, "RCP" ); + break; + case D3DSIO_RSQ: + V_snprintf( buff, nBufLen, "RSQ" ); + break; + case D3DSIO_DP3: + V_snprintf( buff, nBufLen, "DP3" ); + break; + case D3DSIO_DP4: + V_snprintf( buff, nBufLen, "DP4" ); + break; + case D3DSIO_MIN: + V_snprintf( buff, nBufLen, "MIN" ); + break; + case D3DSIO_MAX: + V_snprintf( buff, nBufLen, "MAX" ); + break; + case D3DSIO_SLT: + V_snprintf( buff, nBufLen, "SLT" ); + break; + case D3DSIO_SGE: + V_snprintf( buff, nBufLen, "SGE" ); + break; + case D3DSIO_EXP: + V_snprintf( buff, nBufLen, "EX2" ); + break; + case D3DSIO_LOG: + V_snprintf( buff, nBufLen, "LG2" ); + break; + case D3DSIO_LIT: + V_snprintf( buff, nBufLen, "LIT" ); + break; + case D3DSIO_DST: + V_snprintf( buff, nBufLen, "DST" ); + break; + case D3DSIO_LRP: + Assert( !m_bVertexShader ); + V_snprintf( buff, nBufLen, "LRP" ); + break; + case D3DSIO_FRC: + V_snprintf( buff, nBufLen, "FRC" ); + break; + case D3DSIO_M4x4: + V_snprintf( buff, nBufLen, "m4x4" ); + break; + case D3DSIO_M4x3: + case D3DSIO_M3x4: + case D3DSIO_M3x3: + case D3DSIO_M3x2: + case D3DSIO_CALL: + case D3DSIO_CALLNZ: + case D3DSIO_LOOP: + case D3DSIO_RET: + case D3DSIO_ENDLOOP: + case D3DSIO_LABEL: + Assert(0); + break; + case D3DSIO_DCL: + V_snprintf( buff, nBufLen, "DCL" ); + break; + case D3DSIO_POW: + V_snprintf( buff, nBufLen, "POW" ); + break; + case D3DSIO_CRS: + V_snprintf( buff, nBufLen, "XPD" ); + break; + case D3DSIO_SGN: + Assert(0); + V_snprintf( buff, nBufLen, "SGN" ); + break; + case D3DSIO_ABS: + V_snprintf( buff, nBufLen, "ABS" ); + break; + case D3DSIO_NRM: + Assert( 0 ); + V_snprintf( buff, nBufLen, "NRM" ); + break; + case D3DSIO_SINCOS: + Assert( !m_bVertexShader ); + V_snprintf( buff, nBufLen, "SCS" ); + break; + case D3DSIO_REP: + case D3DSIO_ENDREP: + case D3DSIO_IF: + case D3DSIO_IFC: + case D3DSIO_ELSE: + case D3DSIO_ENDIF: + case D3DSIO_BREAK: + case D3DSIO_BREAKC: + Assert(0); + break; + case D3DSIO_MOVA: + Assert( m_bVertexShader ); + V_snprintf( buff, nBufLen, "MOV" ); // We're always moving into a temp instead, so this is MOV instead of ARL + break; + case D3DSIO_DEFB: + case D3DSIO_DEFI: + Assert(0); + break; + case D3DSIO_TEXCOORD: + V_snprintf( buff, nBufLen, "texcoord" ); + break; + case D3DSIO_TEXKILL: + V_snprintf( buff, nBufLen, "KIL" ); + break; + case D3DSIO_TEX: + V_snprintf( buff, nBufLen, "TEX" ); + break; + case D3DSIO_TEXBEM: + case D3DSIO_TEXBEML: + case D3DSIO_TEXREG2AR: + case D3DSIO_TEXREG2GB: + case D3DSIO_TEXM3x2PAD: + case D3DSIO_TEXM3x2TEX: + case D3DSIO_TEXM3x3PAD: + case D3DSIO_TEXM3x3TEX: + case D3DSIO_TEXM3x3SPEC: + case D3DSIO_TEXM3x3VSPEC: + Assert(0); + break; + case D3DSIO_EXPP: + V_snprintf( buff, nBufLen, "EXP" ); + break; + case D3DSIO_LOGP: + V_snprintf( buff, nBufLen, "LOG" ); + break; + case D3DSIO_CND: + Assert(0); + break; + case D3DSIO_DEF: + V_snprintf( buff, nBufLen, "DEF" ); + break; + case D3DSIO_TEXREG2RGB: + case D3DSIO_TEXDP3TEX: + case D3DSIO_TEXM3x2DEPTH: + case D3DSIO_TEXDP3: + case D3DSIO_TEXM3x3: + Assert(0); + break; + case D3DSIO_TEXDEPTH: + V_snprintf( buff, nBufLen, "texdepth" ); + break; + case D3DSIO_CMP: + Assert( !m_bVertexShader ); + V_snprintf( buff, nBufLen, "CMP" ); + break; + case D3DSIO_BEM: + Assert(0); + break; + case D3DSIO_DP2ADD: + Assert(0); + break; + case D3DSIO_DSX: + case D3DSIO_DSY: + Assert(0); + break; + case D3DSIO_TEXLDD: + V_snprintf( buff, nBufLen, "texldd" ); + break; + case D3DSIO_SETP: + Assert(0); + break; + case D3DSIO_TEXLDL: + V_snprintf( buff, nBufLen, "texldl" ); + break; + case D3DSIO_BREAKP: + case D3DSIO_PHASE: + Assert(0); + break; + } +} + +CUtlString D3DToGL::GetUsageAndIndexString( uint32 dwToken, int fSemanticFlags ) +{ + char szTemp[1024]; + PrintUsageAndIndexToString( dwToken, szTemp, sizeof( szTemp ), fSemanticFlags ); + return szTemp; +} + +//------------------------------------------------------------------------------ +// Helper function which prints ASCII representation of usage-usageindex pair to string +// +// Strictly used by vertex shaders +// not used any more now that we have attribmap metadata +//------------------------------------------------------------------------------ +void D3DToGL::PrintUsageAndIndexToString( uint32 dwToken, char* strUsageUsageIndexName, int nBufLen, int fSemanticFlags ) +{ + uint32 dwUsage = ( dwToken & D3DSP_DCL_USAGE_MASK ); + uint32 dwUsageIndex = ( dwToken & D3DSP_DCL_USAGEINDEX_MASK ) >> D3DSP_DCL_USAGEINDEX_SHIFT; + + switch ( dwUsage ) + { + case D3DDECLUSAGE_POSITION: + if ( m_bGLSL ) + { + if ( m_bVertexShader ) + { + if ( fSemanticFlags & SEMANTIC_OUTPUT ) + V_snprintf( strUsageUsageIndexName, nBufLen, "vTempPos" ); // effectively gl_Position + else + V_snprintf( strUsageUsageIndexName, nBufLen, "gl_Vertex" ); + } + else + { + // .xy = position in viewport coordinates + // .z = depth + V_snprintf( strUsageUsageIndexName, nBufLen, "gl_FragCoord" ); + } + } + else + { + V_snprintf( strUsageUsageIndexName, nBufLen, "vertex.attrib[0]" ); //"vertex.position" ); // aka generic [0] + } + break; + case D3DDECLUSAGE_BLENDWEIGHT: + V_snprintf( strUsageUsageIndexName, nBufLen, "vertex.attrib[1]" ); // "vertex.attrib[12]" ); // or [1] + break; + case D3DDECLUSAGE_BLENDINDICES: + V_snprintf( strUsageUsageIndexName, nBufLen, "vertex.attrib[13]" ); // "vertex.attrib[13]" ); // or [ 7 ] + break; + case D3DDECLUSAGE_NORMAL: + V_snprintf( strUsageUsageIndexName, nBufLen, m_bGLSL ? "vec4( gl_Normal, 0.0 )" : "vertex.attrib[2]" ); + break; + case D3DDECLUSAGE_PSIZE: + Assert(0); + V_snprintf( strUsageUsageIndexName, nBufLen, "_psize" ); // no analog + break; + case D3DDECLUSAGE_TEXCOORD: + if ( m_bGLSL ) + { + // GLSL vs output and ps inputs reference gl_TexCoord[n], not gl_MultiTexCoord. + if ( !m_bVertexShader || (fSemanticFlags & SEMANTIC_OUTPUT) ) + V_snprintf( strUsageUsageIndexName, nBufLen, "gl_TexCoord[%d]", dwUsageIndex ); + else + V_snprintf( strUsageUsageIndexName, nBufLen, "gl_MultiTexCoord%d", dwUsageIndex ); + } + else + { + V_snprintf( strUsageUsageIndexName, nBufLen, "vertex.attrib[%d]", 8+dwUsageIndex ); // "vertex.texcoord[%d]", dwUsageIndex ); // aka [8] - [15] ? + } + break; + case D3DDECLUSAGE_TANGENT: + if ( m_bGLSL ) + { + NoteTangentInputUsed(); + V_strncpy( strUsageUsageIndexName, g_pTangentAttributeName, nBufLen ); + } + else + { + V_snprintf( strUsageUsageIndexName, nBufLen, "vertex.attrib[15]" ); // aka texc[7] + } + break; + case D3DDECLUSAGE_BINORMAL: + V_snprintf( strUsageUsageIndexName, nBufLen, "vertex.attrib[14]" ); // aka texc[6] + break; +// case D3DDECLUSAGE_TESSFACTOR: +// Assert(0); +// V_snprintf( strUsageUsageIndexName, nBufLen, "_position" ); // no analog +// break; +// case D3DDECLUSAGE_POSITIONT: +// Assert(0); +// V_snprintf( strUsageUsageIndexName, nBufLen, "_positiont" ); // no analog +// break; + case D3DDECLUSAGE_COLOR: + if ( m_bGLSL ) + { +// if ( fSemanticFlags & SEMANTIC_OUTPUT ) +// V_snprintf( strUsageUsageIndexName, nBufLen, dwUsageIndex != 0 ? "gl_BackColor" : "gl_FrontColor" ); +// else + V_snprintf( strUsageUsageIndexName, nBufLen, dwUsageIndex != 0 ? "gl_SecondaryColor" : "gl_Color" ); + } + else + { + V_snprintf( strUsageUsageIndexName, nBufLen, "vertex.attrib[%d]", 3+dwUsageIndex ); //dwUsageIndex ); // != 0 ? "vertex.color.secondary" : "vertex.color" ); // aka [3] / [4] (second) + } + break; + case D3DDECLUSAGE_FOG: + Assert( !m_bGLSL ); + V_snprintf( strUsageUsageIndexName, nBufLen, "vertex.attrib[5]" ); //"vertex.position" /* "_fog" */ ); //FIXME, evil // aka [5] / vertex.fogcoord + break; + case D3DDECLUSAGE_DEPTH: + Assert(0); + V_snprintf( strUsageUsageIndexName, nBufLen, "_depth" ); // no analog + break; + case D3DDECLUSAGE_SAMPLE: + Assert(0); + V_snprintf( strUsageUsageIndexName, nBufLen, "_sample" ); // no analog + break; + default: + Debugger(); + break; + } +} + +uint32 D3DToGL::GetRegType( uint32 dwRegToken ) +{ + return ( ( dwRegToken & D3DSP_REGTYPE_MASK2 ) >> D3DSP_REGTYPE_SHIFT2 ) | ( ( dwRegToken & D3DSP_REGTYPE_MASK ) >> D3DSP_REGTYPE_SHIFT ); +} + +void D3DToGL::PrintIndentation( char *pBuf, int nBufLen ) +{ + for( int i=0; i 5 && V_strcmp( &pRegister[nLen-5], ".xyzw" ) == 0 ) + pRegister[nLen-5] = 0; +} + + +// This returns 0 for x, 1 for y, 2 for z, and 3 for w. +int GetSwizzleComponentVectorIndex( char chMask ) +{ + if ( chMask == 'x' ) + return 0; + else if ( chMask == 'y' ) + return 1; + else if ( chMask == 'z' ) + return 2; + else if ( chMask == 'w' ) + return 3; + + Error( "GetSwizzleComponentVectorIndex( '%c' ) - invalid parameter.\n", chMask ); + return 0; +} + + +// GLSL needs the # of src masks to match the dest write mask. +// +// So this: +// r0.xy = r1 + r2; +// becomes: +// r0.xy = r1.xy + r2.xy; +// +// +// Also, and this is the trickier one: GLSL reads the source registers from their first component on +// whereas D3D reads them as referenced in the dest register mask! +// +// So this code in D3D: +// r0.yz = c0.x + c1.wxyz +// Really means: +// r0.y = c0.x + c1.x +// r0.z = c0.x + c1.y +// So we translate it to this in GLSL: +// r0.yz = c0.xx + c1.wx +// r0.yz = c0.xx + c1.xy +// +CUtlString D3DToGL::FixGLSLSwizzle( const char *pDestRegisterName, const char *pSrcRegisterName ) +{ + if ( !m_bGLSL ) + return pSrcRegisterName; + + int nSwizzlesInDest = GetNumSwizzleComponents( pDestRegisterName ); + if ( nSwizzlesInDest == 0 ) + nSwizzlesInDest = 4; + + char szFixedSrcRegister[128]; + GetParamNameWithoutSwizzle( pSrcRegisterName, szFixedSrcRegister, sizeof( szFixedSrcRegister ) ); + strncat( szFixedSrcRegister, ".", sizeof(szFixedSrcRegister) - strlen(szFixedSrcRegister) - 1 ); + for ( int i=0; i < nSwizzlesInDest; i++ ) + { + char chDestWriteMask = GetSwizzleComponent( pDestRegisterName, i ); + int nVectorIndex = GetSwizzleComponentVectorIndex( chDestWriteMask ); + + char ch[2]; + ch[0] = GetSwizzleComponent( pSrcRegisterName, nVectorIndex ); + ch[1] = 0; + strncat( szFixedSrcRegister, ch, sizeof(szFixedSrcRegister) - strlen(szFixedSrcRegister) - 1 ); + } + + SimplifyFourParamRegister( szFixedSrcRegister ); + return szFixedSrcRegister; +} + +// Weird encoding...bits are split apart in the dwToken +inline uint32 GetRegTypeFromToken( uint32 dwToken ) +{ + return ( ( dwToken & D3DSP_REGTYPE_MASK2 ) >> D3DSP_REGTYPE_SHIFT2 ) | ( ( dwToken & D3DSP_REGTYPE_MASK ) >> D3DSP_REGTYPE_SHIFT ); +} + +void D3DToGL::FlagIndirectRegister( uint32 dwToken, int *pARLDestReg ) +{ + if ( !pARLDestReg ) + return; + + switch ( dwToken & D3DVS_SWIZZLE_MASK & D3DVS_X_W ) + { + case D3DVS_X_X: + *pARLDestReg = ARL_DEST_X; + break; + case D3DVS_X_Y: + *pARLDestReg = ARL_DEST_Y; + break; + case D3DVS_X_Z: + *pARLDestReg = ARL_DEST_Z; + break; + case D3DVS_X_W: + *pARLDestReg = ARL_DEST_W; + break; + } +} + + +//------------------------------------------------------------------------------ +// PrintParameterToString() +// +// Helper function which prints ASCII representation of passed Parameter dwToken +// to string. Token defines parameter details. The dwSourceOrDest parameter says +// whether or not this is a source or destination register +//------------------------------------------------------------------------------ +void D3DToGL::PrintParameterToString ( uint32 dwToken, uint32 dwSourceOrDest, char *pRegisterName, int nBufLen, bool bForceScalarSource, int *pARLDestReg ) +{ + char buff[32]; + bool bAllowWriteMask = true; + bool bAllowSwizzle = true; + + uint32 dwRegNum = dwToken & D3DSP_REGNUM_MASK; + + uint32 dwRegType, dwSwizzle; + uint32 dwSrcModifier = D3DSPSM_NONE; + + // Clear string to zero length + V_snprintf( pRegisterName, nBufLen, "" ); + + dwRegType = GetRegTypeFromToken( dwToken ); + + // If this is a dest register + if ( dwSourceOrDest == DST_REGISTER ) + { + // Instruction modifiers + if ( dwToken & D3DSPDM_PARTIALPRECISION ) + { +// strcat_s( pRegisterName, nBufLen, "_pp" ); + } + + if ( dwToken & D3DSPDM_SATURATE && !m_bGLSL ) + { + strcat_s( pRegisterName, nBufLen, "_SAT" ); + } + + if ( dwToken & D3DSPDM_MSAMPCENTROID) + { +// strcat_s( pRegisterName, nBufLen, "_centroid" ); + } + + if ( !m_bGLSL ) + { + strcat_s( pRegisterName, nBufLen, " " ); + } + } + + // If this is a source register + if ( dwSourceOrDest == SRC_REGISTER ) + { + dwSrcModifier = dwToken & D3DSP_SRCMOD_MASK; + + // If there are any source modifiers, check to see if they're at + // least partially "prefix" and prepend appropriately + if ( dwSrcModifier != D3DSPSM_NONE ) + { + switch ( dwSrcModifier ) + { + // These four start with just minus... (some may result in "postfix" notation as well later on) + case D3DSPSM_NEG: // negate + strcat_s( pRegisterName, nBufLen, "-" ); + break; + case D3DSPSM_BIASNEG: // bias and negate + case D3DSPSM_SIGNNEG: // sign and negate + case D3DSPSM_X2NEG: // *2 and negate + Assert(0); + strcat_s( pRegisterName, nBufLen, "-" ); + break; + case D3DSPSM_COMP: // complement + Assert(0); + strcat_s( pRegisterName, nBufLen, "1-" ); + break; + case D3DSPSM_ABS: // abs() + if ( m_bGLSL ) + { + strcat_s( pRegisterName, nBufLen, "abs(" ); + } + else if ( !m_bGeneratingDebugText ) + { + Assert( false ); + } + break; + case D3DSPSM_ABSNEG: // -abs() + if ( m_bGLSL ) + { + strcat_s( pRegisterName, nBufLen, "-abs(" ); + } + else if ( !m_bGeneratingDebugText ) + { + Assert( false ); + } + break; + case D3DSPSM_NOT: // for predicate register: "!p0" + Assert(0); + strcat_s( pRegisterName, nBufLen, "!" ); + break; + } + } + } + + // Register name (from type and number) + switch ( dwRegType ) + { + case D3DSPR_TEMP: + V_snprintf( buff, sizeof( buff ), "r%d", dwRegNum ); + strcat_s( pRegisterName, nBufLen, buff ); + m_dwTempUsageMask |= 0x00000001 << dwRegNum; // Keep track of the use of this temp + break; + case D3DSPR_INPUT: + if ( !m_bVertexShader && ( dwSourceOrDest == SRC_REGISTER ) && m_bGLSL ) + { + V_snprintf( buff, sizeof( buff ), dwRegNum == 0 ? "gl_Color" : "gl_SecondaryColor" ); + strcat_s( pRegisterName, nBufLen, buff ); + } + else if ( m_bVertexShader || ( dwSourceOrDest == SRC_REGISTER ) || m_bGLSL ) + { + V_snprintf( buff, sizeof( buff ), "v%d", dwRegNum ); + strcat_s( pRegisterName, nBufLen, buff ); + } + else // asm pixel shader declaration syntax: + { + V_snprintf( buff, sizeof( buff ), dwRegNum == 0 ? "v0 = fragment.color" : "v1 = fragment.color.secondary" ); + strcat_s( pRegisterName, nBufLen, buff ); + bAllowWriteMask = false; + } + break; + case D3DSPR_CONST: + if ( m_bConstantRegisterDefined[dwRegNum] ) + { + char szConstantRegName[3]; + if ( m_bVertexShader ) + { + V_snprintf( szConstantRegName, 3, "vd" ); + } + else + { + V_snprintf( szConstantRegName, 3, "pd" ); + } + + // Put defined constants into their own namespace "d" + V_snprintf( buff, sizeof( buff ), "%s%d", szConstantRegName, dwRegNum ); + strcat_s( pRegisterName, nBufLen, buff ); + } + else if ( dwToken & D3DSHADER_ADDRESSMODE_MASK ) // Indirect addressing (e.g. skinning in a vertex shader) + { + char szConstantRegName[3]; + if ( m_bVertexShader ) + { + V_snprintf( szConstantRegName, 3, "vc" ); + } + else // No indirect addressing in PS, this shouldn't happen + { + Assert(0); + V_snprintf( szConstantRegName, 3, "pc" ); + } + + // Index into single pc/vc[] register array with relative addressing + FlagIndirectRegister( GetNextToken(), pARLDestReg ); + V_snprintf( buff, sizeof( buff ), m_bGLSL ? "%s[a0 + %d]" : "%s[a0.x + %d]", szConstantRegName, dwRegNum ); + strcat_s( pRegisterName, nBufLen, buff ); + bAllowSwizzle = false; + + m_nHighestRegister = DXABSTRACT_VS_PARAM_SLOTS - 1; + } + else // Direct addressing of constant array + { + char szConstantRegName[3]; + V_snprintf( szConstantRegName, 3, m_bVertexShader ? "vc" : "pc" ); + + // Index into single pc/vc[] register array with absolute addressing, same for GLSL and ASM + V_snprintf( buff, sizeof( buff ), "%s[%d]", szConstantRegName, dwRegNum ); + strcat_s( pRegisterName, nBufLen, buff ); + + //// NOGO if (dwRegNum != 255) // have seen cases where dwRegNum is 0xFF... need to figure out where those opcodes are coming from + { + m_nHighestRegister = std::max( m_nHighestRegister, dwRegNum ); + } + + Assert( m_nHighestRegister < DXABSTRACT_VS_PARAM_SLOTS ); + } + break; + case D3DSPR_ADDR: // aliases to D3DSPR_TEXTURE + if ( m_bVertexShader ) + { + if ( m_bGLSL ) + { + Assert( dwRegNum == 0 ); + + V_snprintf( buff, sizeof( buff ), "va_r" ); + } + else + { + V_snprintf( buff, sizeof( buff ), "VA_REG" ); // Move into our temp, rather than a0 + } + } + else // D3DSPR_TEXTURE in the pixel shader + { + // If dest reg, this is an iterator/varying declaration + if ( dwSourceOrDest == DST_REGISTER ) + { + if ( m_bGLSL ) + { + // Is this iterator centroid? + if ( m_nCentroidMask & ( 0x00000001 << dwRegNum ) ) + { + V_snprintf( buff, sizeof( buff ), "centroid varying vec4 oT%d", dwRegNum ); // centroid varying + } + else + { + V_snprintf( buff, sizeof( buff ), "varying vec4 oT%d", dwRegNum ); + } + } + else + { + V_snprintf( buff, sizeof( buff ), "t%d = fragment.texcoord[%d]", dwRegNum, dwRegNum ); + } + + bAllowWriteMask = false; + } + else // source register + { + if ( m_bGLSL ) + { + V_snprintf( buff, sizeof( buff ), "oT%d", dwRegNum ); + } + else + { + V_snprintf( buff, sizeof( buff ), "t%d", dwRegNum ); + } + } + } + strcat_s( pRegisterName, nBufLen, buff ); + break; + case D3DSPR_RASTOUT: // vertex shader oPos + Assert( m_bVertexShader ); + switch( dwRegNum ) + { + case D3DSRO_POSITION: + strcat_s( pRegisterName, nBufLen, m_bGLSL ? "vTempPos" : "oPos" ); // In GLSL, this ends up in gl_Position later on + m_bDeclareVSOPos = true; + break; + + case D3DSRO_FOG: + strcat_s( pRegisterName, nBufLen, m_bGLSL ? "gl_FogFragCoord" : "oFog" ); + m_bDeclareVSOFog = true; + break; + + default: + printf( "\nD3DSPR_RASTOUT: dwRegNum is %08x and token is %08x", dwRegNum, dwToken ); + Assert(0); + break; + } + break; + case D3DSPR_ATTROUT: + Assert( m_bVertexShader ); + if ( m_bGLSL ) + { + if ( dwRegNum == 0 ) + { + V_snprintf( buff, sizeof( buff ), "gl_FrontColor" ); + } + else if ( dwRegNum == 1 ) + { + V_snprintf( buff, sizeof( buff ), "gl_FrontSecondaryColor" ); + } + else + { + Error( "Invalid D3DSPR_ATTROUT index" ); + } + } + else + { + V_snprintf( buff, sizeof( buff ), "oD%d", dwRegNum ); + } + strcat_s( pRegisterName, nBufLen, buff ); + m_bOutputColorRegister[dwRegNum] = true; + break; + case D3DSPR_TEXCRDOUT: // aliases to D3DSPR_OUTPUT + if ( m_bVertexShader ) + { + if ( m_bGLSL ) + { + V_snprintf( buff, sizeof( buff ), "oT%d", dwRegNum ); + } + else + { + V_snprintf( buff, sizeof( buff ), "oT%d", dwRegNum ); + } + m_dwTexCoordOutMask |= ( 0x00000001 << dwRegNum ); + } + else + { + V_snprintf( buff, sizeof( buff ), "oC%d", dwRegNum ); + } + strcat_s( pRegisterName, nBufLen, buff ); + break; + case D3DSPR_CONSTINT: + Assert( m_bGLSL && m_bAllowStaticControlFlow ); + V_snprintf( buff, sizeof( buff ), "i%d", dwRegNum ); // Loops use these + strcat_s( pRegisterName, nBufLen, buff ); + m_dwConstIntUsageMask |= 0x00000001 << dwRegNum; // Keep track of the use of this integer constant + break; + case D3DSPR_COLOROUT: + if ( m_bGLSL ) + { + V_snprintf( buff, sizeof( buff ), "gl_FragData[%d]", dwRegNum ); + } + else + { + V_snprintf( buff, sizeof( buff ), "oC%d", dwRegNum ); + } + strcat_s( pRegisterName, nBufLen, buff ); + m_bOutputColorRegister[dwRegNum] = true; + break; + case D3DSPR_DEPTHOUT: + V_snprintf( buff, sizeof( buff ), m_bGLSL ? "gl_FragDepth" : "oDepth" ); + strcat_s( pRegisterName, nBufLen, buff ); + m_bOutputDepthRegister = true; + break; + case D3DSPR_SAMPLER: + V_snprintf( buff, sizeof( buff ), m_bGLSL ? "sampler%d" : "texture[%d]", dwRegNum ); + strcat_s( pRegisterName, nBufLen, buff ); + break; + case D3DSPR_CONST2: + Assert(0); + V_snprintf( buff, sizeof( buff ), "c%d", dwRegNum+2048); + strcat_s( pRegisterName, nBufLen, buff ); + break; + case D3DSPR_CONST3: + Assert(0); + V_snprintf( buff, sizeof( buff ), "c%d", dwRegNum+4096); + strcat_s( pRegisterName, nBufLen, buff ); + break; + case D3DSPR_CONST4: + Assert(0); + V_snprintf( buff, sizeof( buff ), "c%d", dwRegNum+6144); + strcat_s( pRegisterName, nBufLen, buff ); + break; + case D3DSPR_CONSTBOOL: + Assert( m_bGLSL && m_bAllowStaticControlFlow ); + V_snprintf( buff, sizeof( buff ), "b%d", dwRegNum ); + strcat_s( pRegisterName, nBufLen, buff ); + m_dwConstBoolUsageMask |= 0x00000001 << dwRegNum; // Keep track of the use of this bool constant + break; + case D3DSPR_LOOP: + Assert(0); + V_snprintf( buff, sizeof( buff ), "aL%d", dwRegNum ); + strcat_s( pRegisterName, nBufLen, buff ); + break; + case D3DSPR_TEMPFLOAT16: + Assert(0); + V_snprintf( buff, sizeof( buff ), "temp_float16_xxx%d", dwRegNum ); + strcat_s( pRegisterName, nBufLen, buff ); + break; + case D3DSPR_MISCTYPE: + if ( !m_bGLSL && !m_bGeneratingDebugText ) + { + Assert(0); + } + V_snprintf( buff, sizeof( buff ), "misc%d", dwRegNum ); + strcat_s( pRegisterName, nBufLen, buff ); + break; + case D3DSPR_LABEL: + Assert(0); + V_snprintf( buff, sizeof( buff ), "label%d", dwRegNum ); + strcat_s( pRegisterName, nBufLen, buff ); + break; + case D3DSPR_PREDICATE: + Assert(0); + V_snprintf( buff, sizeof( buff ), "p%d", dwRegNum ); + strcat_s( pRegisterName, nBufLen, buff ); + break; + } + + // If this is a dest register + if ( dwSourceOrDest == DST_REGISTER ) + { + // + // Write masks + // + // If some (not all, not none) of the write masks are set, we should include them + // + if ( bAllowWriteMask && ( !((dwToken & D3DSP_WRITEMASK_ALL) == D3DSP_WRITEMASK_ALL) || ((dwToken & D3DSP_WRITEMASK_ALL) == 0x00000000) ) ) + { + // Put the dot on there + strcat_s( pRegisterName, nBufLen, "." ); + + // Optionally put on the x, y, z or w + int nMasksWritten = 0; + (void)nMasksWritten; + + if ( dwToken & D3DSP_WRITEMASK_0 ) + { + strcat_s( pRegisterName, nBufLen, "x" ); + ++nMasksWritten; + } + if ( dwToken & D3DSP_WRITEMASK_1 ) + { + strcat_s( pRegisterName, nBufLen, "y" ); + ++nMasksWritten; + } + if ( dwToken & D3DSP_WRITEMASK_2 ) + { + strcat_s( pRegisterName, nBufLen, "z" ); + ++nMasksWritten; + } + if ( dwToken & D3DSP_WRITEMASK_3 ) + { + strcat_s( pRegisterName, nBufLen, "w" ); + ++nMasksWritten; + } + } + } + else // must be a source register + { + if ( bAllowSwizzle ) // relative addressing hard-codes the swizzle on a0.x + { + uint32 dwXSwizzle, dwYSwizzle, dwZSwizzle, dwWSwizzle; + + // Mask out the swizzle modifier + dwSwizzle = dwToken & D3DVS_SWIZZLE_MASK; + + // If there are any swizzles at all, tack on the appropriate notation + if ( dwSwizzle != D3DVS_NOSWIZZLE ) + { + // Separate out the two-bit codes for each component swizzle + dwXSwizzle = dwSwizzle & D3DVS_X_W; + dwYSwizzle = dwSwizzle & D3DVS_Y_W; + dwZSwizzle = dwSwizzle & D3DVS_Z_W; + dwWSwizzle = dwSwizzle & D3DVS_W_W; + + // Put on the dot + strcat_s( pRegisterName, nBufLen, "." ); + + // See where X comes from + switch ( dwXSwizzle ) + { + case D3DVS_X_X: + strcat_s( pRegisterName, nBufLen, "x" ); + break; + case D3DVS_X_Y: + strcat_s( pRegisterName, nBufLen, "y" ); + break; + case D3DVS_X_Z: + strcat_s( pRegisterName, nBufLen, "z" ); + break; + case D3DVS_X_W: + strcat_s( pRegisterName, nBufLen, "w" ); + break; + } + + if ( !bForceScalarSource ) + { + // If the source of the remaining components are aren't + // identical to the source of x, continue with swizzle + if ( ((dwXSwizzle >> D3DVS_SWIZZLE_SHIFT) != (dwYSwizzle >> (D3DVS_SWIZZLE_SHIFT + 2))) || // X and Y sources match? + ((dwXSwizzle >> D3DVS_SWIZZLE_SHIFT) != (dwZSwizzle >> (D3DVS_SWIZZLE_SHIFT + 4))) || // X and Z sources match? + ((dwXSwizzle >> D3DVS_SWIZZLE_SHIFT) != (dwWSwizzle >> (D3DVS_SWIZZLE_SHIFT + 6)))) // X and W sources match? + { + + // OpenGL seems to want us to have either 1 or 4 components in a swizzle, so just plow on through the rest + switch ( dwYSwizzle ) + { + case D3DVS_Y_X: + strcat_s( pRegisterName, nBufLen, "x" ); + break; + case D3DVS_Y_Y: + strcat_s( pRegisterName, nBufLen, "y" ); + break; + case D3DVS_Y_Z: + strcat_s( pRegisterName, nBufLen, "z" ); + break; + case D3DVS_Y_W: + strcat_s( pRegisterName, nBufLen, "w" ); + break; + } + + switch ( dwZSwizzle ) + { + case D3DVS_Z_X: + strcat_s( pRegisterName, nBufLen, "x" ); + break; + case D3DVS_Z_Y: + strcat_s( pRegisterName, nBufLen, "y" ); + break; + case D3DVS_Z_Z: + strcat_s( pRegisterName, nBufLen, "z" ); + break; + case D3DVS_Z_W: + strcat_s( pRegisterName, nBufLen, "w" ); + break; + } + + switch ( dwWSwizzle ) + { + case D3DVS_W_X: + strcat_s( pRegisterName, nBufLen, "x" ); + break; + case D3DVS_W_Y: + strcat_s( pRegisterName, nBufLen, "y" ); + break; + case D3DVS_W_Z: + strcat_s( pRegisterName, nBufLen, "z" ); + break; + case D3DVS_W_W: + strcat_s( pRegisterName, nBufLen, "w" ); + break; + } + + } + + } // end !bForceScalarSource + } + else // dwSwizzle == D3DVS_NOSWIZZLE + { + // If this is a MOVA / ARL, GL on the Mac requires us to tack the .x onto the source register + if ( bForceScalarSource ) + { + strcat_s( pRegisterName, nBufLen, ".x" ); + } + } + } // bAllowSwizzle + + // If there are any source modifiers, check to see if they're at + // least partially "postfix" and tack them on as appropriate + if ( dwSrcModifier != D3DSPSM_NONE ) + { + switch ( dwSrcModifier ) + { + case D3DSPSM_BIAS: // bias + case D3DSPSM_BIASNEG: // bias and negate + Assert(0); + strcat_s( pRegisterName, nBufLen, "_bx2" ); + break; + case D3DSPSM_SIGN: // sign + case D3DSPSM_SIGNNEG: // sign and negate + Assert(0); + strcat_s( pRegisterName, nBufLen, "_sgn" ); + break; + case D3DSPSM_X2: // *2 + case D3DSPSM_X2NEG: // *2 and negate + Assert(0); + strcat_s( pRegisterName, nBufLen, "_x2" ); + break; + case D3DSPSM_ABS: // abs() + case D3DSPSM_ABSNEG: // -abs() + if ( m_bGLSL ) + { + strcat_s( pRegisterName, nBufLen, ")" ); + } + break; + case D3DSPSM_DZ: // divide through by z component + Assert(0); + strcat_s( pRegisterName, nBufLen, "_dz" ); + break; + case D3DSPSM_DW: // divide through by w component + Assert(0); + strcat_s( pRegisterName, nBufLen, "_dw" ); + break; + } + } // end postfix modifiers (really only ps.1.x) + } +} + +void D3DToGL::RecordInputAndOutputPositions() +{ + // Remember where we are in the token stream. + m_pRecordedInputTokenStart = m_pdwNextToken; + + // Remember where our outputs are. + m_nRecordedParamCodeStrlen = V_strlen( (char*)m_pBufParamCode->Base() ); + m_nRecordedALUCodeStrlen = V_strlen( (char*)m_pBufALUCode->Base() ); + m_nRecordedAttribCodeStrlen = V_strlen( (char*)m_pBufAttribCode->Base() ); +} +void D3DToGL::AddTokenHexCodeToBuffer( char *pBuffer, int nSize, int nLastStrlen ) +{ + int nCurStrlen = V_strlen( pBuffer ); + if ( nCurStrlen == nLastStrlen ) + return; + + // Build a string with all the hex codes of the tokens since last time. + char szHex[512]; + szHex[0] = '\n'; + V_snprintf( &szHex[1], sizeof( szHex )-1, HEXCODE_HEADER ); + int nTokens = std::min( 10, m_pdwNextToken - m_pRecordedInputTokenStart ); + for ( int i=0; i < nTokens; i++ ) + { + char szTemp[32]; + V_snprintf( szTemp, sizeof( szTemp ), "0x%x ", m_pRecordedInputTokenStart[i] ); + strncat( szHex, szTemp, sizeof(szHex) - strlen(szHex) - 1 ); + } + strncat( szHex, "\n", sizeof(szHex) - strlen(szHex) - 1 ); + + // Insert the hex codes into the string. + int nBytesToInsert = V_strlen( szHex ); + if ( nCurStrlen + nBytesToInsert + 1 >= nSize ) + Error( "Buffer overflow writing token hex codes" ); + + if ( m_bPutHexCodesAfterLines ) + { + // Put it at the end of the last line. + if ( pBuffer[nCurStrlen-1] == '\n' ) + pBuffer[nCurStrlen-1] = 0; + + strncat( pBuffer, &szHex[1], nSize - strlen( pBuffer ) - 1 ); + } + else + { + memmove( pBuffer + nLastStrlen + nBytesToInsert, pBuffer + nLastStrlen, nCurStrlen - nLastStrlen + 1 ); + memcpy( pBuffer + nLastStrlen, szHex, nBytesToInsert ); + } +} + +void D3DToGL::AddTokenHexCode() +{ + if ( m_pdwNextToken > m_pRecordedInputTokenStart ) + { + AddTokenHexCodeToBuffer( (char*)m_pBufParamCode->Base(), m_pBufParamCode->Size(), m_nRecordedParamCodeStrlen ); + AddTokenHexCodeToBuffer( (char*)m_pBufALUCode->Base(), m_pBufALUCode->Size(), m_nRecordedALUCodeStrlen ); + AddTokenHexCodeToBuffer( (char*)m_pBufAttribCode->Base(), m_pBufAttribCode->Size(), m_nRecordedAttribCodeStrlen ); + } +} + +uint32 D3DToGL::MaintainAttributeMap( uint32 dwToken, uint32 dwRegToken ) +{ + // Check that this reg index has not been used before - if it has, let Houston know + uint dwRegIndex = dwRegToken & D3DSP_REGNUM_MASK; + if ( m_dwAttribMap[ dwRegIndex ] == 0xFFFFFFFF ) + { + // log it + // semantic/usage in the higher nibble + // usage index in the low nibble + + uint usage = dwToken & D3DSP_DCL_USAGE_MASK; + uint usageindex = ( dwToken & D3DSP_DCL_USAGEINDEX_MASK ) >> D3DSP_DCL_USAGEINDEX_SHIFT; + + m_dwAttribMap[ dwRegIndex ] = ( usage << 4 ) | usageindex; + + // avoid writing 0xBB since runtime code uses that for an 'unused' marker + if ( m_dwAttribMap[ dwRegIndex ] == 0xBB ) + { + Debugger(); + } + } + else + { + //not OK + Debugger(); + } + + return dwRegIndex; +} + +void D3DToGL::Handle_DCL() +{ + uint32 dwToken = GetNextToken(); // What kind of dcl is this... + uint32 dwRegToken = GetNextToken(); // Look ahead to register token + + if ( m_bVertexShader ) + { + // If this is an output, remember the index (what the ASM code calls o0, o1, o2..) and the semantic. + // When GetParameterString( DST_REGISTER ) hits this one, we'll return "oN". + // At the end of the main() function, we'll insert a bunch of statements like "gl_Color = o2" based on what we remembered here. + if ( m_bGLSL ) + { + if ( m_dwMajorVersion >= 3 && GetRegTypeFromToken( dwRegToken ) == D3DSPR_OUTPUT ) + { + uint32 dwRegNum = dwRegToken & D3DSP_REGNUM_MASK; + + if ( dwRegNum >= MAX_DECLARED_OUTPUTS ) + Error( "Output register number (%d) too high (only %d supported).", dwRegNum, MAX_DECLARED_OUTPUTS ); + + if ( m_DeclaredOutputs[dwRegNum] != UNDECLARED_OUTPUT ) + Error( "Output dcl_ hit for register #%d more than once!", dwRegNum ); + + Assert( dwToken != UNDECLARED_OUTPUT ); + m_DeclaredOutputs[dwRegNum] = dwToken; + + if ( m_bAddHexCodeComments ) + { + CUtlString sParam2 = GetUsageAndIndexString( dwToken, SEMANTIC_OUTPUT ); + PrintToBuf( *m_pBufHeaderCode, "// [GL remembering that o%d maps to %s]\n", dwRegNum, sParam2.String() ); + } + + PrintToBuf( *m_pBufHeaderCode, "varying vec4 o%d = vec4( 0.0, 0.0, 0.0, 0.0 );\n", dwRegNum ); + } + else + { + CUtlString sParam1 = GetParameterString( dwRegToken, DST_REGISTER, false, NULL ); + CUtlString sParam2 = GetUsageAndIndexString( dwToken, SEMANTIC_INPUT ); + + sParam2 = FixGLSLSwizzle( sParam1, sParam2 ); + PrintToBuf( *m_pBufHeaderCode, "attribute vec4 %s; // ", sParam1.String() ); + + MaintainAttributeMap( dwToken, dwRegToken ); + + char temp[128]; + // regnum goes straight into the vertex.attrib[n] index + sprintf( temp, "%08x %08x\n", dwToken, dwRegToken ); + StrcatToHeaderCode( temp ); + } + } + else // ARB_vertex_program ASM + { + StrcatToAttribCode( "ATTRIB" ); + char buff[64]; + PrintParameterToString( dwRegToken, DST_REGISTER, buff, sizeof( buff ), false, NULL ); + StrcatToAttribCode( buff ); + StrcatToAttribCode( " = " ); + + uint regIndex = MaintainAttributeMap( dwToken, dwRegToken ); + + char temp[128]; + // regnum goes straight into the vertex.attrib[n] index + sprintf( temp, "vertex.attrib[%d]; # %08x %08x\n", regIndex, dwToken, dwRegToken ); + StrcatToAttribCode( temp ); + + // ASM +// CUtlString sParam1 = GetParameterString( dwRegToken, DST_REGISTER ); +// CUtlString sParam2 = GetUsageAndIndexString( dwToken, SEMANTIC_INPUT ); +// PrintToBuf( m_pAttribCode, m_nAttribCodeBufSize, "ATTRIB%s = %s;\n", sParam1.String(), sParam2.String() ); + } + } + else // Pixel shader + { + // If the register is a sampler, the dcl has a dimension decorator that we have to save for subsequent TEX instructions + uint32 nRegType = GetRegType( dwRegToken ); + if ( nRegType == D3DSPR_SAMPLER ) + { + int nRegNum = dwRegToken & D3DSP_REGNUM_MASK; + switch ( TextureType( dwToken ) ) + { + default: + case D3DSTT_UNKNOWN: + case D3DSTT_2D: + m_dwSamplerTypes[nRegNum] = SAMPLER_TYPE_2D; + break; + case D3DSTT_CUBE: + m_dwSamplerTypes[nRegNum] = SAMPLER_TYPE_CUBE; + break; + case D3DSTT_VOLUME: + m_dwSamplerTypes[nRegNum] = SAMPLER_TYPE_3D; + break; + } + + // Track sampler declarations + m_dwSamplerUsageMask |= 1 << nRegNum; + } + else // Not a sampler, we're going to generate vaying declaration code + { + if ( m_bGLSL ) + { + // In pixel shaders we only declare texture coordinate varyings since they may be using centroid + if ( (!m_bVertexShader) && ( GetRegType( dwRegToken ) == D3DSPR_TEXTURE ) ) + { + char buff[256]; + PrintParameterToString( dwRegToken, DST_REGISTER, buff, sizeof( buff ), false, NULL ); + PrintToBuf( *m_pBufHeaderCode, "%s;\n",buff ); + } + } + else // asm + { + char buff[256]; + PrintParameterToString( dwRegToken, DST_REGISTER, buff, sizeof( buff ), false, NULL ); + PrintToBuf( *m_pBufAttribCode, "ATTRIB%s;\n", buff ); + } + } + } +} + + +void D3DToGL::Handle_DEF() +{ + // + // JasonM TODO: catch D3D's sincos-specific D3DSINCOSCONST1 and D3DSINCOSCONST2 constants and filter them out here + // + + // Which register is being defined + uint32 dwToken = GetNextToken(); + + // Note that this constant was explicitly defined + m_bConstantRegisterDefined[dwToken & D3DSP_REGNUM_MASK] = true; + CUtlString sParamName = GetParameterString( dwToken, DST_REGISTER, false, NULL ); + + const char float_fmt[] = "%.12f"; + const char float_fmt_commaspace[] = "%.12f, "; // %g causes GLSL compile problems around consts like "1e+2.0" - try %f + + if ( m_bGLSL ) + { + PrintToBuf( *m_pBufParamCode, "vec4 %s = vec4( ", sParamName.String() ); + + // Run through the 4 floats + for ( int i=0; i < 4; i++ ) + { + float fConst = uint32ToFloat( GetNextToken() ); + + // It must have a decimal point. + char szTemp[256]; + V_snprintf( szTemp, sizeof( szTemp ), float_fmt, fConst ); + StripExtraTrailingZeros( szTemp ); // Turn 1.00000 into 1.0 + + if ( !strchr( szTemp, '.' ) ) + { + strncat( szTemp, ".0", sizeof(szTemp) - strlen(szTemp) - 1 ); + } + + PrintToBuf( *m_pBufParamCode, i != 3 ? "%s, " : "%s", szTemp ); // end with comma-space + } + + PrintToBuf( *m_pBufParamCode, " );\n" ); + } + else + { + PrintToBuf( *m_pBufParamCode, "PARAM%s = { ", sParamName.String() ); + + // Run through the 4 floats + for ( int i=0; i < 4; i++ ) + { + float fConst = uint32ToFloat( GetNextToken() ); + PrintToBuf( *m_pBufParamCode, i != 3 ? float_fmt_commaspace : float_fmt, fConst ); // end with comma-space + } + + PrintToBuf( *m_pBufParamCode, " };\n" ); + } +} + +void D3DToGL::Handle_MAD( uint32 nInstruction ) +{ + uint32 nDestToken = GetNextToken(); + CUtlString sParam1 = GetParameterString( nDestToken, DST_REGISTER, false, NULL ); + int nARLComp0 = ARL_DEST_NONE; + CUtlString sParam2 = GetParameterString( GetNextToken(), SRC_REGISTER, false, &nARLComp0 ); + int nARLComp1 = ARL_DEST_NONE; + CUtlString sParam3 = GetParameterString( GetNextToken(), SRC_REGISTER, false, &nARLComp1 ); + int nARLComp2 = ARL_DEST_NONE; + CUtlString sParam4 = GetParameterString( GetNextToken(), SRC_REGISTER, false, &nARLComp2 ); + + // This optionally inserts a move from our dummy address register to the .x component of the real one + InsertMoveFromAddressRegister( m_pBufALUCode, nARLComp0, nARLComp1, nARLComp2 ); + + if ( m_bGLSL ) + { + sParam2 = FixGLSLSwizzle( sParam1, sParam2 ); + sParam3 = FixGLSLSwizzle( sParam1, sParam3 ); + sParam4 = FixGLSLSwizzle( sParam1, sParam4 ); + PrintToBuf( *m_pBufALUCode, "%s = %s * %s + %s;\n", sParam1.String(), sParam2.String(), sParam3.String(), sParam4.String() ); + + // If the _SAT instruction modifier is used, then do a saturate here. + if ( nDestToken & D3DSPDM_SATURATE ) + { + int nComponents = GetNumSwizzleComponents( sParam1.String() ); + if ( nComponents == 0 ) + nComponents = 4; + + PrintToBuf( *m_pBufALUCode, "%s = clamp( %s, %s, %s );\n", sParam1.String(), sParam1.String(), g_szVecZeros[nComponents], g_szVecOnes[nComponents] ); + } + } + else + { + char buff[256]; + PrintOpcode( nInstruction, buff, sizeof( buff ) ); + PrintToBuf( *m_pBufALUCode, "%s%s, %s, %s, %s;\n", buff, sParam1.String(), sParam2.String(), sParam3.String(), sParam4.String() ); + + if ( nDestToken & D3DSPDM_SATURATE ) + { + // Need to saturate asm! + Assert(0); + } + } +} + + +void D3DToGL::Handle_DP2ADD() +{ + char pDestReg[16], pSrc0Reg[16], pSrc1Reg[16], pSrc2Reg[16]; + uint32 nDestToken = GetNextToken(); + PrintParameterToString( nDestToken, DST_REGISTER, pDestReg, sizeof( pDestReg ), false, NULL ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, pSrc0Reg, sizeof( pSrc0Reg ), false, NULL ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, pSrc1Reg, sizeof( pSrc1Reg ), false, NULL ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, pSrc2Reg, sizeof( pSrc2Reg ), false, NULL ); + + if ( m_bGLSL ) + { + // We should only be assigning to a single component of the dest. + Assert( GetNumSwizzleComponents( pDestReg ) == 1 ); + Assert( GetNumSwizzleComponents( pSrc2Reg ) == 1 ); + + // This is a 2D dot product, so we only want two entries from the middle components. + CUtlString sArg0 = EnsureNumSwizzleComponents( pSrc0Reg, 2 ); + CUtlString sArg1 = EnsureNumSwizzleComponents( pSrc1Reg, 2 ); + + PrintToBuf( *m_pBufALUCode, "%s = dot( %s, %s ) + %s;\n", pDestReg, sArg0.String(), sArg1.String(), pSrc2Reg ); + + // If the _SAT instruction modifier is used, then do a saturate here. + if ( nDestToken & D3DSPDM_SATURATE ) + { + int nComponents = GetNumSwizzleComponents( pDestReg ); + if ( nComponents == 0 ) + nComponents = 4; + + PrintToBuf( *m_pBufALUCode, "%s = clamp( %s, %s, %s );\n", pDestReg, pDestReg, g_szVecZeros[nComponents], g_szVecOnes[nComponents] ); + } + } + else + { + m_bNeedsD2AddTemp = true; + + PrintToBuf( *m_pBufALUCode, "MOV DP2A0, %s;\n", pSrc0Reg ); // MOV DP2A0, src0; + PrintToBuf( *m_pBufALUCode, "MOV DP2A0.z, 1;\n" ); // MOV DP2A0.z, 1; + + PrintToBuf( *m_pBufALUCode, "MOV DP2A1, %s;\n", pSrc1Reg ); // MOV DP2A1, src1; + PrintToBuf( *m_pBufALUCode, "MOV DP2A1.z, %s;\n", pSrc2Reg ); // MOV DP2A1.z, src2; + + PrintToBuf( *m_pBufALUCode, "DP3%s, DP2A0, DP2A1;\n", pDestReg ); // DP3 dest, DP2A0, DP2A1; + + if ( nDestToken & D3DSPDM_SATURATE ) + { + // Need to saturate asm! + Assert(0); + } + } +} + + +void D3DToGL::Handle_SINCOS() +{ + char pDestReg[16], pSrc0Reg[16]; + PrintParameterToString( GetNextToken(), DST_REGISTER, pDestReg, sizeof( pDestReg ), false, NULL ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, pSrc0Reg, sizeof( pSrc0Reg ), true, NULL ); + m_bNeedsSinCosDeclarations = true; + + if ( m_bGLSL ) + { + CUtlString sDest( pDestReg ); + CUtlString sArg0 = EnsureNumSwizzleComponents( pSrc0Reg, 1 );// Ensure input is scalar + CUtlString sResult( "vSinCosTmp.xy" ); // Always going to populate this + sResult = FixGLSLSwizzle( sDest, sResult ); // Make sure we match the desired output reg + + PrintToBuf( *m_pBufALUCode, "vSinCosTmp.z = %s * %s;\n", sArg0.String(), sArg0.String() ); + + PrintToBuf( *m_pBufALUCode, "vSinCosTmp.xy = vSinCosTmp.zz * scA.xy + scA.wz;\n" ); + PrintToBuf( *m_pBufALUCode, "vSinCosTmp.xy = vSinCosTmp.xy * vSinCosTmp.zz + scB.xy;\n" ); + PrintToBuf( *m_pBufALUCode, "vSinCosTmp.xy = vSinCosTmp.xy * vSinCosTmp.zz + scB.wz;\n" ); + + PrintToBuf( *m_pBufALUCode, "vSinCosTmp.x = vSinCosTmp.x * %s;\n", sArg0.String() ); + + PrintToBuf( *m_pBufALUCode, "vSinCosTmp.xy = vSinCosTmp.xy * vSinCosTmp.xx;\n" ); + PrintToBuf( *m_pBufALUCode, "vSinCosTmp.xy = vSinCosTmp.xy + vSinCosTmp.xy;\n" ); + PrintToBuf( *m_pBufALUCode, "vSinCosTmp.x = -vSinCosTmp.x + scB.z;\n" ); + + PrintToBuf( *m_pBufALUCode, "%s = %s;\n", sDest.String(), sResult.String() ); + } + else + { + // This is the code sequence recommended to IHVs by Microsoft in the DirectX 9 DDK: + // + // http://msdn.microsoft.com/en-us/library/ms800337.aspx + // + // MUL SC_TEMP.z, src, src; + // MAD SC_TEMP.xy, SC_TEMP.z, scA, scA.wzyx; + // MAD SC_TEMP.xy, SC_TEMP, SC_TEMP.z, scB; + // MAD SC_TEMP.xy, SC_TEMP, SC_TEMP.z, scB.wzyx; + // MUL SC_TEMP.x, SC_TEMP.x, src; + // MUL SC_TEMP.xy, SC_TEMP, SC_TEMP.x; + // ADD SC_TEMP.xy, SC_TEMP, SC_TEMP; + // ADD SC_TEMP.x, -SC_TEMP.x, scB.z; + + StrcatToALUCode( "MUL SC_TEMP.z, " ); // MUL SC_TEMP.z, src, src; + StrcatToALUCode( pSrc0Reg ); + StrcatToALUCode( ", " ); + StrcatToALUCode( pSrc0Reg ); + StrcatToALUCode( ";\n" ); + + StrcatToALUCode( "MAD SC_TEMP.xy, SC_TEMP.z, scA, scA.wzyx;\n" ); + StrcatToALUCode( "MAD SC_TEMP.xy, SC_TEMP, SC_TEMP.z, scB;\n" ); + StrcatToALUCode( "MAD SC_TEMP.xy, SC_TEMP, SC_TEMP.z, scB.wzyx;\n" ); + + StrcatToALUCode( "MUL SC_TEMP.x, SC_TEMP.x, " ); + StrcatToALUCode( pSrc0Reg ); + StrcatToALUCode( ";\n" ); + StrcatToALUCode( "MUL SC_TEMP.xy, SC_TEMP, SC_TEMP.x;\n" ); + StrcatToALUCode( "ADD SC_TEMP.xy, SC_TEMP, SC_TEMP;\n" ); + StrcatToALUCode( "ADD SC_TEMP.x, -SC_TEMP.x, scB.z;\n" ); + + StrcatToALUCode( "MOV" ); + StrcatToALUCode( pDestReg ); + StrcatToALUCode( ", SC_TEMP;\n" ); + } + + // Eat two more tokens since D3D defines Taylor series constants that we won't need + SkipTokens( 2 ); +} + + +void D3DToGL::Handle_LRP( uint32 nInstruction ) +{ + if ( m_bGLSL ) + { + uint32 nDestToken = GetNextToken(); + CUtlString sDest = GetParameterString( nDestToken, DST_REGISTER, false, NULL ); + int nARLComp0 = ARL_DEST_NONE; + CUtlString sParam0 = GetParameterString( GetNextToken(), SRC_REGISTER, false, &nARLComp0 ); + int nARLComp1 = ARL_DEST_NONE; + CUtlString sParam1 = GetParameterString( GetNextToken(), SRC_REGISTER, false, &nARLComp1 ); + int nARLComp2 = ARL_DEST_NONE; + CUtlString sParam2 = GetParameterString( GetNextToken(), SRC_REGISTER, false, &nARLComp2 ); + + // This optionally inserts a move from our dummy address register to the .x component of the real one + InsertMoveFromAddressRegister( m_pBufALUCode, nARLComp0, nARLComp1, nARLComp2 ); + + sParam0 = FixGLSLSwizzle( sDest, sParam0 ); + sParam1 = FixGLSLSwizzle( sDest, sParam1 ); + sParam2 = FixGLSLSwizzle( sDest, sParam2 ); + + // dest = src0 * (src1 - src2) + src2; + PrintToBuf( *m_pBufALUCode, "%s = %s * ( %s - %s ) + %s;\n", sDest.String(), sParam0.String(), sParam1.String(), sParam2.String(), sParam2.String() ); + + // If the _SAT instruction modifier is used, then do a saturate here. + if ( nDestToken & D3DSPDM_SATURATE ) + { + int nComponents = GetNumSwizzleComponents( sDest.String() ); + if ( nComponents == 0 ) + nComponents = 4; + + PrintToBuf( *m_pBufALUCode, "%s = clamp( %s, %s, %s );\n", sDest.String(), sDest.String(), g_szVecZeros[nComponents], g_szVecOnes[nComponents] ); + } + } + else + { + if ( !m_bVertexShader ) + { + char buff[256]; + PrintOpcode( nInstruction, buff, sizeof( buff ) ); + StrcatToALUCode( buff ); + PrintParameterToString( GetNextToken(), DST_REGISTER, buff, sizeof( buff ), false, NULL ); + StrcatToALUCode( buff ); + StrcatToALUCode( ", " ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, buff, sizeof( buff ), false, NULL ); + StrcatToALUCode( buff ); + StrcatToALUCode( ", " ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, buff, sizeof( buff ), false, NULL ); + StrcatToALUCode( buff ); + StrcatToALUCode( ", " ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, buff, sizeof( buff ), false, NULL ); + StrcatToALUCode( buff ); + StrcatToALUCode( ";\n" ); + } + else // VS doesn't actually have a LRP instruction. Emulate with a SUB and a MAD + { + char pDestReg[16], pSrc0Reg[16], pSrc1Reg[16], pSrc2Reg[16]; + + m_bNeedsLerpTemp = true; + + // dest = src0 * (src1 - src2) + src2; + PrintParameterToString( GetNextToken(), DST_REGISTER, pDestReg, sizeof( pDestReg ), false, NULL ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, pSrc0Reg, sizeof( pSrc0Reg ), false, NULL ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, pSrc1Reg, sizeof( pSrc1Reg ), false, NULL ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, pSrc2Reg, sizeof( pSrc2Reg ), false, NULL ); + + StrcatToALUCode( "SUB LRP_TEMP, " ); // SUB LRP_TEMP, src1, src2; + StrcatToALUCode( pSrc1Reg ); + StrcatToALUCode( ", " ); + StrcatToALUCode( pSrc2Reg ); + StrcatToALUCode( ";\n" ); + + StrcatToALUCode( "MAD" ); // MAD dst, src0, LRP_TEMP, src2; + StrcatToALUCode( pDestReg ); + StrcatToALUCode( ", " ); + StrcatToALUCode( pSrc0Reg ); + StrcatToALUCode( ", LRP_TEMP, " ); + StrcatToALUCode( pSrc2Reg ); + StrcatToALUCode( ";\n" ); + } + } +} + + +void D3DToGL::Handle_TEX( uint32 dwToken, bool bIsTexLDL ) +{ + char pDestReg[64], pSrc0Reg[64], pSrc1Reg[64]; + PrintParameterToString( GetNextToken(), DST_REGISTER, pDestReg, sizeof( pDestReg ), false, NULL ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, pSrc0Reg, sizeof( pSrc0Reg ), false, NULL ); + + DWORD dwSrc1Token = GetNextToken(); + PrintParameterToString( dwSrc1Token, SRC_REGISTER, pSrc1Reg, sizeof( pSrc1Reg ), false, NULL ); + + + if ( m_bGLSL ) + { + Assert( (dwSrc1Token & D3DSP_REGNUM_MASK) < ARRAYSIZE( m_dwSamplerTypes ) ); + uint32 nSamplerType = m_dwSamplerTypes[dwSrc1Token & D3DSP_REGNUM_MASK]; + if ( nSamplerType == SAMPLER_TYPE_2D ) + { + CUtlString sCoordVar = EnsureNumSwizzleComponents( pSrc0Reg, 2 ); + + if ( bIsTexLDL ) + { + // Strip out the W component of the pSrc0Reg and pass that as the LOD to texture2DLod. + char szLOD[128], szExtra[8]; + GetParamNameWithoutSwizzle( pSrc0Reg, szLOD, sizeof( szLOD ) ); + V_snprintf( szExtra, sizeof( szExtra ), ".%c", GetSwizzleComponent( pSrc0Reg, 3 ) ); + strncat( szLOD, szExtra, sizeof(szLOD) - strlen(szLOD) - 1 ); + + PrintToBuf( *m_pBufALUCode, "%s = texture2DLod( %s, %s, %s );\n", pDestReg, pSrc1Reg, sCoordVar.String(), szLOD ); + } + else if ( ( (int) ( dwSrc1Token & D3DSP_REGNUM_MASK ) ) == m_nShadowDepthSampler ) // Syntax for shadow depth sampler + { + // .z is meant to contain the object depth, while .xy contains the 2D tex coords + CUtlString sCoordVar3D = EnsureNumSwizzleComponents( pSrc0Reg, 3 ); + + PrintToBuf( *m_pBufALUCode, "%s = shadow2D( %s, %s );\n", pDestReg, pSrc1Reg, sCoordVar3D.String() ); + Assert( m_dwSamplerTypes[dwSrc1Token & D3DSP_REGNUM_MASK] == SAMPLER_TYPE_2D ); + } + else if( ( OpcodeSpecificData( dwToken ) << D3DSP_OPCODESPECIFICCONTROL_SHIFT ) == D3DSI_TEXLD_PROJECT ) + { + // This projective case is after the shadow case intentionally, due to the way that "projective" + // loads are overloaded in our D3D shaders for shadow lookups. + // + // We use the vec4 variant of texture2DProj() intentionally here, since it lines up well with Direct3D. + + CUtlString s4DProjCoords = EnsureNumSwizzleComponents( pSrc0Reg, 4 ); // Ensure vec4 variant + PrintToBuf( *m_pBufALUCode, "%s = texture2DProj( %s, %s );\n", pDestReg, pSrc1Reg, s4DProjCoords.String() ); + } + else + { + PrintToBuf( *m_pBufALUCode, "%s = texture2D( %s, %s );\n", pDestReg, pSrc1Reg, sCoordVar.String() ); + } + } + else if ( nSamplerType == SAMPLER_TYPE_3D ) + { + CUtlString sCoordVar = EnsureNumSwizzleComponents( pSrc0Reg, 3 ); + PrintToBuf( *m_pBufALUCode, "%s = texture3D( %s, %s );\n", pDestReg, pSrc1Reg, sCoordVar.String() ); + } + else if ( nSamplerType == SAMPLER_TYPE_CUBE ) + { + CUtlString sCoordVar = EnsureNumSwizzleComponents( pSrc0Reg, 3 ); + PrintToBuf( *m_pBufALUCode, "%s = textureCube( %s, %s );\n", pDestReg, pSrc1Reg, sCoordVar.String() ); + } + else + { + Error( "TEX instruction: unsupported sampler type used" ); + } + } + else + { + Assert( !( bIsTexLDL && !m_bGeneratingDebugText ) ); + + if( ( OpcodeSpecificData( dwToken ) << D3DSP_OPCODESPECIFICCONTROL_SHIFT ) == D3DSI_TEXLD_PROJECT ) + { + StrcatToALUCode( "TXP" ); + } + else if( ( OpcodeSpecificData( dwToken ) << D3DSP_OPCODESPECIFICCONTROL_SHIFT) == D3DSI_TEXLD_BIAS ) + { + StrcatToALUCode( "TXB" ); + } + else + { + StrcatToALUCode( "TEX" ); + } + + // Destination + StrcatToALUCode( pDestReg ); + StrcatToALUCode( ", " ); + + // Source0 + StrcatToALUCode( pSrc0Reg ); + StrcatToALUCode( ", " ); + + // Source1 + StrcatToALUCode( pSrc1Reg ); + StrcatToALUCode( ", " ); + + // Syntax for shadow depth sampler + if ( ( (int) ( dwSrc1Token & D3DSP_REGNUM_MASK ) ) == m_nShadowDepthSampler ) + { + m_bDeclareShadowOption = true; + + StrcatToALUCode( "SHADOW" ); // Should result in SHADOW2D target + Assert( m_dwSamplerTypes[dwSrc1Token & D3DSP_REGNUM_MASK] == SAMPLER_TYPE_2D ); + } + + // Sampler dimension (2D, CUBE, 3D) determined by earlier declaration + StrcatToALUCode( g_szSamplerStrings[m_dwSamplerTypes[dwSrc1Token & D3DSP_REGNUM_MASK]] ); + StrcatToALUCode( ";\n" ); + } +} + +void D3DToGL::StrcatToHeaderCode( const char *pBuf ) +{ + strcat_s( (char*)m_pBufHeaderCode->Base(), m_pBufHeaderCode->Size(), pBuf ); +} + +void D3DToGL::StrcatToALUCode( const char *pBuf ) +{ + strcat_s( (char*)m_pBufALUCode->Base(), m_pBufALUCode->Size(), pBuf ); +} + +void D3DToGL::StrcatToParamCode( const char *pBuf ) +{ + strcat_s( (char*)m_pBufParamCode->Base(), m_pBufParamCode->Size(), pBuf ); +} + +void D3DToGL::StrcatToAttribCode( const char *pBuf ) +{ + strcat_s( (char*)m_pBufAttribCode->Base(), m_pBufAttribCode->Size(), pBuf ); +} + +void D3DToGL::Handle_TexLDD( uint32 nInstruction ) +{ + Assert( !m_bGLSL ); // Not supported yet, but can be if we need it. + + char buff[256]; + PrintOpcode( nInstruction, buff, sizeof( buff ) ); + + StrcatToALUCode( buff ); + PrintParameterToString( GetNextToken(), DST_REGISTER, buff, sizeof( buff ), false, NULL ); + StrcatToALUCode( buff ); + StrcatToALUCode( ", " ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, buff, sizeof( buff ), false, NULL ); + StrcatToALUCode( buff ); + StrcatToALUCode( ", " ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, buff, sizeof( buff ), false, NULL ); + StrcatToALUCode( buff ); + StrcatToALUCode( ", " ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, buff, sizeof( buff ), false, NULL ); + StrcatToALUCode( buff ); + StrcatToALUCode( ", " ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, buff, sizeof( buff ), false, NULL ); + StrcatToALUCode( buff ); + StrcatToALUCode( ";\n" ); +} + + +void D3DToGL::Handle_TexCoord() +{ + Assert(0); + + // If ps_1_4, this is texcrd + if ( (m_dwMajorVersion == 1) && (m_dwMinorVersion == 4) && (!m_bVertexShader) ) + { + StrcatToALUCode( "texcrd" ); + } + else // else it's texcoord + { + Assert(0); + StrcatToALUCode( "texcoord" ); + } + + char buff[256]; + PrintParameterToString( GetNextToken(), DST_REGISTER, buff, sizeof( buff ), false, NULL ); + StrcatToALUCode( buff ); + + // If ps_1_4, texcrd also has a source parameter + if ((m_dwMajorVersion == 1) && (m_dwMinorVersion == 4) && (!m_bVertexShader)) + { + StrcatToALUCode( ", " ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, buff, sizeof( buff ), false, NULL ); + StrcatToALUCode( buff ); + } + + StrcatToALUCode( ";\n" ); +} + +void D3DToGL::HandleBinaryOp_GLSL( uint32 nInstruction ) +{ + uint32 nDestToken = GetNextToken(); + CUtlString sParam1 = GetParameterString( nDestToken, DST_REGISTER, false, NULL ); + int nARLComp0 = ARL_DEST_NONE; + CUtlString sParam2 = GetParameterString( GetNextToken(), SRC_REGISTER, false, &nARLComp0 ); + int nARLComp1 = ARL_DEST_NONE; + CUtlString sParam3 = GetParameterString( GetNextToken(), SRC_REGISTER, false, &nARLComp1 ); + + // This optionally inserts a move from our dummy address register to the .x component of the real one + InsertMoveFromAddressRegister( m_pBufALUCode, nARLComp0, nARLComp1 ); + + // DST is a weird one. I haven't seen it used anywhere yet but can add support if necessary. This is what it does: + // dest.x = 1; + // dest.y = src0.y * src1.y; + // dest.z = src0.z; + // dest.w = src1.w; + Assert( nInstruction != D3DSIO_DST ); + + // Since DP3 and DP4 have a scalar as the dest and vectors as the src, don't screw with the swizzle specifications. + if ( nInstruction == D3DSIO_DP3 ) + { + sParam2 = EnsureNumSwizzleComponents( sParam2, 3 ); + sParam3 = EnsureNumSwizzleComponents( sParam3, 3 ); + } + else if ( nInstruction == D3DSIO_DP4 ) + { + sParam2 = EnsureNumSwizzleComponents( sParam2, 4 ); + sParam3 = EnsureNumSwizzleComponents( sParam3, 4 ); + } + else + { + sParam2 = FixGLSLSwizzle( sParam1, sParam2 ); + sParam3 = FixGLSLSwizzle( sParam1, sParam3 ); + } + + char buff[256]; + if ( nInstruction == D3DSIO_ADD || nInstruction == D3DSIO_SUB || nInstruction == D3DSIO_MUL ) + { + // These all look like x = y op z + PrintToBuf( *m_pBufALUCode, "%s = %s %s %s;\n", sParam1.String(), sParam2.String(), GetGLSLOperatorString( nInstruction ), sParam3.String() ); + } + else + { + if ( ( nInstruction == D3DSIO_SGE ) || ( nInstruction == D3DSIO_SLT ) ) + { + sParam2 = FixGLSLSwizzle( sParam1, sParam2 ); + sParam3 = FixGLSLSwizzle( sParam1, sParam3 ); + } + + int nDestComponents = GetNumSwizzleComponents( sParam1.String() ); + int nSrcComponents = GetNumSwizzleComponents( sParam2.String() ); + + // All remaining instructions can use GLSL intrinsics like dot() and cross(). + bool bDoubleClose = OpenIntrinsic( nInstruction, buff, sizeof( buff ), nDestComponents, nSrcComponents ); + + if ( ( nSrcComponents == 1 ) && ( nInstruction == D3DSIO_SGE ) ) + { + PrintToBuf( *m_pBufALUCode, "%s = %s%s >= %s );\n", sParam1.String(), buff, sParam2.String(), sParam3.String() ); + } + else if ( ( nSrcComponents == 1 ) && ( nInstruction == D3DSIO_SLT ) ) + { + PrintToBuf( *m_pBufALUCode, "%s = %s%s < %s );\n", sParam1.String(), buff, sParam2.String(), sParam3.String() ); + } + else + { + PrintToBuf( *m_pBufALUCode, "%s = %s%s, %s %s;\n", sParam1.String(), buff, sParam2.String(), sParam3.String(), bDoubleClose ? ") )" : ")" ); + } + } + + // If the _SAT instruction modifier is used, then do a saturate here. + if ( nDestToken & D3DSPDM_SATURATE ) + { + int nComponents = GetNumSwizzleComponents( sParam1.String() ); + if ( nComponents == 0 ) + nComponents = 4; + + PrintToBuf( *m_pBufALUCode, "%s = clamp( %s, %s, %s );\n", sParam1.String(), sParam1.String(), g_szVecZeros[nComponents], g_szVecOnes[nComponents] ); + } +} + +void D3DToGL::HandleBinaryOp_ASM( uint32 nInstruction ) +{ + CUtlString sParam1 = GetParameterString( GetNextToken(), DST_REGISTER, false, NULL ); + int nARLComp0 = ARL_DEST_NONE; + CUtlString sParam2 = GetParameterString( GetNextToken(), SRC_REGISTER, false, &nARLComp0 ); + int nARLComp1 = ARL_DEST_NONE; + CUtlString sParam3 = GetParameterString( GetNextToken(), SRC_REGISTER, false, &nARLComp1 ); + + // This optionally inserts a move from our dummy address register to the .x component of the real one + InsertMoveFromAddressRegister( m_pBufALUCode, nARLComp0, nARLComp1 ); + + char buff[256]; + PrintOpcode( nInstruction, buff, sizeof( buff ) ); + PrintToBuf( *m_pBufALUCode, "%s%s, %s, %s;\n", buff, sParam1.String(), sParam2.String(), sParam3.String() ); +} + +void D3DToGL::WriteGLSLCmp( const char *pDestReg, const char *pSrc0Reg, const char *pSrc1Reg, const char *pSrc2Reg ) +{ + int nWriteMaskEntries = GetNumWriteMaskEntries( pDestReg ); + for ( int i=0; i < nWriteMaskEntries; i++ ) + { + char params[4][256]; + WriteParamWithSingleMaskEntry( pDestReg, i, params[0], sizeof( params[0] ) ); + WriteParamWithSingleMaskEntry( pSrc0Reg, i, params[1], sizeof( params[1] ) ); + WriteParamWithSingleMaskEntry( pSrc1Reg, i, params[2], sizeof( params[2] ) ); + WriteParamWithSingleMaskEntry( pSrc2Reg, i, params[3], sizeof( params[3] ) ); + + PrintToBuf( *m_pBufALUCode, "%s = ( %s >= 0.0 ) ? %s : %s;\n", params[0], params[1], params[2], params[3] ); + } +} + +void D3DToGL::Handle_CMP() +{ + // In Direct3D, result = (src0 >= 0.0) ? src1 : src2 + // In OpenGL, result = (src0 < 0.0) ? src1 : src2 + // + // As a result, arguments are effectively in a different order than Direct3D! !#$&*!%#$& + char pDestReg[64], pSrc0Reg[64], pSrc1Reg[64], pSrc2Reg[64]; + uint32 nDestToken = GetNextToken(); + PrintParameterToString( nDestToken, DST_REGISTER, pDestReg, sizeof( pDestReg ), false, NULL ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, pSrc0Reg, sizeof( pSrc0Reg ), false, NULL ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, pSrc1Reg, sizeof( pSrc1Reg ), false, NULL ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, pSrc2Reg, sizeof( pSrc2Reg ), false, NULL ); + + if ( m_bGLSL ) + { + // These are a tricky case.. we have to expand it out into multiple statements. + char szDestBase[256]; + GetParamNameWithoutSwizzle( pDestReg, szDestBase, sizeof( szDestBase ) ); + + V_strncpy( pSrc0Reg, FixGLSLSwizzle( pDestReg, pSrc0Reg ), sizeof( pSrc0Reg ) ); + V_strncpy( pSrc1Reg, FixGLSLSwizzle( pDestReg, pSrc1Reg ), sizeof( pSrc1Reg ) ); + V_strncpy( pSrc2Reg, FixGLSLSwizzle( pDestReg, pSrc2Reg ), sizeof( pSrc2Reg ) ); + + if ( DoParamNamesMatch( pDestReg, pSrc0Reg ) && GetNumSwizzleComponents( pDestReg ) > 1 ) + { + // So the dest register is the same as the comperand. We're in danger of screwing up our results. + // + // For example, this code: + // CMP r0.xy, r0.xx, r1, r2 + // would generate this: + // r0.x = (r0.x >= 0) ? r1.x : r2.x; + // r0.y = (r0.x >= 0) ? r1.x : r2.x; + // + // But the first lines changes r0.x and thus screws the atomicity of the CMP instruction for the second line. + // So we assign r0 to a temporary first and then write to the temporary. + PrintToBuf( *m_pBufALUCode, "%s = %s;\n", g_pAtomicTempVarName, szDestBase ); + + char szTempVar[256]; + ReplaceParamName( pDestReg, g_pAtomicTempVarName, szTempVar, sizeof( szTempVar ) ); + WriteGLSLCmp( szTempVar, pSrc0Reg, pSrc1Reg, pSrc2Reg ); + + PrintToBuf( *m_pBufALUCode, "%s = %s;\n", szDestBase, g_pAtomicTempVarName ); + m_bUsedAtomicTempVar = true; + } + else + { + // Just write out the simple expanded version of the CMP. No need to use atomic_temp_var. + WriteGLSLCmp( pDestReg, pSrc0Reg, pSrc1Reg, pSrc2Reg ); + } + + // If the _SAT instruction modifier is used, then do a saturate here. + if ( nDestToken & D3DSPDM_SATURATE ) + { + int nComponents = GetNumSwizzleComponents( pDestReg ); + if ( nComponents == 0 ) + nComponents = 4; + + PrintToBuf( *m_pBufALUCode, "%s = clamp( %s, %s, %s );\n", pDestReg, pDestReg, g_szVecZeros[nComponents], g_szVecOnes[nComponents] ); + } + } + else + { + StrcatToALUCode( "CMP" ); + StrcatToALUCode( pDestReg ); + StrcatToALUCode( ", " ); + StrcatToALUCode( pSrc0Reg ); + StrcatToALUCode( ", " ); + StrcatToALUCode( pSrc2Reg ); // Src 2 | + StrcatToALUCode( ", " ); // |--- Swap these guys from Direct3D's convention + StrcatToALUCode( pSrc1Reg ); // Src 1 | + StrcatToALUCode( ";\n" ); + } +} + +void D3DToGL::Handle_NRM() +{ + char pDestReg[64]; + char pSrc0Reg[64]; + PrintParameterToString( GetNextToken(), DST_REGISTER, pDestReg, sizeof( pDestReg ), false, NULL ); + PrintParameterToString( GetNextToken(), SRC_REGISTER, pSrc0Reg, sizeof( pSrc0Reg ), false, NULL ); + + if ( m_bGLSL ) + { + CUtlString sSrc = EnsureNumSwizzleComponents( pSrc0Reg, 3 ); + PrintToBuf( *m_pBufALUCode, "%s = normalize( %s );\n", pDestReg, sSrc.String() ); + } + else + { + m_bNeedsNRMTemp = true; + + StrcatToALUCode( "DP3 NRM_TEMP.w, " ); + StrcatToALUCode( pSrc0Reg ); + StrcatToALUCode( ", " ); + StrcatToALUCode( pSrc0Reg ); + StrcatToALUCode( ";\nRSQ NRM_TEMP.w, NRM_TEMP.w;\nMUL" ); + StrcatToALUCode( pDestReg ); + StrcatToALUCode( ", NRM_TEMP.w, " ); + StrcatToALUCode( pSrc0Reg ); + StrcatToALUCode( ";\n" ); + } +} + +void D3DToGL::Handle_UnaryOp( uint32 nInstruction ) +{ + uint32 nDestToken = GetNextToken(); + CUtlString sParam1 = GetParameterString( nDestToken, DST_REGISTER, false, NULL ); + CUtlString sParam2 = GetParameterString( GetNextToken(), SRC_REGISTER, ( nInstruction == D3DSIO_MOVA) && !m_bGLSL, NULL ); + sParam2 = FixGLSLSwizzle( sParam1, sParam2 ); + + if ( m_bGLSL ) + { + if ( nInstruction == D3DSIO_MOV ) + { + PrintToBuf( *m_pBufALUCode, "%s = %s;\n", sParam1.String(), sParam2.String() ); + } + else if ( nInstruction == D3DSIO_RSQ ) + { + PrintToBuf( *m_pBufALUCode, "%s = inversesqrt( %s );\n", sParam1.String(), sParam2.String() ); + } + else if ( nInstruction == D3DSIO_RCP ) + { + PrintToBuf( *m_pBufALUCode, "%s = 1.0 / %s;\n", sParam1.String(), sParam2.String() ); + } + else if ( nInstruction == D3DSIO_EXP ) + { + PrintToBuf( *m_pBufALUCode, "%s = exp2( %s );\n", sParam1.String(), sParam2.String() ); + } + else if ( nInstruction == D3DSIO_FRC ) + { + PrintToBuf( *m_pBufALUCode, "%s = fract( %s );\n", sParam1.String(), sParam2.String() ); + } + else if ( nInstruction == D3DSIO_LOG ) // d3d 'log' is log base 2 + { + PrintToBuf( *m_pBufALUCode, "%s = log2( %s );\n", sParam1.String(), sParam2.String() ); + } + else if ( nInstruction == D3DSIO_ABS ) // rbarris did this one, Jason please check + { + PrintToBuf( *m_pBufALUCode, "%s = abs( %s );\n", sParam1.String(), sParam2.String() ); + } + else if ( nInstruction == D3DSIO_MOVA ) + { + m_bDeclareAddressReg = true; + PrintToBuf( *m_pBufALUCode, "%s = %s;\n", sParam1.String(), sParam2.String() ); + + m_nHighestRegister = DXABSTRACT_VS_PARAM_SLOTS - 1; + } + else + { + Error( "Unsupported instruction" ); + } + + // If the _SAT instruction modifier is used, then do a saturate here. + if ( nDestToken & D3DSPDM_SATURATE ) + { + int nComponents = GetNumSwizzleComponents( sParam1.String() ); + if ( nComponents == 0 ) + { + nComponents = 4; + } + + PrintToBuf( *m_pBufALUCode, "%s = clamp( %s, %s, %s );\n", sParam1.String(), sParam1.String(), g_szVecZeros[nComponents], g_szVecOnes[nComponents] ); + } + } + else + { + if ( nInstruction == D3DSIO_MOVA ) + { + m_bDeclareAddressReg = true; + m_nHighestRegister = DXABSTRACT_VS_PARAM_SLOTS - 1; + Assert( m_nHighestRegister < DXABSTRACT_VS_PARAM_SLOTS ); + } + + char buff[256]; + PrintOpcode( nInstruction, buff, sizeof( buff ) ); + PrintToBuf( *m_pBufALUCode, "%s%s, %s;\n", buff, sParam1.String(), sParam2.String() ); + } +} + +void D3DToGL::WriteGLSLSamplerDefinitions() +{ + int nSamplersWritten = 0; + for ( int i=0; i < ARRAYSIZE( m_dwSamplerTypes ); i++ ) + { + if ( m_dwSamplerTypes[i] == SAMPLER_TYPE_2D ) + { + if ( i == m_nShadowDepthSampler ) + { + PrintToBuf( *m_pBufHeaderCode, "uniform sampler2DShadow sampler%d;\n", i ); + } + else + { + PrintToBuf( *m_pBufHeaderCode, "uniform sampler2D sampler%d;\n", i ); + } + ++nSamplersWritten; + } + else if ( m_dwSamplerTypes[i] == SAMPLER_TYPE_3D ) + { + PrintToBuf( *m_pBufHeaderCode, "uniform sampler3D sampler%d;\n", i ); + ++nSamplersWritten; + } + else if ( m_dwSamplerTypes[i] == SAMPLER_TYPE_CUBE ) + { + PrintToBuf( *m_pBufHeaderCode, "uniform samplerCube sampler%d;\n", i ); + ++nSamplersWritten; + } + else if ( m_dwSamplerTypes[i] != SAMPLER_TYPE_UNUSED ) + { + Error( "Unknown sampler type." ); + } + } + + if ( nSamplersWritten > 0 ) + PrintToBuf( *m_pBufHeaderCode, "\n\n" ); +} + +void D3DToGL::WriteGLSLOutputVariableAssignments() +{ + if ( m_bVertexShader ) + { + // Map output "oN" registers back to GLSL output variables. + if ( m_bAddHexCodeComments ) + { + PrintToBuf( *m_pBufAttribCode, "\n// Now we're storing the oN variables from the output dcl_ statements back into their GLSL equivalents.\n" ); + } + + for ( int i=0; i < ARRAYSIZE( m_DeclaredOutputs ); i++ ) + { + if ( m_DeclaredOutputs[i] == UNDECLARED_OUTPUT ) + continue; + + CUtlString sOutputName = GetUsageAndIndexString( m_DeclaredOutputs[i], SEMANTIC_OUTPUT ); + PrintToBuf( *m_pBufAttribCode, "%s = oT%d;\n", sOutputName.String(), i ); + } + } +} + +void D3DToGL::Handle_DeclarativeNonDclOp( uint32 nInstruction ) +{ + char buff[128]; + uint32 dwToken = GetNextToken(); + PrintParameterToString( dwToken, DST_REGISTER, buff, sizeof( buff ), false, NULL ); + + if ( m_bGLSL && nInstruction == D3DSIO_TEXKILL ) + { + // TEXKILL is supposed to discard the pixel if any of the src register's X, Y, or Z components are less than zero. + // We have to translate it to something like: + // if ( r0.x < 0.0 || r0.y < 0.0 ) + // discard; + char c[3]; + c[0] = GetSwizzleComponent( buff, 0 ); + c[1] = GetSwizzleComponent( buff, 1 ); + c[2] = GetSwizzleComponent( buff, 2 ); + + // Get the unique components. + char cUnique[3]; + cUnique[0] = c[0]; + + int nUnique = 1; + if ( c[1] != c[0] ) + cUnique[nUnique++] = c[1]; + + if ( c[2] != c[1] && c[2] != c[0] ) + cUnique[nUnique++] = c[2]; + + // Get the src register base name. + char szBase[256]; + GetParamNameWithoutSwizzle( buff, szBase, sizeof( szBase ) ); + + PrintToBuf( *m_pBufALUCode, "if ( %s.%c < 0.0 ", szBase, cUnique[0] ); + for ( int i=1; i < nUnique; i++ ) + { + PrintToBuf( *m_pBufALUCode, "|| %s.%c < 0.0 ", szBase, cUnique[i] ); + } + PrintToBuf( *m_pBufALUCode, ")\n{\n\tdiscard;\n}\n" ); + } + else + { + char szOpcode[128]; + PrintOpcode( nInstruction, szOpcode, sizeof( szOpcode ) ); + StrcatToALUCode( szOpcode ); + + StrcatToALUCode( buff ); + StrcatToALUCode( ";\n" ); + } +} + + +void D3DToGL::NoteTangentInputUsed() +{ + if ( !m_bTangentInputUsed ) + { + m_bTangentInputUsed = true; +// PrintToBuf( *m_pBufParamCode, "attribute vec4 %s;\n", g_pTangentAttributeName ); + } +} + + +// These are the only ARL instructions that should appear in the instruction stream +void D3DToGL::InsertMoveInstruction( CUtlBuffer *pCode, int nARLComponent ) +{ + switch ( nARLComponent ) + { + case ARL_DEST_X: + strcat_s( ( char * )pCode->Base(), pCode->Size(), m_bGLSL ? "a0 = int( va_r.x );\n" : "ARL a0.x, VA_REG.x;\n" ); + break; + case ARL_DEST_Y: + strcat_s( ( char * )pCode->Base(), pCode->Size(), m_bGLSL ? "a0 = int( va_r.y );\n" : "ARL a0.x, VA_REG.y;\n" ); + break; + case ARL_DEST_Z: + strcat_s( ( char * )pCode->Base(), pCode->Size(), m_bGLSL ? "a0 = int( va_r.z );\n" : "ARL a0.x, VA_REG.z;\n" ); + break; + case ARL_DEST_W: + strcat_s( ( char * )pCode->Base(), pCode->Size(), m_bGLSL ? "a0 = int( va_r.w );\n" : "ARL a0.x, VA_REG.w;\n" ); + break; + } +} + +// This optionally inserts a move from our dummy address register to the .x component of the real one +void D3DToGL::InsertMoveFromAddressRegister( CUtlBuffer *pCode, int nARLComp0, int nARLComp1, int nARLComp2 /* = ARL_DEST_NONE */ ) +{ + int nNumSwizzles = 0; + (void)nNumSwizzles; + + if ( nARLComp0 != ARL_DEST_NONE ) + nNumSwizzles++; + + if ( nARLComp1 != ARL_DEST_NONE ) + nNumSwizzles++; + + if ( nARLComp2 != ARL_DEST_NONE ) + nNumSwizzles++; + + // We shouldn't have any more than one indirect address usage in a single instruction + Assert( nNumSwizzles <= 1 ); + + if ( nARLComp0 != ARL_DEST_NONE ) + { + InsertMoveInstruction( pCode, nARLComp0 ); + } + else if ( nARLComp1 != ARL_DEST_NONE ) + { + InsertMoveInstruction( pCode, nARLComp1 ); + } + else if ( nARLComp2 != ARL_DEST_NONE ) + { + InsertMoveInstruction( pCode, nARLComp2 ); + } +} + + +//------------------------------------------------------------------------------ +// TranslateShader() +// +// This is the main function that the outside world sees. A pointer to the +// uint32 stream returned from the D3DX compile routine is parsed and used +// to write human-readable asm code into the character array pointed to by +// pDisassembledCode. An error code is returned. +//------------------------------------------------------------------------------ + +static int g_translationCounter = 0; + +int D3DToGL::TranslateShader( uint32* code, CUtlBuffer *pBufDisassembledCode, bool *bVertexShader, uint32 options, int32 nShadowDepthSampler, uint32 nCentroidMask, char *debugLabel ) +{ + CUtlString sLine, sParamName; + uint32 dwToken, nInstruction, nNumTokensToSkip; + char buff[256]; + + // obey options + m_bUseEnvParams = (options & D3DToGL_OptionUseEnvParams) != 0; + m_bDoFixupZ = (options & D3DToGL_OptionDoFixupZ) != 0; + m_bDoFixupY = (options & D3DToGL_OptionDoFixupY) != 0; + m_bDoUserClipPlanes = (options & D3DToGL_OptionDoUserClipPlanes) != 0; + m_bGLSL = (options & D3DToGL_OptionGLSL) != 0; + m_bAllowStaticControlFlow = m_bGLSL && (options & D3DToGL_OptionAllowStaticControlFlow) != 0; + m_bAddHexCodeComments = (options & D3DToGL_AddHexComments) != 0; + m_bPutHexCodesAfterLines = (options & D3DToGL_PutHexCommentsAfterLines) != 0; + m_bGeneratingDebugText = (options & D3DToGL_GeneratingDebugText) != 0; + m_bUseBindableUniforms = (options & D3DToGL_OptionUseBindableUniforms) != 0; + m_bGenerateSRGBWriteSuffix = (options & D3DToGL_OptionSRGBWriteSuffix) != 0; + + m_nLoopDepth = 0; + + // debugging + m_bSpew = (options & D3DToGL_OptionSpew) != 0; + + // m_bSpew |= (g_translationCounter == 1012 ); // interested in this specific translation run + + // These are not accessed below in a way that will cause them to glow, so + // we could overflow these and/or the buffer pointed to by pDisassembledCode + m_pBufAttribCode = new CUtlBuffer( 100, 10000, CUtlBuffer::TEXT_BUFFER ); + m_pBufParamCode = new CUtlBuffer( 100, 10000, CUtlBuffer::TEXT_BUFFER ); + m_pBufALUCode = new CUtlBuffer( 100, 60000, CUtlBuffer::TEXT_BUFFER ); + + // Pointers to text buffers for assembling sections of the program + m_pBufHeaderCode = pBufDisassembledCode; + char *pAttribMapStart = NULL; + ((char*)m_pBufHeaderCode->Base())[0] = 0; + ((char*)m_pBufAttribCode->Base())[0] = 0; + ((char*)m_pBufParamCode->Base())[0] = 0; + ((char*)m_pBufALUCode->Base())[0] = 0; + + + for ( int i = 0; i < MAX_SHADER_CONSTANTS; i++ ) + { + m_bConstantRegisterDefined[i] = false; + } + + // Track shadow sampler usage for proper declaration + m_nShadowDepthSampler = nShadowDepthSampler; + m_bDeclareShadowOption = false; + + // Various flags set while parsing code to drive various declaration instructions + m_bNeedsD2AddTemp = false; + m_bNeedsLerpTemp = false; + m_bNeedsNRMTemp = false; + m_bNeedsSinCosDeclarations = false; + m_bDeclareAddressReg = false; + m_bDeclareVSOPos = false; + m_bDeclareVSOFog = false; + m_dwTexCoordOutMask = 0x00000000; + m_bOutputColorRegister[0] = false; + m_bOutputColorRegister[1] = false; + m_bOutputColorRegister[2] = false; + m_bOutputColorRegister[3] = false; + m_bOutputDepthRegister = false; + m_bTangentInputUsed = false; + m_dwTempUsageMask = 0x00000000; + m_dwSamplerUsageMask = 0x00000000; + m_dwConstIntUsageMask = 0x00000000; + m_dwConstBoolUsageMask = 0x00000000; + m_nCentroidMask = nCentroidMask; + m_nHighestRegister = 0; + + m_bUsedAtomicTempVar = false; + for ( int i = 0; i < ARRAYSIZE( m_dwSamplerTypes ); i++ ) + { + m_dwSamplerTypes[i] = SAMPLER_TYPE_UNUSED; + } + for ( int i = 0; i < ARRAYSIZE( m_DeclaredOutputs ); i++ ) + { + m_DeclaredOutputs[i] = UNDECLARED_OUTPUT; + } + + memset( m_dwAttribMap, 0xFF, sizeof(m_dwAttribMap) ); + + m_pdwBaseToken = m_pdwNextToken = code; // Initialize dwToken pointers + + dwToken = GetNextToken(); + m_dwMajorVersion = D3DSHADER_VERSION_MAJOR( dwToken ); + m_dwMinorVersion = D3DSHADER_VERSION_MINOR( dwToken ); + + // We only do vs_2_0 and ps_2_x + if ( m_dwMajorVersion != 2 ) + { + Debugger(); + } + + // If pixel shader + char *glslBindableUniformExtText = (char*)((m_bGLSL && m_bUseBindableUniforms) ? "#extension GL_EXT_bindable_uniform : enable\n" : ""); + + if ( ( dwToken & 0xFFFF0000 ) == 0xFFFF0000 ) + { + // must explicitly enable extensions if emitting GLSL + V_snprintf( (char *)m_pBufHeaderCode->Base(), m_pBufHeaderCode->Size(), m_bGLSL ? "#version 120\n%s" : "!!ARBfp1.0\n%s", glslBindableUniformExtText ); + m_bVertexShader = false; + } + else // vertex shader + { + m_bGenerateSRGBWriteSuffix = false; + + if ( m_bGLSL ) + { + V_snprintf( (char *)m_pBufHeaderCode->Base(), m_pBufHeaderCode->Size(), "#version 120\n%s//ATTRIBMAP-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx\n", glslBindableUniformExtText ); + } + else // asm + { + if ( m_bDoUserClipPlanes ) + { + // include "OPTION NV_vertex_program2;" + V_snprintf( (char *)m_pBufHeaderCode->Base(), m_pBufHeaderCode->Size(), "!!ARBvp1.0\n#//ATTRIBMAP-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx\nOPTION NV_vertex_program2;\n" ); + } + else + { + // do not include "OPTION NV_vertex_program2;" + V_snprintf( (char *)m_pBufHeaderCode->Base(), m_pBufHeaderCode->Size(), "!!ARBvp1.0\n#//ATTRIBMAP-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx\n" ); + } + } + + // find that first '-xx' which is where the attrib map will be written later. + pAttribMapStart = strstr( (char *)m_pBufHeaderCode->Base(), "-xx" ) + 1; + + m_bVertexShader = true; + } + + *bVertexShader = m_bVertexShader; + + if ( m_bAddHexCodeComments ) + { + RecordInputAndOutputPositions(); + } + + if ( m_bSpew ) + { + printf("\n************* translating shader " ); + } + + int opcounter = 0; + + // Loop until we hit the end dwToken...note that D3DPS_END() == D3DVS_END() so this works for either + while ( dwToken != D3DPS_END() ) + { + if ( m_bAddHexCodeComments ) + { + AddTokenHexCode(); + RecordInputAndOutputPositions(); + } + +#ifdef POSIX + int tokenIndex = m_pdwNextToken - code; +#endif + int aluCodeLength0 = V_strlen( (char *) m_pBufALUCode->Base() ); + + dwToken = GetNextToken(); // Get next dwToken in the stream + nInstruction = Opcode( dwToken ); // Mask out the instruction opcode + + if ( m_bSpew ) + { +#ifdef POSIX + printf("\n** token# %04x inst# %04d opcode %s (%08x)", tokenIndex, opcounter, GLMDecode(eD3D_SIO, nInstruction), dwToken ); +#endif + opcounter++; + } + + switch ( nInstruction ) + { + // -- No arguments at all ----------------------------------------------- + case D3DSIO_NOP: + case D3DSIO_PHASE: + case D3DSIO_RET: + case D3DSIO_ENDLOOP: + case D3DSIO_BREAK: + Assert(0); + PrintOpcode( nInstruction, buff, sizeof( buff ) ); + StrcatToALUCode( buff ); + StrcatToALUCode( ";\n" ); + break; + + // -- "Declarative" non dcl ops ---------------------------------------- + case D3DSIO_TEXDEPTH: + case D3DSIO_TEXKILL: + Handle_DeclarativeNonDclOp( nInstruction ); + break; + + // -- Unary ops ------------------------------------------------- + case D3DSIO_BEM: + case D3DSIO_TEXBEM: + case D3DSIO_TEXBEML: + case D3DSIO_TEXDP3: + case D3DSIO_TEXDP3TEX: + case D3DSIO_TEXM3x2DEPTH: + case D3DSIO_TEXM3x2TEX: + case D3DSIO_TEXM3x3: + case D3DSIO_TEXM3x3PAD: + case D3DSIO_TEXM3x3TEX: + case D3DSIO_TEXM3x3VSPEC: + case D3DSIO_TEXREG2AR: + case D3DSIO_TEXREG2GB: + case D3DSIO_TEXREG2RGB: + case D3DSIO_LABEL: + case D3DSIO_CALL: + case D3DSIO_LOOP: + case D3DSIO_BREAKP: + case D3DSIO_DSX: + case D3DSIO_DSY: + Assert(0); + break; + + case D3DSIO_IF: + Assert( m_bGLSL && m_bAllowStaticControlFlow ); + if ( m_bGLSL && m_bAllowStaticControlFlow ) + { + dwToken = GetNextToken(); + PrintParameterToString( dwToken, SRC_REGISTER, buff, sizeof( buff ), false, NULL ); + + // In practice, this is the only form of for loop that will appear in DX asm + PrintToBuf( *m_pBufALUCode, "if ( %s ) {\n", buff ); + } + break; + + case D3DSIO_ELSE: + Assert( m_bGLSL && m_bAllowStaticControlFlow ); + if ( m_bGLSL && m_bAllowStaticControlFlow ) + { + StrcatToALUCode( "}\nelse\n{\n" ); + } + break; + + case D3DSIO_ENDIF: + Assert( m_bGLSL && m_bAllowStaticControlFlow ); + if ( m_bGLSL && m_bAllowStaticControlFlow ) + { + StrcatToALUCode( "}\n" ); + } + break; + + case D3DSIO_REP: // Start a for loop - GLSL only + Assert( m_bGLSL && m_bAllowStaticControlFlow ); + if ( m_bGLSL && m_bAllowStaticControlFlow ) + { + dwToken = GetNextToken(); + PrintParameterToString( dwToken, SRC_REGISTER, buff, sizeof( buff ), false, NULL ); + + // In practice, this is the only form of for loop that will appear in DX asm + PrintToBuf( *m_pBufALUCode, "for( int i=0; i < %s; i++ ) {\n", buff ); + + m_nLoopDepth++; + + // For now, we don't deal with loop nesting + // Easy enough to fix later with an array of loop names i, j, k etc + Assert( m_nLoopDepth <= 1 ); + } + break; + + case D3DSIO_ENDREP: + Assert( m_bGLSL && m_bAllowStaticControlFlow ); + if ( m_bGLSL && m_bAllowStaticControlFlow ) + { + m_nLoopDepth--; + StrcatToALUCode( "}\n" ); + } + break; + + case D3DSIO_NRM: + Handle_NRM(); + break; + + case D3DSIO_MOVA: + + if ( m_bGLSL ) + { + Handle_UnaryOp( nInstruction ); + } + else // asm + { + m_bDeclareAddressReg = true; + m_nHighestRegister = DXABSTRACT_VS_PARAM_SLOTS - 1; + + PrintOpcode( nInstruction, buff, sizeof( buff ) ); + StrcatToALUCode( buff ); + + dwToken = GetNextToken(); + PrintParameterToString( dwToken, DST_REGISTER, buff, sizeof( buff ), false, NULL ); + StrcatToALUCode( buff ); + StrcatToALUCode( ", " ); + + dwToken = GetNextToken(); + PrintParameterToString( dwToken, SRC_REGISTER, buff, sizeof( buff ), false, NULL ); + StrcatToALUCode( buff ); + StrcatToALUCode( ";\n" ); + } + + break; + + // Unary operations + case D3DSIO_MOV: + case D3DSIO_RCP: + case D3DSIO_RSQ: + case D3DSIO_EXP: + case D3DSIO_EXPP: + case D3DSIO_LOG: + case D3DSIO_LOGP: + case D3DSIO_FRC: + case D3DSIO_LIT: + case D3DSIO_ABS: + Handle_UnaryOp( nInstruction ); + break; + + // -- Binary ops ------------------------------------------------- + case D3DSIO_TEXM3x3SPEC: + case D3DSIO_M4x4: + case D3DSIO_M4x3: + case D3DSIO_M3x4: + case D3DSIO_M3x3: + case D3DSIO_M3x2: + case D3DSIO_CALLNZ: + case D3DSIO_IFC: + case D3DSIO_BREAKC: + case D3DSIO_SETP: + Assert(0); + break; + + // Binary Operations + case D3DSIO_ADD: + case D3DSIO_SUB: + case D3DSIO_MUL: + case D3DSIO_DP3: + case D3DSIO_DP4: + case D3DSIO_MIN: + case D3DSIO_MAX: + case D3DSIO_DST: + case D3DSIO_SLT: + case D3DSIO_SGE: + case D3DSIO_CRS: + case D3DSIO_POW: + if ( m_bGLSL ) + { + HandleBinaryOp_GLSL( nInstruction ); + } + else + { + HandleBinaryOp_ASM( nInstruction ); + } + break; + + // -- Ternary ops ------------------------------------------------- + case D3DSIO_DP2ADD: + Handle_DP2ADD(); + break; + case D3DSIO_LRP: + Handle_LRP( nInstruction ); + break; + case D3DSIO_SGN: + Assert( m_bVertexShader ); + Assert(0); // TODO emulate with SLT etc + break; + case D3DSIO_CND: + Assert(0); + break; + case D3DSIO_CMP: + Handle_CMP(); + break; + case D3DSIO_SINCOS: + Handle_SINCOS(); + break; + case D3DSIO_MAD: + Handle_MAD( nInstruction ); + break; + + // -- Quaternary op ------------------------------------------------ + case D3DSIO_TEXLDD: + Handle_TexLDD( nInstruction ); + break; + + // -- Special cases: texcoord vs texcrd and tex vs texld ----------- + case D3DSIO_TEXCOORD: + Handle_TexCoord(); + break; + + case D3DSIO_TEX: + Handle_TEX( dwToken, false ); + break; + + case D3DSIO_TEXLDL: + Handle_TEX( nInstruction, true ); + break; + + case D3DSIO_DCL: + Handle_DCL(); + break; + + case D3DSIO_DEFB: + case D3DSIO_DEFI: + // Shouldn't be using bool or integer constants + Assert(0); + break; + + case D3DSIO_DEF: + Handle_DEF(); + break; + + case D3DSIO_COMMENT: + // Using OpcodeSpecificData() can fail here since the comments can be longer than 0xff dwords + nNumTokensToSkip = ( dwToken & 0x0fff0000 ) >> 16; + SkipTokens( nNumTokensToSkip ); + break; + + case D3DSIO_END: + break; + } + + if ( m_bSpew ) + { + int aluCodeLength1 = V_strlen( (char *) m_pBufALUCode->Base() ); + if ( aluCodeLength1 != aluCodeLength0 ) + { + // code was emitted + printf( "\n > %s", ((char *)m_pBufALUCode->Base()) + aluCodeLength0 ); + + aluCodeLength0 = aluCodeLength1; + } + } + } + + // Note that this constant packing expects .wzyx swizzles in case we ever use the SINCOS code in a ps_2_x shader + // + // The Microsoft documentation on this is all kinds of broken and, strangely, these numbers don't even + // match the D3DSINCOSCONST1 and D3DSINCOSCONST2 constants used by the D3D assembly sincos instruction... + if ( m_bNeedsSinCosDeclarations ) + { + if ( m_bGLSL ) + { + StrcatToParamCode( "vec4 scA = vec4( -1.55009923e-6, -2.17013894e-5, 0.00260416674, 0.00026041668 );\n" ); + StrcatToParamCode( "vec4 scB = vec4( -0.020833334, -0.125, 1.0, 0.5 );\n" ); + } + else + { + StrcatToParamCode( "PARAM scA = { -1.55009923e-6, -2.17013894e-5, 0.00260416674, 0.00026041668 };\n" ); + StrcatToParamCode( "PARAM scB = { -0.020833334, -0.125, 1.0, 0.5 };\n" ); + } + } + + // Stick in the sampler mask in hex + PrintToBuf( *m_pBufHeaderCode, "%sSAMPLERMASK-%x\n", m_bGLSL ? "//" : "#", m_dwSamplerUsageMask ); + + // Uniforms + if ( m_bGLSL ) + { + PrintToBuf( *m_pBufHeaderCode, "//HIGHWATER-%d\n", m_nHighestRegister ); + PrintToBuf( *m_pBufHeaderCode, "\n%suniform vec4 %s[%d];\n", m_bUseBindableUniforms ? "bindable " : "", m_bVertexShader ? "vc" : "pc", m_nHighestRegister + 1 ); + + // On GLSL vertex shaders, we may have integer and boolean constants + if ( m_bAllowStaticControlFlow && m_bVertexShader ) + { + for( int i=0; i<32; i++ ) + { + if ( m_dwConstIntUsageMask & ( 0x00000001 << i ) ) + { + PrintToBuf( *m_pBufHeaderCode, "uniform int i%d;\n", i ); + } + } + + for( int i=0; i<32; i++ ) + { + if ( m_dwConstBoolUsageMask & ( 0x00000001 << i ) ) + { + PrintToBuf( *m_pBufHeaderCode, "uniform bool b%d;\n", i ); + } + } + } + + // Control bit for sRGB Write suffix + if ( m_bGenerateSRGBWriteSuffix ) + { + // R500 Hookup + // Set this guy to 1 when the sRGBWrite state is true, otherwise 0 + StrcatToHeaderCode( "uniform float flSRGBWrite;\n" ); + } + + PrintToBuf( *m_pBufHeaderCode, "\n" ); + + // Write samplers + WriteGLSLSamplerDefinitions(); + } + else + { + PrintToBuf( *m_pBufParamCode, "#HIGHWATER-%d\n", m_nHighestRegister ); + PrintToBuf( *m_pBufParamCode, "PARAM %s[%d] = { program.%s[0..%d] };\n", m_bVertexShader ? "vc" : "pc", m_nHighestRegister + 1, m_bUseEnvParams ? "env" : "local", m_nHighestRegister ); + } + + if ( m_bDeclareAddressReg ) + { + m_nHighestRegister = DXABSTRACT_VS_PARAM_SLOTS - 1; + + if ( m_bGLSL ) + { + StrcatToParamCode( "vec4 va_r;\nint a0;\n" ); + } + else + { + StrcatToParamCode( "ADDRESS a0;\n" ); + StrcatToParamCode( "TEMP VA_REG;\n" ); + } + } + + const char *pTempVarStr = "TEMP"; + if ( m_bGLSL ) + { + pTempVarStr = "vec4"; + } + + // Declare temps in Param code buffer + for( int i=0; i<32; i++ ) + { + if ( m_dwTempUsageMask & ( 0x00000001 << i ) ) + { + PrintToBuf( *m_pBufParamCode, "%s r%d;\n", pTempVarStr, i ); + } + } + + if ( m_bGLSL && m_bVertexShader ) + { + StrcatToParamCode( "vec4 vTempPos;\n" ); + } + + if ( m_bNeedsSinCosDeclarations ) + { + if ( m_bGLSL ) + { + StrcatToParamCode( "vec3 vSinCosTmp;\n" ); // declare temp used by GLSL sin and cos intrinsics + } + else + { + PrintToBuf( *m_pBufParamCode, "%s SC_TEMP;\n", pTempVarStr ); + } + } + + // Optional temps needed to emulate d2add instruction in DX pixel shaders + if ( m_bNeedsD2AddTemp ) + { + PrintToBuf( *m_pBufParamCode, "%s DP2A0;\n%s DP2A1;\n", pTempVarStr, pTempVarStr ); + } + + // Optional temp needed to emulate lerp instruction in DX vertex shaders + if ( m_bNeedsLerpTemp ) + { + PrintToBuf( *m_pBufParamCode, "%s LRP_TEMP;\n", pTempVarStr ); + } + + // Optional temp needed to emulate NRM instruction in DX shaders + if ( m_bNeedsNRMTemp ) + { + PrintToBuf( *m_pBufParamCode, "%s NRM_TEMP;\n", pTempVarStr ); + } + + // Pixel shader color outputs (MRT support?...just declare MRT outputs as useless TEMPS) + if ( !m_bGLSL && !m_bVertexShader ) + { + if ( m_bOutputColorRegister[1] ) + { + StrcatToParamCode( "TEMP oC1;\n" ); + } + if ( m_bOutputColorRegister[2] ) + { + StrcatToParamCode( "TEMP oC2;\n" ); + } + if ( m_bOutputColorRegister[3] ) + { + StrcatToParamCode( "TEMP oC3;\n" ); + } + if ( m_bOutputColorRegister[0] ) + { + StrcatToParamCode( "OUTPUT oC0 = result.color;\n" ); + } + } + + if ( m_bDeclareVSOPos && m_bVertexShader ) + { + if ( m_bGLSL ) + { + if (m_bDoUserClipPlanes) + { + StrcatToALUCode( "gl_ClipVertex = vTempPos;\n" ); // if user clip is enabled, jam clip space position into gl_ClipVertex + } + } + + if ( m_bDoFixupZ || m_bDoFixupY ) + { + if ( !m_bGLSL ) + { + // don't write to real reg - declare a temp and then declare a new output reg oPosGL + StrcatToParamCode( "TEMP oPos;\n" ); + StrcatToParamCode( "OUTPUT oPosGL = result.position;\n" ); + } + + // TODO: insert clip distance computation something like this: + // + // StrcatToALUCode( "DP4 oCLP[0].x, oPos, vc[215]; \n" ); + // + + if ( m_bDoFixupZ ) + { + if ( m_bGLSL ) + { + StrcatToALUCode( "vTempPos.z = vTempPos.z * vc[0].z - vTempPos.w; // z' = (2*z)-w\n" ); + } + else + { + // append instructions to perform Z fixup + // new Z = (old Z * 2.0) - W + + // negate Z, double it, then add the 'w'. + // near: Z=0 -> Z' = +1.0. this seems wrong.... + // far: Z=1 -> Z' = -1.0 uh, this ain't right... + // StrcatToALUCode( "MAD r0.z, -oPos.z, vc[0].z, oPos.w; # z' = (2*-z)+w\n" ); + + // double Z, subtract 'w'. + // near: Z=0 -> Z' = -1.0. + // far: Z=1 -> Z' = +1.0 + //StrcatToALUCode( "MAD r0.z, oPos.z, vc[0].z, -oPos.w; # z' = (2*z)-w\n" ); + StrcatToALUCode( "MAD oPos.z, oPos.z, vc[0].z, -oPos.w; # z' = (2*z)-w\n" ); + } + } + + if ( m_bDoFixupY ) + { + // append instructions to flip Y over + // new Y = -(old Y) + if ( m_bGLSL ) + { + StrcatToALUCode( "vTempPos.y = -vTempPos.y; // y' = -y \n" ); + } + else + { + StrcatToALUCode( "MOV oPos.y, -oPos.y; # y' = -y \n" ); + } + } + + if ( m_bGLSL ) + { + StrcatToALUCode( "gl_Position = vTempPos;\n" ); + } + else + { + StrcatToALUCode( "MOV oPosGL, oPos;\n" ); + } + + } + else + { + StrcatToParamCode( "OUTPUT oPos = result.position;\n" ); + + // TODO: insert clip distance computation something like this: + // + // StrcatToALUCode( "DP4 oCLP[0].x, oPos, c[215]; \n" ); + // + } + } + + if ( m_bVertexShader && m_bDoUserClipPlanes && !m_bGLSL ) + { + // insert oCLP generation instructions + char temp[256]; + + if(0) + { + V_snprintf( temp, sizeof( temp ), "DP4 result.clip[0].x, oPos, c[%d];\n", DXABSTRACT_VS_CLIP_PLANE_BASE ); // ask GLM where to stash the secret params + V_snprintf( temp, sizeof( temp ), "DP4 result.clip[1].x, oPos, c[%d];\n", DXABSTRACT_VS_CLIP_PLANE_BASE+1 ); + } + + if(0) + { + V_snprintf( temp, sizeof( temp ), "DP4 o[CLP0].x, oPos, c[%d];\n", DXABSTRACT_VS_CLIP_PLANE_BASE ); // ask GLM where to stash the secret params + V_snprintf( temp, sizeof( temp ), "DP4 o[CLP1].x, oPos, c[%d];\n", DXABSTRACT_VS_CLIP_PLANE_BASE+1 ); + } + + if(1) + { + V_snprintf( temp, sizeof( temp ), "DP4 oClip0.x, oPos, c[%d];\n", DXABSTRACT_VS_CLIP_PLANE_BASE ); // ask GLM where to stash the secret params + V_snprintf( temp, sizeof( temp ), "DP4 oClip1.x, oPos, c[%d];\n", DXABSTRACT_VS_CLIP_PLANE_BASE+1 ); + } + + StrcatToALUCode( temp ); + } + + if ( m_bGLSL ) + { + if ( m_bVertexShader ) + { + for ( int i=0; i<32; i++ ) + { + char outTexCoordBuff[64]; + if ( m_dwTexCoordOutMask & ( 0x00000001 << i ) ) + { + if ( m_nCentroidMask & ( 0x00000001 << i ) ) + { + V_snprintf( outTexCoordBuff, sizeof( outTexCoordBuff ), "centroid varying vec4 oT%d;\n", i ); // centroid varying + StrcatToHeaderCode( outTexCoordBuff ); + } + else + { + V_snprintf( outTexCoordBuff, sizeof( outTexCoordBuff ), "varying vec4 oT%d;\n", i ); + StrcatToHeaderCode( outTexCoordBuff ); + } + } + } + } + } + else // asm + { + if ( m_bDeclareVSOFog && m_bVertexShader ) + { + StrcatToParamCode( "OUTPUT oFog = result.fogcoord;\n" ); + } + + for ( int i=0; i<32; i++ ) + { + char outTexCoordBuff[64]; + if ( m_dwTexCoordOutMask & ( 0x00000001 << i ) ) + { + V_snprintf( outTexCoordBuff, sizeof( outTexCoordBuff ), "OUTPUT oT%d = result.texcoord[%d];\n", i, i ); + StrcatToParamCode( outTexCoordBuff ); + } + } + + if ( m_bOutputColorRegister[0] && m_bVertexShader ) + { + StrcatToParamCode( "OUTPUT oD0 = result.color;\n" ); + } + + if ( m_bOutputColorRegister[1] && m_bVertexShader ) + { + StrcatToParamCode( "OUTPUT oD1 = result.color.secondary;\n" ); + } + } + + if ( m_bOutputDepthRegister && !m_bVertexShader && !m_bGLSL ) + { + StrcatToParamCode( "OUTPUT oDepth = result.depth;\n" ); + } + + if ( m_bDoUserClipPlanes && m_bVertexShader && !m_bGLSL ) + { + StrcatToParamCode( "OUTPUT oClip0 = result.clip[0];\n" ); + StrcatToParamCode( "OUTPUT oClip1 = result.clip[1];\n" ); + } + + // do some annotation at the end of the attrib block + { + char temp[1000]; + + if ( m_bVertexShader ) + { + // write attrib map into the text starting at pAttribMapStart - two hex digits per attrib + for( int i=0; i<16; i++ ) + { + if ( m_dwAttribMap[i] != 0xFFFFFFFF ) + { + V_snprintf( temp, sizeof(temp), "%02X", m_dwAttribMap[i] ); + memcpy( pAttribMapStart + (i*3), temp, 2 ); + } + } + } + + V_snprintf( temp, sizeof(temp), "%s trans#%d label:%s\n", m_bGLSL ? "//" : "#", g_translationCounter, debugLabel ? debugLabel : "none" ); + StrcatToAttribCode( temp ); + + g_translationCounter++; + } + + // If we actually sample from a shadow depth sampler, we need to declare the shadow option at the top + if ( m_bDeclareShadowOption ) + { + StrcatToHeaderCode( "OPTION ARB_fragment_program_shadow;\n" ); + } + + if ( m_bGLSL ) + { + StrcatToHeaderCode( "\nvoid main()\n{\n" ); + if ( m_bUsedAtomicTempVar ) + { + PrintToBuf( *m_pBufHeaderCode, "vec4 %s;\n\n", g_pAtomicTempVarName ); + } + } + + // sRGB Write suffix + if ( m_bGenerateSRGBWriteSuffix ) + { + Assert( m_bGLSL ); + if ( m_bGLSL ) + { + StrcatToALUCode( "vec3 sRGBFragData;\n" ); + StrcatToALUCode( "sRGBFragData.xyz = log( gl_FragData[0].xyz );\n" ); + StrcatToALUCode( "sRGBFragData.xyz = sRGBFragData.xyz * vec3( 0.454545f, 0.454545f, 0.454545f );\n" ); + StrcatToALUCode( "sRGBFragData.xyz = exp( sRGBFragData.xyz );\n" ); + StrcatToALUCode( "gl_FragData[0].xyz = mix( gl_FragData[0].xyz, sRGBFragData, flSRGBWrite );\n" ); + } + } + + if ( m_bGLSL ) + { + WriteGLSLOutputVariableAssignments(); + StrcatToALUCode( "\n}\n" ); + } + else + { + StrcatToALUCode( "END\n\0" ); + } + + // Put all of the strings together for final program ( pHeaderCode + pAttribCode + pParamCode + pALUCode ) + StrcatToHeaderCode( (char*)m_pBufAttribCode->Base() ); + StrcatToHeaderCode( (char*)m_pBufParamCode->Base() ); + StrcatToHeaderCode( (char*)m_pBufALUCode->Base() ); + + // Cleanup - don't touch m_pBufHeaderCode, as it is managed by the caller + delete m_pBufAttribCode; + delete m_pBufParamCode; + delete m_pBufALUCode; + m_pBufAttribCode = m_pBufParamCode = m_pBufALUCode = NULL; + + if ( m_bSpew ) + { + printf("\n************* translation complete\n\n " ); + } + + return DISASM_OK; +} diff --git a/external/steamworks/glmgr/dx9asmtogl2.h b/external/steamworks/glmgr/dx9asmtogl2.h new file mode 100644 index 0000000..ce73fab --- /dev/null +++ b/external/steamworks/glmgr/dx9asmtogl2.h @@ -0,0 +1,233 @@ +//------------------------------------------------------------------------------ +// DX9AsmToGL2.h +//------------------------------------------------------------------------------ + +#ifndef DX9_ASM_TO_GL_2_H +#define DX9_ASM_TO_GL_2_H + +#include "glmgr.h" + +//============================================================================== + + +#define DISASM_OK 0 +#define DISASM_ERROR 1 + +#define MAX_SHADER_CONSTANTS 512 + +#define MAX_DECLARED_OUTPUTS 32 + +#define HEXCODE_HEADER "// Hex: " + +// Option bits +#define D3DToGL_OptionUseEnvParams 0x001 +#define D3DToGL_OptionDoFixupZ 0x002 // Add instructions to put Z in the right interval for GL +#define D3DToGL_OptionDoFixupY 0x004 // Add instructions to flip the Y over for GL +#define D3DToGL_OptionDoUserClipPlanes 0x008 // ARB mode: Include OPTION vertex_program_2 and append DP4's to write into oCLP[0] and oCLP[1] + // GLSL mode: generate code to write gl_ClipVertex +#define D3DToGL_OptionGLSL 0x010 // Output GLSL, rather than ASM +#define D3DToGL_AddHexComments 0x020 // Include hex comments in the code for debugging +#define D3DToGL_PutHexCommentsAfterLines 0x040 // If D3DToGL_AddHexComments is set, this puts the codes to the right, rather than on separate lines +#define D3DToGL_GeneratingDebugText 0x080 // This tells it that we're just getting info for debugging so go easy on asserts and errors +#define D3DToGL_OptionAllowStaticControlFlow 0x100 +#define D3DToGL_OptionUseBindableUniforms 0x200 // add "bindable" in front of "vc" / "pc" constant arrays (GLSL only) +#define D3DToGL_OptionSRGBWriteSuffix 0x400 // Tack sRGB conversion suffix on to pixel shaders +#define D3DToGL_OptionSpew 0x80000000 + +// Code for which component of the "dummy" address register is needed by an instruction +#define ARL_DEST_NONE -1 +#define ARL_DEST_X 0 +#define ARL_DEST_Y 1 +#define ARL_DEST_Z 2 +#define ARL_DEST_W 3 + +class D3DToGL +{ +private: + // Pointers for dwToken stream management + uint32* m_pdwBaseToken; + uint32* m_pdwNextToken; + + // Vertex shader or pixel shader, and version (necessary because some opcodes alias) + bool m_bVertexShader; + uint32 m_dwMinorVersion; + uint32 m_dwMajorVersion; + + // Option flags + bool m_bUseEnvParams; // set D3DToGL_OptionUseEnvParams in 'options' to use + bool m_bDoFixupZ; // set D3DToGL_OptionDoFixupZ + bool m_bDoFixupY; // set D3DToGL_OptionDoFixupZ + bool m_bDoUserClipPlanes; // set D3DToGL_OptionDoUserClipPlanes + bool m_bSpew; // set D3DToGL_OptionSpew + bool m_bUseBindableUniforms; // set D3DToGL_OptionUseBindableUniforms + bool m_bGenerateSRGBWriteSuffix; // set D3DToGL_OptionSRGBWriteSuffix + + // Default: false + // If you set this to true, it'll convert to GLSL instead of GL ASM. + bool m_bGLSL; // set D3DToGL_OptionGLSL + + // Default: false + bool m_bAllowStaticControlFlow; // set D3DToGL_OptionAllowStaticControlFlow + + // Counter for dealing with nested loops + int m_nLoopDepth; + + // Add "// Hex: 0xFFEEF00"-type statements after each instruction is parsed. + bool m_bAddHexCodeComments; // set D3DToGL_AddHexComments + + // Only applicable if m_bAddHexCodeComments is true. + // If this is true, then it puts the hex code comments to the right of the instructions in a comment + // rather than preceding the instructions. + // Defaults to FALSE. + bool m_bPutHexCodesAfterLines; // set D3DToGL_PutHexCommentsAtEnd + + // This tells it that we're just getting info for debugging so go easy on asserts and errors. + // Defaults to FALSE. + bool m_bGeneratingDebugText; + + // Various scratch temps needed to handle mis-matches in instruction sets between D3D and OpenGL + bool m_bNeedsD2AddTemp; + bool m_bNeedsNRMTemp; + bool m_bDeclareAddressReg; + bool m_bNeedsLerpTemp; + bool m_bNeedsSinCosDeclarations; + + // Keep track of which vs outputs are used so we can declare them + bool m_bDeclareVSOPos; + bool m_bDeclareVSOFog; + uint32 m_dwTexCoordOutMask; + + // Mask of varyings which need centroid decoration + uint32 m_nCentroidMask; + + // Keep track of which temps are used so they can be declared + uint32 m_dwTempUsageMask; + bool m_bOutputColorRegister[4]; + bool m_bOutputDepthRegister; + + // Declaration of integer and bool constants + uint32 m_dwConstIntUsageMask; + uint32 m_dwConstBoolUsageMask; + + // Did we use atomic_temp_var? + bool m_bUsedAtomicTempVar; + + // Track constants so we know how to declare them + bool m_bConstantRegisterDefined[MAX_SHADER_CONSTANTS]; + + // Track sampler types when declared so we can properly decorate TEX instructions + uint32 m_dwSamplerTypes[32]; + + // Track sampler usage + uint32 m_dwSamplerUsageMask; + + // Track shadow sampler usage + int m_nShadowDepthSampler; + bool m_bDeclareShadowOption; + + // Track attribute references + // init to 0xFFFFFFFF (unhit) + // index by (dwRegToken & D3DSP_REGNUM_MASK) in VS DCL insns + // fill with (usage<<4) | (usage index). + uint32 m_dwAttribMap[16]; + + // Register high water mark + uint32 m_nHighestRegister; + + // GLSL does indentation for readability + int m_NumIndentTabs; + + // Output buffers. + CUtlBuffer *m_pBufHeaderCode; + CUtlBuffer *m_pBufAttribCode; + CUtlBuffer *m_pBufParamCode; + CUtlBuffer *m_pBufALUCode; + + char *m_pFinalAssignmentsCode; + int m_nFinalAssignmentsBufSize; + + // Recorded positions for debugging. + uint32* m_pRecordedInputTokenStart; + int m_nRecordedParamCodeStrlen; + int m_nRecordedALUCodeStrlen; + int m_nRecordedAttribCodeStrlen; + + // In GLSL mode, these store the semantic attached to each oN register. + // They are the values that you pass to GetUsageIndexAndString. + uint32 m_DeclaredOutputs[MAX_DECLARED_OUTPUTS]; + + // Have they used the tangent input semantic (i.e. is g_pTangentAttributeName declared)? + bool m_bTangentInputUsed; + + +private: + // Utilities to aid in decoding token stream + uint32 GetNextToken( void ); + void SkipTokens( uint32 numToSkip ); + uint32 Opcode( uint32 dwToken ); + uint32 OpcodeSpecificData( uint32 dwToken ); + uint32 TextureType ( uint32 dwToken ); + uint32 GetRegType( uint32 dwRegToken ); + + // Write to the different buffers. + void StrcatToHeaderCode( const char *pBuf ); + void StrcatToALUCode( const char *pBuf ); + void StrcatToParamCode( const char *pBuf ); + void StrcatToAttribCode( const char *pBuf ); + + // This helps write the token hex codes into the output stream for debugging. + void AddTokenHexCodeToBuffer( char *pBuffer, int nSize, int nLastStrlen ); + void RecordInputAndOutputPositions(); + void AddTokenHexCode(); + + // Utilities for decoding tokens in to strings according to ASM syntax + void PrintOpcode( uint32 inst, char* buff, int nBufLen ); + + // fSemanticFlags is SEMANTIC_INPUT or SEMANTIC_OUTPUT. + void PrintUsageAndIndexToString( uint32 dwToken, char* strUsageUsageIndexName, int nBufLen, int fSemanticFlags ); + CUtlString GetUsageAndIndexString( uint32 dwToken, int fSemanticFlags ); + CUtlString GetParameterString( uint32 dwToken, uint32 dwSourceOrDest, bool bForceScalarSource, int *pARLDestReg ); + const char* GetGLSLOperatorString( uint32 inst ); + + void PrintParameterToString ( uint32 dwToken, uint32 dwSourceOrDest, char *pRegisterName, int nBufLen, bool bForceScalarSource, int *pARLDestReg ); + + void InsertMoveFromAddressRegister( CUtlBuffer *pCode, int nARLComp0, int nARLComp1, int nARLComp2 = ARL_DEST_NONE ); + void InsertMoveInstruction( CUtlBuffer *pCode, int nARLComponent ); + void FlagIndirectRegister( uint32 dwToken, int *pARLDestReg ); + + // Utilities for decoding tokens in to strings according to GLSL syntax + bool OpenIntrinsic( uint32 inst, char* buff, int nBufLen, uint32 destDimension, uint32 nArgumentDimension ); + void PrintIndentation( char *pBuf, int nBufLen ); + + uint32 MaintainAttributeMap( uint32 dwToken, uint32 dwRegToken ); + + CUtlString FixGLSLSwizzle( const char *pDestRegisterName, const char *pSrcRegisterName ); + void WriteGLSLCmp( const char *pDestReg, const char *pSrc0Reg, const char *pSrc1Reg, const char *pSrc2Reg ); + void WriteGLSLSamplerDefinitions(); + void WriteGLSLOutputVariableAssignments(); + void NoteTangentInputUsed(); + + void Handle_DCL(); + void Handle_DEF(); + void Handle_MAD( uint32 nInstruction ); + void Handle_DP2ADD(); + void Handle_SINCOS(); + void Handle_LRP( uint32 nInstruction ); + void Handle_TEX( uint32 dwToken, bool bIsTexLDL ); + void Handle_TexLDD( uint32 nInstruction ); + void Handle_TexCoord(); + void Handle_UnaryOp( uint32 nInstruction ); + void HandleBinaryOp_GLSL( uint32 nInstruction ); + void HandleBinaryOp_ASM( uint32 nInstruction ); + void Handle_CMP(); + void Handle_NRM(); + void Handle_DeclarativeNonDclOp( uint32 nInstruction ); + +public: + D3DToGL(); + + int TranslateShader( uint32* code, CUtlBuffer *pBufDisassembledCode, bool *bVertexShader, uint32 options, int32 nShadowDepthSampler, uint32 nCentroidMask, char *debugLabel ); +}; + + +#endif // DX9_ASM_TO_GL_2_H diff --git a/external/steamworks/glmgr/dxabstract.cpp b/external/steamworks/glmgr/dxabstract.cpp new file mode 100644 index 0000000..8db23c8 --- /dev/null +++ b/external/steamworks/glmgr/dxabstract.cpp @@ -0,0 +1,5951 @@ +//================ Copyright (c) 1996-2009 Valve Corporation. All Rights Reserved. ================= +// +// +// +//================================================================================================== + +#include "dxabstract.h" +#include "dx9asmtogl2.h" +#include "mathlite.h" + +#ifdef OSX +#include "glmgr.h" + +#include "../SteamWorksExample/gameengineosx.h" + +#if DX9MODE + extern CGameEngineGL *g_engine; // so dxabstract (which is C++) can call up to the game engine ObjC object and ask for things.. +#endif + +#include + +// Debugger - 10.8 +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +#endif + +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wunused-variable" +#endif + +#ifdef USE_ACTUAL_DX + +#pragma comment( lib, "../../dx9sdk/lib/d3d9.lib" ) +#pragma comment( lib, "../../dx9sdk/lib/d3dx9.lib" ) + +#else + +// ------------------------------------------------------------------------------------------------------------------------------ // + +bool g_useASMTranslations = true; +//static D3DToGL_ASM g_D3DToOpenGLTranslatorASM; // old translator retired +static D3DToGL g_D3DToOpenGLTranslatorASM; // same class as the GLSL one, just invoked with different options + +bool g_useGLSLTranslations = true; +static D3DToGL g_D3DToOpenGLTranslatorGLSL; + +bool g_bUseControlFlow = false; + +// ------------------------------------------------------------------------------------------------------------------------------ // + +void GlobalMemoryStatus( MEMORYSTATUS *pOut ) +{ + //cheese: return 2GB physical + pOut->dwTotalPhys = (1<<31); +} + +void Sleep( unsigned int ms ) +{ + Assert(0); +} + +bool IsIconic( VD3DHWND hWnd ) +{ + // FIXME for now just act non-minimized all the time + return false; +} + +void GetClientRect( void *hWnd, RECT *destRect ) +{ + // the only useful answer this call can offer, is the size of the canvas. + // actually getting the window bounds is not useful. + // so, see if a D3D device is up and running, and if so, + // dig in and find out its backbuffer size and use that. + +#if DX9MODE // can only make these calls if DX9MODE is on, if not, we won't get here + uint width, height; + g_engine->RenderedSize( width, height, false ); // false = get them, don't set them + Assert( width!=0 && height!=0 ); + + destRect->left = 0; + destRect->top = 0; + destRect->right = width; + destRect->bottom = height; + + //GLMPRINTF(( "-D- GetClientRect returning rect of (0,0, %d,%d)",width,height )); +#endif + + return; +} + +BOOL ClientToScreen( VD3DHWND hWnd, LPPOINT pPoint ) +{ + Assert(0); + return true; +} + +void* GetCurrentThread() +{ + Assert(0); + return 0; +} + +void SetThreadAffinityMask( void *hThread, int nMask ) +{ + Assert(0); +} + +// ------------------------------------------------------------------------------------------------------------------------------ // + +#if 0 +#pragma mark ----- D3DXMATRIX operators + +D3DXMATRIX D3DXMATRIX::operator*( const D3DXMATRIX &o ) const +{ + D3DXMATRIX result; + + D3DXMatrixMultiply( &result, this, &o ); // this = lhs o = rhs result = this * o + + return result; +} + +D3DXMATRIX::operator FLOAT* () +{ + return (float*)this; +} + +float& D3DXMATRIX::operator()( int row, int column ) +{ + return m[row][column]; +} + +const float& D3DXMATRIX::operator()( int row, int column ) const +{ + return m[row][column]; +} + +// ------------------------------------------------------------------------------------------------------------------------------ // + +#pragma mark ----- D3DXPLANE operators + +float& D3DXPLANE::operator[]( int i ) +{ + return ((float*)this)[i]; +} + +bool D3DXPLANE::operator==( const D3DXPLANE &o ) +{ + return a == o.a && b == o.b && c == o.c && d == o.d; +} + +bool D3DXPLANE::operator!=( const D3DXPLANE &o ) +{ + return !( *this == o ); +} + +D3DXPLANE::operator float*() +{ + return (float*)this; +} + +D3DXPLANE::operator const float*() const +{ + return (const float*)this; +} + +// ------------------------------------------------------------------------------------------------------------------------------ // + +#pragma mark ----- D3DXVECTOR2 operators + +D3DXVECTOR2::operator FLOAT* () +{ + return (float*)this; +} + +D3DXVECTOR2::operator CONST FLOAT* () const +{ + return (const float*)this; +} + +// ------------------------------------------------------------------------------------------------------------------------------ // + +#pragma mark ----- D3DXVECTOR3 operators + +D3DXVECTOR3::D3DXVECTOR3( float a, float b, float c ) +{ + x = a; + y = b; + z = c; +} + +D3DXVECTOR3::operator FLOAT* () +{ + return (float*)this; +} + +D3DXVECTOR3::operator CONST FLOAT* () const +{ + return (const float*)this; +} + +// ------------------------------------------------------------------------------------------------------------------------------ // + + +#pragma mark ----- D3DXVECTOR4 operators + +D3DXVECTOR4::D3DXVECTOR4( float a, float b, float c, float d ) +{ + x = a; + y = b; + z = c; + w = d; +} +#endif + +// ------------------------------------------------------------------------------------------------------------------------------ // + +DWORD IDirect3DResource9::SetPriority(DWORD PriorityNew) +{ +// Debugger(); +// GLMPRINTF(( "-X- SetPriority" )); + // no-op city + return 0; +} + +// ------------------------------------------------------------------------------------------------------------------------------ // + +#pragma mark ----- IDirect3DBaseTexture9 + +IDirect3DBaseTexture9::~IDirect3DBaseTexture9() +{ + GLMPRINTF(( ">-A- ~IDirect3DBaseTexture9" )); + + if (m_device) + { + GLMPRINTF(( "-A- ~IDirect3DBaseTexture9 taking normal delete path on %08x, device is %08x ", this, m_device )); + m_device->ReleasedTexture( this ); + + if (m_tex) + { + GLMPRINTF(("-A- ~IDirect3DBaseTexture9 deleted '%s' @ %08x (GLM %08x) %s",m_tex->m_layout->m_layoutSummary, this, m_tex, m_tex->m_debugLabel ? m_tex->m_debugLabel : "" )); + + m_tex->m_ctx->DelTex( m_tex ); + m_tex = NULL; + } + else + { + GLMPRINTF(( "-A- ~IDirect3DBaseTexture9 : whoops, no tex to delete here ?" )); + } + m_device = NULL; // ** THIS ** is the only place to scrub this. Don't do it in the subclass destructors. + } + else + { + GLMPRINTF(( "-A- ~IDirect3DBaseTexture9 taking strange delete path on %08x, device is %08x ", this, m_device )); + } + + GLMPRINTF(( "<-A- ~IDirect3DBaseTexture9" )); +} + +D3DRESOURCETYPE IDirect3DBaseTexture9::GetType() +{ + return m_restype; //D3DRTYPE_TEXTURE; +} + +DWORD IDirect3DBaseTexture9::GetLevelCount() +{ + return m_tex->m_layout->m_mipCount; +} + +HRESULT IDirect3DBaseTexture9::GetLevelDesc(UINT Level,D3DSURFACE_DESC *pDesc) +{ + Assert (Level < m_tex->m_layout->m_mipCount); + + D3DSURFACE_DESC result = m_descZero; + // then mutate it for the level of interest + + GLMTexLayoutSlice *slice = &m_tex->m_layout->m_slices[ m_tex->CalcSliceIndex( 0, Level ) ]; + + result.Width = slice->m_xSize; + result.Height = slice->m_ySize; + + *pDesc = result; + + return S_OK; +} + +// ------------------------------------------------------------------------------------------------------------------------------ // + +#pragma mark ----- IDirect3DTexture9 + +HRESULT IDirect3DDevice9::CreateTexture(UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,VD3DHANDLE* pSharedHandle, char *debugLabel) +{ + GLMPRINTF((">-A-IDirect3DDevice9::CreateTexture")); + IDirect3DTexture9 *dxtex = new IDirect3DTexture9; + dxtex->m_restype = D3DRTYPE_TEXTURE; + + dxtex->m_device = this; + + dxtex->m_descZero.Format = Format; + dxtex->m_descZero.Type = D3DRTYPE_TEXTURE; + dxtex->m_descZero.Usage = Usage; + dxtex->m_descZero.Pool = Pool; + + dxtex->m_descZero.MultiSampleType = D3DMULTISAMPLE_NONE; + dxtex->m_descZero.MultiSampleQuality = 0; + dxtex->m_descZero.Width = Width; + dxtex->m_descZero.Height = Height; + + GLMTexLayoutKey key; + memset( &key, 0, sizeof(key) ); + + key.m_texGLTarget = GL_TEXTURE_2D; + key.m_texFormat = Format; + + if (Levels>1) + { + key.m_texFlags |= kGLMTexMipped; + } + + // http://msdn.microsoft.com/en-us/library/bb172625(VS.85).aspx + + // complain if any usage bits come down that I don't know. + uint knownUsageBits = (D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_RENDERTARGET | D3DUSAGE_DYNAMIC | D3DUSAGE_TEXTURE_SRGB | D3DUSAGE_DEPTHSTENCIL); + if ( (Usage & knownUsageBits) != Usage ) + { + GLMDebugger(); + } + + if (Usage & D3DUSAGE_AUTOGENMIPMAP) + { + key.m_texFlags |= kGLMTexMipped | kGLMTexMippedAuto; + } + + if (Usage & D3DUSAGE_DYNAMIC) + { + // GLMPRINTF(("-X- DYNAMIC tex usage ignored..")); //FIXME + } + + if (Usage & D3DUSAGE_TEXTURE_SRGB) + { + key.m_texFlags |= kGLMTexSRGB; + } + + if (Usage & D3DUSAGE_RENDERTARGET) + { + Assert( !(Usage & D3DUSAGE_DEPTHSTENCIL) ); + + key.m_texFlags |= kGLMTexRenderable; + key.m_texFlags |= kGLMTexSRGB; // this catches callers of CreateTexture who set the "renderable" option - they get an SRGB tex + + if (m_ctx->Caps().m_cantAttachSRGB) + { + // this config can't support SRGB render targets. quietly turn off the sRGB bit. + key.m_texFlags &= ~kGLMTexSRGB; + } + } + + key.m_xSize = Width; + key.m_ySize = Height; + key.m_zSize = 1; + + CGLMTex *tex = m_ctx->NewTex( &key, debugLabel ); + if (!tex) + { + GLMDebugger(); + } + dxtex->m_tex = tex; + + dxtex->m_srgbFlipCount = 0; + + dxtex->m_surfZero = new IDirect3DSurface9; + dxtex->m_surfZero->m_restype = (D3DRESOURCETYPE)0; // this is a ref to a tex, not the owner... + + // do not do an AddRef here. + + dxtex->m_surfZero->m_device = this; + + dxtex->m_surfZero->m_desc = dxtex->m_descZero; + dxtex->m_surfZero->m_tex = tex; + dxtex->m_surfZero->m_face = 0; + dxtex->m_surfZero->m_mip = 0; + + GLMPRINTF(("-A- IDirect3DDevice9::CreateTexture created '%s' @ %08x (GLM %08x) %s",tex->m_layout->m_layoutSummary, dxtex, tex, debugLabel ? debugLabel : "" )); + + *ppTexture = dxtex; + + GLMPRINTF(("<-A-IDirect3DDevice9::CreateTexture")); + return S_OK; +} + + +IDirect3DTexture9::~IDirect3DTexture9() +{ + GLMPRINTF(( ">-A- IDirect3DTexture9" )); + + // IDirect3DBaseTexture9::~IDirect3DBaseTexture9 frees up m_tex + // we take care of surfZero + + if (m_device) + { + m_device->ReleasedTexture( this ); + + if (m_surfZero) + { + ULONG refc = m_surfZero->Release( 0, "~IDirect3DTexture9 public release (surfZero)" ); + Assert( !refc ); + m_surfZero = NULL; + } + // leave m_device alone! + } + + GLMPRINTF(( "<-A- IDirect3DTexture9" )); +} + +HRESULT IDirect3DTexture9::LockRect(UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) +{ + // basically same code as in direct3dsurface9::lockrect + + GLMTexLockParams lockreq; + memset( &lockreq, 0, sizeof(lockreq) ); + + lockreq.m_tex = this->m_tex; + lockreq.m_face = 0; //2D texture, no faces + lockreq.m_mip = Level; + + // pRect can be NULL in which case, default to full size of slice + lockreq.m_region.xmin = pRect? pRect->left : 0; + lockreq.m_region.ymin = pRect ? pRect->top : 0; + lockreq.m_region.zmin = 0; + lockreq.m_region.xmax = pRect ? pRect->right : m_tex->m_layout->m_slices[ m_tex->CalcSliceIndex( 0, Level ) ].m_xSize; + lockreq.m_region.ymax = pRect ? pRect->bottom : m_tex->m_layout->m_slices[ m_tex->CalcSliceIndex( 0, Level ) ].m_ySize; + lockreq.m_region.zmax = 1; + + if ((Flags & (D3DLOCK_READONLY | D3DLOCK_NOSYSLOCK)) == (D3DLOCK_READONLY | D3DLOCK_NOSYSLOCK) ) + { + // smells like readback, force texel readout + lockreq.m_readback = true; + } + + char *lockAddress; + int yStride; + int zStride; + + lockreq.m_tex->Lock( &lockreq, &lockAddress, &yStride, &zStride ); + + pLockedRect->Pitch = yStride; + pLockedRect->pBits = lockAddress; + + return S_OK; +} + +HRESULT IDirect3DTexture9::UnlockRect(UINT Level) +{ + GLMTexLockParams lockreq; + memset( &lockreq, 0, sizeof(lockreq) ); + + lockreq.m_tex = this->m_tex; + lockreq.m_face = 0; //2D texture, no faces + lockreq.m_mip = Level; + + lockreq.m_tex->Unlock( &lockreq ); + + return S_OK; +} + +HRESULT IDirect3DTexture9::GetSurfaceLevel(UINT Level,IDirect3DSurface9** ppSurfaceLevel) +{ + // we create and pass back a surface, and the client is on the hook to release it. tidy. + + IDirect3DSurface9 *surf = new IDirect3DSurface9; + surf->m_restype = (D3DRESOURCETYPE)0; // 0 is special and means this 'surface' does not own its m_tex + + // Dicey...higher level code seems to want this and not want this. Are we missing some AddRef/Release behavior elsewhere? + // trying to turn this off - experimental - 26Oct2010 surf->AddRef(); + + surf->m_device = this->m_device; + + GLMTexLayoutSlice *slice = &m_tex->m_layout->m_slices[ m_tex->CalcSliceIndex( 0, Level ) ]; + + surf->m_desc = m_descZero; + surf->m_desc.Width = slice->m_xSize; + surf->m_desc.Height = slice->m_ySize; + + surf->m_tex = m_tex; + surf->m_face = 0; + surf->m_mip = Level; + + *ppSurfaceLevel = surf; + + return S_OK; +} + +// ------------------------------------------------------------------------------------------------------------------------------ // + +#pragma mark ----- IDirect3DCubeTexture9 + +HRESULT IDirect3DDevice9::CreateCubeTexture(UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,VD3DHANDLE* pSharedHandle, char *debugLabel) +{ + GLMPRINTF((">-A- IDirect3DDevice9::CreateCubeTexture")); + + IDirect3DCubeTexture9 *dxtex = new IDirect3DCubeTexture9; + dxtex->m_restype = D3DRTYPE_CUBETEXTURE; + + dxtex->m_device = this; + + dxtex->m_descZero.Format = Format; + dxtex->m_descZero.Type = D3DRTYPE_CUBETEXTURE; + dxtex->m_descZero.Usage = Usage; + dxtex->m_descZero.Pool = Pool; + + dxtex->m_descZero.MultiSampleType = D3DMULTISAMPLE_NONE; + dxtex->m_descZero.MultiSampleQuality = 0; + dxtex->m_descZero.Width = EdgeLength; + dxtex->m_descZero.Height = EdgeLength; + + GLMTexLayoutKey key; + memset( &key, 0, sizeof(key) ); + + key.m_texGLTarget = GL_TEXTURE_CUBE_MAP; + key.m_texFormat = Format; + + if (Levels>1) + { + key.m_texFlags |= kGLMTexMipped; + } + + // http://msdn.microsoft.com/en-us/library/bb172625(VS.85).aspx + // complain if any usage bits come down that I don't know. + uint knownUsageBits = (D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_RENDERTARGET | D3DUSAGE_DYNAMIC | D3DUSAGE_TEXTURE_SRGB); + if ( (Usage & knownUsageBits) != Usage ) + { + GLMDebugger(); + } + + if (Usage & D3DUSAGE_AUTOGENMIPMAP) + { + key.m_texFlags |= kGLMTexMipped | kGLMTexMippedAuto; + } + + if (Usage & D3DUSAGE_RENDERTARGET) + { + key.m_texFlags |= kGLMTexRenderable; + } + + if (Usage & D3DUSAGE_DYNAMIC) + { + //GLMPRINTF(("-X- DYNAMIC tex usage ignored..")); //FIXME + } + + if (Usage & D3DUSAGE_TEXTURE_SRGB) + { + key.m_texFlags |= kGLMTexSRGB; + } + + key.m_xSize = EdgeLength; + key.m_ySize = EdgeLength; + key.m_zSize = 1; + + CGLMTex *tex = m_ctx->NewTex( &key, debugLabel ); + if (!tex) + { + GLMDebugger(); + } + dxtex->m_tex = tex; + + dxtex->m_srgbFlipCount = 0; + + for( int face = 0; face < 6; face ++) + { + dxtex->m_surfZero[face] = new IDirect3DSurface9; + dxtex->m_surfZero[face]->m_restype = (D3DRESOURCETYPE)0; // 0 is special and means this 'surface' does not own its m_tex + // do not do an AddRef here. + + dxtex->m_surfZero[face]->m_device = this; + + dxtex->m_surfZero[face]->m_desc = dxtex->m_descZero; + dxtex->m_surfZero[face]->m_tex = tex; + dxtex->m_surfZero[face]->m_face = face; + dxtex->m_surfZero[face]->m_mip = 0; + } + + GLMPRINTF(("-A- IDirect3DDevice9::CreateCubeTexture created '%s' @ %08x (GLM %08x)",tex->m_layout->m_layoutSummary, dxtex, tex )); + + *ppCubeTexture = dxtex; + + GLMPRINTF(("<-A- IDirect3DDevice9::CreateCubeTexture")); + + return S_OK; +} + +IDirect3DCubeTexture9::~IDirect3DCubeTexture9() +{ + GLMPRINTF(( ">-A- ~IDirect3DCubeTexture9" )); + + if (m_device) + { + GLMPRINTF(( "-A- ~IDirect3DCubeTexture9 taking normal delete path on %08x, device is %08x, surfzero[0] is %08x ", this, m_device, m_surfZero[0] )); + m_device->ReleasedTexture( this ); + + // let IDirect3DBaseTexture9::~IDirect3DBaseTexture9 free up m_tex + // we handle the surfZero array for the faces + + for( int face = 0; face < 6; face ++) + { + if (m_surfZero[face]) + { + Assert( m_surfZero[face]->m_device = m_device ); + ULONG refc = m_surfZero[face]->Release( 0, "~IDirect3DCubeTexture9 public release (surfZero)"); + if ( refc!=0 ) + { + GLMPRINTF(( "-A- ~IDirect3DCubeTexture9 seeing non zero refcount on surfzero[%d] => %d ", face, refc )); + } + m_surfZero[face] = NULL; + } + } + // leave m_device alone! + } + else + { + GLMPRINTF(( "-A- ~IDirect3DCubeTexture9 taking strange delete path on %08x, device is %08x, surfzero[0] is %08x ", this, m_device, m_surfZero[0] )); + } + + GLMPRINTF(( "<-A- ~IDirect3DCubeTexture9" )); +} + +HRESULT IDirect3DCubeTexture9::GetCubeMapSurface(D3DCUBEMAP_FACES FaceType,UINT Level,IDirect3DSurface9** ppCubeMapSurface) +{ + // we create and pass back a surface, and the client is on the hook to release it... + + IDirect3DSurface9 *surf = new IDirect3DSurface9; + surf->m_restype = (D3DRESOURCETYPE)0; // 0 is special and means this 'surface' does not own its m_tex + + GLMTexLayoutSlice *slice = &m_tex->m_layout->m_slices[ m_tex->CalcSliceIndex( FaceType, Level ) ]; + + surf->m_device = this->m_device; + + surf->m_desc = m_descZero; + surf->m_desc.Width = slice->m_xSize; + surf->m_desc.Height = slice->m_ySize; + + surf->m_tex = m_tex; + surf->m_face = FaceType; + surf->m_mip = Level; + + *ppCubeMapSurface = surf; + + return S_OK; +} + +HRESULT IDirect3DCubeTexture9::GetLevelDesc(UINT Level,D3DSURFACE_DESC *pDesc) +{ + Assert (Level < m_tex->m_layout->m_mipCount); + + D3DSURFACE_DESC result = m_descZero; + // then mutate it for the level of interest + + GLMTexLayoutSlice *slice = &m_tex->m_layout->m_slices[ m_tex->CalcSliceIndex( 0, Level ) ]; + + result.Width = slice->m_xSize; + result.Height = slice->m_ySize; + + *pDesc = result; + + return S_OK; +} + + +// ------------------------------------------------------------------------------------------------------------------------------ // + +#pragma mark ----- IDirect3DVolumeTexture9 + +HRESULT IDirect3DDevice9::CreateVolumeTexture(UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,VD3DHANDLE* pSharedHandle, char *debugLabel) +{ + GLMPRINTF((">-A- IDirect3DDevice9::CreateVolumeTexture")); + // set dxtex->m_restype to D3DRTYPE_VOLUMETEXTURE... + + IDirect3DVolumeTexture9 *dxtex = new IDirect3DVolumeTexture9; + dxtex->m_restype = D3DRTYPE_VOLUMETEXTURE; + + dxtex->m_device = this; + + dxtex->m_descZero.Format = Format; + dxtex->m_descZero.Type = D3DRTYPE_VOLUMETEXTURE; + dxtex->m_descZero.Usage = Usage; + dxtex->m_descZero.Pool = Pool; + + dxtex->m_descZero.MultiSampleType = D3DMULTISAMPLE_NONE; + dxtex->m_descZero.MultiSampleQuality = 0; + dxtex->m_descZero.Width = Width; + dxtex->m_descZero.Height = Height; + + // also a volume specific desc + dxtex->m_volDescZero.Format = Format; + dxtex->m_volDescZero.Type = D3DRTYPE_VOLUMETEXTURE; + dxtex->m_volDescZero.Usage = Usage; + dxtex->m_volDescZero.Pool = Pool; + + dxtex->m_volDescZero.Width = Width; + dxtex->m_volDescZero.Height = Height; + dxtex->m_volDescZero.Depth = Depth; + + GLMTexLayoutKey key; + memset( &key, 0, sizeof(key) ); + + key.m_texGLTarget = GL_TEXTURE_3D; + key.m_texFormat = Format; + + if (Levels>1) + { + key.m_texFlags |= kGLMTexMipped; + } + + // http://msdn.microsoft.com/en-us/library/bb172625(VS.85).aspx + // complain if any usage bits come down that I don't know. + uint knownUsageBits = (D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_RENDERTARGET | D3DUSAGE_DYNAMIC | D3DUSAGE_TEXTURE_SRGB); + if ( (Usage & knownUsageBits) != Usage ) + { + Debugger(); + } + + if (Usage & D3DUSAGE_AUTOGENMIPMAP) + { + key.m_texFlags |= kGLMTexMipped | kGLMTexMippedAuto; + } + + if (Usage & D3DUSAGE_RENDERTARGET) + { + key.m_texFlags |= kGLMTexRenderable; + } + + if (Usage & D3DUSAGE_DYNAMIC) + { + GLMPRINTF(("-X- DYNAMIC tex usage ignored..")); //FIXME + } + + if (Usage & D3DUSAGE_TEXTURE_SRGB) + { + key.m_texFlags |= kGLMTexSRGB; + } + + key.m_xSize = Width; + key.m_ySize = Height; + key.m_zSize = Depth; + + CGLMTex *tex = m_ctx->NewTex( &key, debugLabel ); + if (!tex) + { + Debugger(); + } + dxtex->m_tex = tex; + + dxtex->m_srgbFlipCount = 0; + + dxtex->m_surfZero = new IDirect3DSurface9; + dxtex->m_surfZero->m_restype = (D3DRESOURCETYPE)0; // this is a ref to a tex, not the owner... + // do not do an AddRef here. + + dxtex->m_surfZero->m_device = this; + + dxtex->m_surfZero->m_desc = dxtex->m_descZero; + dxtex->m_surfZero->m_tex = tex; + dxtex->m_surfZero->m_face = 0; + dxtex->m_surfZero->m_mip = 0; + + GLMPRINTF(("-A- IDirect3DDevice9::CreateVolumeTexture created '%s' @ %08x (GLM %08x)",tex->m_layout->m_layoutSummary, dxtex, tex )); + + *ppVolumeTexture = dxtex; + + GLMPRINTF(("<-A- IDirect3DDevice9::CreateVolumeTexture")); + + return S_OK; +} + +IDirect3DVolumeTexture9::~IDirect3DVolumeTexture9() +{ + GLMPRINTF((">-A- ~IDirect3DVolumeTexture9")); + + if (m_device) + { + m_device->ReleasedTexture( this ); + + // let IDirect3DBaseTexture9::~IDirect3DBaseTexture9 free up m_tex + // we handle m_surfZero + + if (m_surfZero) + { + ULONG refc = m_surfZero->Release( 0, "~IDirect3DVolumeTexture9 public release (surfZero)" ); + Assert( !refc ); + m_surfZero = NULL; + } + // leave m_device alone! + } + + GLMPRINTF(("<-A- ~IDirect3DVolumeTexture9")); +} + +HRESULT IDirect3DVolumeTexture9::LockBox(UINT Level,D3DLOCKED_BOX* pLockedVolume,CONST D3DBOX* pBox,DWORD Flags) +{ + GLMTexLockParams lockreq; + memset( &lockreq, 0, sizeof(lockreq) ); + + lockreq.m_tex = this->m_tex; + lockreq.m_face = 0; + lockreq.m_mip = Level; + + lockreq.m_region.xmin = pBox->Left; + lockreq.m_region.ymin = pBox->Top; + lockreq.m_region.zmin = pBox->Front; + lockreq.m_region.xmax = pBox->Right; + lockreq.m_region.ymax = pBox->Bottom; + lockreq.m_region.zmax = pBox->Back; + + char *lockAddress; + int yStride; + int zStride; + + lockreq.m_tex->Lock( &lockreq, &lockAddress, &yStride, &zStride ); + + pLockedVolume->RowPitch = yStride; + pLockedVolume->SlicePitch = yStride; + pLockedVolume->pBits = lockAddress; + + return S_OK; +} + +HRESULT IDirect3DVolumeTexture9::UnlockBox(UINT Level) +{ + GLMTexLockParams lockreq; + memset( &lockreq, 0, sizeof(lockreq) ); + + lockreq.m_tex = this->m_tex; + lockreq.m_face = 0; + lockreq.m_mip = Level; + + this->m_tex->Unlock( &lockreq ); + + return S_OK; +} + +HRESULT IDirect3DVolumeTexture9::GetLevelDesc( UINT Level, D3DVOLUME_DESC *pDesc ) +{ + if (Level > m_tex->m_layout->m_mipCount) + { + Debugger(); + } + + D3DVOLUME_DESC result = m_volDescZero; + // then mutate it for the level of interest + + GLMTexLayoutSlice *slice = &m_tex->m_layout->m_slices[ m_tex->CalcSliceIndex( 0, Level ) ]; + + result.Width = slice->m_xSize; + result.Height = slice->m_ySize; + result.Depth = slice->m_zSize; + + *pDesc = result; + + return S_OK; +} + +// ------------------------------------------------------------------------------------------------------------------------------ // + +#pragma mark ----- IDirect3DSurface9 + +IDirect3DSurface9::~IDirect3DSurface9() +{ + // not much to do here, but good to verify that these things are being freed (and they are) + //GLMPRINTF(("-A- ~IDirect3DSurface9 - signpost")); + + if (m_device) + { + GLMPRINTF(("-A- ~IDirect3DSurface9 - taking real delete path on %08x device %08x", this, m_device)); + m_device->ReleasedSurface( this ); + + memset( &m_desc, 0, sizeof(m_desc) ); + + if (m_restype != 0) // signal that we are a surface that owns this tex (render target) + { + if (m_tex) + { + GLMPRINTF(("-A- ~IDirect3DSurface9 deleted '%s' @ %08x (GLM %08x) %s",m_tex->m_layout->m_layoutSummary, this, m_tex, m_tex->m_debugLabel ? m_tex->m_debugLabel : "" )); + + m_tex->m_ctx->DelTex( m_tex ); + m_tex = NULL; + } + else + { + GLMPRINTF(( "-A- ~IDirect3DSurface9 : whoops, no tex to delete here ?" )); + } + } + else + { + m_tex = NULL; // we are just a view on the tex, we don't own the tex, do not delete it + } + + m_face = m_mip = 0; + + m_device = NULL; + } + else + { + GLMPRINTF(("-A- ~IDirect3DSurface9 - taking strange delete path on %08x device %08x", this, m_device)); + } +} + +HRESULT IDirect3DSurface9::LockRect(D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) +{ + GLMTexLockParams lockreq; + memset( &lockreq, 0, sizeof(lockreq) ); + + lockreq.m_tex = this->m_tex; + lockreq.m_face = this->m_face; + lockreq.m_mip = this->m_mip; + + lockreq.m_region.xmin = pRect->left; + lockreq.m_region.ymin = pRect->top; + lockreq.m_region.zmin = 0; + lockreq.m_region.xmax = pRect->right; + lockreq.m_region.ymax = pRect->bottom; + lockreq.m_region.zmax = 1; + + if ((Flags & (D3DLOCK_READONLY | D3DLOCK_NOSYSLOCK)) == (D3DLOCK_READONLY | D3DLOCK_NOSYSLOCK) ) + { + // smells like readback, force texel readout + lockreq.m_readback = true; + } + + char *lockAddress; + int yStride; + int zStride; + + lockreq.m_tex->Lock( &lockreq, &lockAddress, &yStride, &zStride ); + + pLockedRect->Pitch = yStride; + pLockedRect->pBits = lockAddress; + + return S_OK; +} + +HRESULT IDirect3DSurface9::UnlockRect() +{ + GLMTexLockParams lockreq; + memset( &lockreq, 0, sizeof(lockreq) ); + + lockreq.m_tex = this->m_tex; + lockreq.m_face = this->m_face; + lockreq.m_mip = this->m_mip; + + lockreq.m_tex->Unlock( &lockreq ); + + return S_OK; +} + +HRESULT IDirect3DSurface9::GetDesc(D3DSURFACE_DESC *pDesc) +{ + *pDesc = m_desc; + return S_OK; +} + + +// ------------------------------------------------------------------------------------------------------------------------------ // + + +#pragma mark ----- IDirect3D9 ------------------------------------------------------- + +IDirect3D9::~IDirect3D9() +{ + GLMPRINTF(("-A- ~IDirect3D9 - signpost")); +} + +UINT IDirect3D9::GetAdapterCount() +{ +#if DX9MODE // can only make these calls if DX9MODE is on, if not, we won't get here + GLMgr::NewGLMgr(); // init GL manager + + GLMDisplayDB *db = g_engine->GetDisplayDB(); + int dxAdapterCount = db->GetFakeAdapterCount(); + + return dxAdapterCount; +#else + Debugger(); + return 0; +#endif +} + +HRESULT IDirect3D9::GetDeviceCaps(UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps) +{ + // Generally called from "CShaderDeviceMgrDx8::ComputeCapsFromD3D" in ShaderDeviceDX8.cpp + +#if DX9MODE // can only make these calls if DX9MODE is on, if not, we won't get here + // "Adapter" is used to index amongst the set of fake-adapters maintained in the display DB + GLMDisplayDB *db = g_engine->GetDisplayDB(); + int glmRendererIndex = -1; + int glmDisplayIndex = -1; + + GLMRendererInfoFields glmRendererInfo; + GLMDisplayInfoFields glmDisplayInfo; + + bool result = db->GetFakeAdapterInfo( Adapter, &glmRendererIndex, &glmDisplayIndex, &glmRendererInfo, &glmDisplayInfo ); + Assert (!result); + // just leave glmRendererInfo filled out for subsequent code to look at as needed. + + // fill in the pCaps record for adapter... we zero most of it and just fill in the fields that we think the caller wants. + V_memset( pCaps, 0, sizeof(*pCaps) ); + + + /* Device Info */ + pCaps->DeviceType = D3DDEVTYPE_HAL; + + /* Caps from DX7 Draw */ + pCaps->Caps = 0; // does anyone look at this ? + + pCaps->Caps2 = D3DCAPS2_DYNAMICTEXTURES; + /* Cursor Caps */ + pCaps->CursorCaps = 0; // nobody looks at this + + /* 3D Device Caps */ + pCaps->DevCaps = D3DDEVCAPS_HWTRANSFORMANDLIGHT; + + pCaps->TextureCaps = D3DPTEXTURECAPS_CUBEMAP | D3DPTEXTURECAPS_MIPCUBEMAP | D3DPTEXTURECAPS_NONPOW2CONDITIONAL | D3DPTEXTURECAPS_PROJECTED; + // D3DPTEXTURECAPS_NOPROJECTEDBUMPENV ? + // D3DPTEXTURECAPS_POW2 ? + // caller looks at POT support like this: + // pCaps->m_SupportsNonPow2Textures = + // ( !( caps.TextureCaps & D3DPTEXTURECAPS_POW2 ) || + // ( caps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL ) ); + // so we should set D3DPTEXTURECAPS_NONPOW2CONDITIONAL bit ? + + + pCaps->PrimitiveMiscCaps = 0; //only the HDR setup looks at this for D3DPMISCCAPS_SEPARATEALPHABLEND. + // ? D3DPMISCCAPS_SEPARATEALPHABLEND + // ? D3DPMISCCAPS_BLENDOP + // ? D3DPMISCCAPS_CLIPPLANESCALEDPOINTS + // ? D3DPMISCCAPS_CLIPTLVERTS D3DPMISCCAPS_COLORWRITEENABLE D3DPMISCCAPS_MASKZ D3DPMISCCAPS_TSSARGTEMP + + + pCaps->RasterCaps = D3DPRASTERCAPS_SCISSORTEST + | D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS // ref'd in CShaderDeviceMgrDx8::ComputeCapsFromD3D + | D3DPRASTERCAPS_DEPTHBIAS // ref'd in CShaderDeviceMgrDx8::ComputeCapsFromD3D + ; + + pCaps->TextureFilterCaps = D3DPTFILTERCAPS_MINFANISOTROPIC | D3DPTFILTERCAPS_MAGFANISOTROPIC; + + pCaps->MaxTextureWidth = 4096; + pCaps->MaxTextureHeight = 4096; + pCaps->MaxVolumeExtent = 1024; //guesses + + pCaps->MaxTextureAspectRatio = 0; // imply no limit on AR + + pCaps->MaxAnisotropy = 8; //guess + + pCaps->TextureOpCaps = D3DTEXOPCAPS_ADD | D3DTEXOPCAPS_MODULATE2X; //guess + DWORD MaxTextureBlendStages; + DWORD MaxSimultaneousTextures; + + pCaps->VertexProcessingCaps = D3DVTXPCAPS_TEXGEN_SPHEREMAP; + + pCaps->MaxActiveLights = 8; // guess + + + // MaxUserClipPlanes. A bit complicated.. + // it's difficult to make this fluid without teaching the engine about a cap that could change during run. + + // start it out set to '2'. + // turn it off, if we're in GLSL mode but do not have native clip plane capability. + pCaps->MaxUserClipPlanes = 2; // assume good news + + // is user asking for it to be off ? + if ( 0 /* CommandLine()->CheckParm( "-nouserclip" ) */ ) + { + pCaps->MaxUserClipPlanes = 0; + } + + g_bUseControlFlow = false; //CommandLine()->CheckParm( "-glslcontrolflow" ); + + // are we ARB mode and not forcing GLSL control flow mode? + if ( 0 /* CommandLine()->CheckParm( "-arbmode" ) && !g_bUseControlFlow */ ) + { + pCaps->MaxUserClipPlanes = 0; + } + + + pCaps->MaxVertexBlendMatrices = 0; // see if anyone cares + pCaps->MaxVertexBlendMatrixIndex = 0; // see if anyone cares + + pCaps->MaxPrimitiveCount = 32768; // guess + pCaps->MaxStreams = 4; // guess + + pCaps->VertexShaderVersion = 0x200; // model 2.0 + pCaps->MaxVertexShaderConst = DXABSTRACT_VS_PARAM_SLOTS; // number of vertex shader constant registers + + pCaps->PixelShaderVersion = 0x200; // model 2.0 + + // Here are the DX9 specific ones + pCaps->DevCaps2 = D3DDEVCAPS2_STREAMOFFSET; + + pCaps->PS20Caps.NumInstructionSlots = 512; // guess + // only examined once: + // pCaps->m_SupportsPixelShaders_2_b = ( ( caps.PixelShaderVersion & 0xffff ) >= 0x0200) && (caps.PS20Caps.NumInstructionSlots >= 512); + //pCaps->m_SupportsPixelShaders_2_b = 1; + + pCaps->NumSimultaneousRTs = 1; // Will be at least 1 + pCaps->MaxVertexShader30InstructionSlots = 0; + pCaps->MaxPixelShader30InstructionSlots = 0; + + #if POSIX + pCaps->FakeSRGBWrite = !glmRendererInfo.m_hasGammaWrites; + pCaps->CanDoSRGBReadFromRTs = !glmRendererInfo.m_cantAttachSRGB; + pCaps->MixedSizeTargets = glmRendererInfo.m_hasMixedAttachmentSizes; + #endif + +#endif + + return S_OK; +} + +HRESULT IDirect3D9::GetAdapterIdentifier( UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier ) +{ + // Generally called from "CShaderDeviceMgrDx8::ComputeCapsFromD3D" in ShaderDeviceDX8.cpp + +#if DX9MODE // can only make these calls if DX9MODE is on, if not, we won't get here + + Assert( Flags == D3DENUM_WHQL_LEVEL ); // we're not handling any other queries than this yet + + V_memset( pIdentifier, 0, sizeof(*pIdentifier) ); + + GLMDisplayDB *db = g_engine->GetDisplayDB(); + int glmRendererIndex = -1; + int glmDisplayIndex = -1; + + GLMRendererInfoFields glmRendererInfo; + GLMDisplayInfoFields glmDisplayInfo; + + // the D3D "Adapter" number feeds the fake adapter index + bool result = db->GetFakeAdapterInfo( Adapter, &glmRendererIndex, &glmDisplayIndex, &glmRendererInfo, &glmDisplayInfo ); + Assert (!result); + + sprintf( pIdentifier->Driver, "OpenGL %s (%08x)", + GLMDecode( eGL_RENDERER, glmRendererInfo.m_rendererID & 0x00FFFF00 ), + glmRendererInfo.m_rendererID + ); + + sprintf( pIdentifier->Description, "%s - %dx%d - %dMB VRAM", + GLMDecode( eGL_RENDERER, glmRendererInfo.m_rendererID & 0x00FFFF00 ), + glmDisplayInfo.m_displayPixelWidth, glmDisplayInfo.m_displayPixelHeight, + glmRendererInfo.m_vidMemory >> 20 ); + + pIdentifier->VendorId = glmRendererInfo.m_pciVendorID; // 4318; + pIdentifier->DeviceId = glmRendererInfo.m_pciDeviceID; // 401; + pIdentifier->SubSysId = 0; // 3358668866; + pIdentifier->Revision = 0; // 162; + pIdentifier->VideoMemory = glmRendererInfo.m_vidMemory; // amount of video memory in bytes + + #if 0 + // this came from the shaderapigl effort + V_strncpy( pIdentifier->Driver, "Fake-Video-Card", MAX_DEVICE_IDENTIFIER_STRING ); + V_strncpy( pIdentifier->Description, "Fake-Video-Card", MAX_DEVICE_IDENTIFIER_STRING ); + pIdentifier->VendorId = 4318; + pIdentifier->DeviceId = 401; + pIdentifier->SubSysId = 3358668866; + pIdentifier->Revision = 162; + #endif + + return S_OK; +#else + Debugger(); + return D3DERR_INVALIDCALL; +#endif + +} + +HRESULT IDirect3D9::CheckDeviceFormat(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) +{ +#if DX9MODE // can only make these calls if DX9MODE is on, if not, we won't get here + + if (0) // hush for now, less spew + { + GLMPRINTF(("-X- ** IDirect3D9::CheckDeviceFormat: \n -- Adapter=%d || DeviceType=%4x:%s || AdapterFormat=%8x:%s\n -- RType %8x: %s\n -- CheckFormat %8x: %s\n -- Usage %8x: %s", + Adapter, + DeviceType, GLMDecode(eD3D_DEVTYPE, DeviceType), + AdapterFormat, GLMDecode(eD3D_FORMAT, AdapterFormat), + RType, GLMDecode(eD3D_RTYPE, RType), + CheckFormat, GLMDecode(eD3D_FORMAT, CheckFormat), + Usage, GLMDecodeMask( eD3D_USAGE, Usage ) )); + } + + HRESULT result = D3DERR_NOTAVAILABLE; // failure + + DWORD knownUsageMask = D3DUSAGE_RENDERTARGET | D3DUSAGE_DEPTHSTENCIL | D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP + | D3DUSAGE_QUERY_SRGBREAD | D3DUSAGE_QUERY_FILTER | D3DUSAGE_QUERY_SRGBWRITE | D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING + | D3DUSAGE_QUERY_VERTEXTEXTURE; + + // FramebufferSRGB stuff. + // basically a format is only allowed to have SRGB usage for writing, if you have the framebuffer SRGB extension. + // so, check for that capability with GLM adapter db, and if it's not there, don't mark that bit as usable in any of our formats. + GLMDisplayDB *db = g_engine->GetDisplayDB(); + int glmRendererIndex = -1; + int glmDisplayIndex = -1; + + GLMRendererInfoFields glmRendererInfo; + GLMDisplayInfoFields glmDisplayInfo; + + bool dbresult = db->GetFakeAdapterInfo( Adapter, &glmRendererIndex, &glmDisplayIndex, &glmRendererInfo, &glmDisplayInfo ); + Assert (!dbresult); + + Assert ((Usage & knownUsageMask) == Usage); + + DWORD legalUsage = 0; + switch( AdapterFormat ) + { + case D3DFMT_X8R8G8B8: + switch( RType ) + { + case D3DRTYPE_TEXTURE: + switch( CheckFormat ) + { + case D3DFMT_DXT1: + case D3DFMT_DXT3: + case D3DFMT_DXT5: + legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_QUERY_FILTER; + legalUsage |= D3DUSAGE_QUERY_SRGBREAD; + + //open question: is auto gen of mipmaps is allowed or attempted on any DXT textures. + break; + + case D3DFMT_A8R8G8B8: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_QUERY_FILTER; + legalUsage |= D3DUSAGE_RENDERTARGET | D3DUSAGE_QUERY_SRGBREAD | D3DUSAGE_QUERY_SRGBWRITE | D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING; + break; + + case D3DFMT_R32F: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_QUERY_FILTER; + legalUsage |= D3DUSAGE_RENDERTARGET | D3DUSAGE_QUERY_SRGBREAD | D3DUSAGE_QUERY_SRGBWRITE | D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING; + break; + + case D3DFMT_A16B16G16R16: + legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_QUERY_FILTER; + legalUsage |= D3DUSAGE_RENDERTARGET | D3DUSAGE_QUERY_SRGBREAD | D3DUSAGE_QUERY_SRGBWRITE | D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING; + break; + + case D3DFMT_A16B16G16R16F: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_RENDERTARGET | D3DUSAGE_QUERY_SRGBREAD | D3DUSAGE_QUERY_SRGBWRITE; + + if ( !glmRendererInfo.m_atiR5xx ) + { + legalUsage |= D3DUSAGE_QUERY_FILTER | D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING; + } + break; + + case D3DFMT_A32B32G32R32F: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_RENDERTARGET | D3DUSAGE_QUERY_SRGBREAD | D3DUSAGE_QUERY_SRGBWRITE; + + if ( !glmRendererInfo.m_atiR5xx && !glmRendererInfo.m_nvG7x ) + { + legalUsage |= D3DUSAGE_QUERY_FILTER | D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING; + } + break; + + case D3DFMT_R5G6B5: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_QUERY_FILTER; + break; + + //----------------------------------------------------------- + // these come in from TestTextureFormat in ColorFormatDX8.cpp which is being driven by InitializeColorInformation... + // which is going to try all 8 combinations of (vertex texturable / render targetable / filterable ) on every image format it knows. + + case D3DFMT_R8G8B8: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_QUERY_FILTER; + legalUsage |= D3DUSAGE_QUERY_SRGBREAD; + break; + + case D3DFMT_X8R8G8B8: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_QUERY_FILTER; + legalUsage |= D3DUSAGE_QUERY_SRGBREAD | D3DUSAGE_QUERY_SRGBWRITE; + break; + + // one and two channel textures... we'll have to fake these as four channel tex if we want to support them + case D3DFMT_L8: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_QUERY_FILTER; + break; + + case D3DFMT_A8L8: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_QUERY_FILTER; + break; + + case D3DFMT_A8: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_QUERY_FILTER; + break; + + // going to need to go back and double check all of these.. + case D3DFMT_X1R5G5B5: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_QUERY_FILTER; + break; + + case D3DFMT_A4R4G4B4: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_QUERY_FILTER; + break; + + case D3DFMT_A1R5G5B5: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_QUERY_FILTER; + break; + + case D3DFMT_V8U8: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_QUERY_FILTER; + break; + + case D3DFMT_Q8W8V8U8: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_QUERY_FILTER; + // what the heck is QWVU8 ... ? + break; + + case D3DFMT_X8L8V8U8: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP | D3DUSAGE_QUERY_FILTER; + // what the heck is XLVU8 ... ? + break; + + // formats with depth... + + case D3DFMT_D16: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_RENDERTARGET | D3DUSAGE_DEPTHSTENCIL; + // just a guess on the legal usages + break; + + case D3DFMT_D24S8: legalUsage = D3DUSAGE_DYNAMIC | D3DUSAGE_RENDERTARGET | D3DUSAGE_DEPTHSTENCIL; + // just a guess on the legal usages + break; + + // vendor formats... try marking these all invalid for now + case D3DFMT_NV_INTZ: + case D3DFMT_NV_RAWZ: + case D3DFMT_NV_NULL: + case D3DFMT_ATI_D16: + case D3DFMT_ATI_D24S8: + case D3DFMT_ATI_2N: + case D3DFMT_ATI_1N: + legalUsage = 0; + break; + + //----------------------------------------------------------- + + default: + Assert(!"Unknown check format"); + result = D3DERR_NOTAVAILABLE; + break; + } + + if ((Usage & legalUsage) == Usage) + { + result = S_OK; + } + else + { + DWORD unsatBits = Usage & (~legalUsage); // clear the bits of the req that were legal, leaving the illegal ones + GLMPRINTF(( "-X- --> NOT OK: flags %8x:%s", unsatBits,GLMDecodeMask( eD3D_USAGE, unsatBits ) )); + result = D3DERR_NOTAVAILABLE; + } + break; + + case D3DRTYPE_SURFACE: + switch( CheckFormat ) + { + case 0x434f5441: + case 0x41415353: + result = D3DERR_NOTAVAILABLE; + break; + + case D3DFMT_D24S8: + result = S_OK; + break; + //** IDirect3D9::CheckDeviceFormat adapter=0, DeviceType= 1:D3DDEVTYPE_HAL, AdapterFormat= 5:D3DFMT_X8R8G8B8, RType= 1:D3DRTYPE_SURFACE, CheckFormat=434f5441:UNKNOWN + //** IDirect3D9::CheckDeviceFormat adapter=0, DeviceType= 1:D3DDEVTYPE_HAL, AdapterFormat= 5:D3DFMT_X8R8G8B8, RType= 1:D3DRTYPE_SURFACE, CheckFormat=41415353:UNKNOWN + //** IDirect3D9::CheckDeviceFormat adapter=0, DeviceType= 1:D3DDEVTYPE_HAL, AdapterFormat= 5:D3DFMT_X8R8G8B8, RType= 1:D3DRTYPE_SURFACE, CheckFormat=434f5441:UNKNOWN + //** IDirect3D9::CheckDeviceFormat adapter=0, DeviceType= 1:D3DDEVTYPE_HAL, AdapterFormat= 5:D3DFMT_X8R8G8B8, RType= 1:D3DRTYPE_SURFACE, CheckFormat=41415353:UNKNOWN + + default: + Assert(!"Unknown format"); + result = D3DERR_NOTAVAILABLE; + break; + } + break; + + default: + Assert(!"Unknown resource type"); + result = D3DERR_NOTAVAILABLE; + break; + } + break; + + default: + Assert(!"Unknown adapter format"); + result = D3DERR_NOTAVAILABLE; + break; + } + + return result; +#else + Debugger(); + return D3DERR_INVALIDCALL; +#endif +} + +UINT IDirect3D9::GetAdapterModeCount(UINT Adapter,D3DFORMAT Format) +{ +#if DX9MODE // can only make these calls if DX9MODE is on, if not, we won't get here + + GLMPRINTF(( "-X- IDirect3D9::GetAdapterModeCount: Adapter=%d || Format=%8x:%s", Adapter, Format, GLMDecode(eD3D_FORMAT, Format) )); + + uint modeCount=0; + + GLMDisplayDB *db = g_engine->GetDisplayDB(); + int glmRendererIndex = -1; + int glmDisplayIndex = -1; + + GLMRendererInfoFields glmRendererInfo; + GLMDisplayInfoFields glmDisplayInfo; + + // the D3D "Adapter" number feeds the fake adapter index + bool result = db->GetFakeAdapterInfo( Adapter, &glmRendererIndex, &glmDisplayIndex, &glmRendererInfo, &glmDisplayInfo ); + Assert (!result); + + modeCount = db->GetModeCount( glmRendererIndex, glmDisplayIndex ); + GLMPRINTF(( "-X- --> result is %d", modeCount )); + + return modeCount; +#else + Debugger(); + return 0; +#endif +} + +HRESULT IDirect3D9::EnumAdapterModes(UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode) +{ +#if DX9MODE // can only make these calls if DX9MODE is on, if not, we won't get here + + GLMPRINTF(( "-X- IDirect3D9::EnumAdapterModes: Adapter=%d || Format=%8x:%s || Mode=%d", Adapter, Format, GLMDecode(eD3D_FORMAT, Format), Mode )); + + Assert(Format==D3DFMT_X8R8G8B8); + + GLMDisplayDB *db = g_engine->GetDisplayDB(); + + int glmRendererIndex = -1; + int glmDisplayIndex = -1; + + GLMRendererInfoFields glmRendererInfo; + GLMDisplayInfoFields glmDisplayInfo; + GLMDisplayModeInfoFields glmModeInfo; + + // the D3D "Adapter" number feeds the fake adapter index + bool result = db->GetFakeAdapterInfo( Adapter, &glmRendererIndex, &glmDisplayIndex, &glmRendererInfo, &glmDisplayInfo ); + Assert (!result); + if (result) return D3DERR_NOTAVAILABLE; + + bool result2 = db->GetModeInfo( glmRendererIndex, glmDisplayIndex, Mode, &glmModeInfo ); + Assert( !result2 ); + if (result2) return D3DERR_NOTAVAILABLE; + + pMode->Width = glmModeInfo.m_modePixelWidth; + pMode->Height = glmModeInfo.m_modePixelHeight; + pMode->RefreshRate = glmModeInfo.m_modeRefreshHz; // "adapter default" + pMode->Format = Format; // whatever you asked for ? + + GLMPRINTF(( "-X- IDirect3D9::EnumAdapterModes returning mode size (%d,%d) and D3DFMT_X8R8G8B8",pMode->Width,pMode->Height )); + return S_OK; +#else + Debugger(); + return D3DERR_INVALIDCALL; +#endif +} + +HRESULT IDirect3D9::CheckDeviceType(UINT Adapter,D3DDEVTYPE DevType,D3DFORMAT AdapterFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed) +{ + //FIXME: we just say "OK" on any query + + GLMPRINTF(( "-X- IDirect3D9::CheckDeviceType: Adapter=%d || DevType=%d:%s || AdapterFormat=%d:%s || BackBufferFormat=%d:%s || bWindowed=%d", + Adapter, + DevType, GLMDecode(eD3D_DEVTYPE,DevType), + AdapterFormat, GLMDecode(eD3D_FORMAT, AdapterFormat), + BackBufferFormat, GLMDecode(eD3D_FORMAT, BackBufferFormat), + (int) bWindowed )); + + return S_OK; +} + +HRESULT IDirect3D9::GetAdapterDisplayMode(UINT Adapter,D3DDISPLAYMODE* pMode) +{ +#if DX9MODE // can only make these calls if DX9MODE is on, if not, we won't get here + + // asking what the current mode is + GLMPRINTF(("-X- IDirect3D9::GetAdapterDisplayMode: Adapter=%d", Adapter )); + + GLMDisplayDB *db = g_engine->GetDisplayDB(); + + int glmRendererIndex = -1; + int glmDisplayIndex = -1; + + GLMRendererInfoFields glmRendererInfo; + GLMDisplayInfoFields glmDisplayInfo; + GLMDisplayModeInfoFields glmModeInfo; + + // the D3D "Adapter" number feeds the fake adapter index + bool result = db->GetFakeAdapterInfo( Adapter, &glmRendererIndex, &glmDisplayIndex, &glmRendererInfo, &glmDisplayInfo ); + Assert(!result); + if (result) return D3DERR_INVALIDCALL; + + int modeIndex = -1; // pass -1 as a mode index to find out about whatever the current mode is on the selected display + + bool modeResult = db->GetModeInfo( glmRendererIndex, glmDisplayIndex, modeIndex, &glmModeInfo ); + Assert (!modeResult); + if (modeResult) return D3DERR_INVALIDCALL; + + pMode->Width = glmModeInfo.m_modePixelWidth; + pMode->Height = glmModeInfo.m_modePixelHeight; + pMode->RefreshRate = glmModeInfo.m_modeRefreshHz; // "adapter default" + pMode->Format = D3DFMT_X8R8G8B8; //FIXME, this is a SWAG + + return S_OK; +#else + Debugger(); + return D3DERR_INVALIDCALL; +#endif +} + +HRESULT IDirect3D9::CheckDepthStencilMatch(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) +{ + GLMPRINTF(("-X- IDirect3D9::CheckDepthStencilMatch: Adapter=%d || DevType=%d:%s || AdapterFormat=%d:%s || RenderTargetFormat=%d:%s || DepthStencilFormat=%d:%s", + Adapter, + DeviceType, GLMDecode(eD3D_DEVTYPE,DeviceType), + AdapterFormat, GLMDecode(eD3D_FORMAT, AdapterFormat), + RenderTargetFormat, GLMDecode(eD3D_FORMAT, RenderTargetFormat), + DepthStencilFormat, GLMDecode(eD3D_FORMAT, DepthStencilFormat) )); + + // one known request looks like this: + // AdapterFormat=5:D3DFMT_X8R8G8B8 || RenderTargetFormat=3:D3DFMT_A8R8G8B8 || DepthStencilFormat=2:D3DFMT_D24S8 + + // return S_OK for that one combo, Debugger() on anything else + HRESULT result = D3DERR_NOTAVAILABLE; // failure + + switch( AdapterFormat ) + { + case D3DFMT_X8R8G8B8: + { + if ( (RenderTargetFormat == D3DFMT_A8R8G8B8) && (DepthStencilFormat == D3DFMT_D24S8) ) + { + result = S_OK; + } + } + break; + + default: + Assert(!"Unhandled format"); + result = D3DERR_NOTAVAILABLE; + break; + } + + Assert( result == S_OK ); + + return result; +} + +HRESULT IDirect3D9::CheckDeviceMultiSampleType( UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels ) +{ +#if DX9MODE // can only make these calls if DX9MODE is on, if not, we won't get here + + GLMDisplayDB *db = g_engine->GetDisplayDB(); + + int glmRendererIndex = -1; + int glmDisplayIndex = -1; + + GLMRendererInfoFields glmRendererInfo; + GLMDisplayInfoFields glmDisplayInfo; + GLMDisplayModeInfoFields glmModeInfo; + + // the D3D "Adapter" number feeds the fake adapter index + bool result = db->GetFakeAdapterInfo( Adapter, &glmRendererIndex, &glmDisplayIndex, &glmRendererInfo, &glmDisplayInfo ); + Assert( !result ); + if ( result ) + return D3DERR_INVALIDCALL; + + + if ( 1 /* !CommandLine()->FindParm("-glmenabletrustmsaa") */ ) + { + // These ghetto drivers don't get MSAA + if ( ( glmRendererInfo.m_nvG7x || glmRendererInfo.m_atiR5xx ) && ( MultiSampleType > D3DMULTISAMPLE_NONE ) ) + { + if ( pQualityLevels ) + { + *pQualityLevels = 0; + } + return D3DERR_NOTAVAILABLE; + } + } + + switch ( MultiSampleType ) + { + case D3DMULTISAMPLE_NONE: // always return true + if ( pQualityLevels ) + { + *pQualityLevels = 1; + } + return S_OK; + break; + + case D3DMULTISAMPLE_2_SAMPLES: + case D3DMULTISAMPLE_4_SAMPLES: + case D3DMULTISAMPLE_6_SAMPLES: + case D3DMULTISAMPLE_8_SAMPLES: + // note the fact that the d3d enums for 2, 4, 6, 8 samples are equal to 2,4,6,8... + if (glmRendererInfo.m_maxSamples >= (int)MultiSampleType ) + { + if ( pQualityLevels ) + { + *pQualityLevels = 1; + } + return S_OK; + } + else + { + return D3DERR_NOTAVAILABLE; + } + break; + + default: + if ( pQualityLevels ) + { + *pQualityLevels = 0; + } + return D3DERR_NOTAVAILABLE; + break; + } + return D3DERR_NOTAVAILABLE; +#else + Debugger(); + return D3DERR_NOTAVAILABLE; +#endif + +} + +HRESULT IDirect3D9::CreateDevice(UINT Adapter,D3DDEVTYPE DeviceType,VD3DHWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface) +{ + // constrain these inputs for the time being + // BackBufferFormat -> A8R8G8B8 + // BackBufferCount -> 1; + // MultiSampleType -> D3DMULTISAMPLE_NONE + // AutoDepthStencilFormat -> D3DFMT_D24S8 + + // NULL out the return pointer so if we exit early it is not set + *ppReturnedDeviceInterface = NULL; + + // assume success unless something is sour + HRESULT result = S_OK; + + // relax this check for now + //if (pPresentationParameters->BackBufferFormat != D3DFMT_A8R8G8B8) + //{ + // Debugger(); + // result = -1; + //} + + //rbarris 24Aug10 - relaxing this check - we don't care if the game asks for two backbuffers, it's moot + //if ( pPresentationParameters->BackBufferCount != 1 ) + //{ + // Debugger(); + // result = D3DERR_NOTAVAILABLE; + //} + + if ( pPresentationParameters->AutoDepthStencilFormat != D3DFMT_D24S8 ) + { + Debugger(); + result = D3DERR_NOTAVAILABLE; + } + + if ( result == S_OK ) + { + // create an IDirect3DDevice9 + // it will make a GLMContext and set up some drawables + + IDirect3DDevice9Params devparams; + memset( &devparams, 0, sizeof(devparams) ); + + devparams.m_adapter = Adapter; + devparams.m_deviceType = DeviceType; + devparams.m_focusWindow = hFocusWindow; // is this meaningful? is this a WindowRef ? follow it up the chain.. + devparams.m_behaviorFlags = BehaviorFlags; + devparams.m_presentationParameters = *pPresentationParameters; + + IDirect3DDevice9 *dev = new IDirect3DDevice9; + + result = dev->Create( &devparams ); + + if ( result == S_OK ) + { + *ppReturnedDeviceInterface = dev; + } + } + return result; +} + +// ------------------------------------------------------------------------------------------------------------------------------ // + +#pragma mark ----- IDirect3DQuery9 + +HRESULT IDirect3DQuery9::Issue(DWORD dwIssueFlags) +{ + // Flags field for Issue + // #define D3DISSUE_END (1 << 0) // Tells the runtime to issue the end of a query, changing it's state to "non-signaled". + // #define D3DISSUE_BEGIN (1 << 1) // Tells the runtime to issue the beginng of a query. + + if (dwIssueFlags & D3DISSUE_BEGIN) + { + switch( m_type ) + { + case D3DQUERYTYPE_OCCLUSION: + m_query->Start(); // drop "start counter" call into stream + break; + + default: + Assert(!"Can't use D3DISSUE_BEGIN on this query"); + break; + } + } + + if (dwIssueFlags & D3DISSUE_END) + { + switch( m_type ) + { + case D3DQUERYTYPE_OCCLUSION: + m_query->Stop(); // drop "end counter" call into stream + break; + + case D3DQUERYTYPE_EVENT: + // End is very weird with respect to Events (fences). + // DX9 docs say to use End to put the fence in the stream. So we map End to GLM's Start. + // http://msdn.microsoft.com/en-us/library/ee422167(VS.85).aspx + m_query->Start(); // drop "set fence" into stream + break; + + default: + break; + } + } + return S_OK; +} + +HRESULT IDirect3DQuery9::GetData(void* pData,DWORD dwSize,DWORD dwGetDataFlags) +{ + HRESULT result = -1; + + // GetData is not always called with the flush bit. + + // if an answer is not yet available - return S_FALSE. + // if an answer is available - return S_OK and write the answer into *pData. + bool done = false; + bool flush = (dwGetDataFlags & D3DGETDATA_FLUSH) != 0; // aka spin until done + + // hmmm both of these paths are the same, maybe we could fold them up + if ( !m_query->IsStarted() ) + { + Assert(!"Can't GetData before issue/start"); + printf("\n** IDirect3DQuery9::GetData: can't GetData before issue/start"); + result = -1; + } + else if ( !m_query->IsStopped() ) + { + Assert(!"Can't GetData before issue-end/stop"); + printf("\n** IDirect3DQuery9::GetData: can't GetData before issue-end/stop"); + result = -1; + } + else + { + switch( m_type ) + { + case D3DQUERYTYPE_OCCLUSION: + { + // expectation - caller already did an issue begin (start) and an issue end (stop). + // we can probe using IsDone. + if (flush && (!m_ctx->Caps().m_hasPerfPackage1) ) + { + glFlush(); + } + do + { + done = m_query->IsDone(); + if (done) + { + uint oqValue = 0; // or we could just pass pData directly to Complete... + m_query->Complete(&oqValue); + if (pData) + { + *(uint*)pData = oqValue; + } + result = S_OK; + } + else + { + result = S_FALSE; + } + } while( flush && (!done) ); + } + break; + + case D3DQUERYTYPE_EVENT: + { + // expectation - caller already did an issue end (for fence => start) but has not done anything that would call Stop. + // that's ok because Stop is a no-op for fences. + if (flush && (!m_ctx->Caps().m_hasPerfPackage1) ) + { + glFlush(); + } + + done = m_query->IsDone(); + if (done) + { + m_query->Complete(NULL); // this will block on pre-SLGU + *(uint*)pData = 0; + result = S_OK; + } + else + { + result = S_FALSE; + } + } + break; + + default: + break; + } + } + + return result; +} + +// ------------------------------------------------------------------------------------------------------------------------------ // + +#pragma mark ----- IDirect3DVertexBuffer9 + +HRESULT IDirect3DDevice9::CreateVertexBuffer(UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,VD3DHANDLE* pSharedHandle) +{ + GLMPRINTF(( ">-A- IDirect3DDevice9::CreateVertexBuffer" )); + + IDirect3DVertexBuffer9 *newbuff = new IDirect3DVertexBuffer9; + + newbuff->m_device = this; + + newbuff->m_ctx = m_ctx; + + // FIXME need to find home or use for the Usage, FVF, Pool values passed in + uint options = 0; + + if (Usage&D3DUSAGE_DYNAMIC) + { + options |= GLMBufferOptionDynamic; + } + + newbuff->m_vtxBuffer = m_ctx->NewBuffer( kGLMVertexBuffer, Length, options ) ; + + newbuff->m_vtxDesc.Type = D3DRTYPE_VERTEXBUFFER; + newbuff->m_vtxDesc.Usage = Usage; + newbuff->m_vtxDesc.Pool = Pool; + newbuff->m_vtxDesc.Size = Length; + + *ppVertexBuffer = newbuff; + + GLMPRINTF(( "<-A- IDirect3DDevice9::CreateVertexBuffer" )); + + return S_OK; +} + +IDirect3DVertexBuffer9::~IDirect3DVertexBuffer9() +{ + GLMPRINTF(( ">-A- ~IDirect3DVertexBuffer9" )); + + if (m_device) + { + m_device->ReleasedVertexBuffer( this ); + + if (m_ctx && m_vtxBuffer) + { + GLMPRINTF(( ">-A- ~IDirect3DVertexBuffer9 deleting m_vtxBuffer" )); + m_ctx->DelBuffer( m_vtxBuffer ); + m_vtxBuffer = NULL; + GLMPRINTF(( "<-A- ~IDirect3DVertexBuffer9 deleting m_vtxBuffer - done" )); + } + m_device = NULL; + } + + GLMPRINTF(( "<-A- ~IDirect3DVertexBuffer9" )); +} + +HRESULT IDirect3DVertexBuffer9::Lock(UINT OffsetToLock,UINT SizeToLock,void** ppbData,DWORD Flags) +{ + // FIXME would be good to have "can't lock twice" logic + + Assert( !(Flags & D3DLOCK_READONLY) ); // not impl'd +// Assert( !(Flags & D3DLOCK_NOSYSLOCK) ); // not impl'd - it triggers though + + GLMBuffLockParams lockreq; + lockreq.m_offset = OffsetToLock; + lockreq.m_size = SizeToLock; + lockreq.m_nonblocking = (Flags & D3DLOCK_NOOVERWRITE) != 0; + lockreq.m_discard = (Flags & D3DLOCK_DISCARD) != 0; + + m_vtxBuffer->Lock( &lockreq, (char**)ppbData ); + + GLMPRINTF(("-X- IDirect3DDevice9::Lock on D3D buf %p (GL name %d) offset %d, size %d => address %p", this, this->m_vtxBuffer->m_name, OffsetToLock, SizeToLock, *ppbData)); + return S_OK; +} + +HRESULT IDirect3DVertexBuffer9::Unlock() +{ + m_vtxBuffer->Unlock(); + return S_OK; +} + +// ------------------------------------------------------------------------------------------------------------------------------ // + + +#pragma mark ----- IDirect3DIndexBuffer9 + +HRESULT IDirect3DDevice9::CreateIndexBuffer(UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,VD3DHANDLE* pSharedHandle) +{ + GLMPRINTF(( ">-A- IDirect3DDevice9::CreateIndexBuffer" )); + + // it is important to save all the create info, since GetDesc could get called later to query it + + IDirect3DIndexBuffer9 *newbuff = new IDirect3DIndexBuffer9; + + newbuff->m_device = this; + + newbuff->m_restype = D3DRTYPE_INDEXBUFFER; // hmmmmmmm why are we not derived from d3dresource.. + + newbuff->m_ctx = m_ctx; + + // FIXME need to find home or use for the Usage, Format, Pool values passed in + uint options = 0; + + if (Usage&D3DUSAGE_DYNAMIC) + { + options |= GLMBufferOptionDynamic; + } + + newbuff->m_idxBuffer = m_ctx->NewBuffer( kGLMIndexBuffer, Length, options ) ; + + newbuff->m_idxDesc.Format = Format; + newbuff->m_idxDesc.Type = D3DRTYPE_INDEXBUFFER; + newbuff->m_idxDesc.Usage = Usage; + newbuff->m_idxDesc.Pool = Pool; + newbuff->m_idxDesc.Size = Length; + + *ppIndexBuffer = newbuff; + + GLMPRINTF(( "<-A- IDirect3DDevice9::CreateIndexBuffer" )); + + return S_OK; +} + +IDirect3DIndexBuffer9::~IDirect3DIndexBuffer9() +{ + GLMPRINTF(( ">-A- ~IDirect3DIndexBuffer9" )); + + if (m_device) + { + m_device->ReleasedIndexBuffer( this ); + + if (m_ctx && m_idxBuffer) + { + GLMPRINTF(( ">-A- ~IDirect3DIndexBuffer9 deleting m_idxBuffer" )); + m_ctx->DelBuffer( m_idxBuffer ); + GLMPRINTF(( "<-A- ~IDirect3DIndexBuffer9 deleting m_idxBuffer - done" )); + } + m_device = NULL; + } + else + { + } + + GLMPRINTF(( "<-A- ~IDirect3DIndexBuffer9" )); +} + + +HRESULT IDirect3DIndexBuffer9::Lock(UINT OffsetToLock,UINT SizeToLock,void** ppbData,DWORD Flags) +{ + // FIXME would be good to have "can't lock twice" logic + + GLMBuffLockParams lockreq; + lockreq.m_offset = OffsetToLock; + lockreq.m_size = SizeToLock; + lockreq.m_nonblocking = (Flags & D3DLOCK_NOOVERWRITE) != 0; + lockreq.m_discard = (Flags & D3DLOCK_DISCARD) != 0; + + m_idxBuffer->Lock( &lockreq, (char**)ppbData ); + + return S_OK; +} + +HRESULT IDirect3DIndexBuffer9::Unlock() +{ + m_idxBuffer->Unlock(); + + return S_OK; +} + +HRESULT IDirect3DIndexBuffer9::GetDesc(D3DINDEXBUFFER_DESC *pDesc) +{ + *pDesc = m_idxDesc; + return S_OK; +} + + +// ------------------------------------------------------------------------------------------------------------------------------ // + +#pragma mark ----- IDirect3DDevice9 ------------------------------------------------- + +void ConvertPresentationParamsToGLMDisplayParams( D3DPRESENT_PARAMETERS *d3dp, GLMDisplayParams *gldp ) +{ + memset( gldp, 0, sizeof(*gldp) ); + + gldp->m_fsEnable = !d3dp->Windowed; + + // see http://msdn.microsoft.com/en-us/library/ee416515(VS.85).aspx + // note that the values below are the only ones mentioned by Source engine; there are many others + switch(d3dp->PresentationInterval) + { + case D3DPRESENT_INTERVAL_ONE: + gldp->m_vsyncEnable = true; // "The driver will wait for the vertical retrace period (the runtime will beam-follow to prevent tearing)." + break; + + case D3DPRESENT_INTERVAL_IMMEDIATE: + gldp->m_vsyncEnable = false; // "The runtime updates the window client area immediately and might do so more than once during the adapter refresh period." + break; + + default: + gldp->m_vsyncEnable = true; // if I don't know it, you're getting vsync enabled. + break; + } + + gldp->m_backBufferWidth = d3dp->BackBufferWidth; + gldp->m_backBufferHeight = d3dp->BackBufferHeight; + gldp->m_backBufferFormat = d3dp->BackBufferFormat; + gldp->m_multiSampleCount = d3dp->MultiSampleType; // it's a count really + + gldp->m_enableAutoDepthStencil = d3dp->EnableAutoDepthStencil; + gldp->m_autoDepthStencilFormat = d3dp->AutoDepthStencilFormat; + + gldp->m_fsRefreshHz = d3dp->FullScreen_RefreshRateInHz; + + // some fields in d3d PB we're not acting on yet... + // UINT BackBufferCount; + // DWORD MultiSampleQuality; + // D3DSWAPEFFECT SwapEffect; + // VD3DHWND hDeviceWindow; + // DWORD Flags; +} + +HRESULT IDirect3DDevice9::Create( IDirect3DDevice9Params *params ) +{ +#if DX9MODE + + GLMPRINTF((">-X-IDirect3DDevice9::Create")); + HRESULT result = S_OK; + + // create an IDirect3DDevice9 + // make a GLMContext and set up some drawables + m_params = *params; + + m_ctx = NULL; + m_drawableFBO = NULL; + + memset( m_rtSurfaces, 0, sizeof(m_rtSurfaces) ); + m_dsSurface = NULL; + + m_defaultColorSurface = NULL; + m_defaultDepthStencilSurface = NULL; + + memset( m_streams, 0, sizeof(m_streams) ); + memset( m_textures, 0, sizeof(m_textures) ); + memset( m_samplers, 0, sizeof(m_samplers) ); + + + //============================================================================ + // param block for GLM context create + GLMDisplayParams glmParams; + ConvertPresentationParamsToGLMDisplayParams( ¶ms->m_presentationParameters, &glmParams ); + + glmParams.m_mtgl = true; // forget this idea -> (params->m_behaviorFlags & D3DCREATE_MULTITHREADED) != 0; + // the call above fills in a bunch of things, but doesn't know about anything outside of the presentation params. + // those tend to be the things that do not change after create, so we do those here in Create. + + glmParams.m_focusWindow = params->m_focusWindow; + + #if 0 //FIXME-HACK + // map the D3D "adapter" to a renderer/display pair + // (that GPU will have to stay set as-is for any subsequent mode changes) + + int glmRendererIndex = -1; + int glmDisplayIndex = -1; + + GLMRendererInfoFields glmRendererInfo; + GLMDisplayInfoFields glmDisplayInfo; + + // the D3D "Adapter" number feeds the fake adapter index + bool adaptResult = GLMgr::aGLMgr()->GetDisplayDB()->GetFakeAdapterInfo( params->m_adapter, &glmRendererIndex, &glmDisplayIndex, &glmRendererInfo, &glmDisplayInfo ); + Assert(!adaptResult); + + glmParams.m_rendererIndex = glmRendererIndex; + glmParams.m_displayIndex = glmDisplayIndex; + // glmParams.m_modeIndex hmmmmm, client doesn't give us a mode number, just a resolution.. + #endif + + m_ctx = GLMgr::aGLMgr()->NewContext( &glmParams ); + if (!m_ctx) + { + GLMPRINTF(("<-X- IDirect3DDevice9::Create (error out)")); + return (HRESULT) -1; + } + + // make an FBO to draw into and activate it. + m_drawableFBO = m_ctx->NewFBO(); + + m_ctx->SetDrawingFBO( m_drawableFBO ); + + // bind it to context. will receive attachments shortly. + m_ctx->BindFBOToCtx( m_drawableFBO, GL_READ_FRAMEBUFFER_EXT ); + m_ctx->BindFBOToCtx( m_drawableFBO, GL_DRAW_FRAMEBUFFER_EXT ); + + // we create two IDirect3DSurface9's. These will be known as the internal render target 0 and the depthstencil. + + GLMPRINTF(("-X- IDirect3DDevice9::Create making color render target...")); + // color surface + result = this->CreateRenderTarget( + m_params.m_presentationParameters.BackBufferWidth, // width + m_params.m_presentationParameters.BackBufferHeight, // height + m_params.m_presentationParameters.BackBufferFormat, // format + m_params.m_presentationParameters.MultiSampleType, // MSAA depth + m_params.m_presentationParameters.MultiSampleQuality, // MSAA quality + true, // lockable + &m_defaultColorSurface, // ppSurface + NULL // shared handle + ); + + if (result != S_OK) + { + GLMPRINTF(("<-X- IDirect3DDevice9::Create (error out)")); + return result; + } + // do not do an AddRef.. + + GLMPRINTF(("-X- IDirect3DDevice9::Create making color render target complete -> %08x", m_defaultColorSurface )); + + GLMPRINTF(("-X- IDirect3DDevice9::Create setting color render target...")); + result = this->SetRenderTarget(0, m_defaultColorSurface); + if (result != S_OK) + { + GLMPRINTF(("< IDirect3DDevice9::Create (error out)")); + return result; + } + GLMPRINTF(("-X- IDirect3DDevice9::Create setting color render target complete.")); + + Assert (m_params.m_presentationParameters.EnableAutoDepthStencil); + + GLMPRINTF(("-X- IDirect3DDevice9::Create making depth-stencil...")); + result = CreateDepthStencilSurface( + m_params.m_presentationParameters.BackBufferWidth, // width + m_params.m_presentationParameters.BackBufferHeight, // height + m_params.m_presentationParameters.AutoDepthStencilFormat, // format + m_params.m_presentationParameters.MultiSampleType, // MSAA depth + m_params.m_presentationParameters.MultiSampleQuality, // MSAA quality + TRUE, // enable z-buffer discard ???? + &m_defaultDepthStencilSurface, // ppSurface + NULL // shared handle + ); + if (result != S_OK) + { + GLMPRINTF(("<-X- IDirect3DDevice9::Create (error out)")); + return result; + } + // do not do an AddRef here.. + + GLMPRINTF(("-X- IDirect3DDevice9::Create making depth-stencil complete -> %08x", m_defaultDepthStencilSurface)); + GLMPRINTF(("-X- Direct3DDevice9::Create setting depth-stencil render target...")); + result = this->SetDepthStencilSurface(m_defaultDepthStencilSurface); + if (result != S_OK) + { + GLMDebugger(); + GLMPRINTF(("<-X- IDirect3DDevice9::Create (error out)")); + return result; + } + GLMPRINTF(("-X- IDirect3DDevice9::Create setting depth-stencil render target complete.")); + + bool ready = m_drawableFBO->IsReady(); + if (!ready) + { + GLMPRINTF(("<-X- IDirect3DDevice9::Create (error out)")); + return (HRESULT)-1; + } + + // this next part really needs to be inside GLMContext.. or replaced with D3D style viewport setup calls. + m_ctx->GenDebugFontTex(); + + // blast the gl state mirror... + memset( &this->gl, 0, sizeof( this->gl ) ); + + GLScissorEnable_t defScissorEnable = { true }; + GLScissorBox_t defScissorBox = { 0,0, m_params.m_presentationParameters.BackBufferWidth,m_params.m_presentationParameters.BackBufferHeight }; + GLViewportBox_t defViewportBox = { 0,0, m_params.m_presentationParameters.BackBufferWidth,m_params.m_presentationParameters.BackBufferHeight }; + GLViewportDepthRange_t defViewportDepthRange = { 0.1, 1000.0 }; + GLCullFaceEnable_t defCullFaceEnable = { true }; + GLCullFrontFace_t defCullFrontFace = { GL_CCW }; + + gl.m_ScissorEnable = defScissorEnable; + gl.m_ScissorBox = defScissorBox; + gl.m_ViewportBox = defViewportBox; + gl.m_ViewportDepthRange = defViewportDepthRange; + gl.m_CullFaceEnable = defCullFaceEnable; + gl.m_CullFrontFace = defCullFrontFace; + + gl.m_stateDirtyMask = (1<RenderedSize( m_params.m_presentationParameters.BackBufferWidth, m_params.m_presentationParameters.BackBufferHeight, true ); // true = set + + return result; +#else + Debugger(); + return D3DERR_INVALIDCALL; +#endif +} + +IDirect3DDevice9::~IDirect3DDevice9() +{ + GLMPRINTF(( "-D- IDirect3DDevice9::~IDirect3DDevice9 signpost" )); // want to know when this is called, if ever +} + +#pragma mark ----- Basics - (IDirect3DDevice9) + + +HRESULT IDirect3DDevice9::Reset(D3DPRESENT_PARAMETERS* pPresentationParameters) +{ +#if DX9MODE + HRESULT result = S_OK; + + // define the task of reset as: + // provide new drawable RT's for the backbuffer (color and depthstencil). + // fix up viewport / scissor.. + // then pass the new presentation parameters through to GLM. + // (it will in turn notify appframework on the next present... which may be very soon, as mode changes are usually spotted inside Present() ). + + // so some of this looks a lot like Create - we're just a subset of what it does. + // with a little work you could refactor this to be common code. + + //------------------------------------------------------------------------------- absorb new presentation params.. + + m_params.m_presentationParameters = *pPresentationParameters; + + //------------------------------------------------------------------------------- color buffer.. + // release old color surface if it's there.. + if (m_defaultColorSurface) + { + ULONG refc = m_defaultColorSurface->Release( 0, "IDirect3DDevice9::Reset public release color surface" ); + Assert( !refc ); + m_defaultColorSurface = NULL; + } + + GLMPRINTF(("-X- IDirect3DDevice9::Reset making new color render target...")); + // color surface + result = this->CreateRenderTarget( + m_params.m_presentationParameters.BackBufferWidth, // width + m_params.m_presentationParameters.BackBufferHeight, // height + m_params.m_presentationParameters.BackBufferFormat, // format + m_params.m_presentationParameters.MultiSampleType, // MSAA depth + m_params.m_presentationParameters.MultiSampleQuality, // MSAA quality + true, // lockable + &m_defaultColorSurface, // ppSurface + NULL // shared handle + ); + + if (result != S_OK) + { + GLMPRINTF(("<-X- IDirect3DDevice9::Reset (error out)")); + return result; + } + // do not do an AddRef here.. + + GLMPRINTF(("-X- IDirect3DDevice9::Reset making color render target complete -> %08x", m_defaultColorSurface )); + + GLMPRINTF(("-X- IDirect3DDevice9::Reset setting color render target...")); + result = this->SetRenderTarget(0, m_defaultColorSurface); + if (result != S_OK) + { + GLMPRINTF(("< IDirect3DDevice9::Reset (error out)")); + return result; + } + GLMPRINTF(("-X- IDirect3DDevice9::Reset setting color render target complete.")); + + + //-------------------------------------------------------------------------------depth stencil buffer + // release old depthstencil surface if it's there.. + if (m_defaultDepthStencilSurface) + { + ULONG refc = m_defaultDepthStencilSurface->Release( 0, "IDirect3DDevice9::Reset public release depthstencil surface" ); + Assert(!refc); + m_defaultDepthStencilSurface = NULL; + } + + Assert (m_params.m_presentationParameters.EnableAutoDepthStencil); + + GLMPRINTF(("-X- IDirect3DDevice9::Reset making depth-stencil...")); + result = CreateDepthStencilSurface( + m_params.m_presentationParameters.BackBufferWidth, // width + m_params.m_presentationParameters.BackBufferHeight, // height + m_params.m_presentationParameters.AutoDepthStencilFormat, // format + m_params.m_presentationParameters.MultiSampleType, // MSAA depth + m_params.m_presentationParameters.MultiSampleQuality, // MSAA quality + TRUE, // enable z-buffer discard ???? + &m_defaultDepthStencilSurface, // ppSurface + NULL // shared handle + ); + if (result != S_OK) + { + GLMPRINTF(("<-X- IDirect3DDevice9::Reset (error out)")); + return result; + } + // do not do an AddRef here.. + + GLMPRINTF(("-X- IDirect3DDevice9::Reset making depth-stencil complete -> %08x", m_defaultDepthStencilSurface)); + + GLMPRINTF(("-X- IDirect3DDevice9::Reset setting depth-stencil render target...")); + result = this->SetDepthStencilSurface(m_defaultDepthStencilSurface); + if (result != S_OK) + { + GLMPRINTF(("<-X- IDirect3DDevice9::Reset (error out)")); + return result; + } + GLMPRINTF(("-X- IDirect3DDevice9::Reset setting depth-stencil render target complete.")); + + bool ready = m_drawableFBO->IsReady(); + if (!ready) + { + GLMPRINTF(("<-X- IDirect3DDevice9::Reset (error out)")); + return D3DERR_DEVICELOST; + } + + //-------------------------------------------------------------------------------zap viewport and scissor to new backbuffer size + + GLScissorEnable_t defScissorEnable = { true }; + GLScissorBox_t defScissorBox = { 0,0, m_params.m_presentationParameters.BackBufferWidth,m_params.m_presentationParameters.BackBufferHeight }; + GLViewportBox_t defViewportBox = { 0,0, m_params.m_presentationParameters.BackBufferWidth,m_params.m_presentationParameters.BackBufferHeight }; + GLViewportDepthRange_t defViewportDepthRange = { 0.1, 1000.0 }; + GLCullFaceEnable_t defCullFaceEnable = { true }; + GLCullFrontFace_t defCullFrontFace = { GL_CCW }; + + gl.m_ScissorEnable = defScissorEnable; + gl.m_ScissorBox = defScissorBox; + gl.m_ViewportBox = defViewportBox; + gl.m_ViewportDepthRange = defViewportDepthRange; + gl.m_CullFaceEnable = defCullFaceEnable; + gl.m_CullFrontFace = defCullFrontFace; + + gl.m_stateDirtyMask |= (1<m_displayParams.m_focusWindow; + Assert( glmParams.m_focusWindow != NULL ); + + // so GetClientRect can return sane answers + uint width, height; + g_engine->RenderedSize( pPresentationParameters->BackBufferWidth, pPresentationParameters->BackBufferHeight, true ); // true = set + + m_ctx->SetDisplayParams( &glmParams ); + + return S_OK; +#else + Debugger(); + return D3DERR_INVALIDCALL; +#endif +} + +HRESULT IDirect3DDevice9::SetViewport(CONST D3DVIEWPORT9* pViewport) +{ + GLMPRINTF(("-X- IDirect3DDevice9::SetViewport : minZ %f, maxZ %f",pViewport->MinZ, pViewport->MaxZ )); + + gl.m_ViewportBox.x = pViewport->X; + gl.m_ViewportBox.width = pViewport->Width; + + gl.m_ViewportBox.y = pViewport->Y; + gl.m_ViewportBox.height = pViewport->Height; + + gl.m_stateDirtyMask |= (1<MinZ; + gl.m_ViewportDepthRange.far = pViewport->MaxZ; + + gl.m_stateDirtyMask |= (1<BeginFrame(); + + return S_OK; +} + +HRESULT IDirect3DDevice9::EndScene() +{ + m_ctx->EndFrame(); + return S_OK; +} + + +// stolen from glmgrbasics.cpp + +enum ECarbonModKeyIndex +{ + EcmdKeyBit = 8, /* command key down?*/ + EshiftKeyBit = 9, /* shift key down?*/ + EalphaLockBit = 10, /* alpha lock down?*/ + EoptionKeyBit = 11, /* option key down?*/ + EcontrolKeyBit = 12 /* control key down?*/ +}; + +enum ECarbonModKeyMask +{ + EcmdKey = 1 << EcmdKeyBit, + EshiftKey = 1 << EshiftKeyBit, + EalphaLock = 1 << EalphaLockBit, + EoptionKey = 1 << EoptionKeyBit, + EcontrolKey = 1 << EcontrolKeyBit +}; + +//ConVar gl_blitmode( "gl_blitmode", "1" ); +int gl_blitmode = 1; + +HRESULT IDirect3DDevice9::Present(CONST RECT* pSourceRect,CONST RECT* pDestRect,VD3DHWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) +{ + // before attempting to present a tex, make sure it's been resolved if it was MSAA. + // if we push that responsibility down to m_ctx->Present, it could probably do it without an extra copy. + // i.e. anticipate the blit from the resolvedtex to GL_BACK, and just do that instead. + + // no explicit ResolveTex call first - that got pushed down into GLMContext::Present + m_ctx->Present( m_defaultColorSurface->m_tex ); + + return S_OK; +} + +#pragma mark ----- Textures - (IDirect3DDevice9) +#pragma mark ( create functions for each texture are now adjacent to the rest of the methods for each texture class) + + +HRESULT IDirect3DDevice9::SetTexture(DWORD Stage,IDirect3DBaseTexture9* pTexture) +{ + // texture sets are sent through immediately to GLM + // but we also latch the value so we know which TMU's are active. + // whuch can help FlushSamplers do less work. + + // place new tex + m_textures[Stage] = pTexture; + if (!pTexture) + { + m_ctx->SetSamplerTex( Stage, NULL ); + } + else + { + m_ctx->SetSamplerTex( Stage, pTexture->m_tex ); + } + + return S_OK; +} + +HRESULT IDirect3DDevice9::GetTexture(DWORD Stage,IDirect3DBaseTexture9** ppTexture) +{ + // if implemented, should it increase the ref count ?? + GLMDebugger(); + return S_OK; +} + + +#pragma mark ----- RT's and Surfaces - (IDirect3DDevice9) + +HRESULT IDirect3DDevice9::CreateRenderTarget(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,VD3DHANDLE* pSharedHandle, char *debugLabel) +{ + HRESULT result = S_OK; + + IDirect3DSurface9 *surf = new IDirect3DSurface9; + surf->m_restype = D3DRTYPE_SURFACE; + + surf->m_device = this; // always set device on creations! + + GLMTexLayoutKey rtkey; + memset( &rtkey, 0, sizeof(rtkey) ); + + rtkey.m_texGLTarget = GL_TEXTURE_2D; + rtkey.m_xSize = Width; + rtkey.m_ySize = Height; + rtkey.m_zSize = 1; + + rtkey.m_texFormat = Format; + rtkey.m_texFlags = kGLMTexRenderable; + + rtkey.m_texFlags |= kGLMTexSRGB; // all render target tex are SRGB mode + if (m_ctx->Caps().m_cantAttachSRGB) + { + // this config can't support SRGB render targets. quietly turn off the sRGB bit. + rtkey.m_texFlags &= ~kGLMTexSRGB; + } + + if ( (MultiSample !=0) && (!m_ctx->Caps().m_nvG7x) ) + { + rtkey.m_texFlags |= kGLMTexMultisampled; + rtkey.m_texSamples = MultiSample; + // FIXME no support for "MS quality" yet + } + + surf->m_tex = m_ctx->NewTex( &rtkey, debugLabel ); + surf->m_face = 0; + surf->m_mip = 0; + + //desc + surf->m_desc.Format = Format; + surf->m_desc.Type = D3DRTYPE_SURFACE; + surf->m_desc.Usage = 0; //FIXME ??????????? + surf->m_desc.Pool = D3DPOOL_DEFAULT; //FIXME ??????????? + surf->m_desc.MultiSampleType = MultiSample; + surf->m_desc.MultiSampleQuality = MultisampleQuality; + surf->m_desc.Width = Width; + surf->m_desc.Height = Height; + + *ppSurface = (result==S_OK) ? surf : NULL; + + #if IUNKNOWN_ALLOC_SPEW + char scratch[1024]; + sprintf(scratch,"RT %s", surf->m_tex->m_layout->m_layoutSummary ); + surf->SetMark( true, scratch ); + #endif + + + return result; +} + +HRESULT IDirect3DDevice9::SetRenderTarget(DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget) +{ + HRESULT result = S_OK; + + GLMPRINTF(("-F- SetRenderTarget index=%d, surface=%8x (tex=%8x %s)", + RenderTargetIndex, + pRenderTarget, + pRenderTarget ? pRenderTarget->m_tex : NULL, + pRenderTarget ? pRenderTarget->m_tex->m_layout->m_layoutSummary : "" + )); + + // note that it is OK to pass NULL for pRenderTarget, it implies that you would like to detach any color buffer from that target index + + // behaviors... + // if new surf is same as old surf, no change in refcount, in fact, it's early exit + IDirect3DSurface9 *oldTarget = m_rtSurfaces[RenderTargetIndex]; + + if (pRenderTarget == oldTarget) + { + GLMPRINTF(("-F- --> no change",RenderTargetIndex)); + return S_OK; + } + + // we now know that the new surf is not the same as the old surf. + // you can't assume either one is non NULL here though. + + if (m_rtSurfaces[RenderTargetIndex]) + { + m_rtSurfaces[RenderTargetIndex]->Release( 1, "-A SetRenderTarget private release" ); // note this is the private refcount being lowered + } + + if (pRenderTarget) + { + pRenderTarget->AddRef( 1, "+A SetRenderTarget private addref" ); // again, private refcount being raised + } + + m_rtSurfaces[RenderTargetIndex] = pRenderTarget; // emplace it whether NULL or not + + if (!pRenderTarget) + { + GLMPRINTF(("-F- --> Setting NULL render target on index=%d ",RenderTargetIndex)); + } + else + { + GLMPRINTF(("-F- --> attaching index=%d on drawing FBO (%8x)",RenderTargetIndex, m_drawableFBO)); + // attach color to FBO + GLMFBOTexAttachParams rtParams; + memset( &rtParams, 0, sizeof(rtParams) ); + + rtParams.m_tex = pRenderTarget->m_tex; + rtParams.m_face = pRenderTarget->m_face; + rtParams.m_mip = pRenderTarget->m_mip; + rtParams.m_zslice = 0; // FIXME if you ever want to be able to render to slices of a 3D tex.. + + m_drawableFBO->TexAttach( &rtParams, (EGLMFBOAttachment)(kAttColor0 + RenderTargetIndex) ); + } + + return result; +} + +HRESULT IDirect3DDevice9::GetRenderTarget(DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget) +{ + if ( !m_rtSurfaces[ RenderTargetIndex ] ) + return D3DERR_NOTFOUND; + + if ( ( RenderTargetIndex > 4 ) || !ppRenderTarget ) + return D3DERR_INVALIDCALL; + + // safe because of early exit on NULL above + m_rtSurfaces[ RenderTargetIndex ]->AddRef(0, "+B GetRenderTarget public addref"); // per http://msdn.microsoft.com/en-us/library/bb174404(VS.85).aspx + + *ppRenderTarget = m_rtSurfaces[ RenderTargetIndex ]; + + return S_OK; +} + +HRESULT IDirect3DDevice9::CreateOffscreenPlainSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,VD3DHANDLE* pSharedHandle) +{ + // set surf->m_restype to D3DRTYPE_SURFACE... + + // this is almost identical to CreateRenderTarget.. + + HRESULT result = S_OK; + + IDirect3DSurface9 *surf = new IDirect3DSurface9; + surf->m_restype = D3DRTYPE_SURFACE; + + surf->m_device = this; // always set device on creations! + + GLMTexLayoutKey rtkey; + memset( &rtkey, 0, sizeof(rtkey) ); + + rtkey.m_texGLTarget = GL_TEXTURE_2D; + rtkey.m_xSize = Width; + rtkey.m_ySize = Height; + rtkey.m_zSize = 1; + + rtkey.m_texFormat = Format; + rtkey.m_texFlags = kGLMTexRenderable; + + surf->m_tex = m_ctx->NewTex( &rtkey, "offscreen plain surface" ); + surf->m_face = 0; + surf->m_mip = 0; + + //desc + surf->m_desc.Format = Format; + surf->m_desc.Type = D3DRTYPE_SURFACE; + surf->m_desc.Usage = 0; + surf->m_desc.Pool = D3DPOOL_DEFAULT; + surf->m_desc.MultiSampleType = D3DMULTISAMPLE_NONE; + surf->m_desc.MultiSampleQuality = 0; + surf->m_desc.Width = Width; + surf->m_desc.Height = Height; + + *ppSurface = (result==S_OK) ? surf : NULL; + + return result; +} + +HRESULT IDirect3DDevice9::CreateDepthStencilSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,VD3DHANDLE* pSharedHandle) +{ + HRESULT result = S_OK; + + IDirect3DSurface9 *surf = new IDirect3DSurface9; + surf->m_restype = D3DRTYPE_SURFACE; + + surf->m_device = this; // always set device on creations! + + GLMTexLayoutKey depthkey; + memset( &depthkey, 0, sizeof(depthkey) ); + + depthkey.m_texGLTarget = GL_TEXTURE_2D; + depthkey.m_xSize = Width; + depthkey.m_ySize = Height; + depthkey.m_zSize = 1; + + depthkey.m_texFormat = Format; + depthkey.m_texFlags = kGLMTexRenderable | kGLMTexIsDepth | kGLMTexIsStencil; + + if ( (MultiSample !=0) && (!m_ctx->Caps().m_nvG7x) ) + { + depthkey.m_texFlags |= kGLMTexMultisampled; + depthkey.m_texSamples = MultiSample; + // FIXME no support for "MS quality" yet + } + + surf->m_tex = m_ctx->NewTex( &depthkey, "depth-stencil surface" ); + surf->m_face = 0; + surf->m_mip = 0; + + //desc + + surf->m_desc.Format = Format; + surf->m_desc.Type = D3DRTYPE_SURFACE; + surf->m_desc.Usage = 0; //FIXME ??????????? + surf->m_desc.Pool = D3DPOOL_DEFAULT; //FIXME ??????????? + surf->m_desc.MultiSampleType = MultiSample; + surf->m_desc.MultiSampleQuality = MultisampleQuality; + surf->m_desc.Width = Width; + surf->m_desc.Height = Height; + + *ppSurface = (result==S_OK) ? surf : NULL; + + return result; +} + +HRESULT IDirect3DDevice9::SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil) +{ + HRESULT result = S_OK; + + GLMPRINTF(("-F- SetDepthStencilSurface, surface=%8x (tex=%8x %s)", + pNewZStencil, + pNewZStencil ? pNewZStencil->m_tex : NULL, + pNewZStencil ? pNewZStencil->m_tex->m_layout->m_layoutSummary : "" + )); + + if (pNewZStencil) + { + pNewZStencil->AddRef(1, "+A SetDepthStencilSurface private addref"); + } + + if (m_dsSurface) + { + m_dsSurface->Release(1, "-A SetDepthStencilSurface private release"); + // do not do a Release here.. + } + + if (m_dsSurface != pNewZStencil) + { + GLMPRINTF(("-F- --> attaching depthstencil %8x on drawing FBO (%8x)", pNewZStencil, m_drawableFBO)); + + m_dsSurface = pNewZStencil; + + // aka FBO attach + + GLMFBOTexAttachParams depthParams; + memset( &depthParams, 0, sizeof(depthParams) ); + + // NULL is OK - it means unbind the depth buffer + depthParams.m_tex = (pNewZStencil) ? pNewZStencil->m_tex : NULL; + depthParams.m_face = 0; + depthParams.m_mip = 0; + depthParams.m_zslice= 0; + + // brute force baby + // clear old attachments in all D/S categories + m_drawableFBO->TexDetach( kAttStencil ); + m_drawableFBO->TexDetach( kAttDepth ); + m_drawableFBO->TexDetach( kAttDepthStencil ); + + // select dest for new attachment + + if (depthParams.m_tex!=NULL) + { + EGLMFBOAttachment destAttach = (depthParams.m_tex->m_layout->m_format->m_glDataFormat != 34041) ? kAttDepth : kAttDepthStencil; + m_drawableFBO->TexAttach( &depthParams, destAttach ); // attach(NULL) is allowed to mean "detach". + } + } + else + { + GLMPRINTF(("-F- --> no change")); + } + + return result; +} + +HRESULT IDirect3DDevice9::GetDepthStencilSurface(IDirect3DSurface9** ppZStencilSurface) +{ + if ( !ppZStencilSurface ) + { + return D3DERR_INVALIDCALL; + } + + if ( !m_dsSurface ) + { + *ppZStencilSurface = NULL; + return D3DERR_NOTFOUND; + } + + m_dsSurface->AddRef(0, "+B GetDepthStencilSurface public addref"); // per http://msdn.microsoft.com/en-us/library/bb174384(VS.85).aspx + + *ppZStencilSurface = m_dsSurface; + + return S_OK; +} + +HRESULT IDirect3DDevice9::GetRenderTargetData(IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface) +{ + // is it just a blit ? + + this->StretchRect( pRenderTarget, NULL, pDestSurface, NULL, D3DTEXF_NONE ); // is this good enough ??? + + return S_OK; +} + +HRESULT IDirect3DDevice9::GetFrontBufferData(UINT iSwapChain,IDirect3DSurface9* pDestSurface) +{ + Debugger(); + return S_OK; +} + +HRESULT IDirect3DDevice9::StretchRect(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter) +{ + // find relevant slices in GLM tex + + CGLMTex *srcTex = pSourceSurface->m_tex; + int srcSliceIndex = srcTex->CalcSliceIndex( pSourceSurface->m_face, pSourceSurface->m_mip ); + GLMTexLayoutSlice *srcSlice = &srcTex->m_layout->m_slices[ srcSliceIndex ]; + + CGLMTex *dstTex = pDestSurface->m_tex; + int dstSliceIndex = dstTex->CalcSliceIndex( pDestSurface->m_face, pDestSurface->m_mip ); + GLMTexLayoutSlice *dstSlice = &dstTex->m_layout->m_slices[ dstSliceIndex ]; + + if ( dstTex->m_rboName != 0 ) + { + Assert(!"No path yet for blitting into an MSAA tex"); + return S_OK; + } + + bool useFastBlit = (gl_blitmode != 0); + + if ( !useFastBlit && (srcTex->m_rboName !=0)) // old way, we do a resolve to scratch tex first (necessitating two step blit) + { + m_ctx->ResolveTex( srcTex, true ); + } + + // set up source/dest rect in GLM form + GLMRect srcRect, dstRect; + + // d3d nomenclature: + // Y=0 is the visual top and also aligned with V=0. + + srcRect.xmin = pSourceRect ? pSourceRect->left : 0; + srcRect.xmax = pSourceRect ? pSourceRect->right : srcSlice->m_xSize; + srcRect.ymin = pSourceRect ? pSourceRect->top : 0; + srcRect.ymax = pSourceRect ? pSourceRect->bottom : srcSlice->m_ySize; + + dstRect.xmin = pDestRect ? pDestRect->left : 0; + dstRect.xmax = pDestRect ? pDestRect->right : dstSlice->m_xSize; + dstRect.ymin = pDestRect ? pDestRect->top : 0; + dstRect.ymax = pDestRect ? pDestRect->bottom : dstSlice->m_ySize; + + GLenum filterGL = 0; + switch(Filter) + { + case D3DTEXF_NONE: + case D3DTEXF_POINT: + filterGL = GL_NEAREST; + break; + + case D3DTEXF_LINEAR: + filterGL = GL_LINEAR; + break; + + default: // D3DTEXF_ANISOTROPIC + Assert(!"Impl aniso stretch"); + break; + } + + if (useFastBlit) + { + m_ctx->Blit2( srcTex, &srcRect, pSourceSurface->m_face, pSourceSurface->m_mip, + dstTex, &dstRect, pDestSurface->m_face, pDestSurface->m_mip, + filterGL + ); + } + else + { + m_ctx->BlitTex( srcTex, &srcRect, pSourceSurface->m_face, pSourceSurface->m_mip, + dstTex, &dstRect, pDestSurface->m_face, pDestSurface->m_mip, + filterGL + ); + } + + return S_OK; +} + + +// This totally sucks, but this information can't be gleaned any +// other way when translating from D3D to GL at this level +// +// This returns a mask, since multiple GLSL "varyings" can be tagged with centroid +static uint32 CentroidMaskFromName( bool bPixelShader, const char *pName ) +{ + if ( !pName ) + return 0; + + if ( bPixelShader ) + { + if ( V_stristr( pName, "lightmappedgeneric_ps" ) || V_strstr( pName, "worldtwotextureblend_ps" ) ) + { + return (0x01 << 2) | (0x01 << 3); // iterators 2 and 3 + } + else if ( V_stristr( pName, "lightmappedreflective_ps" ) || V_stristr( pName, "water_ps" ) ) + { + return (0x01 << 6) | (0x01 << 7); // iterators 6 and 7 + } + else if ( V_stristr( pName, "shadow_ps" ) ) + { + return (0x01 << 0) | (0x01 << 1) | (0x01 << 3) | (0x01 << 3) | (0x01 << 4); // iterators 0 through 4 + } + else if ( V_stristr( pName, "ShaderedGlass_ps" ) ) + { + return (0x01 << 2); // iterator 2 + } + else if ( V_stristr( pName, "WorldVertexAlpha_ps" ) || V_stristr( pName, "WorldVertexTransition_ps" ) ) + { + // These pixel shaders want centroid but shouldn't be used + Assert(0); + return 0; + } + } + else // vertex shader + { + // Vertex shaders also + if ( V_stristr( pName, "lightmappedgeneric_vs" ) ) + { + return (0x01 << 2) | (0x01 << 3); // iterators 2 and 3 + } + else if ( V_stristr( pName, "lightmappedreflective_vs" ) || V_stristr( pName, "water_vs" ) ) + { + return (0x01 << 6) | (0x01 << 7); // iterators 6 and 7 + } + else if ( V_stristr( pName, "shadow_vs" ) ) + { + return (0x01 << 0) | (0x01 << 1) | (0x01 << 3) | (0x01 << 3) | (0x01 << 4); // iterators 0 through 4 + } + else if ( V_stristr( pName, "ShaderedGlass_vs" ) ) + { + return (0x01 << 2); // iterator 2 + } + } + + // This shader doesn't have any centroid iterators + return 0; +} + + +// This totally sucks, but this information can't be gleaned any +// other way when translating from D3D to GL at this level +static int ShadowDepthSamplerFromName( const char *pName ) +{ + if ( !pName ) + return -1; + + if ( V_stristr( pName, "water_ps" ) ) + { + return 7; + } + else if ( V_stristr( pName, "infected_ps" ) ) + { + return 1; + } + else if ( V_stristr( pName, "phong_ps" ) ) + { + return 4; + } + else if ( V_stristr( pName, "vertexlit_and_unlit_generic_bump_ps" ) ) + { + return 8; + } + else if ( V_stristr( pName, "vertexlit_and_unlit_generic_ps" ) ) + { + return 8; + } + else if ( V_stristr( pName, "eye_refract_ps" ) ) + { + return 6; + } + else if ( V_stristr( pName, "eyes_flashlight_ps" ) ) + { + return 4; + } + else if ( V_stristr( pName, "worldtwotextureblend_ps" ) ) + { + return 7; + } + else if ( V_stristr( pName, "teeth_flashlight_ps" ) ) + { + return 2; + } + else if ( V_stristr( pName, "flashlight_ps" ) ) // substring of above, make sure this comes last!! + { + return 7; + } + + // This shader doesn't have a shadow depth map sampler + return -1; +} + + +#pragma mark ----- Pixel Shaders - (IDirect3DDevice9) + +HRESULT IDirect3DDevice9::CreatePixelShader(CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader, const char *pShaderName, char *debugLabel) +{ + HRESULT result = D3DERR_INVALIDCALL; + *ppShader = NULL; + + int nShadowDepthSampler = ShadowDepthSamplerFromName( pShaderName ); + uint32 nCentroidMask = CentroidMaskFromName( true, pShaderName ); + + bool passthrough = ( memcmp( pFunction, "//GLSLfp", 8 ) ==0 ); // if we were given GLSL text, pass it through instead of treating it as bytecodes.. + + if ( g_bUseControlFlow || !m_ctx->Caps().m_hasDualShaders ) + { + // either having control-flow 'on' or -glmdualshaders 'off' disqualifies ARB assembler mode + g_useASMTranslations = false; + } + + if ( ! (g_useASMTranslations || g_useGLSLTranslations) ) + { + Assert(!"Must set at least one translation option.."); + *ppShader = NULL; + return -1; + } + else + { + int numTranslations = (g_useASMTranslations!=0) + (g_useGLSLTranslations!=0); + + bool bVertexShader = false; + + // we can do one or two translated forms. they go together in a single buffer with some markers to allow GLM to break it up. + // this also lets us mirror each set of translations to disk with a single file making it easier to view and edit side by side. + + int maxTranslationSize = 50000; // size of any one translation + + CUtlBuffer transbuf( 3000, numTranslations * maxTranslationSize, CUtlBuffer::TEXT_BUFFER ); + CUtlBuffer tempbuf( 3000, maxTranslationSize, CUtlBuffer::TEXT_BUFFER ); + + if (passthrough) + { + // no-translation path - copy text to transbuf + transbuf.AppendString ( (char*)pFunction ); + transbuf.AppendString( "\n\n" ); // whitespace + + bVertexShader = false; + } + else + { + if ( g_useASMTranslations ) + { + // no extra tag needed for ARBfp, just use the !!ARBfp marker + + tempbuf.EnsureCapacity( maxTranslationSize ); + g_D3DToOpenGLTranslatorASM.TranslateShader( (uint32 *) pFunction, &tempbuf, &bVertexShader, D3DToGL_OptionUseEnvParams, nShadowDepthSampler, 0, debugLabel ); + + // grow to encompass... + transbuf.AppendString ( (char*)tempbuf.Base() ); + transbuf.AppendString( "\n\n" ); // whitespace + } + + if ( g_useGLSLTranslations ) + { + transbuf.AppendString( "//GLSLfp\n" ); // this is required so GLM can crack the text apart + + // note the GLSL translator wants its own buffer + tempbuf.EnsureCapacity( maxTranslationSize ); + + uint glslPixelShaderOptions = D3DToGL_OptionGLSL | D3DToGL_OptionUseEnvParams; + + + // Fake SRGB mode - needed on R500, probably indefinitely. + // Do this stuff if caps show m_needsFakeSRGB=true and the sRGBWrite state is true + // (but not if it's engine_post which is special) + + if (!m_ctx->Caps().m_hasGammaWrites) + { + if ( pShaderName ) + { + if ( !V_stristr( pShaderName, "engine_post" ) ) + { + glslPixelShaderOptions |= D3DToGL_OptionSRGBWriteSuffix; + } + } + } + + if (m_ctx->Caps().m_hasBindableUniforms) + { + glslPixelShaderOptions |= D3DToGL_OptionUseBindableUniforms; + } + g_D3DToOpenGLTranslatorGLSL.TranslateShader( (uint32 *) pFunction, &tempbuf, &bVertexShader, glslPixelShaderOptions, nShadowDepthSampler, nCentroidMask, debugLabel ); + + transbuf.AppendString( (char*)tempbuf.Base() ); + transbuf.AppendString( "\n\n" ); // whitespace + } + } + + if ( bVertexShader ) + { + // don't cross the streams + Assert(!"Can't accept vertex shader in CreatePixelShader"); + result = D3DERR_INVALIDCALL; + } + else + { + IDirect3DPixelShader9 *newprog = new IDirect3DPixelShader9; + + newprog->m_pixProgram = m_ctx->NewProgram( kGLMFragmentProgram, (char *)transbuf.Base() ) ; + + newprog->m_device = this; + + //------ find the frag program metadata and extract it.. note this takes place even for passthrough shaders, so they need to supply the needed string too + + // find the highwater mark + const char *highWaterPrefix = "//HIGHWATER-"; // try to arrange this so it can work with pure GLSL if needed + const char *highWaterStr = strstr( (char *)transbuf.Base(), highWaterPrefix ); + if (highWaterStr) + { + const char *highWaterActualData = highWaterStr + strlen( highWaterPrefix ); + + int value = -1; + sscanf( highWaterActualData, "%d", &value ); + + newprog->m_pixHighWater = value; + newprog->m_pixProgram->m_descs[kGLMGLSL].m_highWater = value; + } + else + { + Assert(!"couldn't find highwater mark in pixel shader"); + } + + // find the sampler map + const char *samplerMaskPrefix = "//SAMPLERMASK-"; // try to arrange this so it can work with pure GLSL if needed + + char *samplerMaskStr = strstr( (char *)transbuf.Base(), samplerMaskPrefix ); + if (samplerMaskStr) + { + char *samplerMaskActualData = samplerMaskStr + strlen( samplerMaskPrefix ); + + int value = -1; + sscanf( samplerMaskActualData, "%04x", &value ); + + newprog->m_pixSamplerMask = value; + newprog->m_pixProgram->m_samplerMask = value; // helps GLM maintain a better linked pair cache even when SRGB sampler state changes + } + else + { + Assert(!"couldn't find sampler map in pixel shader"); + } + + *ppShader = newprog; + + result = S_OK; + } + } + + + return result; +} + +IDirect3DPixelShader9::~IDirect3DPixelShader9() +{ + GLMPRINTF(( ">-A- ~IDirect3DPixelShader9" )); + + if (m_device) + { + m_device->ReleasedPixelShader( this ); + + if (m_pixProgram) + { + m_pixProgram->m_ctx->DelProgram( m_pixProgram ); + m_pixProgram = NULL; + } + m_device = NULL; + } + + GLMPRINTF(( "<-A- ~IDirect3DPixelShader9" )); +} + + +HRESULT IDirect3DDevice9::SetPixelShader(IDirect3DPixelShader9* pShader) +{ + if (pShader) + { + m_ctx->SetDrawingProgram( kGLMFragmentProgram, pShader->m_pixProgram ); + } + else + { + m_ctx->SetDrawingProgram( kGLMFragmentProgram, NULL ); + } + m_pixelShader = pShader; + + return S_OK; +} + +HRESULT IDirect3DDevice9::SetPixelShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) +{ + m_ctx->SetProgramParametersF( kGLMFragmentProgram, StartRegister, (float *)pConstantData, Vector4fCount ); + + return S_OK; +} + +HRESULT IDirect3DDevice9::SetPixelShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) +{ + GLMPRINTF(("-X- Ignoring IDirect3DDevice9::SetPixelShaderConstantB call, count was %d", BoolCount )); +// actually no way to do this yet. +// m_ctx->SetProgramParametersB( kGLMFragmentProgram, StartRegister, pConstantData, BoolCount ); + + return S_OK; +} + +HRESULT IDirect3DDevice9::SetPixelShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) +{ + GLMPRINTF(("-X- Ignoring IDirect3DDevice9::SetPixelShaderConstantI call, count was %d", Vector4iCount )); +// m_ctx->SetProgramParametersI( kGLMFragmentProgram, StartRegister, pConstantData, Vector4iCount ); + return S_OK; +} + + +#pragma mark ----- Vertex Shaders - (IDirect3DDevice9) + +HRESULT IDirect3DDevice9::CreateVertexShader(CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader, const char *pShaderName, char *debugLabel) +{ + HRESULT result = D3DERR_INVALIDCALL; + *ppShader = NULL; + + uint32 nCentroidMask = CentroidMaskFromName( false, pShaderName ); + + bool passthrough = ( memcmp( pFunction, "//GLSLvp", 8 ) ==0 ); // if we were given GLSL text, pass it through instead of treating it as bytecodes.. + + if ( ! (g_useASMTranslations || g_useGLSLTranslations) ) + { + Assert(!"Must set at least one translation option.."); + *ppShader = NULL; + return -1; + } + else + { + int numTranslations = (g_useASMTranslations!=0) + (g_useGLSLTranslations!=0); + + bool bVertexShader = false; + + // we can do one or two translated forms. they go together in a single buffer with some markers to allow GLM to break it up. + // this also lets us mirror each set of translations to disk with a single file making it easier to view and edit side by side. + + int maxTranslationSize = 500000; // size of any one translation + + CUtlBuffer transbuf( 1000, numTranslations * maxTranslationSize, CUtlBuffer::TEXT_BUFFER ); + CUtlBuffer tempbuf( 1000, maxTranslationSize, CUtlBuffer::TEXT_BUFFER ); + + if (passthrough) + { + // no-translation path - copy text to transbuf + transbuf.AppendString ( (char*)pFunction ); + transbuf.AppendString( "\n\n" ); // whitespace + + char *checktext = transbuf.Base(); + bVertexShader = true; + } + else + { + if ( g_useASMTranslations ) + { + // no extra tag needed for ARBvp, just use the !!ARBvp marker + + tempbuf.EnsureCapacity( maxTranslationSize ); + + uint asmTransOptions = D3DToGL_OptionUseEnvParams | D3DToGL_OptionDoFixupZ | D3DToGL_OptionDoFixupY; + + // D3DToGL_OptionDoUserClipPlanes not being set for asm yet, it generates NV VP 2.. + g_D3DToOpenGLTranslatorASM.TranslateShader( (uint32 *) pFunction, &tempbuf, &bVertexShader, asmTransOptions, -1, 0, debugLabel ); + + // grow to encompass... + transbuf.AppendString ( (char*)tempbuf.Base() ); + transbuf.AppendString( "\n\n" ); // whitespace + } + + if ( g_useGLSLTranslations ) + { + transbuf.AppendString( "//GLSLvp\n" ); // this is required so GLM can crack the text apart + + // note the GLSL translator wants its own buffer + tempbuf.EnsureCapacity( maxTranslationSize ); + + uint glslVertexShaderOptions = D3DToGL_OptionGLSL | D3DToGL_OptionUseEnvParams | D3DToGL_OptionDoFixupZ | D3DToGL_OptionDoFixupY; + + if ( g_bUseControlFlow ) + { + glslVertexShaderOptions |= D3DToGL_OptionAllowStaticControlFlow; + } + + if ( m_ctx->Caps().m_hasNativeClipVertexMode ) + { + // note the matched trickery over in IDirect3DDevice9::FlushStates - + // if on a chipset that does no have native gl_ClipVertex support, then + // omit writes to gl_ClipVertex, and instead submit plane equations that have been altered, + // and clipping will take place in GL space using gl_Position instead of gl_ClipVertex. + + // note that this is very much a hack to mate up with ATI R5xx hardware constraints, and with older + // drivers even for later ATI parts like r6xx/r7xx. And it doesn't work on NV parts, so you really + // do have to choose the right way to go. + + glslVertexShaderOptions |= D3DToGL_OptionDoUserClipPlanes; + } + + if (m_ctx->Caps().m_hasBindableUniforms) + { + glslVertexShaderOptions |= D3DToGL_OptionUseBindableUniforms; + } + + g_D3DToOpenGLTranslatorGLSL.TranslateShader( (uint32 *) pFunction, &tempbuf, &bVertexShader, glslVertexShaderOptions, -1, nCentroidMask, debugLabel ); + + transbuf.AppendString( (char*)tempbuf.Base() ); + transbuf.AppendString( "\n\n" ); // whitespace + } + } + + if ( !bVertexShader ) + { + // don't cross the streams + Assert(!"Can't accept pixel shader in CreateVertexShader"); + result = D3DERR_INVALIDCALL; + } + else + { + IDirect3DVertexShader9 *newprog = new IDirect3DVertexShader9; + + newprog->m_device = this; + + newprog->m_vtxProgram = m_ctx->NewProgram( kGLMVertexProgram, (char *)transbuf.Base() ) ; + + // find the highwater mark.. note this takes place even for passthrough shaders, so they need to supply the needed string too + + const char *highWaterPrefix = "//HIGHWATER-"; // try to arrange this so it can work with pure GLSL if needed + const char *highWaterStr = strstr( (char *)transbuf.Base(), highWaterPrefix ); + if (highWaterStr) + { + const char *highWaterActualData = highWaterStr + strlen( highWaterPrefix ); + + int value = -1; + sscanf( highWaterActualData, "%d", &value ); + + newprog->m_vtxHighWater = value; + newprog->m_vtxProgram->m_descs[kGLMGLSL].m_highWater = value; + } + else + { + Assert(!"couldn't find highwater mark in vertex shader"); + } + + // find the attrib map.. + const char *attribMapPrefix = "//ATTRIBMAP-"; // try to arrange this so it can work with pure GLSL if needed + const char *textbase = (char *)transbuf.Base(); + + const char *attribMapStr = strstr( textbase, attribMapPrefix ); + if (attribMapStr) + { + const char *attribMapActualData = attribMapStr + strlen( attribMapPrefix ); + for( int i=0; i<16; i++) + { + int value = -1; + const char *dataItem = attribMapActualData + (i*3); + sscanf( dataItem, "%02x", &value ); + if (value >=0) + { + // make sure it's not a terminator + if (value == 0xBB) + { + Debugger(); + } + } + else + { + // probably an 'xx'... check + if ( (dataItem[0] != 'x') || (dataItem[1] != 'x') ) + { + Debugger(); // bad news + } + else + { + value = 0xBB; // not likely to see one of these... "fog with usage index 11" + } + } + newprog->m_vtxAttribMap[i] = value; + } + } + else + { + Debugger(); // that's bad... + } + + *ppShader = newprog; + + result = S_OK; + } + } + + return result; +} + +IDirect3DVertexShader9::~IDirect3DVertexShader9() +{ + GLMPRINTF(( ">-A- ~IDirect3DVertexShader9" )); + + if (m_device) + { + m_device->ReleasedVertexShader( this ); + + if (m_vtxProgram) + { + m_vtxProgram->m_ctx->DelProgram( m_vtxProgram ); + m_vtxProgram = NULL; + } + m_device = NULL; + } + else + { + } + + + GLMPRINTF(( "<-A- ~IDirect3DVertexShader9" )); +} + +HRESULT IDirect3DDevice9::SetVertexShader(IDirect3DVertexShader9* pShader) +{ + if (pShader) + { + m_ctx->SetDrawingProgram( kGLMVertexProgram, pShader->m_vtxProgram ); + } + else + { + m_ctx->SetDrawingProgram( kGLMVertexProgram, NULL ); + } + m_vertexShader = pShader; + + return S_OK; +} + +HRESULT IDirect3DDevice9::SetVertexShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) // groups of 4 floats! +{ + m_ctx->SetProgramParametersF( kGLMVertexProgram, StartRegister, (float *)pConstantData, Vector4fCount ); + return S_OK; +} + +HRESULT IDirect3DDevice9::SetVertexShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) // individual bool count! +{ + m_ctx->SetProgramParametersB( kGLMVertexProgram, StartRegister, (int *)pConstantData, BoolCount ); + return S_OK; +} + +HRESULT IDirect3DDevice9::SetVertexShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) // groups of 4 ints! +{ + m_ctx->SetProgramParametersI( kGLMVertexProgram, StartRegister, (int *)pConstantData, Vector4iCount ); + return S_OK; +} + + +#pragma mark ----- Shader Pairs - (IDirect3DDevice9) + +// callers need to ifdef POSIX this, because this method does not exist on real DX9 +HRESULT IDirect3DDevice9::LinkShaderPair( IDirect3DVertexShader9* vs, IDirect3DPixelShader9* ps ) +{ + // these are really GLSL "shaders" not "programs" but the old reference to "program" persists due to the assembler heritage + if (vs->m_vtxProgram && ps->m_pixProgram) + { + m_ctx->LinkShaderPair( vs->m_vtxProgram, ps->m_pixProgram ); + } + return S_OK; +} + +// callers need to ifdef POSIX this, because this method does not exist on real DX9 +// +HRESULT IDirect3DDevice9::QueryShaderPair( int index, GLMShaderPairInfo *infoOut ) +{ + // these are really GLSL "shaders" not "programs" ... + + m_ctx->QueryShaderPair( index, infoOut ); + + return S_OK; +} + + +#pragma mark ----- Vertex Buffers and Vertex Declarations - (IDirect3DDevice9) + +HRESULT IDirect3DDevice9::CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl) +{ + *ppDecl = NULL; + + // the goal here is to arrive at something which lets us quickly generate GLMVertexSetups. + + // the information we don't have, that must be inferred from the decls, is: + // -> how many unique streams (buffers) are used - pure curiosity + // -> what the stride and offset is for each decl. Size you can figure out on the spot, stride requires surveying all the components in each stream first. + // so init an array of per-stream offsets to 0. + // each one is a cursor that gets bumped by decls. + uint streamOffsets[ D3D_MAX_STREAMS ]; + uint streamCount = 0; + (void)streamCount; + + uint attribMap[16]; + uint attribMapIndex = 0; + memset( attribMap, 0xFF, sizeof( attribMap ) ); + + memset( streamOffsets, 0, sizeof( streamOffsets ) ); + + IDirect3DVertexDeclaration9 *decl9 = new IDirect3DVertexDeclaration9; + + decl9->m_elemCount = 0; + + for (const D3DVERTEXELEMENT9 *src = pVertexElements; (src->Stream != 0xFF); src++) + { + // element + D3DVERTEXELEMENT9_GL *elem = &decl9->m_elements[ decl9->m_elemCount++ ]; + + // copy the D3D decl wholesale. + elem->m_dxdecl = *src; + + // latch current offset in this stream. + elem->m_gldecl.m_offset = streamOffsets[ elem->m_dxdecl.Stream ]; + + // figure out size of this attr and move the cursor + // if cursor was on zero, bump the active stream count + + if (!streamOffsets[ elem->m_dxdecl.Stream ]) + streamCount++; + + int bytes = 0; + switch( elem->m_dxdecl.Type ) + { + case D3DDECLTYPE_FLOAT1: elem->m_gldecl.m_datasize = 1; elem->m_gldecl.m_datatype = GL_FLOAT; elem->m_gldecl.m_normalized=0; bytes = 4; break; + case D3DDECLTYPE_FLOAT2: elem->m_gldecl.m_datasize = 2; elem->m_gldecl.m_datatype = GL_FLOAT; elem->m_gldecl.m_normalized=0; bytes = 8; break; + + //case D3DVSDT_FLOAT3: + case D3DDECLTYPE_FLOAT3: elem->m_gldecl.m_datasize = 3; elem->m_gldecl.m_datatype = GL_FLOAT; elem->m_gldecl.m_normalized=0; bytes = 12; break; + + //case D3DVSDT_FLOAT4: + case D3DDECLTYPE_FLOAT4: elem->m_gldecl.m_datasize = 4; elem->m_gldecl.m_datatype = GL_FLOAT; elem->m_gldecl.m_normalized=0; bytes = 16; break; + + // case D3DVSDT_UBYTE4: + case D3DDECLTYPE_D3DCOLOR: + case D3DDECLTYPE_UBYTE4: + + // Force this path since we're on 10.6.2 and can't rely on EXT_vertex_array_bgra + if ( 1 ) + { + // pass 4 UB's but we know this is out of order compared to D3DCOLOR data + elem->m_gldecl.m_datasize = 4; elem->m_gldecl.m_datatype = GL_UNSIGNED_BYTE; + } + else + { + // pass a GL BGRA color courtesy of http://www.opengl.org/registry/specs/ARB/vertex_array_bgra.txt + elem->m_gldecl.m_datasize = GL_BGRA; elem->m_gldecl.m_datatype = GL_UNSIGNED_BYTE; + } + + elem->m_gldecl.m_normalized = (elem->m_dxdecl.Type == D3DDECLTYPE_D3DCOLOR); + + bytes = 4; + break; + + case D3DDECLTYPE_SHORT2: + // pass 2 US's but we know this is out of order compared to D3DCOLOR data + elem->m_gldecl.m_datasize = 2; elem->m_gldecl.m_datatype = GL_UNSIGNED_SHORT; + + elem->m_gldecl.m_normalized = 0; + + bytes = 4; + break; + + default: Debugger(); return D3DERR_INVALIDCALL; break; + + /* + typedef enum _D3DDECLTYPE + { + D3DDECLTYPE_FLOAT1 = 0, // 1D float expanded to (value, 0., 0., 1.) + D3DDECLTYPE_FLOAT2 = 1, // 2D float expanded to (value, value, 0., 1.) + D3DDECLTYPE_FLOAT3 = 2, // 3D float expanded to (value, value, value, 1.) + D3DDECLTYPE_FLOAT4 = 3, // 4D float + D3DDECLTYPE_D3DCOLOR = 4, // 4D packed unsigned bytes mapped to 0. to 1. range + // Input is in D3DCOLOR format (ARGB) expanded to (R, G, B, A) + D3DDECLTYPE_UBYTE4 = 5, // 4D unsigned byte + D3DDECLTYPE_SHORT2 = 6, // 2D signed short expanded to (value, value, 0., 1.) + D3DDECLTYPE_SHORT4 = 7, // 4D signed short + + // The following types are valid only with vertex shaders >= 2.0 + + + D3DDECLTYPE_UBYTE4N = 8, // Each of 4 bytes is normalized by dividing to 255.0 + D3DDECLTYPE_SHORT2N = 9, // 2D signed short normalized (v[0]/32767.0,v[1]/32767.0,0,1) + D3DDECLTYPE_SHORT4N = 10, // 4D signed short normalized (v[0]/32767.0,v[1]/32767.0,v[2]/32767.0,v[3]/32767.0) + D3DDECLTYPE_USHORT2N = 11, // 2D unsigned short normalized (v[0]/65535.0,v[1]/65535.0,0,1) + D3DDECLTYPE_USHORT4N = 12, // 4D unsigned short normalized (v[0]/65535.0,v[1]/65535.0,v[2]/65535.0,v[3]/65535.0) + D3DDECLTYPE_UDEC3 = 13, // 3D unsigned 10 10 10 format expanded to (value, value, value, 1) + D3DDECLTYPE_DEC3N = 14, // 3D signed 10 10 10 format normalized and expanded to (v[0]/511.0, v[1]/511.0, v[2]/511.0, 1) + D3DDECLTYPE_FLOAT16_2 = 15, // Two 16-bit floating point values, expanded to (value, value, 0, 1) + D3DDECLTYPE_FLOAT16_4 = 16, // Four 16-bit floating point values + D3DDECLTYPE_UNUSED = 17, // When the type field in a decl is unused. + } D3DDECLTYPE; + */ + } + + // write the offset and move the cursor + elem->m_gldecl.m_offset = streamOffsets[elem->m_dxdecl.Stream]; + streamOffsets[ elem->m_dxdecl.Stream ] += bytes; + + // cannot write m_stride yet, so zero it + elem->m_gldecl.m_stride = 0; + + elem->m_gldecl.m_buffer = NULL; // must be filled in at draw time.. + + // elem count was already bumped. + + // update attrib map + attribMap[ attribMapIndex++ ] = (elem->m_dxdecl.Usage << 4) | (elem->m_dxdecl.UsageIndex); + } + // the loop is done, we now know how many active streams there are, how many atribs are active in the declaration, + // and how big each one is in terms of stride. + + // all that is left is to go back and write the strides - the stride comes from the stream offset cursors accumulated earlier. + for( int j=0; j< decl9->m_elemCount; j++) + { + D3DVERTEXELEMENT9_GL *elem = &decl9->m_elements[ j ]; + + elem->m_gldecl.m_stride = streamOffsets[ elem->m_dxdecl.Stream ]; + } + + *ppDecl = decl9; + + return S_OK; +} + +IDirect3DVertexDeclaration9::~IDirect3DVertexDeclaration9() +{ + GLMPRINTF(("-A- ~IDirect3DVertexDeclaration9 signpost")); +} + +HRESULT IDirect3DDevice9::SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl) +{ + // we just latch it. At draw time we combine the current vertex decl with the current stream set and generate a vertex setup for GLM. + // GLM can see what the differences are and act accordingly to adjust vert attrib bindings. + + m_vertDecl = pDecl; + + return S_OK; +} + +HRESULT IDirect3DDevice9::SetFVF(DWORD FVF) +{ + Debugger(); + return D3DERR_INVALIDCALL; +} + +HRESULT IDirect3DDevice9::GetFVF(DWORD* pFVF) +{ + Debugger(); + return D3DERR_INVALIDCALL; +} + + +#pragma mark ----- Vertex Buffers and Streams - (IDirect3DDevice9) + +#pragma mark ----- Create function moved to be adjacent to other buffer methods + +HRESULT IDirect3DDevice9::SetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride) +{ + // perfectly legal to see a vertex buffer of NULL get passed in here. + // so we need an array to track these. + // OK, we are being given the stride, we don't need to calc it.. + + GLMPRINTF(("-X- IDirect3DDevice9::SetStreamSource setting stream #%d to D3D buf %p (GL name %d); offset %d, stride %d", StreamNumber, pStreamData, (pStreamData) ? pStreamData->m_vtxBuffer->m_name: -1, OffsetInBytes, Stride)); + + if (pStreamData) + { + m_streams[ StreamNumber ].m_vtxBuffer = pStreamData; + m_streams[ StreamNumber ].m_offset = OffsetInBytes; + m_streams[ StreamNumber ].m_stride = Stride; + } + else + { + m_streams[ StreamNumber ].m_vtxBuffer = NULL; + m_streams[ StreamNumber ].m_offset = 0; + m_streams[ StreamNumber ].m_stride = 0; + } + + return S_OK; +} + +#pragma mark ----- Index Buffers - (IDirect3DDevice9) +#pragma mark ----- Creatue function relocated to be adjacent to the rest of the index buffer methods + +HRESULT IDirect3DDevice9::SetIndices(IDirect3DIndexBuffer9* pIndexData) +{ + // just latch it. + m_indices.m_idxBuffer = pIndexData; + return S_OK; +} + + +#pragma mark ----- Release Handlers - (IDirect3DDevice9) +void IDirect3DDevice9::ReleasedTexture( IDirect3DBaseTexture9 *baseTex ) +{ + // see if this texture is referenced in any of the texture units and scrub it if so. + for( int i=0; i<16; i++) + { + if (m_textures[i] == baseTex) + { + m_textures[i] = NULL; + m_ctx->SetSamplerTex( i, NULL ); // texture sets go straight through to GLM, no dirty bit + } + } +} + +void IDirect3DDevice9::ReleasedSurface( IDirect3DSurface9 *surface ) +{ + for( int i=0; i<16; i++) + { + if (m_rtSurfaces[i]==surface) + { + // this was a surprise release... scrub it + m_rtSurfaces[i] = NULL; + GLMPRINTF(( "-A- Scrubbed surface %08x from m_rtSurfaces[%d]", surface, i )); + } + } + if( m_dsSurface == surface ) + { + m_dsSurface = NULL; + GLMPRINTF(( "-A- Scrubbed surface %08x from m_dsSurface", surface )); + } + + if ( m_defaultColorSurface == surface ) + { + m_defaultColorSurface = NULL; + GLMPRINTF(( "-A- Scrubbed surface %08x from m_defaultColorSurface", surface )); + } + + if ( m_defaultDepthStencilSurface == surface ) + { + m_defaultDepthStencilSurface = NULL; + GLMPRINTF(( "-A- Scrubbed surface %08x from m_defaultDepthStencilSurface", surface )); + } +} + +void IDirect3DDevice9::ReleasedPixelShader( IDirect3DPixelShader9 *pixelShader ) +{ + if ( m_pixelShader == pixelShader ) + { + m_pixelShader = NULL; + GLMPRINTF(( "-A- Scrubbed pixel shader %08x from m_pixelShader", pixelShader )); + } +} + +void IDirect3DDevice9::ReleasedVertexShader( IDirect3DVertexShader9 *vertexShader ) +{ + if ( m_vertexShader == vertexShader ) + { + m_vertexShader = NULL; + GLMPRINTF(( "-A- Scrubbed vertex shader %08x from m_vertexShader", vertexShader )); + } +} + +void IDirect3DDevice9::ReleasedVertexBuffer( IDirect3DVertexBuffer9 *vertexBuffer ) +{ + for (int i=0; i< D3D_MAX_STREAMS; i++) + { + if ( m_streams[i].m_vtxBuffer == vertexBuffer ) + { + m_streams[i].m_vtxBuffer = NULL; + GLMPRINTF(( "-A- Scrubbed vertex buffer %08x from m_streams[%d]", vertexBuffer, i )); + } + } +} + +void IDirect3DDevice9::ReleasedIndexBuffer( IDirect3DIndexBuffer9 *indexBuffer ) +{ + if ( m_indices.m_idxBuffer == indexBuffer ) + { + m_indices.m_idxBuffer = NULL; + GLMPRINTF(( "-A- Scrubbed index buffer %08x from m_indices", indexBuffer )); + } +} + + +void IDirect3DDevice9::ReleasedQuery( IDirect3DQuery9 *query ) +{ + // nothing to do yet.. +} + + + + +#pragma mark ----- Queries - (IDirect3DDevice9) + +// note that detection of whether queries are supported is done by trying to create one. +// so for GL, be observant here of whether we have that capability or not. +// pretty much have this everywhere but i950. + +HRESULT IDirect3DDevice9::CreateQuery(D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery) +{ + if (m_ctx->Caps().m_hasOcclusionQuery) + { + IDirect3DQuery9 *newquery = new IDirect3DQuery9; + + newquery->m_device = this; + + newquery->m_type = Type; + newquery->m_ctx = m_ctx; + + GLMQueryParams params; + memset( ¶ms, 0, sizeof(params) ); + + bool known = false; + switch(newquery->m_type) + { + case D3DQUERYTYPE_OCCLUSION: /* D3DISSUE_BEGIN, D3DISSUE_END */ + // create an occlusion query + params.m_type = EOcclusion; + break; + + case D3DQUERYTYPE_EVENT: /* D3DISSUE_END */ + params.m_type = EFence; + break; + + case D3DQUERYTYPE_RESOURCEMANAGER: /* D3DISSUE_END */ + case D3DQUERYTYPE_TIMESTAMP: /* D3DISSUE_END */ + case D3DQUERYTYPE_TIMESTAMPFREQ: /* D3DISSUE_END */ + case D3DQUERYTYPE_INTERFACETIMINGS: /* D3DISSUE_BEGIN, D3DISSUE_END */ + case D3DQUERYTYPE_PIXELTIMINGS: /* D3DISSUE_BEGIN, D3DISSUE_END */ + case D3DQUERYTYPE_CACHEUTILIZATION: /* D3DISSUE_BEGIN, D3DISSUE_END */ + Assert( !"Un-implemented query type" ); + break; + + default: + Assert( !"Unknown query type" ); + break; + } + newquery->m_query = m_ctx->NewQuery( ¶ms ); + + *ppQuery = newquery; + return S_OK; + } + else + { + *ppQuery = NULL; + return -1; // failed + } + +} + +IDirect3DQuery9::~IDirect3DQuery9() +{ + GLMPRINTF((">-A- ~IDirect3DQuery9")); + + if (m_device) + { + m_device->ReleasedQuery( this ); + + if (m_query) + { + GLMPRINTF((">-A- ~IDirect3DQuery9 freeing m_query")); + + m_query->m_ctx->DelQuery( m_query ); + m_query = NULL; + + GLMPRINTF(("<-A- ~IDirect3DQuery9 freeing m_query done")); + } + m_device = NULL; + } + + GLMPRINTF(("<-A- ~IDirect3DQuery9")); +} + +#pragma mark ----- Render States - (IDirect3DDevice9) + +struct D3D_RSINFO +{ + int m_class; + D3DRENDERSTATETYPE m_state; + DWORD m_defval; + // m_class runs 0-3. + // 3 = must implement - fully general - "obey" + // 2 = implement setup to the default value (it has a GL effect but does not change later) "obey once" + // 1 = "fake implement" setup to the default value no GL effect, debug break if anything but default value comes through - "ignore" + // 0 = game never ever sets this one, break if someone even tries. "complain" +}; + +#define D3DRS_VALUE_LIMIT 210 +bool g_D3DRS_INFO_unpacked_ready = false; // set to true after unpack +D3D_RSINFO g_D3DRS_INFO_unpacked[ D3DRS_VALUE_LIMIT+1 ]; + +#ifdef D3D_RSI + #error macro collision... rename this +#else + #define D3D_RSI(nclass,nstate,ndefval) { nclass, nstate, ndefval } +#endif + +// FP conversions to hex courtesy of http://babbage.cs.qc.cuny.edu/IEEE-754/Decimal.html +#define CONST_DZERO 0x00000000 +#define CONST_DONE 0x3F800000 +#define CONST_D64 0x42800000 +#define DONT_KNOW_YET 0x31415926 + + +// see http://www.toymaker.info/Games/html/render_states.html + +D3D_RSINFO g_D3DRS_INFO_packed[] = +{ + // these do not have to be in any particular order. they get unpacked into the empty array above for direct indexing. + + D3D_RSI( 3, D3DRS_ZENABLE, DONT_KNOW_YET ), // enable Z test (or W buffering) + D3D_RSI( 3, D3DRS_ZWRITEENABLE, DONT_KNOW_YET ), // enable Z write + D3D_RSI( 3, D3DRS_ZFUNC, DONT_KNOW_YET ), // select Z func + + D3D_RSI( 3, D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_RED | D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_BLUE | D3DCOLORWRITEENABLE_ALPHA ), // see transitiontable.cpp "APPLY_RENDER_STATE_FUNC( D3DRS_COLORWRITEENABLE, ColorWriteEnable )" + + D3D_RSI( 3, D3DRS_CULLMODE, D3DCULL_CCW ), // backface cull control + + D3D_RSI( 3, D3DRS_ALPHABLENDENABLE, DONT_KNOW_YET ), // ->CTransitionTable::ApplySeparateAlphaBlend and ApplyAlphaBlend + D3D_RSI( 3, D3DRS_BLENDOP, D3DBLENDOP_ADD ), + D3D_RSI( 3, D3DRS_SRCBLEND, DONT_KNOW_YET ), + D3D_RSI( 3, D3DRS_DESTBLEND, DONT_KNOW_YET ), + + D3D_RSI( 1, D3DRS_SEPARATEALPHABLENDENABLE, FALSE ), // hit in CTransitionTable::ApplySeparateAlphaBlend + D3D_RSI( 1, D3DRS_SRCBLENDALPHA, D3DBLEND_ONE ), // going to demote these to class 1 until I figure out if they are implementable + D3D_RSI( 1, D3DRS_DESTBLENDALPHA, D3DBLEND_ZERO ), + D3D_RSI( 1, D3DRS_BLENDOPALPHA, D3DBLENDOP_ADD ), + + // what is the deal with alpha test... looks like it is inited to off. + D3D_RSI( 3, D3DRS_ALPHATESTENABLE, 0 ), + D3D_RSI( 3, D3DRS_ALPHAREF, 0 ), + D3D_RSI( 3, D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL ), + + D3D_RSI( 3, D3DRS_STENCILENABLE, FALSE ), + D3D_RSI( 3, D3DRS_STENCILFAIL, D3DSTENCILOP_KEEP ), + D3D_RSI( 3, D3DRS_STENCILZFAIL, D3DSTENCILOP_KEEP ), + D3D_RSI( 3, D3DRS_STENCILPASS, D3DSTENCILOP_KEEP ), + D3D_RSI( 3, D3DRS_STENCILFUNC, D3DCMP_ALWAYS ), + D3D_RSI( 3, D3DRS_STENCILREF, 0 ), + D3D_RSI( 3, D3DRS_STENCILMASK, 0xFFFFFFFF ), + D3D_RSI( 3, D3DRS_STENCILWRITEMASK, 0xFFFFFFFF ), + + D3D_RSI( 3, D3DRS_TWOSIDEDSTENCILMODE, FALSE ), + D3D_RSI( 3, D3DRS_CCW_STENCILFAIL, D3DSTENCILOP_KEEP ), + D3D_RSI( 3, D3DRS_CCW_STENCILZFAIL, D3DSTENCILOP_KEEP ), + D3D_RSI( 3, D3DRS_CCW_STENCILPASS, D3DSTENCILOP_KEEP ), + D3D_RSI( 3, D3DRS_CCW_STENCILFUNC, D3DCMP_ALWAYS ), + + D3D_RSI( 3, D3DRS_FOGENABLE, FALSE ), // see CShaderAPIDx8::FogMode and friends - be ready to do the ARB fog linear option madness + D3D_RSI( 3, D3DRS_FOGCOLOR, 0 ), + D3D_RSI( 3, D3DRS_FOGTABLEMODE, D3DFOG_NONE ), + D3D_RSI( 3, D3DRS_FOGSTART, CONST_DZERO ), + D3D_RSI( 3, D3DRS_FOGEND, CONST_DONE ), + D3D_RSI( 3, D3DRS_FOGDENSITY, CONST_DZERO ), + D3D_RSI( 3, D3DRS_RANGEFOGENABLE, FALSE ), + D3D_RSI( 3, D3DRS_FOGVERTEXMODE, D3DFOG_NONE ), // watch out for CShaderAPIDx8::CommitPerPassFogMode.... + + D3D_RSI( 3, D3DRS_MULTISAMPLEANTIALIAS, TRUE ), + D3D_RSI( 3, D3DRS_MULTISAMPLEMASK, 0xFFFFFFFF ), + + D3D_RSI( 3, D3DRS_SCISSORTESTENABLE, FALSE ), // heed IDirect3DDevice9::SetScissorRect + + D3D_RSI( 3, D3DRS_DEPTHBIAS, CONST_DZERO ), + D3D_RSI( 3, D3DRS_SLOPESCALEDEPTHBIAS, CONST_DZERO ), + + D3D_RSI( 3, D3DRS_COLORWRITEENABLE1, 0x0000000f ), + D3D_RSI( 3, D3DRS_COLORWRITEENABLE2, 0x0000000f ), + D3D_RSI( 3, D3DRS_COLORWRITEENABLE3, 0x0000000f ), + + D3D_RSI( 3, D3DRS_SRGBWRITEENABLE, 0 ), // heeded but ignored.. + + D3D_RSI( 2, D3DRS_CLIPPING, TRUE ), // um, yeah, clipping is enabled (?) + D3D_RSI( 3, D3DRS_CLIPPLANEENABLE, 0 ), // mask 1<m_class >= 0; packed++ ) + { + if ( (packed->m_state <0) || (packed->m_state >= D3DRS_VALUE_LIMIT) ) + { + // bad + Debugger(); + } + else + { + // dispatch it to the unpacked array + g_D3DRS_INFO_unpacked[ packed->m_state ] = *packed; + } + } +} + +// convenience functions + +GLenum D3DCompareFuncToGL( DWORD function ) +{ + switch ( function ) + { + case D3DCMP_NEVER : return GL_NEVER; // Always fail the test. + case D3DCMP_LESS : return GL_LESS; // Accept the new pixel if its value is less than the value of the current pixel. + case D3DCMP_EQUAL : return GL_EQUAL; // Accept the new pixel if its value equals the value of the current pixel. + case D3DCMP_LESSEQUAL : return GL_LEQUAL; // Accept the new pixel if its value is less than or equal to the value of the current pixel. ** + case D3DCMP_GREATER : return GL_GREATER; // Accept the new pixel if its value is greater than the value of the current pixel. + case D3DCMP_NOTEQUAL : return GL_NOTEQUAL; // Accept the new pixel if its value does not equal the value of the current pixel. + case D3DCMP_GREATEREQUAL: return GL_GEQUAL; // Accept the new pixel if its value is greater than or equal to the value of the current pixel. + case D3DCMP_ALWAYS : return GL_ALWAYS; // Always pass the test. + default : Debugger(); return 0xFFFFFFFF; + } +} + +static GLenum D3DStencilOpToGL( DWORD operation ) +{ + switch( operation ) + { + case D3DSTENCILOP_KEEP : return GL_KEEP; + case D3DSTENCILOP_ZERO : return GL_ZERO; + case D3DSTENCILOP_REPLACE : return GL_REPLACE; + case D3DSTENCILOP_INCRSAT : return GL_INCR; + case D3DSTENCILOP_DECRSAT : return GL_DECR; + case D3DSTENCILOP_INVERT : return GL_INVERT; + case D3DSTENCILOP_INCR : return GL_INCR_WRAP_EXT; + case D3DSTENCILOP_DECR : return GL_DECR_WRAP_EXT; + default : Debugger(); return 0xFFFFFFFF; + } +} + +static GLenum D3DBlendFactorToGL( DWORD equation ) +{ + switch (equation) + { + case D3DBLEND_ZERO : return GL_ZERO; // Blend factor is (0, 0, 0, 0). + case D3DBLEND_ONE : return GL_ONE; // Blend factor is (1, 1, 1, 1). + case D3DBLEND_SRCCOLOR : return GL_SRC_COLOR; // Blend factor is (Rs, Gs, Bs, As). + case D3DBLEND_INVSRCCOLOR : return GL_ONE_MINUS_SRC_COLOR; // Blend factor is (1 - Rs, 1 - Gs, 1 - Bs, 1 - As). + case D3DBLEND_SRCALPHA : return GL_SRC_ALPHA; // Blend factor is (As, As, As, As). + case D3DBLEND_INVSRCALPHA : return GL_ONE_MINUS_SRC_ALPHA; // Blend factor is ( 1 - As, 1 - As, 1 - As, 1 - As). + case D3DBLEND_DESTALPHA : return GL_DST_ALPHA; // Blend factor is (Ad Ad Ad Ad). + case D3DBLEND_INVDESTALPHA : return GL_ONE_MINUS_DST_ALPHA; // Blend factor is (1 - Ad 1 - Ad 1 - Ad 1 - Ad). + case D3DBLEND_DESTCOLOR : return GL_DST_COLOR; // Blend factor is (Rd, Gd, Bd, Ad). + case D3DBLEND_INVDESTCOLOR : return GL_ONE_MINUS_DST_COLOR; // Blend factor is (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad). + case D3DBLEND_SRCALPHASAT : return GL_SRC_ALPHA_SATURATE; // Blend factor is (f, f, f, 1); where f = min(As, 1 - Ad). + + /* + // these are weird.... break if we hit them + case D3DBLEND_BOTHSRCALPHA : Assert(0); return GL_ZERO; // Obsolete. Starting with DirectX 6, you can achieve the same effect by setting the source and destination blend factors to D3DBLEND_SRCALPHA and D3DBLEND_INVSRCALPHA in separate calls. + case D3DBLEND_BOTHINVSRCALPHA: Assert(0); return GL_ZERO; // Source blend factor is (1 - As, 1 - As, 1 - As, 1 - As), and destination blend factor is (As, As, As, As); the destination blend selection is overridden. This blend mode is supported only for the D3DRS_SRCBLEND render state. + case D3DBLEND_BLENDFACTOR : Assert(0); return GL_ZERO; // Constant color blending factor used by the frame-buffer blender. This blend mode is supported only if D3DPBLENDCAPS_BLENDFACTOR is set in the SrcBlendCaps or DestBlendCaps members of D3DCAPS9. + + dxabstract.h has not heard of these, so let them hit the debugger if they come through + case D3DBLEND_INVBLENDFACTOR: //Inverted constant color-blending factor used by the frame-buffer blender. This blend mode is supported only if the D3DPBLENDCAPS_BLENDFACTOR bit is set in the SrcBlendCaps or DestBlendCaps members of D3DCAPS9. + case D3DBLEND_SRCCOLOR2: // Blend factor is (PSOutColor[1]r, PSOutColor[1]g, PSOutColor[1]b, not used). This flag is available in Direct3D 9Ex only. + case D3DBLEND_INVSRCCOLOR2: // Blend factor is (1 - PSOutColor[1]r, 1 - PSOutColor[1]g, 1 - PSOutColor[1]b, not used)). This flag is available in Direct3D 9Ex only. + */ + default: + Debugger(); + return 0xFFFFFFFF; + break; + } +} + +static GLenum D3DBlendOperationToGL( DWORD operation ) +{ + switch (operation) + { + case D3DBLENDOP_ADD : return GL_FUNC_ADD; // The result is the destination added to the source. Result = Source + Destination + + /* not covered by dxabstract.h.. + case D3DBLENDOP_SUBTRACT : return GL_FUNC_SUBTRACT; // The result is the destination subtracted from to the source. Result = Source - Destination + case D3DBLENDOP_REVSUBTRACT : return GL_FUNC_REVERSE_SUBTRACT; // The result is the source subtracted from the destination. Result = Destination - Source + case D3DBLENDOP_MIN : return GL_MIN; // The result is the minimum of the source and destination. Result = MIN(Source, Destination) + case D3DBLENDOP_MAX : return GL_MAX; // The result is the maximum of the source and destination. Result = MAX(Source, Destination) + */ + + default: + Debugger(); + return 0xFFFFFFFF; + break; + + } +} + +HRESULT IDirect3DDevice9::SetRenderState( D3DRENDERSTATETYPE State, DWORD Value ) +{ + char rsSpew = 1; + char ignored = 0; + + if (!g_D3DRS_INFO_unpacked_ready) + { + UnpackD3DRSITable(); + g_D3DRS_INFO_unpacked_ready = true; + } + + if (State >= D3DRS_VALUE_LIMIT) + { + Debugger(); // bad + } + else + { + D3D_RSINFO *info = &g_D3DRS_INFO_unpacked[ State ]; + + if (info->m_state != State) + { + Debugger(); // bad - we never set up that state in our list + } + + if (rsSpew) + { + GLMPRINTF(("-X- IDirect3DDevice9::SetRenderState: set %s(%d) to %d(0x%08x) ( class %d, defval is %d(0x%08x) )", GLMDecode( eD3D_RSTATE,State),State, Value,Value, info->m_class, info->m_defval,info->m_defval )); + } + + switch( info->m_class ) + { + case 0: // just ignore quietly. example: D3DRS_LIGHTING + ignored = 1; + break; + + case 1: + { + // no GL response - and no error as long as the write value matches the default + if (Value != info->m_defval) + { + static char stop_here_1 = 0; + if (stop_here_1) + Debugger(); + } + } + break; + + case 2: + + // provide GL response, but only support known default value + if (Value != info->m_defval) + { + static char stop_here_2 = 0; + if (stop_here_2) + Debugger(); + } + // fall through to mode 3 + + case 3: + + // full GL response, support any legal value + // note we're handling the class-2's as well. + switch(State) + { + case D3DRS_ZENABLE: // kGLDepthTestEnable + gl.m_DepthTestEnable.enable = Value; + gl.m_stateDirtyMask |= (1< GL blend equation + { + GLenum equation = D3DBlendOperationToGL( Value ); + gl.m_BlendEquation.equation = equation; + gl.m_stateDirtyMask |= (1< GL blend factor + case D3DRS_DESTBLEND: // kGLBlendFactor + { + GLenum factor = D3DBlendFactorToGL( Value ); + + if (State==D3DRS_SRCBLEND) + { + gl.m_BlendFactor.srcfactor = factor; + } + else + { + gl.m_BlendFactor.dstfactor = factor; + } + gl.m_stateDirtyMask |= (1< GL_STENCIL_TEST_TWO_SIDE_EXT... not yet implemented ? + case D3DRS_CCW_STENCILFAIL: // GLStencilOp_t + case D3DRS_CCW_STENCILZFAIL: // GLStencilOp_t + case D3DRS_CCW_STENCILPASS: // GLStencilOp_t + case D3DRS_CCW_STENCILFUNC: // GLStencilFunc_t + ignored = 1; + break; + + case D3DRS_FOGENABLE: // none of these are implemented yet... erk + gl.m_FogEnable = (Value != 0); + GLMPRINTF(("-D- fogenable = %d",Value )); + //ignored = 1; + break; + + case D3DRS_FOGCOLOR: + case D3DRS_FOGTABLEMODE: + case D3DRS_FOGSTART: + case D3DRS_FOGEND: + case D3DRS_FOGDENSITY: + case D3DRS_RANGEFOGENABLE: + case D3DRS_FOGVERTEXMODE: + ignored = 1; + break; + + case D3DRS_MULTISAMPLEANTIALIAS: + case D3DRS_MULTISAMPLEMASK: + ignored = 1; + break; + + case D3DRS_SCISSORTESTENABLE: // kGLScissorEnable + { + gl.m_ScissorEnable.enable = Value; + + gl.m_stateDirtyMask |= (1<m_addressModes[ Type - (int)D3DSAMP_ADDRESSU ] = (D3DTEXTUREADDRESS)Value; + break; + + case D3DSAMP_BORDERCOLOR: + samp->m_borderColor = Value; + break; + + case D3DSAMP_MAGFILTER: samp->m_magFilter = (D3DTEXTUREFILTERTYPE)Value; break; + case D3DSAMP_MINFILTER: samp->m_minFilter = (D3DTEXTUREFILTERTYPE)Value; break; + case D3DSAMP_MIPFILTER: samp->m_mipFilter = (D3DTEXTUREFILTERTYPE)Value; break; + case D3DSAMP_MIPMAPLODBIAS: samp->m_mipmapBias = Value; break; // float in sheep's clothing - check this one out + case D3DSAMP_MAXMIPLEVEL: samp->m_maxMipLevel = Value; break; + case D3DSAMP_MAXANISOTROPY: samp->m_maxAniso = Value; break; + case D3DSAMP_SRGBTEXTURE: samp->m_srgb = Value; break; + case D3DSAMP_SHADOWFILTER: samp->m_shadowFilter = Value; break; + + default: + Assert(!"Unknown sampler parameter"); + break; + + } + gl.m_samplerDirtyMask |= (1<WriteAlphaTestEnable( &gl.m_AlphaTestEnable ); + + if ( stateHitMask & (1<WriteAlphaTestFunc( &gl.m_AlphaTestFunc ); + + if ( stateHitMask & (1<WriteAlphaToCoverageEnable( &gl.m_AlphaToCoverageEnable ); + + if ( stateHitMask & (1<WriteCullFaceEnable( &gl.m_CullFaceEnable ); + + if ( stateHitMask & (1<WriteCullFrontFace( &gl.m_CullFrontFace ); + + if ( stateHitMask & (1<WritePolygonMode( &gl.m_PolygonMode ); + + if ( stateHitMask & (1<WriteDepthBias( &gl.m_DepthBias ); + + if ( stateHitMask & (1<WriteScissorEnable( &gl.m_ScissorEnable ); + + if ( stateHitMask & (1<WriteScissorBox( &gl.m_ScissorBox ); + + if ( stateHitMask & (1<WriteViewportBox( &gl.m_ViewportBox ); + + if ( stateHitMask & (1<WriteViewportDepthRange( &gl.m_ViewportDepthRange ); + + if ( stateHitMask & (1<WriteClipPlaneEnable( &gl.m_ClipPlaneEnable[x], x ); + } + } + + if ( stateHitMask & (1<Caps().m_hasNativeClipVertexMode ) + { + // hacked coeffs = { src->x, -src->y, 0.5f * src->z, src->w + (0.5f * src->z) }; + // Antonio's trick - so we can use gl_Position as the clippee, not gl_ClipVertex. + + GLClipPlaneEquation_t *equ = &gl.m_ClipPlaneEquation[x]; + + ///////////////// temp1 + temp1.x = equ->x; + temp1.y = equ->y * -1.0; + temp1.z = equ->z * 0.5; + temp1.w = equ->w + (equ->z * 0.5); + + + //////////////// temp2 + VMatrix mat1( 1, 0, 0, 0, + 0, -1, 0, 0, + 0, 0, 2, -1, + 0, 0, 0, 1 + ); + //mat1 = mat1.Transpose(); + + VMatrix mat2; + bool success = mat1.InverseGeneral( mat2 ); + + if (success) + { + VMatrix mat3; + mat3 = mat2.Transpose(); + + VPlane origPlane( Vector( equ->x, equ->y, equ->z ), equ->w ); + VPlane newPlane; + + newPlane = mat3 * origPlane /* * mat3 */; + + VPlane finalPlane = newPlane; + + temp2.x = newPlane.m_Normal.x; + temp2.y = newPlane.m_Normal.y; + temp2.z = newPlane.m_Normal.z; + temp2.w = newPlane.m_Dist; + } + else + { + temp2.x = 0; + temp2.y = 0; + temp2.z = 0; + temp2.w = 0; + } + } + else + { + temp1 = temp2 = gl.m_ClipPlaneEquation[x]; + } + + if (1) //GLMKnob("caps-key",NULL)==0.0) + { + m_ctx->WriteClipPlaneEquation( &temp1, x ); // no caps lock = Antonio or classic + + /* + if (x<1) + { + GLMPRINTF(( " plane %d √vers1[ %5.2f %5.2f %5.2f %5.2f ] vers2[ %5.2f %5.2f %5.2f %5.2f ]", + x, + temp1.x,temp1.y,temp1.z,temp1.w, + temp2.x,temp2.y,temp2.z,temp2.w + )); + } + */ + } + else + { + m_ctx->WriteClipPlaneEquation( &temp2, x ); // caps = our way or classic + + /* + if (x<1) + { + GLMPRINTF(( " plane %d vers1[ %5.2f %5.2f %5.2f %5.2f ] √vers2[ %5.2f %5.2f %5.2f %5.2f ]", + x, + temp1.x,temp1.y,temp1.z,temp1.w, + temp2.x,temp2.y,temp2.z,temp2.w + )); + } + */ + } + } + } + + if ( stateHitMask & (1<WriteColorMaskSingle( &gl.m_ColorMaskSingle ); + +// if ( stateHitMask & (1<WriteColorMaskMultiple( &gl.m_ColorMaskMultiple ); // ???????????? hmmmmmmmm + + if ( stateHitMask & (1<WriteBlendEnable( &gl.m_BlendEnable ); + + if ( stateHitMask & (1<WriteBlendFactor( &gl.m_BlendFactor ); + + if ( stateHitMask & (1<WriteBlendEquation( &gl.m_BlendEquation ); + + if ( stateHitMask & (1<WriteBlendColor( &gl.m_BlendColor ); + + if ( stateHitMask & (1<WriteBlendEnableSRGB( &gl.m_BlendEnableSRGB ); + + if ( stateHitMask & (1<WriteDepthTestEnable( &gl.m_DepthTestEnable ); + + if ( stateHitMask & (1<WriteDepthFunc( &gl.m_DepthFunc ); + + if ( stateHitMask & (1<WriteDepthMask( &gl.m_DepthMask ); + + if ( stateHitMask & (1<WriteStencilTestEnable( &gl.m_StencilTestEnable ); + + if ( stateHitMask & (1<WriteStencilFunc( &gl.m_StencilFunc ); + + if ( stateHitMask & (1<WriteStencilOp( &gl.m_StencilOp,0 ); + m_ctx->WriteStencilOp( &gl.m_StencilOp,1 ); // ********* need to recheck this + } + + if ( stateHitMask & (1<WriteStencilWriteMask( &gl.m_StencilWriteMask ); + + if ( stateHitMask & (1<WriteClearColor( &gl.m_ClearColor ); + + if ( stateHitMask & (1<WriteClearDepth( &gl.m_ClearDepth ); + + if ( stateHitMask & (1<WriteClearStencil( &gl.m_ClearStencil ); + + gl.m_stateDirtyMask &= (~stateHitMask); + + return S_OK; +} + + + // addressing modes + // 1 D3DTADDRESS_WRAP Tile the texture at every integer junction. + // D3DTADDRESS_MIRROR Similar to D3DTADDRESS_WRAP, except that the texture is flipped at every integer junction. + // 3 D3DTADDRESS_CLAMP Texture coordinates outside the range [0.0, 1.0] are set to the texture color at 0.0 or 1.0, respectively. + // 4 D3DTADDRESS_BORDER Texture coordinates outside the range [0.0, 1.0] are set to the border color. + // D3DTADDRESS_MIRRORONCE Similar to D3DTADDRESS_MIRROR and D3DTADDRESS_CLAMP. + // Takes the absolute value of the texture coordinate (thus, mirroring around 0), + // and then clamps to the maximum value. The most common usage is for volume textures, + // where support for the full D3DTADDRESS_MIRRORONCE texture-addressing mode is not + // necessary, but the data is symmetric around the one axis. +static GLenum dxtogl_addressMode[] = +{ + GL_REPEAT, // 0 is an invalid sampler addressing mode, if it comes up, just use REPEAT + GL_REPEAT, // from D3DTADDRESS_WRAP + (GLenum)-1, // no D3DTADDRESS_MIRROR support + GL_CLAMP_TO_EDGE, // from D3DTADDRESS_CLAMP + GL_CLAMP, // from D3DTADDRESS_BORDER + (GLenum)-1, // no D3DTADDRESS_MIRRORONCE support +}; + +/* + _D3DTEXTUREFILTERTYPE: + D3DTEXF_NONE = 0, // filtering disabled (valid for mip filter only) + D3DTEXF_POINT = 1, // nearest + D3DTEXF_LINEAR = 2, // linear interpolation + D3DTEXF_ANISOTROPIC = 3, // anisotropic +*/ + +static GLenum dxtogl_magFilter[4] = // indexed by _D3DTEXTUREFILTERTYPE +{ + GL_NEAREST, // D3DTEXF_NONE not applicable to mag filter but we handle it like POINT (mat_showmiplevels hits this) + GL_NEAREST, // D3DTEXF_POINT + GL_LINEAR, // D3DTEXF_LINEAR + GL_LINEAR, // D3DTEXF_ANISOTROPIC (aniso will be driven by setting maxAniso, not by a GL filter mode) +}; + +static GLenum dxtogl_minFilter[4][4] = // indexed by _D3DTEXTUREFILTERTYPE on both axes: [row is min filter][col is mip filter]. +{ + // mip filter ---------------> D3DTEXF_NONE D3DTEXF_POINT D3DTEXF_LINEAR (D3DTEXF_ANISOTROPIC not applicable to mip filter) + /* min = D3DTEXF_NONE */ { GL_NEAREST, GL_NEAREST_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR, (GLenum)-1 }, // D3DTEXF_NONE we just treat like POINT + /* min = D3DTEXF_POINT */ { GL_NEAREST, GL_NEAREST_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR, (GLenum)-1 }, + /* min = D3DTEXF_LINEAR */ { GL_LINEAR, GL_LINEAR_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_LINEAR, (GLenum)-1 }, + /* min = D3DTEXF_ANISOTROPIC */ { GL_LINEAR, GL_LINEAR_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_LINEAR, (GLenum)-1 }, // no diff from prior row, set maxAniso to effect the sampling +}; + +HRESULT IDirect3DDevice9::FlushSamplers( uint mask ) +{ + // a minor optimization we could do here would be to only write sampler state for + // TMU's that are active (i.e. consult m_textures) + uint activeSamplerMask = m_pixelShader ? m_pixelShader->m_pixSamplerMask : 0; // if no pixel shader bound at time of draw, act like it references no samplers + // (and avoid an access violation while yer at it) + + // ho, we're not clearing the dirty mask for samplers as we go... need to do that... + uint samplerHitMask = gl.m_samplerDirtyMask & mask; + for( int index = 0; (index < 16) && (samplerHitMask !=0); index++) + { + uint bitMask = 1<m_addressModes[0] = dxtogl_addressMode[ dxsamp->m_addressModes[0] ]; + glsamp->m_addressModes[1] = dxtogl_addressMode[ dxsamp->m_addressModes[1] ]; + glsamp->m_addressModes[2] = dxtogl_addressMode[ dxsamp->m_addressModes[2] ]; + + // border color + uint dxcolor = dxsamp->m_borderColor; + glsamp->m_borderColor[0] = ((dxcolor >> 16) & 0xFF) / 255.0f; //R + glsamp->m_borderColor[1] = ((dxcolor >> 8) & 0xFF) / 255.0f; //G + glsamp->m_borderColor[2] = ((dxcolor ) & 0xFF) / 255.0f; //B + glsamp->m_borderColor[3] = ((dxcolor >> 24) & 0xFF) / 255.0f; //A + + // filter state + + // mag filter - pretty easy + Assert( dxsamp->m_magFilter <= D3DTEXF_ANISOTROPIC ); + Assert( dxsamp->m_magFilter >= D3DTEXF_POINT ); + + glsamp->m_magFilter = dxtogl_magFilter[ dxsamp->m_magFilter ]; + + // min filter - more involved + Assert( dxsamp->m_minFilter <= D3DTEXF_ANISOTROPIC ); + Assert( dxsamp->m_minFilter >= D3DTEXF_POINT ); + Assert( dxsamp->m_mipFilter <= D3DTEXF_LINEAR ); + Assert( dxsamp->m_mipFilter >= D3DTEXF_NONE ); + + D3DTEXTUREFILTERTYPE mipFilterLimit = D3DTEXF_LINEAR; + + /* + if (GLMKnob("caps-key",NULL) > 0.0) + { + if (dxsamp->m_mipFilter > D3DTEXF_NONE) + { + // evil hack + glsamp->m_magFilter = GL_LINEAR_MIPMAP_NEAREST; + } + } + + if (GLMKnob("option-key",NULL) > 0.0) + { + // limit to point + mipFilterLimit = D3DTEXF_POINT; + } + + if (GLMKnob("control-key",NULL) > 0.0) + { + // limit to none + mipFilterLimit = D3DTEXF_NONE; + } + */ + + D3DTEXTUREFILTERTYPE mipFilterChoice = std::min( dxsamp->m_mipFilter, mipFilterLimit ); + glsamp->m_minFilter = dxtogl_minFilter[ dxsamp->m_minFilter ][ mipFilterChoice ]; + + // should we check for mip filtering being requested on unmipped textures ? does it matter ? + + // mipmap bias + glsamp->m_mipmapBias = dxsamp->m_mipmapBias; + + // d3d "MAX MIP LEVEL" means the *largest size* MIP that will be selected. (max size) + // this is the same as GL's "MIN LOD level" which means the GL_TEXTURE_MIN_LOD level. (min index) + + int texMipCount = m_textures[index]->m_tex->m_layout->m_mipCount; + Assert( texMipCount >=1 ); + + glsamp->m_minMipLevel = dxsamp->m_maxMipLevel; // it says gl_minMipLevel because we're setting GL's "GL_TEXTURE_MIN_LOD" aka d3d's "maximum mip size index". + if (glsamp->m_minMipLevel >= texMipCount) + { + // clamp - you can't have the GL base tex level be higher than the index of the last mip + glsamp->m_minMipLevel = texMipCount - 1; + } + + // d3d has no idea of a "MIN MIP LEVEL" i.e. smallest size allowed. + // this would be expressed in GL by setting the GL_TEXTURE_MIN_LOD meaning largest index to select. + // for now, just set it to the index of the last mip. + glsamp->m_maxMipLevel = texMipCount-1; // d3d has no value for constraining how small we can sample. + // however we may need to set this more intelligently if textures are not being fully submitted. + + // aniso, and check for questionable combinations + Assert( ((dxsamp->m_minFilter == D3DTEXF_ANISOTROPIC) && (dxsamp->m_maxAniso >= 1)) || ((dxsamp->m_minFilter < D3DTEXF_ANISOTROPIC) && (dxsamp->m_maxAniso >= 1)) ); + glsamp->m_maxAniso = dxsamp->m_maxAniso; + + // SRGB + glsamp->m_srgb = dxsamp->m_srgb != 0; + + // write that sampler. + m_ctx->SetSamplerParams( index, glsamp ); + samplerHitMask ^= mask; //turn bit off + + // finally, if the SRGB state of the sampler does not match the SRGB format of the underlying texture... + // ... and the tex is not a renderable... + // ... and it is possible to re-submit the tex in an sRGB format... + + // ******** AND THE TEX IS ACTUALLY REFERENCED BY THE ACTIVE PIXEL SHADER ******* + + // fix it. + // else complain ? + + if (mask & activeSamplerMask) // don't do SRGB check on unreferenced textures. + { + bool texsrgb = (m_textures[index]->m_tex->m_layout->m_key.m_texFlags & kGLMTexSRGB) != 0; + bool mismatch = (texsrgb != glsamp->m_srgb); + bool mismatchFixed = false; + bool srgbCapableTex = false; // not yet known + bool renderableTex = false; // not yet known. + + if (mismatch) + { + srgbCapableTex = m_textures[index]->m_tex->m_layout->m_format->m_glIntFormatSRGB != 0; + renderableTex = (m_textures[index]->m_tex->m_layout->m_key.m_texFlags & kGLMTexRenderable) != 0; + // we can fix it if it's not a renderable, and an sRGB enabled format variation is available. + + if (srgbCapableTex && !renderableTex) + { + const char *texname = m_textures[index]->m_tex->m_debugLabel; + if (!texname) texname = "-"; + + m_textures[index]->m_srgbFlipCount++; + + //policy: print the ones that have flipped 1 or N times + bool print_allflips = false; //CommandLine()->FindParm("-glmspewallsrgbflips"); + bool print_firstflips = false; //CommandLine()->FindParm("-glmspewfirstsrgbflips"); + bool print_freqflips = false; //CommandLine()->FindParm("-glmspewfreqsrgbflips"); + bool print_crawls = false; //CommandLine()->FindParm("-glmspewsrgbcrawls"); + bool print_maxcrawls = false; //CommandLine()->FindParm("-glmspewsrgbmaxcrawls"); + bool print_it = false; + + if (print_allflips) + { + print_it = true; + } + if (print_firstflips) // report on first flip + { + print_it |= m_textures[index]->m_srgbFlipCount==1; + } + if (print_freqflips) // report on 50th flip + { + print_it |= m_textures[index]->m_srgbFlipCount==50; + } + + if ( print_it ) + { + const char *formatStr = "srgb change (samp=%d): tex '%-30s' %08x %s (srgb=%d, %d times)"; + + if (strlen(texname) >= 30) + { + formatStr = "srgb change (samp=%d): tex '%s' %08x %s (srgb=%d, %d times)"; + } + + printf( "\n" ); + printf( formatStr, index, texname, m_textures[index], m_textures[index]->m_tex->m_layout->m_layoutSummary, (int)glsamp->m_srgb, m_textures[index]->m_srgbFlipCount ); + + #if 0 // stack crawling not implemented in steamworks example + if (print_crawls) + { + static char *interesting_crawl_substrs[] = { "CShader::OnDrawElements", NULL }; // add more as needed + + CStackCrawlParams cp; + memset( &cp, 0, sizeof(cp) ); + cp.m_frameLimit = 20; + + g_extCocoaMgr->GetStackCrawl(&cp); + + for( int i=0; i< cp.m_frameCount; i++) + { + // for each row of crawl, decide if name is interesting + bool hit = print_maxcrawls; + + for( char **match = interesting_crawl_substrs; (!hit) && (*match != NULL); match++) + { + if (strstr(cp.m_crawlNames[i], *match)) + { + hit = true; + } + } + + if (hit) + { + printf( "\n\t%s", cp.m_crawlNames[i] ); + } + } + printf( "\n"); + } + #endif + } + + #if GLMDEBUG && 0 + //"toi" = texture of interest + static char s_toi[256] = "colorcorrection"; + if (strstr( texname, s_toi )) + { + // breakpoint on this if you like + GLMPRINTF(( "srgb change %d for %s", m_textures[index]->m_srgbFlipCount, texname )); + } + #endif + + // re-submit the tex unless we're stifling it + if ( 1 /* !CommandLine()->FindParm( "-glmnosrgbflips" ) */ ) + { + m_textures[index]->m_tex->ResetSRGB( glsamp->m_srgb, false ); + } + } + else + { + //GLMPRINTF(("-Z- srgb sampling conflict: NOT fixing tex %08x [%s] (srgb req: %d) because (tex-srgb-capable=%d tex-renderable=%d)", m_textures[index], m_textures[index]->m_tex->m_layout->m_layoutSummary, (int)glsamp->m_srgb, (int)srgbCapableTex, (int)renderableTex )); + // we just leave the sampler state where it is, and that's life + } + } + } + + glsamp->m_compareMode = dxsamp->m_shadowFilter ? GL_COMPARE_R_TO_TEXTURE_ARB : GL_NONE; + } + } + + return S_OK; +} + +HRESULT IDirect3DDevice9::FlushIndexBindings( void ) +{ + // push index buffer state + m_ctx->SetIndexBuffer( m_indices.m_idxBuffer->m_idxBuffer ); + + return S_OK; +} + +#if 0 +HRESULT IDirect3DDevice9::FlushVertexBindings( void ) +{ + // push vertex buffer state for the current vertex decl + + GLMVertexSetup setup; + IDirect3DVertexDeclaration9 *vxdecl = m_vertDecl; + + memset( &setup, 0, sizeof( setup ) ); + + // see if the elems in the vertex decl match the attrib map of the shader we're about to draw with. + // can we do this in a simple style that handles both matched and unmatched orderings? + // just pick up each elem from the decl. + // visit the same slot in the shader attrib map. + // if the usage/usageindex matches, you're good. + // if not, hunt through the shader attrib map and find it. + // if you can't find it, then the shader is not consuming that attribute - odd but not fatal ? + // the serious one is shader trying to consume an attrib that isn't being sourced. + // we can check for that though with a little more work (copy the shader attrib map and mark the attribs as each one gets satisfied) + + unsigned char vshAttribMap[ 16 ]; + uint activeAttribCount = 0; + for( int i=0; i<16; i++) + { + vshAttribMap[i] = m_vertexShader->m_vtxAttribMap[i]; + if (vshAttribMap[i] != 0xBB) + { + activeAttribCount++; // this counting could be done at shader creation time, or changed to a mask + } + } + + for( int elemIndex=0; elemIndexm_elemCount; elemIndex++) + { + D3DVERTEXELEMENT9_GL *srcelem = &vxdecl->m_elements[elemIndex]; + + int matchIndex = elemIndex; // initial guess - will iterate if this does not match + int tries = 0; // >16 means done + bool matched = false; + + do + { + if ( ((vshAttribMap[matchIndex] >>4) == srcelem->m_dxdecl.Usage) && ((vshAttribMap[matchIndex] & 0x0F) == srcelem->m_dxdecl.UsageIndex) ) + { + // hit + int attribIndex = matchIndex; + int streamIndex = srcelem->m_dxdecl.Stream; + + GLMVertexAttributeDesc *dstAttr = &setup.m_attrs[ matchIndex ]; + + // copy whole thing + *dstAttr = srcelem->m_gldecl; + + // then fix buffer, stride, offset + dstAttr->m_buffer = m_streams[ streamIndex ].m_vtxBuffer->m_vtxBuffer; + dstAttr->m_stride = m_streams[ streamIndex ].m_stride; + dstAttr->m_offset += m_streams[ streamIndex ].m_offset; + + // set mask + setup.m_attrMask |= (1<FindParm("-hushasserts") */) + { + AssertOnce( !"Vertex shader not consuming attribs that are sourced by decl"); + } + } + } + + if (activeAttribCount >0) + { + // this one is more serious + if (1 /*!CommandLine()->FindParm("-hushasserts") */) + { + Assert( !"Vertex shader consuming attribs not sourced by decl"); + } + } + + // pass the whole shebang to GLM + m_ctx->SetVertexAttributes( &setup ); +} +#endif + + +HRESULT IDirect3DDevice9::FlushVertexBindings( uint baseVertexIndex ) +{ + // push vertex buffer state for the current vertex decl + // in this variant we just walk the attrib map in the VS and do a pull for each one. + // if we can't find a match in the vertex decl, we may fall back to the secret 'dummy' VBO that GLM maintains + + GLMVertexSetup setup; + memset( &setup, 0, sizeof( setup ) ); + + IDirect3DVertexDeclaration9 *vxdecl = m_vertDecl; + unsigned char *vshAttribMap = m_vertexShader->m_vtxAttribMap; + + // this loop could be tightened if we knew the number of live entries in the shader attrib map. + // which of course would be easy to do in the create shader function or even in the translator. + + GLMVertexAttributeDesc *dstAttr = setup.m_attrs; + for( int i=0; i<16; i++,dstAttr++ ) + { + unsigned char vshattrib = vshAttribMap[ i ]; + if (vshattrib != 0xBB) + { + // try to find the match in the decl. + // idea: put some inverse table in the decl which could accelerate this search. + + D3DVERTEXELEMENT9_GL *elem = m_vertDecl->m_elements; + for( int j=0; j< m_vertDecl->m_elemCount; j++,elem++) + { + // if it matches, install it, change vshattrib so the code below does not trigger, then end the loop + if ( ((vshattrib>>4) == elem->m_dxdecl.Usage) && ((vshattrib & 0x0F) == elem->m_dxdecl.UsageIndex) ) + { + // targeting attribute #i in the setup with element data #j from the decl + + *dstAttr = elem->m_gldecl; + + // then fix buffer, stride, offset - note that we honor the base vertex index here by fiddling the offset + int streamIndex = elem->m_dxdecl.Stream; + dstAttr->m_buffer = m_streams[ streamIndex ].m_vtxBuffer->m_vtxBuffer; + dstAttr->m_stride = m_streams[ streamIndex ].m_stride; + dstAttr->m_offset += m_streams[ streamIndex ].m_offset + (baseVertexIndex * dstAttr->m_stride); + + // set mask + setup.m_attrMask |= (1<m_buffer = NULL; + dstAttr->m_stride = 0; + dstAttr->m_offset = 0; + + // only implement certain usages... if we haven't seen it before, stop. + switch( vshattrib >>4 ) // aka usage + { + case D3DDECLUSAGE_POSITION: + case D3DDECLUSAGE_BLENDWEIGHT: + case D3DDECLUSAGE_BLENDINDICES: + Debugger(); + break; + + case D3DDECLUSAGE_NORMAL: + dstAttr->m_datasize = 3; + dstAttr->m_datatype = GL_FLOAT; + dstAttr->m_normalized = false; + break; + + case D3DDECLUSAGE_PSIZE: + Debugger(); + break; + + case D3DDECLUSAGE_TEXCOORD: + dstAttr->m_datasize = 3; + dstAttr->m_datatype = GL_FLOAT; + dstAttr->m_normalized = false; + break; + + case D3DDECLUSAGE_TANGENT: + case D3DDECLUSAGE_BINORMAL: + case D3DDECLUSAGE_TESSFACTOR: + case D3DDECLUSAGE_PLUGH: + Debugger(); + break; + + case D3DDECLUSAGE_COLOR: + dstAttr->m_datasize = 4; + dstAttr->m_datatype = GL_UNSIGNED_BYTE; + dstAttr->m_normalized = true; + break; + + case D3DDECLUSAGE_FOG: + case D3DDECLUSAGE_DEPTH: + case D3DDECLUSAGE_SAMPLE: + Debugger(); + break; + } + } + } + } + + // copy active program's vertex attrib map into the vert setup info + memcpy( &setup.m_vtxAttribMap, m_vertexShader->m_vtxAttribMap, sizeof( m_vertexShader->m_vtxAttribMap ) ); + + m_ctx->SetVertexAttributes( &setup ); + + return S_OK; +} + + + +HRESULT IDirect3DDevice9::FlushGLM( void ) +{ + Debugger();// old routine not used now + return D3DERR_INVALIDCALL; +} + +HRESULT IDirect3DDevice9::DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) +{ + this->FlushStates( 0xFFFFFFFF ); + this->FlushSamplers( 0xFFFFFFFF ); + //this->FlushIndexBindings( ); //indices not really used.. + this->FlushVertexBindings( 0 /*StartVertex*/ ); //no stream base offsetting for drawarrays mode + m_ctx->FlushDrawStates( true ); + + switch(PrimitiveType) + { + case D3DPT_POINTLIST: + m_ctx->DrawArrays( (GLenum)GL_POINTS, StartVertex, (GLsizei)PrimitiveCount ); + break; + + case D3DPT_LINELIST: + m_ctx->DrawArrays( (GLenum)GL_LINES, StartVertex, (GLsizei)PrimitiveCount*2 ); + break; + + case D3DPT_TRIANGLELIST: + m_ctx->DrawArrays( (GLenum)GL_TRIANGLES, StartVertex, (GLsizei)PrimitiveCount*3 ); + break; + + case D3DPT_TRIANGLESTRIP: + m_ctx->DrawArrays( (GLenum)GL_TRIANGLE_STRIP, StartVertex, (GLsizei)PrimitiveCount+2 ); + break; + + default: + break; + } + + return S_OK; +} + +// Type +// [in] Member of the D3DPRIMITIVETYPE enumerated type, describing the type of primitive to render. D3DPT_POINTLIST is not supported with this method. See Remarks. + +// BaseVertexIndex +// [in] Offset from the start of the vertex buffer to the first vertex. See Scenario 4. + +// MinIndex +// [in] Minimum vertex index for vertices used during this call. This is a zero based index relative to BaseVertexIndex. + +// NumVertices +// [in] Number of vertices used during this call. The first vertex is located at index: BaseVertexIndex + MinIndex. + +// StartIndex +// [in] Index of the first index to use when accesssing the vertex buffer. Beginning at StartIndex to index vertices from the vertex buffer. + +// PrimitiveCount +// [in] Number of primitives to render. The number of vertices used is a function of the primitive count and the primitive type. The maximum number of primitives allowed is determined by checking the MaxPrimitiveCount member of the D3DCAPS9 structure. + + +HRESULT IDirect3DDevice9::DrawIndexedPrimitive( D3DPRIMITIVETYPE Type,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount ) +{ + this->FlushStates( 0xFFFFFFFF ); + + this->FlushSamplers( 0xFFFFFFFF ); + + this->FlushIndexBindings( ); + this->FlushVertexBindings( BaseVertexIndex ); + m_ctx->FlushDrawStates( true ); + + if (gl.m_FogEnable) + { + GLMPRINTF(("-D- IDirect3DDevice9::DrawIndexedPrimitive is seeing enabled fog...")); + } + + switch(Type) + { + case D3DPT_POINTLIST: + Debugger(); + break; + + case D3DPT_LINELIST: + GLMPRINTF(("-X- IDirect3DDevice9::DrawIndexedPrimitive( D3DPT_LINELIST ) - ignored.")); +// Debugger(); + m_ctx->DrawRangeElements( (GLenum)GL_LINES, (GLuint)MinVertexIndex, (GLuint)(MinVertexIndex + NumVertices), (GLsizei)primCount*2, (GLenum)GL_UNSIGNED_SHORT, (const GLvoid *)(startIndex * sizeof(short)) ); + break; + + case D3DPT_TRIANGLELIST: + m_ctx->DrawRangeElements(GL_TRIANGLES, (GLuint)MinVertexIndex, (GLuint)(MinVertexIndex + NumVertices), (GLsizei)primCount*3, (GLenum)GL_UNSIGNED_SHORT, (const GLvoid *)(startIndex * sizeof(short)) ); + break; + + case D3DPT_TRIANGLESTRIP: + // enabled... Debugger(); + m_ctx->DrawRangeElements(GL_TRIANGLE_STRIP, (GLuint)MinVertexIndex, (GLuint)(MinVertexIndex + NumVertices), (GLsizei)(2+primCount), (GLenum)GL_UNSIGNED_SHORT, (const GLvoid *)(startIndex * sizeof(short)) ); + break; + + default: + break; + } + + return S_OK; +} + +HRESULT IDirect3DDevice9::DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) +{ + this->FlushStates( 0xFFFFFFFF ); + + Debugger(); + return S_OK; +} + + + + +BOOL IDirect3DDevice9::ShowCursor(BOOL bShow) +{ + // FIXME NOP + //Debugger(); + return TRUE; +} + +void d3drect_to_glmbox( D3DRECT *src, GLScissorBox_t *dst ) +{ + // to convert from a d3d rect to a GL rect you have to fix up the vertical axis, since D3D Y=0 is the top, but GL Y=0 is the bottom. + // you can't fix it without knowing the height. + + dst->width = src->x2 - src->x1; + dst->x = src->x1; // left edge + + dst->height = src->y2 - src->y1; + dst->y = src->y1; // bottom edge - take large Y from d3d and subtract from surf height. +} + +HRESULT IDirect3DDevice9::Clear(DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil) +{ + + this->FlushStates( (1<FlushDrawStates( false ); + + + // for debug Color = (rand() | 0xFF0000FF) & 0xFF3F3FFF; + if (!Count) + { + // run clear with no added rectangle + m_ctx->Clear( (Flags&D3DCLEAR_TARGET)!=0, Color, + (Flags&D3DCLEAR_ZBUFFER)!=0, Z, + (Flags&D3DCLEAR_STENCIL)!=0, Stencil, + NULL + ); + } + else + { + GLScissorBox_t tempbox; + + // do the rects one by one and convert each one to GL form + for( int i=0; iClear( (Flags&D3DCLEAR_TARGET)!=0, Color, + (Flags&D3DCLEAR_ZBUFFER)!=0, Z, + (Flags&D3DCLEAR_STENCIL)!=0, Stencil, + &tempbox + ); + } + } + + return S_OK; +} + +HRESULT IDirect3DDevice9::SetTransform(D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) +{ + Debugger(); + return S_OK; +} + +HRESULT IDirect3DDevice9::SetTextureStageState(DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) +{ + Debugger(); + return S_OK; +} + +HRESULT IDirect3DDevice9::ValidateDevice(DWORD* pNumPasses) +{ + Debugger(); + return S_OK; +} + +HRESULT IDirect3DDevice9::SetMaterial(CONST D3DMATERIAL9* pMaterial) +{ + GLMPRINTF(("-X- IDirect3DDevice9::SetMaterial - ignored.")); +// Debugger(); + return S_OK; +} + + +HRESULT IDirect3DDevice9::LightEnable(DWORD Index,BOOL Enable) +{ + Debugger(); + return S_OK; +} + +HRESULT IDirect3DDevice9::SetScissorRect(CONST RECT* pRect) +{ + int nSurfaceHeight = m_drawableFBO->m_attach[ kAttColor0 ].m_tex->m_layout->m_key.m_ySize; + + GLScissorBox_t newScissorBox = { (GLint)pRect->left, (GLint)pRect->top, (GLint)(pRect->right - pRect->left), (GLint)(pRect->bottom - pRect->top) }; + gl.m_ScissorBox = newScissorBox; + gl.m_stateDirtyMask |= (1<SetVertexShaderConstantF( DXABSTRACT_VS_CLIP_PLANE_BASE+Index, pPlane, 1 ); // stash the clip plane values into shader param - translator knows where to look + } + + // if GLSL mode... latch it and let FlushStates push it out + { + GLClipPlaneEquation_t peq; + peq.x = pPlane[0]; + peq.y = pPlane[1]; + peq.z = pPlane[2]; + peq.w = pPlane[3]; + + gl.m_ClipPlaneEquation[ Index ] = peq; + gl.m_stateDirtyMask |= (1<WriteClipPlaneEquation( &peq, Index ); + } + + return S_OK; +} + +HRESULT IDirect3DDevice9::EvictManagedResources() +{ + GLMPRINTF(("-X- IDirect3DDevice9::EvictManagedResources --> IGNORED")); + return S_OK; +} + +HRESULT IDirect3DDevice9::SetLight(DWORD Index,CONST D3DLIGHT9*) +{ + Debugger(); + return S_OK; +} + +void IDirect3DDevice9::SetGammaRamp(UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp) +{ + // just slam it directly for the time being + // this code is OS X specific + + CGDisplayErr cgErr; + (void)cgErr; + + CGGammaValue redt[256]; + CGGammaValue grnt[256]; + CGGammaValue blut[256]; + for( int i=0; i<256; i++) + { + redt[i] = ((float)pRamp->red[i]) / 65535.0f; + grnt[i] = ((float)pRamp->green[i]) / 65535.0f; + blut[i] = ((float)pRamp->blue[i]) / 65535.0f; + } + cgErr = CGSetDisplayTransferByTable( 0, 256, redt, grnt, blut ); + +} + +// ------------------------------------------------------------------------------------------------------------------------------ // + +void* ID3DXBuffer::GetBufferPointer() +{ + Debugger(); + return NULL; +} + +DWORD ID3DXBuffer::GetBufferSize() +{ + Debugger(); + return 0; +} + + + +#if 0 //d3dx not provided in steamworks example + +#pragma mark ----- More D3DX stuff + +// ------------------------------------------------------------------------------------------------------------------------------ // +// D3DX stuff. +// ------------------------------------------------------------------------------------------------------------------------------ // + +// matrix stack... + +HRESULT D3DXCreateMatrixStack( DWORD Flags, LPD3DXMATRIXSTACK* ppStack) +{ + + *ppStack = new ID3DXMatrixStack; + + (*ppStack)->Create(); + + return S_OK; +} + +HRESULT ID3DXMatrixStack::Create() +{ + m_stack.EnsureCapacity( 16 ); // 1KB ish + m_stack.AddToTail(); + m_stackTop = 0; // top of stack is at index 0 currently + + LoadIdentity(); + + return S_OK; +} + +D3DXMATRIX* ID3DXMatrixStack::GetTop() +{ + return (D3DXMATRIX*)&m_stack[ m_stackTop ]; +} + +void ID3DXMatrixStack::Push() +{ + D3DMATRIX temp = m_stack[ m_stackTop ]; + m_stack.AddToTail( temp ); + m_stackTop ++; +} + +void ID3DXMatrixStack::Pop() +{ + int elem = m_stackTop--; + m_stack.Remove( elem ); +} + +void ID3DXMatrixStack::LoadIdentity() +{ + D3DXMATRIX *mat = GetTop(); + + D3DXMatrixIdentity( mat ); +} + +void ID3DXMatrixStack::LoadMatrix( const D3DXMATRIX *pMat ) +{ + *(GetTop()) = *pMat; +} + + +void ID3DXMatrixStack::MultMatrix( const D3DXMATRIX *pMat ) +{ + + // http://msdn.microsoft.com/en-us/library/bb174057(VS.85).aspx + // This method right-multiplies the given matrix to the current matrix + // (transformation is about the current world origin). + // m_pstack[m_currentPos] = m_pstack[m_currentPos] * (*pMat); + // This method does not add an item to the stack, it replaces the current + // matrix with the product of the current matrix and the given matrix. + + + Debugger(); +} + +void ID3DXMatrixStack::MultMatrixLocal( const D3DXMATRIX *pMat ) +{ + // http://msdn.microsoft.com/en-us/library/bb174058(VS.85).aspx + // This method left-multiplies the given matrix to the current matrix + // (transformation is about the local origin of the object). + // m_pstack[m_currentPos] = (*pMat) * m_pstack[m_currentPos]; + // This method does not add an item to the stack, it replaces the current + // matrix with the product of the given matrix and the current matrix. + + + Debugger(); +} + +HRESULT ID3DXMatrixStack::ScaleLocal(FLOAT x, FLOAT y, FLOAT z) +{ + // http://msdn.microsoft.com/en-us/library/bb174066(VS.85).aspx + // Scale the current matrix about the object origin. + // This method left-multiplies the current matrix with the computed + // scale matrix. The transformation is about the local origin of the object. + // + // D3DXMATRIX tmp; + // D3DXMatrixScaling(&tmp, x, y, z); + // m_stack[m_currentPos] = tmp * m_stack[m_currentPos]; + + Debugger(); +} + + +HRESULT ID3DXMatrixStack::RotateAxisLocal(CONST D3DXVECTOR3* pV, FLOAT Angle) +{ + // http://msdn.microsoft.com/en-us/library/bb174062(VS.85).aspx + // Left multiply the current matrix with the computed rotation + // matrix, counterclockwise about the given axis with the given angle. + // (rotation is about the local origin of the object) + + // D3DXMATRIX tmp; + // D3DXMatrixRotationAxis( &tmp, pV, angle ); + // m_stack[m_currentPos] = tmp * m_stack[m_currentPos]; + // Because the rotation is left-multiplied to the matrix stack, the rotation + // is relative to the object's local coordinate space. + + Debugger(); +} + +HRESULT ID3DXMatrixStack::TranslateLocal(FLOAT x, FLOAT y, FLOAT z) +{ + // http://msdn.microsoft.com/en-us/library/bb174068(VS.85).aspx + // Left multiply the current matrix with the computed translation + // matrix. (transformation is about the local origin of the object) + + // D3DXMATRIX tmp; + // D3DXMatrixTranslation( &tmp, x, y, z ); + // m_stack[m_currentPos] = tmp * m_stack[m_currentPos]; + + Debugger(); +} + + + + +const char* D3DXGetPixelShaderProfile( IDirect3DDevice9 *pDevice ) +{ + Debugger(); + return ""; +} + + +D3DXMATRIX* D3DXMatrixMultiply( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 ) +{ + D3DXMATRIX temp; + + for( int i=0; i<4; i++) + { + for( int j=0; j<4; j++) + { + temp.m[i][j] = (pM1->m[ i ][ 0 ] * pM2->m[ 0 ][ j ]) + + (pM1->m[ i ][ 1 ] * pM2->m[ 1 ][ j ]) + + (pM1->m[ i ][ 2 ] * pM2->m[ 2 ][ j ]) + + (pM1->m[ i ][ 3 ] * pM2->m[ 3 ][ j ]); + } + } + *pOut = temp; + return pOut; +} + +D3DXVECTOR3* D3DXVec3TransformCoord( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ) // http://msdn.microsoft.com/en-us/library/ee417622(VS.85).aspx +{ + // this one is tricky because + // "Transforms a 3D vector by a given matrix, projecting the result back into w = 1". + // but the vector has no W attached to it coming in, so we have to go through the motions of figuring out what w' would be + // assuming the input vector had a W of 1. + + // dot product of [a b c 1] against w column + float wp = (pM->m[3][0] * pV->x) + (pM->m[3][1] * pV->y) + (pM->m[3][2] * pV->z) + (pM->m[3][3]); + + if (wp == 0.0f ) + { + // do something to avoid dividing by zero.. + Debugger(); + } + else + { + // unclear on whether I should include the fake W in the sum (last term) before dividing by wp... hmmmm + // leave it out for now and see how well it works + pOut->x = ((pM->m[0][0] * pV->x) + (pM->m[0][1] * pV->y) + (pM->m[0][2] * pV->z) /* + (pM->m[0][3]) */ ) / wp; + pOut->y = ((pM->m[1][0] * pV->x) + (pM->m[1][1] * pV->y) + (pM->m[1][2] * pV->z) /* + (pM->m[1][3]) */ ) / wp; + pOut->z = ((pM->m[2][0] * pV->x) + (pM->m[2][1] * pV->y) + (pM->m[2][2] * pV->z) /* + (pM->m[2][3]) */ ) / wp; + } + + return pOut; +} + + +void D3DXMatrixIdentity( D3DXMATRIX *mat ) +{ + for( int i=0; i<4; i++) + { + for( int j=0; j<4; j++) + { + mat->m[i][j] = (i==j) ? 1.0f : 0.0f; // 1's on the diagonal. + } + } +} + +D3DXMATRIX* D3DXMatrixTranslation( D3DXMATRIX *pOut, FLOAT x, FLOAT y, FLOAT z ) +{ + D3DXMatrixIdentity( pOut ); + pOut->m[3][0] = x; + pOut->m[3][1] = y; + pOut->m[3][2] = z; + return pOut; +} + +D3DXMATRIX* D3DXMatrixInverse( D3DXMATRIX *pOut, FLOAT *pDeterminant, CONST D3DXMATRIX *pM ) +{ + Assert( sizeof( D3DXMATRIX ) == (16 * sizeof(float) ) ); + Assert( sizeof( VMatrix ) == (16 * sizeof(float) ) ); + Assert( pDeterminant == NULL ); // homey don't play that + + VMatrix *origM = (VMatrix*)pM; + VMatrix *destM = (VMatrix*)pOut; + + bool success = MatrixInverseGeneral( *origM, *destM ); + Assert( success ); + + return pOut; +} + + +D3DXMATRIX* D3DXMatrixTranspose( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM ) +{ + if (pOut != pM) + { + for( int i=0; i<4; i++) + { + for( int j=0; j<4; j++) + { + pOut->m[i][j] = pM->m[j][i]; + } + } + } + else + { + D3DXMATRIX temp = *pM; + D3DXMatrixTranspose( pOut, &temp ); + } + + return NULL; +} + + +D3DXPLANE* D3DXPlaneNormalize( D3DXPLANE *pOut, CONST D3DXPLANE *pP) +{ + // not very different from normalizing a vector. + // figure out the square root of the sum-of-squares of the x,y,z components + // make sure that's non zero + // then divide all four components by that value + // or return some dummy plane like 0,0,1,0 if it fails + + float len = sqrt( (pP->a * pP->a) + (pP->b * pP->b) + (pP->c * pP->c) ); + if (len > 1e-10) //FIXME need a real epsilon here ? + { + pOut->a = pP->a / len; pOut->b = pP->b / len; pOut->c = pP->c / len; pOut->d = pP->d / len; + } + else + { + pOut->a = 0.0f; pOut->b = 0.0f; pOut->c = 1.0f; pOut->d = 0.0f; + } + return pOut; +} + + +D3DXVECTOR4* D3DXVec4Transform( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, CONST D3DXMATRIX *pM ) +{ + VMatrix *mat = (VMatrix*)pM; + Vector4D *vIn = (Vector4D*)pV; + Vector4D *vOut = (Vector4D*)pOut; + + Vector4DMultiplyTranspose( *mat, *vIn, *vOut ); + + return pOut; +} + + + +D3DXVECTOR4* D3DXVec4Normalize( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV ) +{ + Vector4D *vIn = (Vector4D*) pV; + Vector4D *vOut = (Vector4D*) pOut; + + *vOut = *vIn; + Vector4DNormalize( *vOut ); + + return pOut; +} + + +D3DXMATRIX* D3DXMatrixOrthoOffCenterRH( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,FLOAT zf ) +{ + Debugger(); + return NULL; +} + + +D3DXMATRIX* D3DXMatrixPerspectiveRH( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ) +{ + Debugger(); + return NULL; +} + + +D3DXMATRIX* D3DXMatrixPerspectiveOffCenterRH( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf ) +{ + Debugger(); + return NULL; +} + + +D3DXPLANE* D3DXPlaneTransform( D3DXPLANE *pOut, CONST D3DXPLANE *pP, CONST D3DXMATRIX *pM ) +{ + float *out = &pOut->a; + + // dot dot dot + for( int x=0; x<4; x++ ) + { + out[x] = (pM->m[0][x] * pP->a) + + (pM->m[1][x] * pP->b) + + (pM->m[2][x] * pP->c) + + (pM->m[3][x] * pP->d); + } + + return pOut; +} + +void D3DPERF_SetOptions( DWORD dwOptions ) +{ +} + + +HRESULT D3DXCompileShader( + LPCSTR pSrcData, + UINT SrcDataLen, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pFunctionName, + LPCSTR pProfile, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs, + LPD3DXCONSTANTTABLE* ppConstantTable) +{ + Debugger(); // is anyone calling this ? + return S_OK; +} + +#endif + +// ------------------------------------------------------------------------------------------------------------------------------ // + +IDirect3D9 *Direct3DCreate9(UINT SDKVersion) +{ + GLMPRINTF(( "-X- Direct3DCreate9: %d", SDKVersion )); + + return new IDirect3D9; +} + +// ------------------------------------------------------------------------------------------------------------------------------ // + + +#endif + diff --git a/external/steamworks/glmgr/dxabstract.h b/external/steamworks/glmgr/dxabstract.h new file mode 100644 index 0000000..70119c8 --- /dev/null +++ b/external/steamworks/glmgr/dxabstract.h @@ -0,0 +1,2420 @@ +//================ Copyright (c) 1996-2009 Valve Corporation. All Rights Reserved. ================= +// +// +// +//================================================================================================== + +#ifndef DXABSTRACT_H +#define DXABSTRACT_H +#ifdef _WIN32 +#pragma once +#endif + +//================================================================================================== + +// Source engine only #include "materialsystem/IShader.h" +// constants below copied from that header + +// size of the VS register bank in ARB / GLSL we expose +// it's not 256, because you can't use all 256 slots in 10.5.x. +// use this constant everywhere you might normally use "256" in reference to a parameter array size. +// The highest vertex shader constant is c216, plus we allocate c217 and c218 for two clip planes +#define DXABSTRACT_VS_PARAM_SLOTS 219 + +// user clip plane 0 goes in DXABSTRACT_VS_CLIP_PLANE_BASE... plane 1 goes in the slot after that +// dxabstract uses these constants to check plane index limit and to deliver planes to shader for DP4 -> oCLP[n] +#define DXABSTRACT_VS_CLIP_PLANE_BASE (DXABSTRACT_VS_PARAM_SLOTS-2) + +//================================================================================================== + + +// Uncomment this on Windows if you want to compile the Windows GL version. +// #undef USE_ACTUAL_DX + +#ifdef USE_ACTUAL_DX + +#ifndef WIN32 +#error sorry man +#endif +#ifdef _X360 +#include "d3d9.h" +#include "d3dx9.h" +#else +#include +#include "../../dx9sdk/include/d3d9.h" +#include "../../dx9sdk/include/d3dx9.h" +#endif +typedef HWND VD3DHWND; + +#else + +#ifdef WIN32 +#error Gl on win32? +#endif + +#define DX_TO_GL_ABSTRACTION + +#include "imageformat.h" +#include "glmgr.h" + +extern "C" void Debugger(void); + +// ------------------------------------------------------------------------------------------------------------------------------ // +// DEFINES +// ------------------------------------------------------------------------------------------------------------------------------ // + +typedef void* VD3DHWND; +typedef void* VD3DHANDLE; + +// +// +// Stuff that would be in windows.h +// +// +#ifdef _WINNT_ +#error "No interoperability with windows.h!" +#else + +#ifndef __stdcall +#define __stdcall +#endif + + typedef int INT; + typedef unsigned long ULONG; + typedef long LONG; + typedef float FLOAT; + typedef unsigned int DWORD; + typedef unsigned short WORD; + typedef long long LONGLONG; + typedef unsigned int UINT; + typedef long HRESULT; + typedef unsigned char BYTE; + #define CONST const + typedef unsigned long ULONG_PTR; + typedef ULONG_PTR SIZE_T; + typedef signed char BOOL; + + typedef const char* LPCSTR; + typedef char* LPSTR; + typedef DWORD* LPDWORD; + + #define ZeroMemory RtlZeroMemory + #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length)) + + typedef union _LARGE_INTEGER { + struct { + DWORD LowPart; + LONG HighPart; + }; + struct { + DWORD LowPart; + LONG HighPart; + } u; + LONGLONG QuadPart; + } LARGE_INTEGER; + + /* + typedef struct _GUID { + + bool operator==( const struct _GUID &other ) const; + + unsigned long Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[ 8 ]; + } GUID; + */ + +#ifndef VALVE_RECT_DEFINED +#define VALVE_RECT_DEFINED + + typedef struct tagRECT + { + LONG left; + LONG top; + LONG right; + LONG bottom; + } RECT; + + #define _RECT tagRECT +#endif + // turn this on to get refcount logging from IUnknown + + #define IUNKNOWN_ALLOC_SPEW 0 + #define IUNKNOWN_ALLOC_SPEW_MARK_ALL 0 + + struct IUnknown + { + public: + int m_refcount[2]; + bool m_mark; + + IUnknown( void ) + { + m_refcount[0] = 1; + m_refcount[1] = 0; + m_mark = (IUNKNOWN_ALLOC_SPEW_MARK_ALL != 0); // either all are marked, or only the ones that have SetMark(true) called on them + + #if IUNKNOWN_ALLOC_SPEW + if (m_mark) + { + GLMPRINTF(("-A- IUnew (%08x) refc -> (%d,%d) ",this,m_refcount[0],m_refcount[1])); + } + #endif + }; + + virtual ~IUnknown( void ) + { + #if IUNKNOWN_ALLOC_SPEW + if (m_mark) + { + GLMPRINTF(("-A- IUdel (%08x) ",this )); + } + #endif + }; + + void AddRef( int which=0, const char *comment = NULL ) + { + Assert( which >= 0 ); + Assert( which < 2 ); + m_refcount[which]++; + + #if IUNKNOWN_ALLOC_SPEW + if (m_mark) + { + GLMPRINTF(("-A- IUAddRef (%08x,%d) refc -> (%d,%d) [%s]",this,which,m_refcount[0],m_refcount[1],comment?comment:"...")) ; + if (!comment) + { + GLMPRINTF(("")) ; // place to hang a breakpoint + } + } + #endif + }; + + ULONG __stdcall Release( int which=0, const char *comment = NULL ) + { + Assert( which >= 0 ); + Assert( which < 2 ); + + //int oldrefcs[2] = { m_refcount[0], m_refcount[1] }; + bool deleting = false; + + m_refcount[which]--; + if ( (!m_refcount[0]) && (!m_refcount[1]) ) + { + deleting = true; + } + + #if IUNKNOWN_ALLOC_SPEW + if (m_mark) + { + GLMPRINTF(("-A- IURelease (%08x,%d) refc -> (%d,%d) [%s] %s",this,which,m_refcount[0],m_refcount[1],comment?comment:"...",deleting?"->DELETING":"")); + if (!comment) + { + GLMPRINTF(("")) ; // place to hang a breakpoint + } + } + #endif + + if (deleting) + { + if (m_mark) + { + GLMPRINTF(("")) ; // place to hang a breakpoint + } + delete this; + return 0; + } + else + { + return m_refcount[0]; + } + }; + void SetMark( bool markValue, char *comment=NULL ) + { + #if IUNKNOWN_ALLOC_SPEW + if (!m_mark && markValue) // leading edge detect + { + // print the same thing that the constructor would have printed if it had been marked from the beginning + // i.e. it's anticipated that callers asking for marking will do so right at create time + GLMPRINTF(("-A- IUSetMark (%08x) refc -> (%d,%d) (%s) ",this,m_refcount[0],m_refcount[1],comment?comment:"...")); + } + #endif + + m_mark = markValue; + } + }; + + typedef struct tagPOINT + { + LONG x; + LONG y; + } POINT, *PPOINT, *LPPOINT; + + typedef struct _MEMORYSTATUS { + DWORD dwLength; + SIZE_T dwTotalPhys; + } MEMORYSTATUS, *LPMEMORYSTATUS; + + + typedef DWORD COLORREF; + #define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16))) + + #define MAKE_HRESULT(sev,fac,code) \ + ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) ) + + #define S_FALSE ((HRESULT)0x00000001L) + #define S_OK 0 + #define E_OUTOFMEMORY ((HRESULT)(0x8007000EL)) + + #define FAILED(hr) ((HRESULT)(hr) < 0) + #define SUCCEEDED(hr) ((HRESULT)(hr) >= 0) + + #define MAKEFOURCC(ch0, ch1, ch2, ch3) \ + ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ + ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) + + struct RGNDATA + { + public: + }; + + void Sleep( unsigned int ms ); + bool IsIconic( VD3DHWND hWnd ); + void GetClientRect( VD3DHWND hWnd, RECT *destRect ); + BOOL ClientToScreen( VD3DHWND hWnd, LPPOINT pPoint ); + + typedef const void* LPCVOID; + + void* GetCurrentThread(); + void SetThreadAffinityMask( void *hThread, int nMask ); + void GlobalMemoryStatus( MEMORYSTATUS *pOut ); + +#endif + +#define D3DSI_OPCODE_MASK 0x0000FFFF +#define D3DSP_TEXTURETYPE_MASK 0x78000000 + +#define D3DUSAGE_AUTOGENMIPMAP (0x00000400L) +#define D3DSP_DCL_USAGE_MASK 0x0000000f + +#define D3DSP_OPCODESPECIFICCONTROL_MASK 0x00ff0000 +#define D3DSP_OPCODESPECIFICCONTROL_SHIFT 16 + + +/* Flags to construct D3DRS_COLORWRITEENABLE */ +#define D3DCOLORWRITEENABLE_RED (1L<<0) +#define D3DCOLORWRITEENABLE_GREEN (1L<<1) +#define D3DCOLORWRITEENABLE_BLUE (1L<<2) +#define D3DCOLORWRITEENABLE_ALPHA (1L<<3) + +#define D3DSGR_NO_CALIBRATION 0x00000000L + + +#define D3DXINLINE inline + +#define D3D_SDK_VERSION 32 + +#define _FACD3D 0x876 +#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) + + +#define D3DERR_NOTFOUND MAKE_D3DHRESULT(2150) +#define D3DERR_DEVICELOST MAKE_D3DHRESULT(2152) +#define D3DERR_NOTAVAILABLE MAKE_D3DHRESULT(2154) +#define D3DERR_DEVICENOTRESET MAKE_D3DHRESULT(2153) +#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156) +#define D3DERR_DRIVERINTERNALERROR MAKE_D3DHRESULT(2087) +#define D3DERR_OUTOFVIDEOMEMORY MAKE_D3DHRESULT(380) +#define D3D_OK S_OK + +#define D3DPRESENT_RATE_DEFAULT 0x00000000 + +// +// DevCaps +// + // we need to see who in Source land is interested in these values, as dxabstract is currently reporting zero for the whole Caps word +#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */ +#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */ +#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */ +#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */ +#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */ +#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */ +#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */ +#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */ +#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */ +#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */ +#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */ +#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */ +#define D3DDEVCAPS_PUREDEVICE 0x00100000L /* Device supports D3DCREATE_PUREDEVICE */ +#define D3DDEVCAPS_QUINTICRTPATCHES 0x00200000L /* Device supports quintic Beziers and BSplines */ +#define D3DDEVCAPS_RTPATCHHANDLEZERO 0x00800000L /* Indicates that RT Patches may be drawn efficiently using handle 0 */ +#define D3DDEVCAPS_NPATCHES 0x01000000L /* Device supports N-Patches */ + +// +// PrimitiveMiscCaps +// +#define D3DPMISCCAPS_MASKZ 0x00000002L +#define D3DPMISCCAPS_CULLNONE 0x00000010L +#define D3DPMISCCAPS_CULLCW 0x00000020L +#define D3DPMISCCAPS_CULLCCW 0x00000040L +#define D3DPMISCCAPS_COLORWRITEENABLE 0x00000080L +#define D3DPMISCCAPS_CLIPPLANESCALEDPOINTS 0x00000100L /* Device correctly clips scaled points to clip planes */ +#define D3DPMISCCAPS_CLIPTLVERTS 0x00000200L /* device will clip post-transformed vertex primitives */ +#define D3DPMISCCAPS_TSSARGTEMP 0x00000400L /* device supports D3DTA_TEMP for temporary register */ +#define D3DPMISCCAPS_BLENDOP 0x00000800L /* device supports D3DRS_BLENDOP */ +#define D3DPMISCCAPS_NULLREFERENCE 0x00001000L /* Reference Device that doesnt render */ +#define D3DPMISCCAPS_PERSTAGECONSTANT 0x00008000L /* Device supports per-stage constants */ +#define D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS 0x00040000L /* Device supports different bit depths for MRT */ +#define D3DPMISCCAPS_FOGVERTEXCLAMPED 0x00100000L /* Device clamps fog blend factor per vertex */ + +// Flags field for Issue +#define D3DISSUE_END (1 << 0) // Tells the runtime to issue the end of a query, changing it's state to "non-signaled". +#define D3DISSUE_BEGIN (1 << 1) // Tells the runtime to issue the beginng of a query. + + +#define D3DPRESENT_INTERVAL_ONE 0x00000001L +#define D3DPRESENT_INTERVAL_IMMEDIATE 0x80000000L + +/* + * Options for clearing + */ +#define D3DCLEAR_TARGET 0x00000001l /* Clear target surface */ +#define D3DCLEAR_ZBUFFER 0x00000002l /* Clear target z buffer */ +#define D3DCLEAR_STENCIL 0x00000004l /* Clear stencil planes */ + + +#define D3DENUM_WHQL_LEVEL 0x00000002L + + + + +#define D3DPTEXTURECAPS_NOPROJECTEDBUMPENV 0x00200000L /* Device does not support projected bump env lookup operation + in programmable and fixed function pixel shaders */ +#define D3DDEVCAPS2_STREAMOFFSET 0x00000001L /* Device supports offsets in streams. Must be set by DX9 drivers */ + +#define D3DDEVCAPS_PUREDEVICE 0x00100000L /* Device supports D3DCREATE_PUREDEVICE */ + +#define D3DCREATE_PUREDEVICE 0x00000010L +#define D3DCREATE_SOFTWARE_VERTEXPROCESSING 0x00000020L +#define D3DCREATE_HARDWARE_VERTEXPROCESSING 0x00000040L +#define D3DCREATE_FPU_PRESERVE 0x00000002L +#define D3DPRASTERCAPS_FOGRANGE 0x00010000L +#define D3DPRASTERCAPS_FOGTABLE 0x00000100L +#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L +#define D3DPRASTERCAPS_WFOG 0x00100000L +#define D3DPRASTERCAPS_ZFOG 0x00200000L +#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L +#define D3DPRASTERCAPS_WBUFFER 0x00040000L +#define D3DPRASTERCAPS_ZTEST 0x00000010L + +// +// Caps2 +// +#define D3DCAPS2_CANCALIBRATEGAMMA 0x00100000L +#define D3DPRASTERCAPS_SCISSORTEST 0x01000000L +#define D3DPTEXTURECAPS_MIPCUBEMAP 0x00010000L /* Device can do mipmapped cube maps */ +#define D3DPTEXTURECAPS_ALPHA 0x00000004L /* Alpha in texture pixels is supported */ +#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L /* Only square textures are supported */ +#define D3DCREATE_MULTITHREADED 0x00000004L +#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */ +#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L +#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L +#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L /* Device can do cubemap textures */ +#define D3DPTEXTURECAPS_POW2 0x00000002L /* Power-of-2 texture dimensions are required - applies to non-Cube/Volume textures only. */ +#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L +#define D3DPTEXTURECAPS_PROJECTED 0x00000400L /* Device can do D3DTTFF_PROJECTED */ +#define D3DTEXOPCAPS_ADD 0x00000040L +#define D3DTEXOPCAPS_MODULATE2X 0x00000010L +#define D3DPRASTERCAPS_DEPTHBIAS 0x04000000L +#define D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS 0x02000000L +#define D3DVTXPCAPS_TEXGEN_SPHEREMAP 0x00000100L /* device supports D3DTSS_TCI_SPHEREMAP */ +#define D3DCAPS2_DYNAMICTEXTURES 0x20000000L + +// The following usages are valid only for querying CheckDeviceFormat +#define D3DUSAGE_QUERY_SRGBREAD (0x00010000L) +#define D3DUSAGE_QUERY_FILTER (0x00020000L) +#define D3DUSAGE_QUERY_SRGBWRITE (0x00040000L) +#define D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING (0x00080000L) +#define D3DUSAGE_QUERY_VERTEXTEXTURE (0x00100000L) + +/* Usages for Vertex/Index buffers */ +#define D3DUSAGE_WRITEONLY (0x00000008L) +#define D3DUSAGE_SOFTWAREPROCESSING (0x00000010L) +#define D3DUSAGE_DONOTCLIP (0x00000020L) +#define D3DUSAGE_POINTS (0x00000040L) +#define D3DUSAGE_RTPATCHES (0x00000080L) +#define D3DUSAGE_NPATCHES (0x00000100L) + + +// Flags field for GetData +#define D3DGETDATA_FLUSH (1 << 0) // Tells the runtime to flush if the query is outstanding. + +// Flexible vertex format bits +// +#define D3DFVF_RESERVED0 0x001 +#define D3DFVF_POSITION_MASK 0x400E +#define D3DFVF_XYZ 0x002 +#define D3DFVF_XYZRHW 0x004 +#define D3DFVF_XYZB1 0x006 +#define D3DFVF_XYZB2 0x008 +#define D3DFVF_XYZB3 0x00a +#define D3DFVF_XYZB4 0x00c +#define D3DFVF_XYZB5 0x00e +#define D3DFVF_XYZW 0x4002 +#define D3DFVF_NORMAL 0x010 +#define D3DFVF_PSIZE 0x020 +#define D3DFVF_DIFFUSE 0x040 +#define D3DFVF_SPECULAR 0x080 +#define D3DFVF_TEXCOUNT_MASK 0xf00 +#define D3DFVF_TEXCOUNT_SHIFT 8 +#define D3DFVF_TEX0 0x000 +#define D3DFVF_TEX1 0x100 +#define D3DFVF_TEX2 0x200 +#define D3DFVF_TEX3 0x300 +#define D3DFVF_TEX4 0x400 +#define D3DFVF_TEX5 0x500 +#define D3DFVF_TEX6 0x600 +#define D3DFVF_TEX7 0x700 +#define D3DFVF_TEX8 0x800 +#define D3DFVF_LASTBETA_UBYTE4 0x1000 +#define D3DFVF_LASTBETA_D3DCOLOR 0x8000 +#define D3DFVF_RESERVED2 0x6000 // 2 reserved bits + + +#define D3DTA_SELECTMASK 0x0000000f // mask for arg selector +#define D3DTA_DIFFUSE 0x00000000 // select diffuse color (read only) +#define D3DTA_CURRENT 0x00000001 // select stage destination register (read/write) +#define D3DTA_TEXTURE 0x00000002 // select texture color (read only) +#define D3DTA_TFACTOR 0x00000003 // select D3DRS_TEXTUREFACTOR (read only) +#define D3DTA_SPECULAR 0x00000004 // select specular color (read only) +#define D3DTA_TEMP 0x00000005 // select temporary register color (read/write) +#define D3DTA_CONSTANT 0x00000006 // select texture stage constant +#define D3DTA_COMPLEMENT 0x00000010 // take 1.0 - x (read modifier) +#define D3DTA_ALPHAREPLICATE 0x00000020 // replicate alpha to color components (read modifier) + + +#define D3DUSAGE_RENDERTARGET (0x00000001L) +#define D3DUSAGE_QUERY_VERTEXTEXTURE (0x00100000L) +#define D3DUSAGE_QUERY_FILTER (0x00020000L) +#define D3DUSAGE_DEPTHSTENCIL (0x00000002L) +#define D3DUSAGE_WRITEONLY (0x00000008L) +#define D3DUSAGE_SOFTWAREPROCESSING (0x00000010L) +#define D3DUSAGE_DYNAMIC (0x00000200L) + +#define D3DSI_INSTLENGTH_MASK 0x0F000000 +#define D3DSI_INSTLENGTH_SHIFT 24 +#define D3DSP_TEXTURETYPE_SHIFT 27 +#define D3DSP_REGTYPE_SHIFT 28 +#define D3DSP_REGTYPE_SHIFT2 8 +#define D3DSP_REGTYPE_MASK 0x70000000 +#define D3DSP_REGTYPE_MASK2 0x00001800 + +#define D3DSP_REGNUM_MASK 0x000007FF + +#define D3DSP_DSTMOD_SHIFT 20 +#define D3DSP_DSTMOD_MASK 0x00F00000 +#define D3DSPDM_MSAMPCENTROID (4<>8)&0xFF) +#define D3DSHADER_VERSION_MINOR(_Version) (((_Version)>>0)&0xFF) + +#define D3DSHADER_ADDRESSMODE_SHIFT 13 +#define D3DSHADER_ADDRESSMODE_MASK (1 << D3DSHADER_ADDRESSMODE_SHIFT) + +#define D3DPS_END() 0x0000FFFF + +// ps_2_0 texld controls +#define D3DSI_TEXLD_PROJECT (0x01 << D3DSP_OPCODESPECIFICCONTROL_SHIFT) +#define D3DSI_TEXLD_BIAS (0x02 << D3DSP_OPCODESPECIFICCONTROL_SHIFT) + + +// destination parameter write mask +#define D3DSP_WRITEMASK_0 0x00010000 // Component 0 (X;Red) +#define D3DSP_WRITEMASK_1 0x00020000 // Component 1 (Y;Green) +#define D3DSP_WRITEMASK_2 0x00040000 // Component 2 (Z;Blue) +#define D3DSP_WRITEMASK_3 0x00080000 // Component 3 (W;Alpha) +#define D3DSP_WRITEMASK_ALL 0x000F0000 // All Components + +#define D3DVS_SWIZZLE_SHIFT 16 +#define D3DVS_SWIZZLE_MASK 0x00FF0000 + +// The following bits define where to take component X from: + +#define D3DVS_X_X (0 << D3DVS_SWIZZLE_SHIFT) +#define D3DVS_X_Y (1 << D3DVS_SWIZZLE_SHIFT) +#define D3DVS_X_Z (2 << D3DVS_SWIZZLE_SHIFT) +#define D3DVS_X_W (3 << D3DVS_SWIZZLE_SHIFT) + +// The following bits define where to take component Y from: + +#define D3DVS_Y_X (0 << (D3DVS_SWIZZLE_SHIFT + 2)) +#define D3DVS_Y_Y (1 << (D3DVS_SWIZZLE_SHIFT + 2)) +#define D3DVS_Y_Z (2 << (D3DVS_SWIZZLE_SHIFT + 2)) +#define D3DVS_Y_W (3 << (D3DVS_SWIZZLE_SHIFT + 2)) + +// The following bits define where to take component Z from: + +#define D3DVS_Z_X (0 << (D3DVS_SWIZZLE_SHIFT + 4)) +#define D3DVS_Z_Y (1 << (D3DVS_SWIZZLE_SHIFT + 4)) +#define D3DVS_Z_Z (2 << (D3DVS_SWIZZLE_SHIFT + 4)) +#define D3DVS_Z_W (3 << (D3DVS_SWIZZLE_SHIFT + 4)) + +// The following bits define where to take component W from: + +#define D3DVS_W_X (0 << (D3DVS_SWIZZLE_SHIFT + 6)) +#define D3DVS_W_Y (1 << (D3DVS_SWIZZLE_SHIFT + 6)) +#define D3DVS_W_Z (2 << (D3DVS_SWIZZLE_SHIFT + 6)) +#define D3DVS_W_W (3 << (D3DVS_SWIZZLE_SHIFT + 6)) + +// source parameter modifiers +#define D3DSP_SRCMOD_SHIFT 24 +#define D3DSP_SRCMOD_MASK 0x0F000000 + + +struct IDirect3DSurface9; +struct IDirect3DDevice9; +struct IDirect3DCubeTexture9; +struct IDirect3DVertexDeclaration9; +struct IDirect3DQuery9; + + + + + +// ------------------------------------------------------------------------------------------------------------------------------ // +// ENUMS +// ------------------------------------------------------------------------------------------------------------------------------ // + +typedef enum _D3DSHADER_PARAM_SRCMOD_TYPE +{ + D3DSPSM_NONE = 0<= 2.0 + + + D3DDECLTYPE_UBYTE4N = 8, // Each of 4 bytes is normalized by dividing to 255.0 + D3DDECLTYPE_SHORT2N = 9, // 2D signed short normalized (v[0]/32767.0,v[1]/32767.0,0,1) + D3DDECLTYPE_SHORT4N = 10, // 4D signed short normalized (v[0]/32767.0,v[1]/32767.0,v[2]/32767.0,v[3]/32767.0) + D3DDECLTYPE_USHORT2N = 11, // 2D unsigned short normalized (v[0]/65535.0,v[1]/65535.0,0,1) + D3DDECLTYPE_USHORT4N = 12, // 4D unsigned short normalized (v[0]/65535.0,v[1]/65535.0,v[2]/65535.0,v[3]/65535.0) + D3DDECLTYPE_UDEC3 = 13, // 3D unsigned 10 10 10 format expanded to (value, value, value, 1) + D3DDECLTYPE_DEC3N = 14, // 3D signed 10 10 10 format normalized and expanded to (v[0]/511.0, v[1]/511.0, v[2]/511.0, 1) + D3DDECLTYPE_FLOAT16_2 = 15, // Two 16-bit floating point values, expanded to (value, value, 0, 1) + D3DDECLTYPE_FLOAT16_4 = 16, // Four 16-bit floating point values + D3DDECLTYPE_UNUSED = 17, // When the type field in a decl is unused. +} D3DDECLTYPE; + +typedef enum _D3DDECLMETHOD +{ + D3DDECLMETHOD_DEFAULT = 0, + D3DDECLMETHOD_PARTIALU, + D3DDECLMETHOD_PARTIALV, + D3DDECLMETHOD_CROSSUV, // Normal + D3DDECLMETHOD_UV, + D3DDECLMETHOD_LOOKUP, // Lookup a displacement map + D3DDECLMETHOD_LOOKUPPRESAMPLED, // Lookup a pre-sampled displacement map +} D3DDECLMETHOD; + +typedef enum _D3DDECLUSAGE +{ + D3DDECLUSAGE_POSITION = 0, + D3DDECLUSAGE_BLENDWEIGHT = 1, + D3DDECLUSAGE_BLENDINDICES = 2, + D3DDECLUSAGE_NORMAL = 3, + D3DDECLUSAGE_PSIZE = 4, + D3DDECLUSAGE_TEXCOORD = 5, + D3DDECLUSAGE_TANGENT = 6, + D3DDECLUSAGE_BINORMAL = 7, + D3DDECLUSAGE_TESSFACTOR = 8, + D3DDECLUSAGE_PLUGH = 9, // mystery value + D3DDECLUSAGE_COLOR = 10, + D3DDECLUSAGE_FOG = 11, + D3DDECLUSAGE_DEPTH = 12, + D3DDECLUSAGE_SAMPLE = 13, +} D3DDECLUSAGE; + +typedef enum _D3DPRIMITIVETYPE { + D3DPT_POINTLIST = 1, + D3DPT_LINELIST = 2, + D3DPT_TRIANGLELIST = 4, + D3DPT_TRIANGLESTRIP = 5, + D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DPRIMITIVETYPE; + + + + +// ------------------------------------------------------------------------------------------------------------------------------ // +// STRUCTURES +// ------------------------------------------------------------------------------------------------------------------------------ // + +typedef struct D3DXPLANE +{ + float& operator[]( int i ); + bool operator==( const D3DXPLANE &o ); + bool operator!=( const D3DXPLANE &o ); + operator float*(); + operator const float*() const; + + float a, b, c, d; +} D3DXPLANE; + +typedef enum _D3DVERTEXBLENDFLAGS +{ + D3DVBF_DISABLE = 0, // Disable vertex blending + D3DVBF_1WEIGHTS = 1, // 2 matrix blending + D3DVBF_2WEIGHTS = 2, // 3 matrix blending + D3DVBF_3WEIGHTS = 3, // 4 matrix blending + D3DVBF_TWEENING = 255, // blending using D3DRS_TWEENFACTOR + D3DVBF_0WEIGHTS = 256, // one matrix is used with weight 1.0 + D3DVBF_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum +} D3DVERTEXBLENDFLAGS; + +typedef struct _D3DINDEXBUFFER_DESC +{ + D3DFORMAT Format; + D3DRESOURCETYPE Type; + DWORD Usage; + D3DPOOL Pool; + UINT Size; +} D3DINDEXBUFFER_DESC; + +typedef struct _D3DVERTEXELEMENT9 +{ + WORD Stream; // Stream index + WORD Offset; // Offset in the stream in bytes + BYTE Type; // Data type + BYTE Method; // Processing method + BYTE Usage; // Semantics + BYTE UsageIndex; // Semantic index +} D3DVERTEXELEMENT9, *LPD3DVERTEXELEMENT9; + + +#define MAX_DEVICE_IDENTIFIER_STRING 512 +typedef struct _D3DADAPTER_IDENTIFIER9 +{ + char Driver[MAX_DEVICE_IDENTIFIER_STRING]; + char Description[MAX_DEVICE_IDENTIFIER_STRING]; + char DeviceName[32]; /* Device name for GDI (ex. \\.\DISPLAY1) */ + + LARGE_INTEGER DriverVersion; /* Defined for 32 bit components */ + + DWORD VendorId; + DWORD DeviceId; + DWORD SubSysId; + DWORD Revision; + DWORD VideoMemory; + +} D3DADAPTER_IDENTIFIER9; + + +typedef struct _D3DCOLORVALUE { + float r; + float g; + float b; + float a; +} D3DCOLORVALUE; + +typedef struct _D3DMATERIAL9 { + D3DCOLORVALUE Diffuse; /* Diffuse color RGBA */ + D3DCOLORVALUE Ambient; /* Ambient color RGB */ + D3DCOLORVALUE Specular; /* Specular 'shininess' */ + D3DCOLORVALUE Emissive; /* Emissive color RGB */ + float Power; /* Sharpness if specular highlight */ +} D3DMATERIAL9; + +typedef struct _D3DVOLUME_DESC +{ + D3DFORMAT Format; + D3DRESOURCETYPE Type; + DWORD Usage; + D3DPOOL Pool; + + UINT Width; + UINT Height; + UINT Depth; +} D3DVOLUME_DESC; + +typedef struct _D3DVIEWPORT9 { + DWORD X; + DWORD Y; /* Viewport Top left */ + DWORD Width; + DWORD Height; /* Viewport Dimensions */ + float MinZ; /* Min/max of clip Volume */ + float MaxZ; +} D3DVIEWPORT9; + +typedef struct _D3DPSHADERCAPS2_0 +{ + DWORD Caps; + INT DynamicFlowControlDepth; + INT NumTemps; + INT StaticFlowControlDepth; + INT NumInstructionSlots; +} D3DPSHADERCAPS2_0; + +typedef struct _D3DCAPS9 +{ + /* Device Info */ + D3DDEVTYPE DeviceType; + + /* Caps from DX7 Draw */ + DWORD Caps; + DWORD Caps2; + + /* Cursor Caps */ + DWORD CursorCaps; + + /* 3D Device Caps */ + DWORD DevCaps; + + DWORD PrimitiveMiscCaps; + DWORD RasterCaps; + DWORD TextureCaps; + DWORD TextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture9's + + DWORD MaxTextureWidth, MaxTextureHeight; + DWORD MaxVolumeExtent; + + DWORD MaxTextureAspectRatio; + DWORD MaxAnisotropy; + + DWORD TextureOpCaps; + DWORD MaxTextureBlendStages; + DWORD MaxSimultaneousTextures; + + DWORD VertexProcessingCaps; + DWORD MaxActiveLights; + DWORD MaxUserClipPlanes; + DWORD MaxVertexBlendMatrices; + DWORD MaxVertexBlendMatrixIndex; + + DWORD MaxPrimitiveCount; // max number of primitives per DrawPrimitive call + DWORD MaxStreams; + + DWORD VertexShaderVersion; + DWORD MaxVertexShaderConst; // number of vertex shader constant registers + + DWORD PixelShaderVersion; + + // Here are the DX9 specific ones + DWORD DevCaps2; + D3DPSHADERCAPS2_0 PS20Caps; + + DWORD NumSimultaneousRTs; // Will be at least 1 + DWORD MaxVertexShader30InstructionSlots; + DWORD MaxPixelShader30InstructionSlots; + + // only on Posix/GL + #if POSIX + DWORD FakeSRGBWrite; // 1 for parts which can't support SRGB writes due to driver issues - 0 for others + DWORD MixedSizeTargets; // 1 for parts which can mix attachment sizes (RT's color vs depth) + DWORD CanDoSRGBReadFromRTs; // 0 when we're on Leopard, 1 when on Snow Leopard + #endif +} D3DCAPS9; + +typedef struct _D3DDISPLAYMODE +{ + UINT Width; + UINT Height; + UINT RefreshRate; + D3DFORMAT Format; +} D3DDISPLAYMODE; + +typedef struct _D3DGAMMARAMP +{ + WORD red [256]; + WORD green[256]; + WORD blue [256]; +} D3DGAMMARAMP; + + +/* Resize Optional Parameters */ +typedef struct _D3DPRESENT_PARAMETERS_ +{ + UINT BackBufferWidth; + UINT BackBufferHeight; + D3DFORMAT BackBufferFormat; + UINT BackBufferCount; + + D3DMULTISAMPLE_TYPE MultiSampleType; + DWORD MultiSampleQuality; + + D3DSWAPEFFECT SwapEffect; + VD3DHWND hDeviceWindow; + BOOL Windowed; + BOOL EnableAutoDepthStencil; + D3DFORMAT AutoDepthStencilFormat; + DWORD Flags; + + /* FullScreen_RefreshRateInHz must be zero for Windowed mode */ + UINT FullScreen_RefreshRateInHz; + UINT PresentationInterval; +} D3DPRESENT_PARAMETERS; + +typedef struct _D3DDEVICE_CREATION_PARAMETERS +{ + UINT AdapterOrdinal; + D3DDEVTYPE DeviceType; + VD3DHWND hFocusWindow; + DWORD BehaviorFlags; +} D3DDEVICE_CREATION_PARAMETERS; + +/* Structures for LockBox */ +typedef struct _D3DBOX +{ + UINT Left; + UINT Top; + UINT Right; + UINT Bottom; + UINT Front; + UINT Back; +} D3DBOX; + +typedef struct _D3DLOCKED_BOX +{ + INT RowPitch; + INT SlicePitch; + void* pBits; +} D3DLOCKED_BOX; + +typedef struct _D3DSURFACE_DESC +{ + D3DFORMAT Format; + D3DRESOURCETYPE Type; + DWORD Usage; + D3DPOOL Pool; + + D3DMULTISAMPLE_TYPE MultiSampleType; + DWORD MultiSampleQuality; + UINT Width; + UINT Height; +} D3DSURFACE_DESC; + + +typedef struct _D3DLOCKED_RECT +{ + INT Pitch; + void* pBits; +} D3DLOCKED_RECT; + + +typedef struct _D3DRASTER_STATUS +{ + BOOL InVBlank; + UINT ScanLine; +} D3DRASTER_STATUS; + +typedef enum _D3DLIGHTTYPE { + D3DLIGHT_POINT = 1, + D3DLIGHT_SPOT = 2, + D3DLIGHT_DIRECTIONAL = 3, + D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DLIGHTTYPE; + +typedef struct _D3DVECTOR { + float x; + float y; + float z; +} D3DVECTOR; + +class D3DXVECTOR2 +{ +public: + operator FLOAT* (); + operator CONST FLOAT* () const; + + float x,y; +}; + +class D3DXVECTOR3 : public D3DVECTOR +{ +public: + D3DXVECTOR3() {} + D3DXVECTOR3( float a, float b, float c ); + operator FLOAT* (); + operator CONST FLOAT* () const; +}; + +typedef enum _D3DXINCLUDE_TYPE +{ + D3DXINC_LOCAL, + + // force 32-bit size enum + D3DXINC_FORCE_DWORD = 0x7fffffff + +} D3DXINCLUDE_TYPE; + +typedef struct _D3DLIGHT9 { + D3DLIGHTTYPE Type; /* Type of light source */ + D3DCOLORVALUE Diffuse; /* Diffuse color of light */ + D3DCOLORVALUE Specular; /* Specular color of light */ + D3DCOLORVALUE Ambient; /* Ambient color of light */ + D3DVECTOR Position; /* Position in world space */ + D3DVECTOR Direction; /* Direction in world space */ + float Range; /* Cutoff range */ + float Falloff; /* Falloff */ + float Attenuation0; /* Constant attenuation */ + float Attenuation1; /* Linear attenuation */ + float Attenuation2; /* Quadratic attenuation */ + float Theta; /* Inner angle of spotlight cone */ + float Phi; /* Outer angle of spotlight cone */ +} D3DLIGHT9; + +class D3DXVECTOR4 +{ +public: + D3DXVECTOR4() {} + D3DXVECTOR4( float a, float b, float c, float d ); + + float x,y,z,w; +}; + +//---------------------------------------------------------------------------- +// D3DXMACRO: +// ---------- +// Preprocessor macro definition. The application pass in a NULL-terminated +// array of this structure to various D3DX APIs. This enables the application +// to #define tokens at runtime, before the file is parsed. +//---------------------------------------------------------------------------- + +typedef struct _D3DXMACRO +{ + LPCSTR Name; + LPCSTR Definition; + +} D3DXMACRO, *LPD3DXMACRO; + + + + + + + + + +// ------------------------------------------------------------------------------------------------------------------------------ // +// ------------------------------------------------------------------------------------------------------------------------------ // +// **** FIXED FUNCTION STUFF - None of this stuff needs support in GL. +// +// Also look for any functions marked with "**** FIXED FUNCTION STUFF" +// +// It's only laying around here so we don't have to chop up the shader system a lot to strip out the fixed function code paths. +// ------------------------------------------------------------------------------------------------------------------------------ // +// ------------------------------------------------------------------------------------------------------------------------------ // + +// **** FIXED FUNCTION STUFF - None of this stuff needs support in GL. +typedef enum _D3DTRANSFORMSTATETYPE { + D3DTS_VIEW = 2, + D3DTS_PROJECTION = 3, + D3DTS_TEXTURE0 = 16, + D3DTS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DTRANSFORMSTATETYPE; + +// **** FIXED FUNCTION STUFF - None of this stuff needs support in GL. +typedef enum _D3DTEXTUREOP +{ + // Control + D3DTOP_DISABLE = 1, // disables stage + D3DTOP_SELECTARG1 = 2, // the default + D3DTOP_SELECTARG2 = 3, + + // Modulate + D3DTOP_MODULATE = 4, // multiply args together + D3DTOP_MODULATE2X = 5, // multiply and 1 bit + D3DTOP_MODULATE4X = 6, // multiply and 2 bits + + // Add + D3DTOP_ADD = 7, // add arguments together + D3DTOP_ADDSIGNED = 8, // add with -0.5 bias + D3DTOP_ADDSIGNED2X = 9, // as above but left 1 bit + D3DTOP_SUBTRACT = 10, // Arg1 - Arg2, with no saturation + D3DTOP_ADDSMOOTH = 11, // add 2 args, subtract product + // Arg1 + Arg2 - Arg1*Arg2 + // = Arg1 + (1-Arg1)*Arg2 + + // Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha) + D3DTOP_BLENDDIFFUSEALPHA = 12, // iterated alpha + D3DTOP_BLENDTEXTUREALPHA = 13, // texture alpha + D3DTOP_BLENDFACTORALPHA = 14, // alpha from D3DRS_TEXTUREFACTOR + + // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha) + D3DTOP_BLENDTEXTUREALPHAPM = 15, // texture alpha + D3DTOP_BLENDCURRENTALPHA = 16, // by alpha of current color + + // Specular mapping + D3DTOP_PREMODULATE = 17, // modulate with next texture before use + D3DTOP_MODULATEALPHA_ADDCOLOR = 18, // Arg1.RGB + Arg1.A*Arg2.RGB + // COLOROP only + D3DTOP_MODULATECOLOR_ADDALPHA = 19, // Arg1.RGB*Arg2.RGB + Arg1.A + // COLOROP only + D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB + // COLOROP only + D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A + // COLOROP only + + // Bump mapping + D3DTOP_BUMPENVMAP = 22, // per pixel env map perturbation + D3DTOP_BUMPENVMAPLUMINANCE = 23, // with luminance channel + + // This can do either diffuse or specular bump mapping with correct input. + // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B) + // where each component has been scaled and offset to make it signed. + // The result is replicated into all four (including alpha) channels. + // This is a valid COLOROP only. + D3DTOP_DOTPRODUCT3 = 24, + + // Triadic ops + D3DTOP_MULTIPLYADD = 25, // Arg0 + Arg1*Arg2 + D3DTOP_LERP = 26, // (Arg0)*Arg1 + (1-Arg0)*Arg2 + + D3DTOP_FORCE_DWORD = 0x7fffffff, +} D3DTEXTUREOP; + +// **** FIXED FUNCTION STUFF - None of this stuff needs support in GL. +typedef enum _D3DTEXTURESTAGESTATETYPE +{ + D3DTSS_COLOROP = 1, /* D3DTEXTUREOP - per-stage blending controls for color channels */ + D3DTSS_COLORARG1 = 2, /* D3DTA_* (texture arg) */ + D3DTSS_COLORARG2 = 3, /* D3DTA_* (texture arg) */ + D3DTSS_ALPHAOP = 4, /* D3DTEXTUREOP - per-stage blending controls for alpha channel */ + D3DTSS_ALPHAARG1 = 5, /* D3DTA_* (texture arg) */ + D3DTSS_ALPHAARG2 = 6, /* D3DTA_* (texture arg) */ + D3DTSS_BUMPENVMAT00 = 7, /* float (bump mapping matrix) */ + D3DTSS_BUMPENVMAT01 = 8, /* float (bump mapping matrix) */ + D3DTSS_BUMPENVMAT10 = 9, /* float (bump mapping matrix) */ + D3DTSS_BUMPENVMAT11 = 10, /* float (bump mapping matrix) */ + D3DTSS_TEXCOORDINDEX = 11, /* identifies which set of texture coordinates index this texture */ + D3DTSS_BUMPENVLOFFSET = 23, /* float offset for bump map luminance */ + D3DTSS_TEXTURETRANSFORMFLAGS = 24, /* D3DTEXTURETRANSFORMFLAGS controls texture transform */ + D3DTSS_COLORARG0 = 26, /* D3DTA_* third arg for triadic ops */ + D3DTSS_RESULTARG = 28, /* D3DTA_* arg for result (CURRENT or TEMP) */ + + + D3DTSS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DTEXTURESTAGESTATETYPE; + + + + + + + +// ------------------------------------------------------------------------------------------------------------------------------ // +// INTERFACES +// ------------------------------------------------------------------------------------------------------------------------------ // + +struct IDirect3DResource9 : public IUnknown +{ + IDirect3DDevice9 *m_device; // parent device + D3DRESOURCETYPE m_restype; + + DWORD SetPriority(DWORD PriorityNew); +}; + +struct IDirect3DBaseTexture9 : public IDirect3DResource9 // "A Texture.." +{ + D3DSURFACE_DESC m_descZero; // desc of top level. + CGLMTex *m_tex; // a CGLMTex can represent all forms of tex + int m_srgbFlipCount; + + virtual ~IDirect3DBaseTexture9(); + D3DRESOURCETYPE GetType(); + DWORD GetLevelCount(); + HRESULT GetLevelDesc(UINT Level,D3DSURFACE_DESC *pDesc); +}; + +struct IDirect3DTexture9 : public IDirect3DBaseTexture9 // "Texture 2D" +{ + IDirect3DSurface9 *m_surfZero; // surf of top level. + + virtual ~IDirect3DTexture9(); + + HRESULT LockRect(UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags); + HRESULT UnlockRect(UINT Level); + HRESULT GetSurfaceLevel(UINT Level,IDirect3DSurface9** ppSurfaceLevel); +}; + +typedef struct IDirect3DTexture9 *LPDIRECT3DTEXTURE9, *PDIRECT3DTEXTURE9; + +struct IDirect3DCubeTexture9 : public IDirect3DBaseTexture9 // "Texture Cube Map" +{ + IDirect3DSurface9 *m_surfZero[6]; // surfs of top level. + + virtual ~IDirect3DCubeTexture9(); + + HRESULT GetCubeMapSurface(D3DCUBEMAP_FACES FaceType,UINT Level,IDirect3DSurface9** ppCubeMapSurface); + HRESULT GetLevelDesc(UINT Level,D3DSURFACE_DESC *pDesc); +}; + +struct IDirect3DVolumeTexture9 : public IDirect3DBaseTexture9 // "Texture 3D" +{ + IDirect3DSurface9 *m_surfZero; // surf of top level. + D3DVOLUME_DESC m_volDescZero; // volume desc top level + + virtual ~IDirect3DVolumeTexture9(); + + HRESULT LockBox(UINT Level,D3DLOCKED_BOX* pLockedVolume,CONST D3DBOX* pBox,DWORD Flags); + HRESULT UnlockBox(UINT Level); + HRESULT GetLevelDesc( UINT level, D3DVOLUME_DESC *pDesc ); +}; + + +// for the moment, a "D3D surface" is modeled as a GLM tex, a face, and a mip. +// no Create method, these are filled in by the various create surface methods. + +struct IDirect3DSurface9 : public IDirect3DResource9 +{ + virtual ~IDirect3DSurface9(); + + HRESULT LockRect(D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags); + HRESULT UnlockRect(); + HRESULT GetDesc(D3DSURFACE_DESC *pDesc); + + D3DSURFACE_DESC m_desc; + CGLMTex *m_tex; + int m_face; + int m_mip; +}; + + + +struct IDirect3D9 : public IUnknown +{ +public: + virtual ~IDirect3D9(); + + UINT GetAdapterCount(); //cheese: returns 1 + + HRESULT GetDeviceCaps (UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps); + HRESULT GetAdapterIdentifier (UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier); + HRESULT CheckDeviceFormat (UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat); + UINT GetAdapterModeCount (UINT Adapter,D3DFORMAT Format); + HRESULT EnumAdapterModes (UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode); + HRESULT CheckDeviceType (UINT Adapter,D3DDEVTYPE DevType,D3DFORMAT AdapterFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed); + HRESULT GetAdapterDisplayMode (UINT Adapter,D3DDISPLAYMODE* pMode); + HRESULT CheckDepthStencilMatch (UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat); + HRESULT CheckDeviceMultiSampleType (UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels); + + HRESULT CreateDevice (UINT Adapter,D3DDEVTYPE DeviceType,VD3DHWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface); +}; + +struct IDirect3DSwapChain9 : public IUnknown +{ +}; + + + + // typedef enum D3DDECLUSAGE + // { + // D3DDECLUSAGE_POSITION = 0, + // D3DDECLUSAGE_BLENDWEIGHT = 1, + // D3DDECLUSAGE_BLENDINDICES = 2, + // D3DDECLUSAGE_NORMAL = 3, + // D3DDECLUSAGE_PSIZE = 4, + // D3DDECLUSAGE_TEXCOORD = 5, + // D3DDECLUSAGE_TANGENT = 6, + // D3DDECLUSAGE_BINORMAL = 7, + // D3DDECLUSAGE_TESSFACTOR = 8, + // D3DDECLUSAGE_POSITIONT = 9, + // D3DDECLUSAGE_COLOR = 10, + // D3DDECLUSAGE_FOG = 11, + // D3DDECLUSAGE_DEPTH = 12, + // D3DDECLUSAGE_SAMPLE = 13, + // } D3DDECLUSAGE, *LPD3DDECLUSAGE; + // Constants + // + // D3DDECLUSAGE_POSITION + // Position data ranging from (-1,-1) to (1,1). Use D3DDECLUSAGE_POSITION with + // a usage index of 0 to specify untransformed position for fixed function + // vertex processing and the n-patch tessellator. Use D3DDECLUSAGE_POSITION + // with a usage index of 1 to specify untransformed position in the fixed + // function vertex shader for vertex tweening. + // + // D3DDECLUSAGE_BLENDWEIGHT + // Blending weight data. Use D3DDECLUSAGE_BLENDWEIGHT with a usage index of 0 + // to specify the blend weights used in indexed and nonindexed vertex + // blending. + // + // D3DDECLUSAGE_BLENDINDICES + // Blending indices data. Use D3DDECLUSAGE_BLENDINDICES with a usage index of + // 0 to specify matrix indices for indexed paletted skinning. + // + // D3DDECLUSAGE_NORMAL + // Vertex normal data. Use D3DDECLUSAGE_NORMAL with a usage index of 0 to + // specify vertex normals for fixed function vertex processing and the n-patch + // tessellator. Use D3DDECLUSAGE_NORMAL with a usage index of 1 to specify + // vertex normals for fixed function vertex processing for vertex tweening. + // + // D3DDECLUSAGE_PSIZE + // Point size data. Use D3DDECLUSAGE_PSIZE with a usage index of 0 to specify + // the point-size attribute used by the setup engine of the rasterizer to + // expand a point into a quad for the point-sprite functionality. + // + // D3DDECLUSAGE_TEXCOORD + // Texture coordinate data. Use D3DDECLUSAGE_TEXCOORD, n to specify texture + // coordinates in fixed function vertex processing and in pixel shaders prior + // to ps_3_0. These can be used to pass user defined data. + // + // D3DDECLUSAGE_TANGENT + // Vertex tangent data. + // + // D3DDECLUSAGE_BINORMAL + // Vertex binormal data. + // + // D3DDECLUSAGE_TESSFACTOR + // Single positive floating point value. Use D3DDECLUSAGE_TESSFACTOR with a + // usage index of 0 to specify a tessellation factor used in the tessellation + // unit to control the rate of tessellation. For more information about the + // data type, see D3DDECLTYPE_FLOAT1. + // + // D3DDECLUSAGE_POSITIONT + // Vertex data contains transformed position data ranging from (0,0) to + // (viewport width, viewport height). Use D3DDECLUSAGE_POSITIONT with a usage + // index of 0 to specify transformed position. When a declaration containing + // this is set, the pipeline does not perform vertex processing. + // + // D3DDECLUSAGE_COLOR + // Vertex data contains diffuse or specular color. Use D3DDECLUSAGE_COLOR with + // a usage index of 0 to specify the diffuse color in the fixed function + // vertex shader and pixel shaders prior to ps_3_0. Use D3DDECLUSAGE_COLOR + // with a usage index of 1 to specify the specular color in the fixed function + // vertex shader and pixel shaders prior to ps_3_0. + // + // D3DDECLUSAGE_FOG + // Vertex data contains fog data. Use D3DDECLUSAGE_FOG with a usage index of 0 + // to specify a fog blend value used after pixel shading finishes. This + // applies to pixel shaders prior to version ps_3_0. + // + // D3DDECLUSAGE_DEPTH + // Vertex data contains depth data. + // + // D3DDECLUSAGE_SAMPLE + // Vertex data contains sampler data. Use D3DDECLUSAGE_SAMPLE with a usage + // index of 0 to specify the displacement value to look up. It can be used + // only with D3DDECLUSAGE_LOOKUPPRESAMPLED or D3DDECLUSAGE_LOOKUP. + + //note the form of the list terminator.. + + // #define D3DDECL_END() {0xFF,0,D3DDECLTYPE_UNUSED,0,0,0} + // typedef struct _D3DVERTEXELEMENT9 + // { + // WORD Stream; // Stream index + // WORD Offset; // Offset in the stream in bytes + // BYTE Type; // Data type + // BYTE Method; // Processing method + // BYTE Usage; // Semantics + // BYTE UsageIndex; // Semantic index + // } D3DVERTEXELEMENT9, *LPD3DVERTEXELEMENT9; + +#define MAX_D3DVERTEXELEMENTS 16 + +struct D3DVERTEXELEMENT9_GL +{ + // fields right out of the original decl element (copied) + D3DVERTEXELEMENT9 m_dxdecl; // d3d info + // WORD Stream; // Stream index + // WORD Offset; // Offset in the stream in bytes + // BYTE Type; // Data type + // BYTE Method; // Processing method + // BYTE Usage; // Semantics + // BYTE UsageIndex; // Semantic index + + GLMVertexAttributeDesc m_gldecl; + // CGLMBuffer *m_buffer; // late-dropped from selected stream desc (left NULL, will replace with stream source buffer at sync time) + // GLuint m_datasize; // component count (1,2,3,4) of the attrib + // GLenum m_datatype; // data type of the attribute (GL_FLOAT et al) + // GLuint m_stride; // late-dropped from stream desc + // GLuint m_offset; // net offset to attribute 'zero' within the stream data. Add the stream offset before passing to GL. + // GLuint m_normalized; // net offset to attribute 'zero' within the stream data. Add the stream offset before passing to GL. +}; + +struct IDirect3DVertexDeclaration9 : public IUnknown +{ +//public: + uint m_elemCount; + D3DVERTEXELEMENT9_GL m_elements[ MAX_D3DVERTEXELEMENTS ]; + + virtual ~IDirect3DVertexDeclaration9(); +}; + +struct IDirect3DQuery9 : public IDirect3DResource9 //was IUnknown +{ +//public: + D3DQUERYTYPE m_type; // D3DQUERYTYPE_OCCLUSION or D3DQUERYTYPE_EVENT + GLMContext *m_ctx; + CGLMQuery *m_query; + + virtual ~IDirect3DQuery9(); + + HRESULT Issue(DWORD dwIssueFlags); + HRESULT GetData(void* pData,DWORD dwSize,DWORD dwGetDataFlags); +}; + +struct IDirect3DVertexBuffer9 : public IDirect3DResource9 //was IUnknown +{ +//public: + GLMContext *m_ctx; + CGLMBuffer *m_vtxBuffer; + D3DVERTEXBUFFER_DESC m_vtxDesc; // to satisfy GetDesc + + virtual ~IDirect3DVertexBuffer9(); + HRESULT Lock(UINT OffsetToLock,UINT SizeToLock,void** ppbData,DWORD Flags); + HRESULT Unlock(); + +}; + +struct IDirect3DIndexBuffer9 : public IDirect3DResource9 //was IUnknown +{ +//public: + GLMContext *m_ctx; + CGLMBuffer *m_idxBuffer; + D3DINDEXBUFFER_DESC m_idxDesc; // to satisfy GetDesc + + virtual ~IDirect3DIndexBuffer9(); + + HRESULT Lock(UINT OffsetToLock,UINT SizeToLock,void** ppbData,DWORD Flags); + HRESULT Unlock(); + HRESULT GetDesc(D3DINDEXBUFFER_DESC *pDesc); +}; + +struct IDirect3DPixelShader9 : public IDirect3DResource9 //was IUnknown +{ +//public: + CGLMProgram *m_pixProgram; + uint m_pixHighWater; // count of active constant slots referenced by shader. + uint m_pixSamplerMask; // (1< m_stack; + int m_stackTop; // top of stack is at the highest index, this is that index. push increases, pop decreases. + + HRESULT Create( void ); + + D3DXMATRIX* GetTop(); + void Push(); + void Pop(); + void LoadIdentity(); + void LoadMatrix( const D3DXMATRIX *pMat ); + void MultMatrix( const D3DXMATRIX *pMat ); + void MultMatrixLocal( const D3DXMATRIX *pMat ); + HRESULT ScaleLocal(FLOAT x, FLOAT y, FLOAT z); + + // Left multiply the current matrix with the computed rotation + // matrix, counterclockwise about the given axis with the given angle. + // (rotation is about the local origin of the object) + HRESULT RotateAxisLocal(CONST D3DXVECTOR3* pV, FLOAT Angle); + + // Left multiply the current matrix with the computed translation + // matrix. (transformation is about the local origin of the object) + HRESULT TranslateLocal(FLOAT x, FLOAT y, FLOAT z); +}; +typedef ID3DXMatrixStack* LPD3DXMATRIXSTACK; + +struct IDirect3DDevice9Params +{ + UINT m_adapter; + D3DDEVTYPE m_deviceType; + VD3DHWND m_focusWindow; + DWORD m_behaviorFlags; + D3DPRESENT_PARAMETERS m_presentationParameters; +}; + +#define D3D_MAX_STREAMS 4 +struct D3DStreamDesc +{ + IDirect3DVertexBuffer9 *m_vtxBuffer; + uint m_offset; + uint m_stride; +}; + +struct D3DIndexDesc +{ + IDirect3DIndexBuffer9 *m_idxBuffer; +}; + +// we latch sampler values until draw time and then convert them all to GL form +// note these are similar in name to the fields of a GLMTexSamplingParams but contents are not +// particularly in the texture filtering area + +struct D3DSamplerDesc +{ + D3DTEXTUREADDRESS m_addressModes[3]; // D3DTEXTUREADDRESS modes for S,T,R + DWORD m_borderColor; // DWORD bordercolor + D3DTEXTUREFILTERTYPE m_magFilter; // mag filter + D3DTEXTUREFILTERTYPE m_minFilter; // min filter + D3DTEXTUREFILTERTYPE m_mipFilter; // mip filter + float m_mipmapBias; // float: mipmap bias + DWORD m_maxMipLevel; // DWORD 0..(n-1) LOD index of largest map to use (0 == largest) + DWORD m_maxAniso; // D3DSAMP_MAXANISOTROPY max aniso + DWORD m_srgb; // D3DSAMP_SRGBTEXTURE 0 = no SRGB sampling + DWORD m_shadowFilter; // D3DSAMP_SHADOWFILTER +}; + +struct IDirect3DDevice9 : public IUnknown +{ +public: + // members + + IDirect3DDevice9Params m_params; // mirror of the creation inputs + + // D3D flavor stuff + IDirect3DSurface9 *m_rtSurfaces[16]; // current color RT surfaces. [0] is initially == m_defaultColorSurface + IDirect3DSurface9 *m_dsSurface; // current DS RT surface. can be changed! + + IDirect3DSurface9 *m_defaultColorSurface; // default color surface. + IDirect3DSurface9 *m_defaultDepthStencilSurface; // queried by GetDepthStencilSurface. + + IDirect3DVertexDeclaration9 *m_vertDecl; // Set by SetVertexDeclaration... + D3DStreamDesc m_streams[ D3D_MAX_STREAMS ]; // Set by SetStreamSource.. + D3DIndexDesc m_indices; // Set by SetIndices.. + + IDirect3DVertexShader9 *m_vertexShader; // Set by SetVertexShader... + IDirect3DPixelShader9 *m_pixelShader; // Set by SetPixelShader... + + IDirect3DBaseTexture9 *m_textures[16]; // set by SetTexture... NULL if stage inactive + D3DSamplerDesc m_samplers[16]; // set by SetSamplerState.. + // GLM flavor stuff + GLMContext *m_ctx; + CGLMFBO *m_drawableFBO; // this FBO should have all the attachments set to match m_rtSurfaces and m_dsSurface. + + // GL state + struct + { + // render state buckets + GLAlphaTestEnable_t m_AlphaTestEnable; + GLAlphaTestFunc_t m_AlphaTestFunc; + + GLAlphaToCoverageEnable_t m_AlphaToCoverageEnable; + + GLDepthTestEnable_t m_DepthTestEnable; + GLDepthMask_t m_DepthMask; + GLDepthFunc_t m_DepthFunc; + + GLClipPlaneEnable_t m_ClipPlaneEnable[kGLMUserClipPlanes]; + GLClipPlaneEquation_t m_ClipPlaneEquation[kGLMUserClipPlanes]; + + GLColorMaskSingle_t m_ColorMaskSingle; + GLColorMaskMultiple_t m_ColorMaskMultiple; + + GLCullFaceEnable_t m_CullFaceEnable; + GLCullFrontFace_t m_CullFrontFace; + GLPolygonMode_t m_PolygonMode; + GLDepthBias_t m_DepthBias; + GLScissorEnable_t m_ScissorEnable; + GLScissorBox_t m_ScissorBox; + GLViewportBox_t m_ViewportBox; + GLViewportDepthRange_t m_ViewportDepthRange; + + GLBlendEnable_t m_BlendEnable; + GLBlendFactor_t m_BlendFactor; + GLBlendEquation_t m_BlendEquation; + GLBlendColor_t m_BlendColor; + GLBlendEnableSRGB_t m_BlendEnableSRGB; + + GLStencilTestEnable_t m_StencilTestEnable; + GLStencilFunc_t m_StencilFunc; + GLStencilOp_t m_StencilOp; + GLStencilWriteMask_t m_StencilWriteMask; + + GLClearColor_t m_ClearColor; + GLClearDepth_t m_ClearDepth; + GLClearStencil_t m_ClearStencil; + + bool m_FogEnable; // not really pushed to GL, just latched here + + // samplers + GLMTexSamplingParams m_samplers[ 16 ]; + + // bindings...hmmm... + + // dirty-bits + uint m_stateDirtyMask; // covers the state blocks, indexed by 1<x = pV1->x - pV2->x; + pOut->y = pV1->y - pV2->y; + pOut->z = pV1->z - pV2->z; + return pOut; +} + +D3DXINLINE D3DXVECTOR3* D3DXVec3Cross( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ + D3DXVECTOR3 v; + + v.x = pV1->y * pV2->z - pV1->z * pV2->y; + v.y = pV1->z * pV2->x - pV1->x * pV2->z; + v.z = pV1->x * pV2->y - pV1->y * pV2->x; + + *pOut = v; + return pOut; +} + +D3DXINLINE FLOAT D3DXVec3Dot( CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ + return pV1->x * pV2->x + pV1->y * pV2->y + pV1->z * pV2->z; +} + +D3DXMATRIX* D3DXMatrixInverse( D3DXMATRIX *pOut, FLOAT *pDeterminant, CONST D3DXMATRIX *pM ); + +D3DXMATRIX* D3DXMatrixTranspose( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM ); + +D3DXPLANE* D3DXPlaneNormalize( D3DXPLANE *pOut, CONST D3DXPLANE *pP); + +D3DXVECTOR4* D3DXVec4Transform( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, CONST D3DXMATRIX *pM ); + + +D3DXVECTOR4* D3DXVec4Normalize( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV ); + +D3DXMATRIX* D3DXMatrixTranslation( D3DXMATRIX *pOut, FLOAT x, FLOAT y, FLOAT z ); + +// Build an ortho projection matrix. (right-handed) +D3DXMATRIX* D3DXMatrixOrthoOffCenterRH( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,FLOAT zf ); + +D3DXMATRIX* D3DXMatrixPerspectiveRH( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); + +D3DXMATRIX* D3DXMatrixPerspectiveOffCenterRH( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf ); + +// Transform a plane by a matrix. The vector (a,b,c) must be normal. +// M should be the inverse transpose of the transformation desired. +D3DXPLANE* D3DXPlaneTransform( D3DXPLANE *pOut, CONST D3DXPLANE *pP, CONST D3DXMATRIX *pM ); + +IDirect3D9 *Direct3DCreate9(UINT SDKVersion); + +void D3DPERF_SetOptions( DWORD dwOptions ); + +HRESULT D3DXCompileShader( + LPCSTR pSrcData, + UINT SrcDataLen, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pFunctionName, + LPCSTR pProfile, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs, + LPD3DXCONSTANTTABLE* ppConstantTable); + +#endif // USE_ACTUAL_DX + +// fake D3D usage constant for SRGB tex creation +#define D3DUSAGE_TEXTURE_SRGB (0x80000000L) + +#endif // DXABSTRACT_H + diff --git a/external/steamworks/glmgr/glmdebug.h b/external/steamworks/glmgr/glmdebug.h new file mode 100644 index 0000000..e40ad83 --- /dev/null +++ b/external/steamworks/glmgr/glmdebug.h @@ -0,0 +1,45 @@ +#ifndef GLMDEBUG_H +#define GLMDEBUG_H + +// include this anywhere you need to be able to compile-out code related specifically to GLM debugging. + +// we expect DEBUG to be driven by the build system so you can include this header anywhere. +// when we come out, GLMDEBUG will be defined to a value - 0, 1, or 2 +// 0 means no GLM debugging is possible +// 1 means it's possible and resulted from being a debug build +// 2 means it's possible and resulted from being manually forced on for a release build + +#ifdef POSIX + #ifndef GLMDEBUG + #ifdef DEBUG + #define GLMDEBUG 1 // normally 1 here, testing + #else + // #define GLMDEBUG 2 // don't check this in enabled.. + #endif + + #ifndef GLMDEBUG + #define GLMDEBUG 0 + #endif + #endif +#else + #ifndef GLMDEBUG + #define GLMDEBUG 0 + #endif +#endif + +// helpful macro if you are in a position to call GLM functions directly (i.e. you live in materialsystem / shaderapidx9) +#if GLMDEBUG + #define GLMPRINTF(args) GLMPrintf args + #define GLMPRINTSTR(args) GLMPrintStr args + #define GLMPRINTTEXT(args) GLMPrintText args + #define GLMBEGINPIXEVENT(args) GLMBeginPIXEvent args + #define GLMENDPIXEVENT(args) GLMEndPIXEvent args +#else + #define GLMPRINTF(args) + #define GLMPRINTSTR(args) + #define GLMPRINTTEXT(args) + #define GLMBEGINPIXEVENT(args) + #define GLMENDPIXEVENT(args) +#endif + +#endif diff --git a/external/steamworks/glmgr/glmdisplay.h b/external/steamworks/glmgr/glmdisplay.h new file mode 100644 index 0000000..640dd64 --- /dev/null +++ b/external/steamworks/glmgr/glmdisplay.h @@ -0,0 +1,275 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ +// +// glmdisplay.h +// display related stuff - used by both GLMgr and the CocoaMgr +// +//=============================================================================== + +#ifndef GLMDISPLAY_H +#define GLMDISPLAY_H + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#include "glmgrbasics.h" + +typedef void _PseudoNSGLContext; // aka NSOpenGLContext +typedef _PseudoNSGLContext *PseudoNSGLContextPtr; + +struct GLMDisplayModeInfoFields +{ + uint m_modePixelWidth; + uint m_modePixelHeight; + uint m_modeRefreshHz; + // are we even going to talk about bit depth... not yet +}; + +struct GLMDisplayInfoFields +{ + CGDirectDisplayID m_cgDisplayID; + CGOpenGLDisplayMask m_glDisplayMask; // result of CGDisplayIDToOpenGLDisplayMask on the cg_displayID. + + uint m_displayPixelWidth; + uint m_displayPixelHeight; +}; + +struct GLMRendererInfoFields +{ + /*properties of interest and their desired values. + + kCGLRPFullScreen = 54, true + kCGLRPAccelerated = 73, true + kCGLRPWindow = 80, true + + kCGLRPRendererID = 70, informational + kCGLRPDisplayMask = 84, informational + kCGLRPBufferModes = 100, informational + kCGLRPColorModes = 103, informational + kCGLRPAccumModes = 104, informational + kCGLRPDepthModes = 105, informational + kCGLRPStencilModes = 106, informational + kCGLRPMaxAuxBuffers = 107, informational + kCGLRPMaxSampleBuffers = 108, informational + kCGLRPMaxSamples = 109, informational + kCGLRPSampleModes = 110, informational + kCGLRPSampleAlpha = 111, informational + kCGLRPVideoMemory = 120, informational + kCGLRPTextureMemory = 121, informational + kCGLRPRendererCount = 128 number of renderers in the CGLRendererInfoObj under examination + + kCGLRPOffScreen = 53, D/C + kCGLRPRobust = 75, FALSE or D/C - aka we're asking for no-fallback + kCGLRPBackingStore = 76, D/C + kCGLRPMPSafe = 78, D/C + kCGLRPMultiScreen = 81, D/C + kCGLRPCompliant = 83, D/C + */ + + + //--------------------------- info we have from CGL renderer queries, IOKit, Gestalt + //--------------------------- these are set up in the displayDB by CocoaMgr + GLint m_fullscreen; + GLint m_accelerated; + GLint m_windowed; + + GLint m_rendererID; + GLint m_displayMask; + GLint m_bufferModes; + GLint m_colorModes; + GLint m_accumModes; + GLint m_depthModes; + GLint m_stencilModes; + + GLint m_maxAuxBuffers; + GLint m_maxSampleBuffers; + GLint m_maxSamples; + GLint m_sampleModes; + GLint m_sampleAlpha; + + GLint m_vidMemory; + GLint m_texMemory; + + uint m_pciVendorID; + uint m_pciDeviceID; + char m_pciModelString[64]; + char m_driverInfoString[64]; + + //--------------------------- OS version related - set up by CocoaMgr + + // OS version found + uint m_osComboVersion; // 0x00XXYYZZ : XX major, YY minor, ZZ minor minor : 10.6.3 --> 0x000A0603. 10.5.8 --> 0x000A0508. + + //--------------------------- shorthands - also set up by CocoaMgr - driven by vendorid / deviceid + + bool m_ati; + bool m_atiR5xx; + bool m_atiR6xx; + bool m_atiR7xx; + bool m_atiR8xx; + bool m_atiNewer; + + bool m_intel; + bool m_intel95x; + bool m_intel3100; + bool m_intelNewer; + + bool m_nv; + bool m_nvG7x; + bool m_nvG8x; + bool m_nvNewer; + + //--------------------------- context query results - left blank in the display DB - but valid in a GLMContext (call ctx->Caps() to get a const ref) + + // booleans + bool m_hasGammaWrites; // aka glGetBooleanv(GL_FRAMEBUFFER_SRGB_CAPABLE_EXT) / glEnable(GL_FRAMEBUFFER_SRGB_EXT) + bool m_hasMixedAttachmentSizes; // aka ARB_fbo in 10.6.3 - test for min OS vers, then exported ext string + bool m_hasBGRA; // aka GL_BGRA vertex attribs in 10.6.3 - - test for min OS vers, then exported ext string + bool m_hasNewFullscreenMode; // aka 10.6.x "big window" fullscreen mode + bool m_hasNativeClipVertexMode; // aka GLSL gl_ClipVertex does not fall back to SW- OS version and folklore-based + bool m_hasOcclusionQuery; // occlusion query: do you speak it ?! + bool m_hasFramebufferBlit; // framebuffer blit: know what I'm sayin?! + bool m_hasPerfPackage1; // means new MTGL, fast OQ, fast uniform upload, NV can resolve flipped (late summer 2010 post 10.6.4 update) + + // counts + int m_maxAniso; // aniso limit - context query + + // other exts + bool m_hasBindableUniforms; + bool m_hasUniformBuffers; + + // runtime options that aren't negotiable once set + bool m_hasDualShaders; // must supply CLI arg "-glmdualshaders" or we go GLSL only + + //--------------------------- " can'ts " - specific problems that need to be worked around + + bool m_cantBlitReliably; // Intel chipsets have problems blitting sRGB sometimes + bool m_cantAttachSRGB; // NV G8x on 10.5.8 can't have srgb tex on FBO color - separate issue from hasGammaWrites + bool m_cantResolveFlipped; // happens on NV in 10.6.4 and prior - console variable "gl_can_resolve_flipped" can overrule + bool m_cantResolveScaled; // happens everywhere per GL spec but may be relaxed some day - console variable "gl_can_resolve_scaled" can overrule + bool m_costlyGammaFlips; // this means that sRGB sampling state affects shader code gen, resulting in state-dependent code regen + + + //--------------------------- " bads " - known bad drivers + bool m_badDriver1064NV; // this is the bad NVIDIA driver on 10.6.4 - stutter, tex corruption, black screen issues +}; + +//////////////////////////////////////////////////////////////////////////////////////// + + +// this stuff is all sitting in glmgrcocoa.mm since it needs to make ObjC calls. + +//=============================================================================== + +// modes, displays, and renderers +// think of renderers as being at the top of a tree. +// each renderer has displays hanging off of it. +// each display has modes hanging off of it. +// the tree is populated on demand and then queried as needed. + +//=============================================================================== + +// GLMDisplayModeInfoFields is in glmdisplay.h + +class GLMDisplayMode +{ +public: + GLMDisplayModeInfoFields m_info; + + GLMDisplayMode( uint width, uint height, uint refreshHz ); + ~GLMDisplayMode( void ); + + void Dump( int which ); +}; + +//=============================================================================== + +// GLMDisplayInfoFields is in glmdisplay.h + +class GLMDisplayInfo +{ +public: + GLMDisplayInfoFields m_info; + std::vector< GLMDisplayMode* > *m_modes; // starts out NULL, set by PopulateModes + + GLMDisplayInfo( CGDirectDisplayID displayID, CGOpenGLDisplayMask displayMask ); + ~GLMDisplayInfo( void ); + + void PopulateModes( void ); + + void Dump( int which ); +}; + +//=============================================================================== + +// GLMRendererInfoFields is in glmdisplay.h + +class GLMRendererInfo +{ +public: + GLMRendererInfoFields m_info; + std::vector< GLMDisplayInfo* > *m_displays; // starts out NULL, set by PopulateDisplays + + GLMRendererInfo ( GLMRendererInfoFields *info ); + ~GLMRendererInfo ( void ); + + void PopulateDisplays( void ); + void Dump( int which ); +}; + +//=============================================================================== + +// this is just a tuple describing fake adapters which are really renderer/display pairings. +// dxabstract bridges the gap between the d3d adapter-centric world and the GL renderer+display world. +// this makes it straightforward to handle cases like two video cards with two displays on one, and one on the other - +// you get three fake adapters which represent each useful screen. + +// the constraint that dxa will have to follow though, is that if the user wants to change their +// display selection for full screen, they would only be able to pick on that has the same underlying renderer. +// can't change fakeAdapter from one to another with different GL renderer under it. Screen hop but no card hop. + +struct GLMFakeAdapter +{ + int m_rendererIndex; + int m_displayIndex; +}; + +class GLMDisplayDB +{ +public: + std::vector< GLMRendererInfo* > *m_renderers; // starts out NULL, set by PopulateRenderers + + std::vector< GLMFakeAdapter > m_fakeAdapters; + + GLMDisplayDB ( void ); + ~GLMDisplayDB ( void ); + + virtual void PopulateRenderers( void ); + virtual void PopulateFakeAdapters( uint realRendererIndex ); // fake adapters = one real adapter times however many displays are on it + virtual void Populate( void ); + + // The info-get functions return false on success. + virtual int GetFakeAdapterCount( void ); + virtual bool GetFakeAdapterInfo( int fakeAdapterIndex, int *rendererOut, int *displayOut, GLMRendererInfoFields *rendererInfoOut, GLMDisplayInfoFields *displayInfoOut ); + + virtual int GetRendererCount( void ); + virtual bool GetRendererInfo( int rendererIndex, GLMRendererInfoFields *infoOut ); + + virtual int GetDisplayCount( int rendererIndex ); + virtual bool GetDisplayInfo( int rendererIndex, int displayIndex, GLMDisplayInfoFields *infoOut ); + + virtual int GetModeCount( int rendererIndex, int displayIndex ); + virtual bool GetModeInfo( int rendererIndex, int displayIndex, int modeIndex, GLMDisplayModeInfoFields *infoOut ); + + virtual void Dump( void ); +}; + + + +#endif diff --git a/external/steamworks/glmgr/glmgr.cpp b/external/steamworks/glmgr/glmgr.cpp new file mode 100644 index 0000000..18c1446 --- /dev/null +++ b/external/steamworks/glmgr/glmgr.cpp @@ -0,0 +1,7113 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ +// +// glmgr.cpp +// +//=============================================================================== + +#include "glmgr.h" +#include "glmdisplay.h" +#include "dxabstract.h" // need to be able to see D3D enums +#include "../SteamWorksExample/gameengineosx.h" + +extern CGameEngineGL *g_engine; // so glmgr (which is C++) can call up to the game engine ObjC object and ask for things.. + +#ifdef __clang__ +#pragma clang diagnostic warning "-Wint-to-pointer-cast" +#pragma clang diagnostic ignored "-Wunused-variable" +#endif + +#ifdef OSX +// Debugger - 10.8 +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + + +//=============================================================================== + +char g_nullFragmentProgramText [] = +{ + "!!ARBfp1.0 \n" + "PARAM black = { 0.0, 0.0, 0.0, 1.0 }; \n" // opaque black + "MOV result.color, black; \n" + "END \n\n\n" + "//GLSLfp\n" + "void main()\n" + "{\n" + "gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n" + "}\n" + +}; + + + + // make dummy programs for doing texture preload via dummy draw +char g_preloadTexVertexProgramText[] = +{ + "//GLSLvp \n" + "#version 120 \n" + "varying vec4 otex; \n" + "void main() \n" + "{ \n" + "vec4 pos = ftransform(); // vec4( 0.1, 0.1, 0.1, 0.1 ); \n" + "vec4 tex = vec4( 0.0, 0.0, 0.0, 0.0 ); \n" + " \n" + "gl_Position = pos; \n" + "otex = tex; \n" + "} \n" +}; + +char g_preload2DTexFragmentProgramText[] = +{ + "//GLSLfp \n" + "#version 120 \n" + "varying vec4 otex; \n" + "//SAMPLERMASK-8000 // may not be needed \n" + "//HIGHWATER-30 // may not be needed \n" + " \n" + "uniform vec4 pc[31]; \n" + "uniform sampler2D sampler15; \n" + " \n" + "void main() \n" + "{ \n" + "vec4 r0; \n" + "r0 = texture2D( sampler15, otex.xy ); \n" + "gl_FragColor = r0; //discard; \n" + "} \n" +}; + +char g_preload3DTexFragmentProgramText[] = +{ + "//GLSLfp \n" + "#version 120 \n" + "varying vec4 otex; \n" + "//SAMPLERMASK-8000 // may not be needed \n" + "//HIGHWATER-30 // may not be needed \n" + " \n" + "uniform vec4 pc[31]; \n" + "uniform sampler3D sampler15; \n" + " \n" + "void main() \n" + "{ \n" + "vec4 r0; \n" + "r0 = texture3D( sampler15, otex.xyz ); \n" + "gl_FragColor = r0; //discard; \n" + "} \n" +}; + +char g_preloadCubeTexFragmentProgramText[] = +{ + "//GLSLfp \n" + "#version 120 \n" + "varying vec4 otex; \n" + "//SAMPLERMASK-8000 // may not be needed \n" + "//HIGHWATER-30 // may not be needed \n" + " \n" + "uniform vec4 pc[31]; \n" + "uniform samplerCube sampler15; \n" + " \n" + "void main() \n" + "{ \n" + "vec4 r0; \n" + "r0 = textureCube( sampler15, otex.xyz ); \n" + "gl_FragColor = r0; //discard; \n" + "} \n" +}; + + + + + + + +//=============================================================================== +// helper routines for debug + +static bool hasnonzeros( float *values, int count ) +{ + for( int i=0; i [ %10.5f %10.5f %10.5f %10.5f ]", + baseSlotNumber+islot, + row[0],row[1],row[2],row[3], + col[0],col[1],col[2],col[3] + )); + } + else + { + if (islot<3) + { + GLMPRINTF(( "-D- %03d: [ %10.5f %10.5f %10.5f %10.5f ] T=> [ %10.5f %10.5f %10.5f ]", + baseSlotNumber+islot, + row[0],row[1],row[2],row[3], + col[0],col[1],col[2] + )); + } + else + { + GLMPRINTF(( "-D- %03d: T=> [ %10.5f %10.5f %10.5f ]", + baseSlotNumber+islot, + col[0],col[1],col[2] + )); + } + } + } + GLMPRINTSTR(("-D-")); + } + else + { + GLMPRINTF(("-D- %s - (all 0.0)", label )); + } + +} + + +static void transform_dp4( float *in4, float *m00, int slots, float *out4 ) +{ + // m00 points to a column. + // each DP is one column of the matrix ( m00[4*n] + // if we are passed a three slot matrix, this is three columns, the source W plays into all three columns, but we must set the final output W to 1 ? + for( int n=0; nm_ctx ); + if (cgl_err) + { + // give up + GLMStop(); + } +} + +GLMContext *GLMgr::GetCurrentContext( void ) +{ + CGLContextObj ctx = CGLGetCurrentContext(); + + GLint glm_context_link = 0; + + CGLGetParameter( ctx, kCGLCPClientStorage, &glm_context_link ); + + if ( glm_context_link ) + { + return (GLMContext*)(uintptr_t)glm_context_link; + } + else + { + return NULL; + } +} + + +//=============================================================================== +// GLMContext public methods +void GLMContext::MakeCurrent( void ) +{ +// GLM_FUNC; + + CGLSetCurrentContext( m_ctx ); +} + +void GLMContext::CheckCurrent( void ) +{ + #if 1 +// GLM_FUNC; + + // probably want to make this a no-op for release builds + // but we can't, because someone is messing with current context and not sure where yet + CGLContextObj curr = CGLGetCurrentContext(); + if (curr != m_ctx) + { + if (1 /*!CommandLine()->FindParm("-hushasserts") */) + { + Assert( !"Current context mismatch"); + + #if GLMDEBUG + Debugger(); + #endif + } + MakeCurrent(); // you're welcome + } + #endif +} + + +const GLMRendererInfoFields& GLMContext::Caps( void ) +{ + return m_caps; +} + +void GLMContext::DumpCaps( void ) +{ + /* + #define dumpfield( fff ) printf( "\n "#fff" : %d", (int) m_caps.fff ) + #define dumpfield_hex( fff ) printf( "\n "#fff" : 0x%08x", (int) m_caps.fff ) + #define dumpfield_str( fff ) printf( "\n "#fff" : %s", m_caps.fff ) + */ + + #define dumpfield( fff ) printf( "\n %-30s : %d", #fff, (int) m_caps.fff ) + #define dumpfield_hex( fff ) printf( "\n %-30s : 0x%08x", #fff, (int) m_caps.fff ) + #define dumpfield_str( fff ) printf( "\n %-30s : %s", #fff, m_caps.fff ) + + printf("\n-------------------------------- context caps for context %p", this); + + dumpfield( m_fullscreen ); + dumpfield( m_accelerated ); + dumpfield( m_windowed ); + dumpfield_hex( m_rendererID ); + dumpfield( m_displayMask ); + dumpfield( m_bufferModes ); + dumpfield( m_colorModes ); + dumpfield( m_accumModes ); + dumpfield( m_depthModes ); + dumpfield( m_stencilModes ); + dumpfield( m_maxAuxBuffers ); + dumpfield( m_maxSampleBuffers ); + dumpfield( m_maxSamples ); + dumpfield( m_sampleModes ); + dumpfield( m_sampleAlpha ); + dumpfield_hex( m_vidMemory ); + dumpfield_hex( m_texMemory ); + + dumpfield_hex( m_pciVendorID ); + dumpfield_hex( m_pciDeviceID ); + dumpfield_str( m_pciModelString ); + dumpfield_str( m_driverInfoString ); + + printf( "\n m_osComboVersion: 0x%08x (%d.%d.%d)", m_caps.m_osComboVersion, (m_caps.m_osComboVersion>>16)&0xFF, (m_caps.m_osComboVersion>>8)&0xFF, (m_caps.m_osComboVersion)&0xFF ); + + dumpfield( m_ati ); + if (m_caps.m_ati) + { + dumpfield( m_atiR5xx ); + dumpfield( m_atiR6xx ); + dumpfield( m_atiR7xx ); + dumpfield( m_atiR8xx ); + dumpfield( m_atiNewer ); + } + + dumpfield( m_intel ); + if (m_caps.m_intel) + { + dumpfield( m_intel95x ); + dumpfield( m_intel3100 ); + dumpfield( m_intelNewer ); + } + + dumpfield( m_nv ); + if (m_caps.m_nv) + { + //dumpfield( m_nvG7x ); + dumpfield( m_nvG8x ); + dumpfield( m_nvNewer ); + } + + dumpfield( m_hasGammaWrites ); + dumpfield( m_hasMixedAttachmentSizes ); + dumpfield( m_hasBGRA ); + dumpfield( m_hasNewFullscreenMode ); + dumpfield( m_hasNativeClipVertexMode ); + dumpfield( m_maxAniso ); + dumpfield( m_hasBindableUniforms ); + dumpfield( m_hasUniformBuffers ); + dumpfield( m_hasPerfPackage1 ); + + dumpfield( m_cantBlitReliably ); + dumpfield( m_cantAttachSRGB ); + dumpfield( m_cantResolveFlipped ); + dumpfield( m_cantResolveScaled ); + dumpfield( m_costlyGammaFlips ); + dumpfield( m_badDriver1064NV ); + + printf("\n--------------------------------"); + + #undef dumpfield + #undef dumpfield_hex + #undef dumpfield_str +} + +void DefaultSamplingParams( GLMTexSamplingParams *samp, GLMTexLayoutKey *key ) +{ + memset( samp, 0, sizeof(*samp) ); + + // Default to black, it may make drivers happier + samp->m_borderColor[0] = 0.0f; + samp->m_borderColor[0] = 0.0f; + samp->m_borderColor[0] = 0.0f; + samp->m_borderColor[0] = 1.0f; + + // generally speaking.. + // if it's a render target, default it to GL_CLAMP_TO_BORDER, else GL_REPEAT + // if it has mipmaps, default the min filter to GL_LINEAR_MIPMAP_LINEAR, else GL_LINEAR + + // ** none of these really matter all that much because the first time we go to render, the d3d sampler state will be consulted + // and applied directly to the tex object without regard to any previous values.. + + GLenum rtclamp = GL_CLAMP_TO_EDGE; //GL_CLAMP_TO_BORDER + + switch( key->m_texFlags & (kGLMTexRenderable|kGLMTexMipped) ) + { + case 0: + // -- mipped, -- renderable + samp->m_addressModes[0] = GL_REPEAT; + samp->m_addressModes[1] = GL_REPEAT; + samp->m_addressModes[2] = GL_REPEAT; + + samp->m_magFilter = GL_LINEAR; + samp->m_minFilter = GL_LINEAR; + break; + + case kGLMTexRenderable: + // -- mipped, ++ renderable + samp->m_addressModes[0] = rtclamp; + samp->m_addressModes[1] = rtclamp; + samp->m_addressModes[2] = rtclamp; + + samp->m_magFilter = GL_LINEAR; + samp->m_minFilter = GL_LINEAR; + break; + + case kGLMTexMipped: + // ++ mipped, -- renderable + samp->m_addressModes[0] = GL_REPEAT; + samp->m_addressModes[1] = GL_REPEAT; + samp->m_addressModes[2] = GL_REPEAT; + + samp->m_magFilter = GL_LINEAR; + samp->m_minFilter = GL_LINEAR_MIPMAP_LINEAR; // was GL_NEAREST_MIPMAP_LINEAR; + break; + + case kGLMTexRenderable | kGLMTexMipped: + // ++ mipped, ++ renderable + samp->m_addressModes[0] = rtclamp; + samp->m_addressModes[1] = rtclamp; + samp->m_addressModes[2] = rtclamp; + + samp->m_magFilter = GL_LINEAR; + samp->m_minFilter = GL_LINEAR_MIPMAP_LINEAR; // was GL_NEAREST_MIPMAP_LINEAR; + break; + + } + + samp->m_mipmapBias = 0.0f; + + samp->m_minMipLevel = 0; // this drives GL_TEXTURE_MIN_LOD - i.e. lowest MIP selection index clamp (largest size), not "slice defined" boundary + samp->m_maxMipLevel = 16; // this drives GL_TEXTURE_MAX_LOD - i.e. highest MIP selection clamp (smallest size), not "slice defined" boundary + + samp->m_maxAniso = 1; + samp->m_compareMode = GL_NONE; // only for depth or stencil tex + + samp->m_srgb = false; +} + +CGLMTex *GLMContext::NewTex( GLMTexLayoutKey *key, const char *debugLabel ) +{ + //hushed GLM_FUNC; + MakeCurrent(); + + // get a layout based on the key + GLMTexLayout *layout = m_texLayoutTable->NewLayoutRef( key ); + + GLMTexSamplingParams defsamp; + DefaultSamplingParams( &defsamp, key ); + + CGLMTex *tex = new CGLMTex( this, layout, &defsamp, debugLabel ); + + return tex; +} + +void GLMContext::DelTex( CGLMTex *tex ) +{ + //hushed GLM_FUNC; + MakeCurrent(); + + for( int i=0; iBindTexToTMU( NULL, i ); + m_samplers[i].m_boundTex = NULL; // for clarity + + tex->m_bindPoints &= ~(1<m_rtAttachCount !=0) + { + // leak it and complain - we may have to implement a deferred-delete system for tex like these + + GLMPRINTF(("-D- ################## Leaking tex %08x [ %s ] - was attached for drawing at time of delete",tex, tex->m_layout->m_layoutSummary )); + + #if 0 + // can't actually do this yet as the draw calls will tank + FOR_EACH_VEC( m_fboTable, i ) + { + CGLMFBO *fbo = m_fboTable[i]; + fbo->TexScrub( tex ); + } + tex->m_rtAttachCount = 0; + #endif + } + else + { + delete tex; + } +} + + + + // push and pop attrib when blit has mixed srgb source and dest? +//ConVar gl_radar7954721_workaround_mixed ( "gl_radar7954721_workaround_mixed", "1" ); +int gl_radar7954721_workaround_mixed = 1; + + // push and pop attrib on any blit? +//ConVar gl_radar7954721_workaround_all ( "gl_radar7954721_workaround_all", "0" ); +int gl_radar7954721_workaround_all = 0; + + // what attrib mask to use ? +//ConVar gl_radar7954721_workaround_maskval ( "gl_radar7954721_workaround_maskval", "0" ); +int gl_radar7954721_workaround_maskval = 0; + +enum eBlitFormatClass +{ + eColor, + eDepth, // may not get used. not sure.. + eDepthStencil +}; + +uint glAttachFromClass[ 3 ] = { GL_COLOR_ATTACHMENT0_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_DEPTH_STENCIL_ATTACHMENT_EXT }; + +void glScrubFBO ( GLenum target ) +{ + glFramebufferRenderbufferEXT ( target, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, 0); GLMCheckError(); + glFramebufferRenderbufferEXT ( target, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0); GLMCheckError(); + glFramebufferRenderbufferEXT ( target, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0); GLMCheckError(); + + glFramebufferTexture2DEXT ( target, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, 0, 0 ); GLMCheckError(); + glFramebufferTexture2DEXT ( target, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0 ); GLMCheckError(); + glFramebufferTexture2DEXT ( target, GL_STENCIL_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0 ); GLMCheckError(); +} + +void glAttachRBOtoFBO ( GLenum target, eBlitFormatClass formatClass, uint rboName ) +{ + switch( formatClass ) + { + case eColor: + glFramebufferRenderbufferEXT ( target, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, rboName); GLMCheckError(); + break; + + case eDepth: + glFramebufferRenderbufferEXT ( target, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, rboName); GLMCheckError(); + break; + + case eDepthStencil: + glFramebufferRenderbufferEXT ( target, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, rboName); GLMCheckError(); + glFramebufferRenderbufferEXT ( target, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, rboName); GLMCheckError(); + break; + } +} + +void glAttachTex2DtoFBO ( GLenum target, eBlitFormatClass formatClass, uint texName, uint texMip ) +{ + switch( formatClass ) + { + case eColor: + glFramebufferTexture2DEXT ( target, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texName, texMip ); GLMCheckError(); + break; + + case eDepth: + glFramebufferTexture2DEXT ( target, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, texName, texMip ); GLMCheckError(); + break; + + case eDepthStencil: + glFramebufferTexture2DEXT ( target, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, texName, texMip ); GLMCheckError(); + glFramebufferTexture2DEXT ( target, GL_STENCIL_ATTACHMENT_EXT, GL_TEXTURE_2D, texName, texMip ); GLMCheckError(); + break; + } +} + +//ConVar gl_can_resolve_flipped("gl_can_resolve_flipped", "0" ); +int gl_can_resolve_flipped = 0; + +//ConVar gl_cannot_resolve_flipped("gl_cannot_resolve_flipped", "0" ); +int gl_cannot_resolve_flipped = 0; + + +// these are only consulted if the m_cant_resolve_scaled cap bool is false. + +//ConVar gl_minify_resolve_mode("gl_minify_resolve_mode", "1" ); // if scaled resolve available, for downscaled resolve blits only (i.e. internal blits) +int gl_minify_resolve_mode = 1; + +//ConVar gl_magnify_resolve_mode("gl_magnify_resolve_mode", "2" ); // if scaled resolve available, for upscaled resolve blits only +int gl_magnify_resolve_mode = 2; + + + // 0 == old style, two steps + // 1 == faster, one step blit aka XGL_SCALED_RESOLVE_FASTEST_EXT - if available. + // 2 == faster, one step blit aka XGL_SCALED_RESOLVE_NICEST_EXT - if available. + +unsigned short foo[4]; + +void GLMContext::Blit2( CGLMTex *srcTex, GLMRect *srcRect, int srcFace, int srcMip, CGLMTex *dstTex, GLMRect *dstRect, int dstFace, int dstMip, uint filter ) +{ + Assert( srcFace == 0 ); + Assert( dstFace == 0 ); + +// glColor4usv( foo ); + + //----------------------------------------------------------------- format assessment + + eBlitFormatClass formatClass; + uint blitMask= 0; + + switch( srcTex->m_layout->m_format->m_glDataFormat ) + { + case GL_BGRA: case GL_RGB: case GL_RGBA: case GL_ALPHA: case GL_LUMINANCE: case GL_LUMINANCE_ALPHA: + formatClass = eColor; + blitMask = GL_COLOR_BUFFER_BIT; + break; + + case GL_DEPTH_COMPONENT: + formatClass = eDepth; + blitMask = GL_DEPTH_BUFFER_BIT; + break; + + case GL_DEPTH_STENCIL_EXT: + formatClass = eDepthStencil; + blitMask = GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT; + break; + + default: + Assert(!"Unsupported format for blit" ); + GLMStop(); + break; + } + + //----------------------------------------------------------------- blit assessment + + + bool blitResolves = srcTex->m_rboName != 0; + bool blitScales = ((srcRect->xmax - srcRect->xmin) != (dstRect->xmax - dstRect->xmin)) || ((srcRect->ymax - srcRect->ymin) != (dstRect->ymax - dstRect->ymin)); + + bool blitToBack = (dstTex == NULL); + bool blitFlips = blitToBack; // implicit y-flip upon blit to GL_BACK supplied + + //should we support blitFromBack ? + + bool srcGamma = srcTex && ((srcTex->m_layout->m_key.m_texFlags & kGLMTexSRGB) != 0); + bool dstGamma = dstTex && ((dstTex->m_layout->m_key.m_texFlags & kGLMTexSRGB) != 0); + + bool doPushPop = (srcGamma != dstGamma) && gl_radar7954721_workaround_mixed/*.GetInt()*/ && m_caps.m_nv; // workaround for cross gamma blit problems on NV + // ^^ need to re-check this on some post-10.6.3 build on NV to see if it was fixed + + if (doPushPop) + { + glPushAttrib( 0 ); + } + + //----------------------------------------------------------------- figure out the plan + + bool blitTwoStep = false; // think positive + + // each subsequent segment here can only set blitTwoStep, not clear it. + // the common case where these get hit is resolve out to presentation + // there may be GL extensions or driver revisions which start doing these safely. + // ideally many blits internally resolve without scaling and can thus go direct without using the scratch tex. + + if (blitResolves && (blitFlips||blitToBack)) // flips, blit to back, same thing (for now) + { + if( gl_cannot_resolve_flipped/*.GetInt()*/ ) + { + blitTwoStep = true; + } + else if (!gl_can_resolve_flipped/*.GetInt()*/) + { + blitTwoStep = blitTwoStep || m_caps.m_cantResolveFlipped; // if neither convar renders an opinion, fall back to the caps to decide if we have to two-step. + } + } + + // only consider trying to use the scaling resolve filter, + // if we are confident we are not headed for two step mode already. + if (!blitTwoStep) + { + if (blitResolves && blitScales) + { + if (m_caps.m_cantResolveScaled) + { + // filter is unchanged, two step mode switches on + blitTwoStep = true; + } + else + { + bool blitScalesDown = ((srcRect->xmax - srcRect->xmin) > (dstRect->xmax - dstRect->xmin)) || ((srcRect->ymax - srcRect->ymin) > (dstRect->ymax - dstRect->ymin)); + int mode = (blitScalesDown) ? gl_minify_resolve_mode/*.GetInt()*/ : gl_magnify_resolve_mode/*.GetInt()*/; + + // roughly speaking, resolve blits that minify represent setup for special effects ("copy framebuffer to me") + // resolve blits that magnify are almost always on the final present in the case where remder size < display size + + switch( mode ) + { + case 0: + default: + // filter is unchanged, two step mode + blitTwoStep = true; + break; + + case 1: + // filter goes to fastest, one step mode + blitTwoStep = false; + filter = XGL_SCALED_RESOLVE_FASTEST_EXT; + break; + + case 2: + // filter goes to nicest, one step mode + blitTwoStep = false; + filter = XGL_SCALED_RESOLVE_NICEST_EXT; + break; + } + } + } + } + + //----------------------------------------------------------------- save old scissor state and disable scissor + GLScissorEnable_t oldsciss,newsciss; + m_ScissorEnable.Read( &oldsciss, 0 ); + + // turn off scissor + newsciss.enable = false; + m_ScissorEnable.Write( &newsciss, true, true ); + + //----------------------------------------------------------------- fork in the road, depending on two-step or not + if (blitTwoStep) + { + // a resolve that can't be done directly due to constraints on scaling or flipping. + + // bind scratch FBO0 to read, scrub it, attach RBO + BindFBOToCtx ( m_scratchFBO[0], GL_READ_FRAMEBUFFER_EXT ); GLMCheckError(); + glScrubFBO ( GL_READ_FRAMEBUFFER_EXT ); + glAttachRBOtoFBO ( GL_READ_FRAMEBUFFER_EXT, formatClass, srcTex->m_rboName ); + + // bind scratch FBO1 to write, scrub it, attach scratch tex + BindFBOToCtx ( m_scratchFBO[1], GL_DRAW_FRAMEBUFFER_EXT ); GLMCheckError(); + glScrubFBO ( GL_DRAW_FRAMEBUFFER_EXT ); + glAttachTex2DtoFBO ( GL_DRAW_FRAMEBUFFER_EXT, formatClass, srcTex->m_texName, 0 ); + + // set read and draw buffers appropriately + glReadBuffer ( glAttachFromClass[formatClass] ); + glDrawBuffer ( glAttachFromClass[formatClass] ); + + // blit#1 - to resolve to scratch + // implicitly means no scaling, thus will be done with NEAREST sampling + + GLenum resolveFilter = GL_NEAREST; + + glBlitFramebufferEXT( 0, 0, srcTex->m_layout->m_key.m_xSize, srcTex->m_layout->m_key.m_ySize, + 0, 0, srcTex->m_layout->m_key.m_xSize, srcTex->m_layout->m_key.m_ySize, // same source and dest rect, whole surface + blitMask, resolveFilter ); + GLMCheckError(); + + // FBO1 now holds the interesting content. + // scrub FBO0, bind FBO1 to READ, fall through to next stage of blit where 1 goes onto 0 (or BACK) + + glScrubFBO ( GL_READ_FRAMEBUFFER_EXT ); // zap FBO0 + BindFBOToCtx ( m_scratchFBO[1], GL_READ_FRAMEBUFFER_EXT ); GLMCheckError(); + } + else + { + // arrange source surface on FBO1 for blit directly to dest (which could be FBO0 or BACK) + BindFBOToCtx ( m_scratchFBO[1], GL_READ_FRAMEBUFFER_EXT ); GLMCheckError(); + glScrubFBO ( GL_READ_FRAMEBUFFER_EXT ); + if (blitResolves) + { + glAttachRBOtoFBO( GL_READ_FRAMEBUFFER_EXT, formatClass, srcTex->m_rboName ); + } + else + { + glAttachTex2DtoFBO( GL_READ_FRAMEBUFFER_EXT, formatClass, srcTex->m_texName, srcMip ); + } + + glReadBuffer( glAttachFromClass[formatClass] ); + } + + //----------------------------------------------------------------- zero or one blits may have happened above, whichever took place, FBO1 is now on read + + bool yflip = false; + if (blitToBack) + { + // backbuffer is special - FBO0 is left out (either scrubbed already, or not used) + + BindFBOToCtx ( NULL, GL_DRAW_FRAMEBUFFER_EXT ); GLMCheckError(); + glDrawBuffer ( GL_BACK ); GLMCheckError(); + + yflip = true; + } + else + { + // not going to GL_BACK - use FBO0. set up dest tex or RBO on it. i.e. it's OK to blit from MSAA to MSAA if needed, though unlikely. + Assert( dstTex != NULL ); + + BindFBOToCtx ( m_scratchFBO[0], GL_DRAW_FRAMEBUFFER_EXT ); GLMCheckError(); + glScrubFBO ( GL_DRAW_FRAMEBUFFER_EXT ); + + if (dstTex->m_rboName) + { + glAttachRBOtoFBO( GL_DRAW_FRAMEBUFFER_EXT, formatClass, dstTex->m_rboName ); + } + else + { + glAttachTex2DtoFBO( GL_DRAW_FRAMEBUFFER_EXT, formatClass, dstTex->m_texName, dstMip ); + } + + glDrawBuffer ( glAttachFromClass[formatClass] ); GLMCheckError(); + } + + // final blit + + // i think in general, if we are blitting same size, gl_nearest is the right filter to pass. + // this re-steering won't kick in if there is scaling or a special scaled resolve going on. + if (!blitScales) + { + // steer it + filter = GL_NEAREST; + } + + // this is blit #1 or #2 depending on what took place above. + if (yflip) + { + glBlitFramebufferEXT( srcRect->xmin, srcRect->ymin, srcRect->xmax, srcRect->ymax, + dstRect->xmin, dstRect->ymax, dstRect->xmax, dstRect->ymin, // note dest Y's are flipped + blitMask, filter ); + } + else + { + glBlitFramebufferEXT( srcRect->xmin, srcRect->ymin, srcRect->xmax, srcRect->ymax, + dstRect->xmin, dstRect->ymin, dstRect->xmax, dstRect->ymax, + blitMask, filter ); + } + GLMCheckError(); + + //----------------------------------------------------------------- scrub READ and maybe DRAW FBO, and unbind + + glScrubFBO ( GL_READ_FRAMEBUFFER_EXT ); + BindFBOToCtx ( NULL, GL_READ_FRAMEBUFFER_EXT ); GLMCheckError(); + if (!blitToBack) + { + glScrubFBO ( GL_DRAW_FRAMEBUFFER_EXT ); + BindFBOToCtx ( NULL, GL_DRAW_FRAMEBUFFER_EXT ); GLMCheckError(); + } + + //----------------------------------------------------------------- restore GLM's drawing FBO + + // restore GLM drawing FBO + BindFBOToCtx( m_drawingFBO, GL_READ_FRAMEBUFFER_EXT ); GLMCheckError(); + BindFBOToCtx( m_drawingFBO, GL_DRAW_FRAMEBUFFER_EXT ); GLMCheckError(); + + if (doPushPop) + { + glPopAttrib( ); + } + + + //----------------------------------------------------------------- restore old scissor state + m_ScissorEnable.Write( &oldsciss, true, true ); +} + + +void GLMContext::BlitTex( CGLMTex *srcTex, GLMRect *srcRect, int srcFace, int srcMip, CGLMTex *dstTex, GLMRect *dstRect, int dstFace, int dstMip, GLenum filter, bool useBlitFB ) +{ + switch( srcTex->m_layout->m_format->m_glDataFormat ) + { + case GL_BGRA: + case GL_RGB: + case GL_RGBA: + case GL_ALPHA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + #if 0 + if (GLMKnob("caps-key",NULL) > 0.0) + { + useBlitFB = false; + } + #endif + + if ( m_caps.m_cantBlitReliably ) // this is referring to a problem with the x3100.. + { + useBlitFB = false; + } + break; + } + + if (0) + { + GLMPRINTF(("-D- Blit from %d %d %d %d to %d %d %d %d", + srcRect->xmin, srcRect->ymin, srcRect->xmax, srcRect->ymax, + dstRect->xmin, dstRect->ymin, dstRect->xmax, dstRect->ymax + )); + + GLMPRINTF(( "-D- src tex layout is %s", srcTex->m_layout->m_layoutSummary )); + GLMPRINTF(( "-D- dst tex layout is %s", dstTex->m_layout->m_layoutSummary )); + } + + int pushed = 0; + uint pushmask = gl_radar7954721_workaround_maskval/*.GetInt()*/; + //GL_COLOR_BUFFER_BIT + //| GL_CURRENT_BIT + //| GL_ENABLE_BIT + //| GL_FOG_BIT + //| GL_PIXEL_MODE_BIT + //| GL_SCISSOR_BIT + //| GL_STENCIL_BUFFER_BIT + //| GL_TEXTURE_BIT + //GL_VIEWPORT_BIT + //; + + if (gl_radar7954721_workaround_all/*.GetInt()*/!=0) + { + glPushAttrib( pushmask ); + pushed++; + } + else + { + bool srcGamma = (srcTex->m_layout->m_key.m_texFlags & kGLMTexSRGB) != 0; + bool dstGamma = (dstTex->m_layout->m_key.m_texFlags & kGLMTexSRGB) != 0; + + if (srcGamma != dstGamma) + { + if (gl_radar7954721_workaround_mixed/*.GetInt()*/) + { + glPushAttrib( pushmask ); + pushed++; + } + } + } + + if (useBlitFB) + { + // state we need to save + // current setting of scissor + // current setting of the drawing fbo (no explicit save, it's in the context) + GLScissorEnable_t oldsciss,newsciss; + m_ScissorEnable.Read( &oldsciss, 0 ); + + // remember to restore m_drawingFBO at end of effort + + // setup + // turn off scissor + newsciss.enable = false; + m_ScissorEnable.Write( &newsciss, true, true ); + + // select which attachment enum we're going to use for the blit + // default to color0, unless it's a depth or stencil flava + + Assert( srcTex->m_layout->m_format->m_glDataFormat == dstTex->m_layout->m_format->m_glDataFormat ); + + EGLMFBOAttachment attachIndex = (EGLMFBOAttachment)0; + GLenum attachIndexGL = 0; + GLuint blitMask = 0; + switch( srcTex->m_layout->m_format->m_glDataFormat ) + { + case GL_BGRA: + case GL_RGB: + case GL_RGBA: + case GL_ALPHA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + attachIndex = kAttColor0; + attachIndexGL = GL_COLOR_ATTACHMENT0_EXT; + blitMask = GL_COLOR_BUFFER_BIT; + break; + + case GL_DEPTH_COMPONENT: + attachIndex = kAttDepth; + attachIndexGL = GL_DEPTH_ATTACHMENT_EXT; + blitMask = GL_DEPTH_BUFFER_BIT; + break; + + case GL_DEPTH_STENCIL_EXT: + attachIndex = kAttDepthStencil; + attachIndexGL = GL_DEPTH_STENCIL_ATTACHMENT_EXT; + blitMask = GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT; + break; + + default: + Assert(0); + break; + } + + // set the read fb, attach read tex at appropriate attach point, set read buffer + BindFBOToCtx( m_blitReadFBO, GL_READ_FRAMEBUFFER_EXT ); + GLMCheckError(); + + GLMFBOTexAttachParams attparams; + attparams.m_tex = srcTex; + attparams.m_face = srcFace; + attparams.m_mip = srcMip; + attparams.m_zslice = 0; + m_blitReadFBO->TexAttach( &attparams, attachIndex, GL_READ_FRAMEBUFFER_EXT ); + GLMCheckError(); + + glReadBuffer( attachIndexGL ); + GLMCheckError(); + + + // set the write fb and buffer, and attach write tex + BindFBOToCtx( m_blitDrawFBO, GL_DRAW_FRAMEBUFFER_EXT ); + GLMCheckError(); + + attparams.m_tex = dstTex; + attparams.m_face = dstFace; + attparams.m_mip = dstMip; + attparams.m_zslice = 0; + m_blitDrawFBO->TexAttach( &attparams, attachIndex, GL_DRAW_FRAMEBUFFER_EXT ); + GLMCheckError(); + + glDrawBuffer( attachIndexGL ); + GLMCheckError(); + + // do the blit + glBlitFramebufferEXT( srcRect->xmin, srcRect->ymin, srcRect->xmax, srcRect->ymax, + dstRect->xmin, dstRect->ymin, dstRect->xmax, dstRect->ymax, + blitMask, filter ); + GLMCheckError(); + + // cleanup + // unset the read fb and buffer, detach read tex + // unset the write fb and buffer, detach write tex + + m_blitReadFBO->TexDetach( attachIndex, GL_READ_FRAMEBUFFER_EXT ); + GLMCheckError(); + + m_blitDrawFBO->TexDetach( attachIndex, GL_DRAW_FRAMEBUFFER_EXT ); + GLMCheckError(); + + // put the original FB back in place (both read and draw) + // this bind will hit both read and draw bindings + BindFBOToCtx( m_drawingFBO, GL_READ_FRAMEBUFFER_EXT ); + GLMCheckError(); + BindFBOToCtx( m_drawingFBO, GL_DRAW_FRAMEBUFFER_EXT ); + GLMCheckError(); + + // set the read and write buffers back to... what ? does it matter for anything but copies ? don't worry about it + + // restore the scissor state + m_ScissorEnable.Write( &oldsciss, true, true ); + } + else + { + // textured quad style + + // we must attach the dest tex as the color buffer on the blit draw FBO + // so that means we need to re-set the drawing FBO on exit + + EGLMFBOAttachment attachIndex = (EGLMFBOAttachment)0; + GLenum attachIndexGL = 0; + switch( srcTex->m_layout->m_format->m_glDataFormat ) + { + case GL_BGRA: + case GL_RGB: + case GL_RGBA: + case GL_ALPHA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + attachIndex = kAttColor0; + attachIndexGL = GL_COLOR_ATTACHMENT0_EXT; + break; + + default: + Assert(!"Can't blit that format"); + break; + } + + BindFBOToCtx( m_blitDrawFBO, GL_DRAW_FRAMEBUFFER_EXT ); + GLMCheckError(); + + GLMFBOTexAttachParams attparams; + attparams.m_tex = dstTex; + attparams.m_face = dstFace; + attparams.m_mip = dstMip; + attparams.m_zslice = 0; + m_blitDrawFBO->TexAttach( &attparams, attachIndex, GL_DRAW_FRAMEBUFFER_EXT ); + GLMCheckError(); + + glDrawBuffer( attachIndexGL ); + GLMCheckError(); + + // attempt to just set states directly the way we want them, then use the latched states to repair them afterward. + this->NullProgram(); // out of program mode + + glDisable ( GL_ALPHA_TEST ); + glDisable ( GL_CULL_FACE ); + glDisable ( GL_POLYGON_OFFSET_FILL ); + glDisable ( GL_SCISSOR_TEST ); + + glDisable ( GL_CLIP_PLANE0 ); + glDisable ( GL_CLIP_PLANE1 ); + + glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE ); + glDisable ( GL_BLEND ); + + glDepthMask ( GL_FALSE ); + glDisable ( GL_DEPTH_TEST ); + + glDisable ( GL_STENCIL_TEST ); + glStencilMask ( GL_FALSE ); + + GLMCheckError(); + + // now do the unlit textured quad... + glActiveTexture( GL_TEXTURE0 ); + glBindTexture( GL_TEXTURE_2D, srcTex->m_texName ); + GLMCheckError(); + + glEnable(GL_TEXTURE_2D); + GLMCheckError(); + + // immediate mode is fine + + float topv = 1.0; + float botv = 0.0; + + glBegin(GL_QUADS); + glTexCoord2f ( 0.0, botv ); + glVertex3f ( -1.0, -1.0, 0.0 ); + + glTexCoord2f ( 1.0, botv ); + glVertex3f ( 1.0, -1.0, 0.0 ); + + glTexCoord2f ( 1.0, topv ); + glVertex3f ( 1.0, 1.0, 0.0 ); + + glTexCoord2f ( 0.0, topv ); + glVertex3f ( -1.0, 1.0, 0.0 ); + glEnd(); + GLMCheckError(); + + glBindTexture( GL_TEXTURE_2D, 0 ); + GLMCheckError(); + + glDisable(GL_TEXTURE_2D); + GLMCheckError(); + + // invalidate tex binding 0 so it gets reset + m_samplers[0].m_boundTex = NULL; + + // leave active program empty - flush draw states will fix + + // then restore states using the scoreboard + + m_AlphaTestEnable.Flush( true ); + m_AlphaToCoverageEnable.Flush( true ); + m_CullFaceEnable.Flush( true ); + m_DepthBias.Flush( true ); + m_ScissorEnable.Flush( true ); + + m_ClipPlaneEnable.FlushIndex( 0, true ); + m_ClipPlaneEnable.FlushIndex( 1, true ); + + m_ColorMaskSingle.Flush( true ); + m_BlendEnable.Flush( true ); + + m_DepthMask.Flush( true ); + m_DepthTestEnable.Flush( true ); + + m_StencilWriteMask.Flush( true ); + m_StencilTestEnable.Flush( true ); + + // unset the write fb and buffer, detach write tex + + m_blitDrawFBO->TexDetach( attachIndex, GL_DRAW_FRAMEBUFFER_EXT ); + GLMCheckError(); + + // put the original FB back in place (both read and draw) + BindFBOToCtx( m_drawingFBO, GL_READ_FRAMEBUFFER_EXT ); + GLMCheckError(); + BindFBOToCtx( m_drawingFBO, GL_DRAW_FRAMEBUFFER_EXT ); + GLMCheckError(); + } + + while(pushed) + { + glPopAttrib(); + pushed--; + } +} + +void GLMContext::ResolveTex( CGLMTex *tex, bool forceDirty ) +{ + // only run resolve if it's (a) possible and (b) dirty or force-dirtied + if ( (tex->m_rboName) && ((tex->m_rboDirty)||forceDirty) ) + { + // state we need to save + // current setting of scissor + // current setting of the drawing fbo (no explicit save, it's in the context) + GLScissorEnable_t oldsciss,newsciss; + m_ScissorEnable.Read( &oldsciss, 0 ); + + // remember to restore m_drawingFBO at end of effort + + // setup + // turn off scissor + newsciss.enable = false; + m_ScissorEnable.Write( &newsciss, true, true ); + + // select which attachment enum we're going to use for the blit + // default to color0, unless it's a depth or stencil flava + + // for resolve, only handle a modest subset of the possible formats + EGLMFBOAttachment attachIndex = (EGLMFBOAttachment)0; + (void)attachIndex; + + GLenum attachIndexGL = 0; + GLuint blitMask = 0; + switch( tex->m_layout->m_format->m_glDataFormat ) + { + case GL_BGRA: + case GL_RGB: + case GL_RGBA: + // case GL_ALPHA: + // case GL_LUMINANCE: + // case GL_LUMINANCE_ALPHA: + attachIndex = kAttColor0; + attachIndexGL = GL_COLOR_ATTACHMENT0_EXT; + blitMask = GL_COLOR_BUFFER_BIT; + break; + + // case GL_DEPTH_COMPONENT: + // attachIndex = kAttDepth; + // attachIndexGL = GL_DEPTH_ATTACHMENT_EXT; + // blitMask = GL_DEPTH_BUFFER_BIT; + // break; + + case GL_DEPTH_STENCIL_EXT: + attachIndex = kAttDepthStencil; + attachIndexGL = GL_DEPTH_STENCIL_ATTACHMENT_EXT; + blitMask = GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT; + break; + + default: + Assert(!"Unsupported format for MSAA resolve" ); + break; + } + + + // set the read fb, attach read RBO at appropriate attach point, set read buffer + BindFBOToCtx( m_blitReadFBO, GL_READ_FRAMEBUFFER_EXT ); + GLMCheckError(); + + // going to avoid the TexAttach / TexDetach calls due to potential confusion, implement it directly here + + //----------------------------------------------------------------------------------- + // put tex->m_rboName on the read FB's attachment + if (attachIndexGL==GL_DEPTH_STENCIL_ATTACHMENT_EXT) + { + // you have to attach it both places... + // http://www.opengl.org/wiki/GL_EXT_framebuffer_object + + // bind the RBO to the GL_RENDERBUFFER_EXT target - is this extraneous ? + //glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, tex->m_rboName ); + //GLMCheckError(); + + // attach the GL_RENDERBUFFER_EXT target to the depth and stencil attach points + glFramebufferRenderbufferEXT( GL_READ_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, tex->m_rboName); + GLMCheckError(); + + glFramebufferRenderbufferEXT( GL_READ_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, tex->m_rboName); + GLMCheckError(); + + // no need to leave the RBO hanging on + //glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, 0 ); + //GLMCheckError(); + } + else + { + //glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, tex->m_rboName ); + //GLMCheckError(); + + glFramebufferRenderbufferEXT( GL_READ_FRAMEBUFFER_EXT, attachIndexGL, GL_RENDERBUFFER_EXT, tex->m_rboName); + GLMCheckError(); + + //glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, 0 ); + //GLMCheckError(); + } + + glReadBuffer( attachIndexGL ); + GLMCheckError(); + + //----------------------------------------------------------------------------------- + // put tex->m_texName on the draw FBO attachment + + // set the write fb and buffer, and attach write tex + BindFBOToCtx( m_blitDrawFBO, GL_DRAW_FRAMEBUFFER_EXT ); + GLMCheckError(); + + // regular path - attaching a texture2d + + if (attachIndexGL==GL_DEPTH_STENCIL_ATTACHMENT_EXT) + { + glFramebufferTexture2DEXT( GL_DRAW_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, tex->m_texName, 0 ); + GLMCheckError(); + + glFramebufferTexture2DEXT( GL_DRAW_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_TEXTURE_2D, tex->m_texName, 0 ); + GLMCheckError(); + } + else + { + glFramebufferTexture2DEXT( GL_DRAW_FRAMEBUFFER_EXT, attachIndexGL, GL_TEXTURE_2D, tex->m_texName, 0 ); + GLMCheckError(); + } + + glDrawBuffer( attachIndexGL ); + GLMCheckError(); + + //----------------------------------------------------------------------------------- + + // blit + glBlitFramebufferEXT( 0, 0, tex->m_layout->m_key.m_xSize, tex->m_layout->m_key.m_ySize, + 0, 0, tex->m_layout->m_key.m_xSize, tex->m_layout->m_key.m_ySize, + blitMask, GL_NEAREST ); + // or should it be GL_LINEAR? does it matter ? + + GLMCheckError(); + + //----------------------------------------------------------------------------------- + // cleanup + //----------------------------------------------------------------------------------- + + + // unset the read fb and buffer, detach read RBO + //glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, 0 ); + //GLMCheckError(); + + if (attachIndexGL==GL_DEPTH_STENCIL_ATTACHMENT_EXT) + { + // detach the GL_RENDERBUFFER_EXT target from the depth and stencil attach points + glFramebufferRenderbufferEXT( GL_READ_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0); + GLMCheckError(); + + glFramebufferRenderbufferEXT( GL_READ_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0); + GLMCheckError(); + } + else + { + glFramebufferRenderbufferEXT( GL_READ_FRAMEBUFFER_EXT, attachIndexGL, GL_RENDERBUFFER_EXT, 0); + GLMCheckError(); + } + + //----------------------------------------------------------------------------------- + // unset the write fb and buffer, detach write tex + + + if (attachIndexGL==GL_DEPTH_STENCIL_ATTACHMENT_EXT) + { + glFramebufferTexture2DEXT( GL_DRAW_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0 ); + GLMCheckError(); + + glFramebufferTexture2DEXT( GL_DRAW_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0 ); + GLMCheckError(); + } + else + { + glFramebufferTexture2DEXT( GL_DRAW_FRAMEBUFFER_EXT, attachIndexGL, GL_TEXTURE_2D, 0, 0 ); + GLMCheckError(); + } + + // put the original FB back in place (both read and draw) + // this bind will hit both read and draw bindings + BindFBOToCtx( m_drawingFBO, GL_READ_FRAMEBUFFER_EXT ); + GLMCheckError(); + BindFBOToCtx( m_drawingFBO, GL_DRAW_FRAMEBUFFER_EXT ); + GLMCheckError(); + + // set the read and write buffers back to... what ? does it matter for anything but copies ? don't worry about it + + // restore the scissor state + m_ScissorEnable.Write( &oldsciss, true, true ); + + // mark the RBO clean on the resolved tex + tex->m_rboDirty = false; + } +} + +void GLMContext::PreloadTex( CGLMTex *tex, bool force ) +{ + #if 0 // disabled in sample for time being + // if conditions allow (i.e. a drawing surface is active) + // bind the texture on TMU 15 + // set up a dummy program to sample it but not write (use 'discard') + // draw a teeny little triangle that won't generate a lot of fragments + if (!m_pairCache) + return; + + if (!m_drawingFBO) + return; + + if (!m_drawingFBO) + return; + + if (tex->m_texPreloaded && !force) // only do one preload unless forced to re-do + { + //printf("\nnot-preloading %s", tex->m_debugLabel ? tex->m_debugLabel : "(unknown)"); + return; + } + + //printf("\npreloading %s", tex->m_debugLabel ? tex->m_debugLabel : "(unknown)"); + + CGLMProgram *vp = m_preloadTexVertexProgram; + CGLMProgram *fp = NULL; + switch(tex->m_layout->m_key.m_texGLTarget) + { + case GL_TEXTURE_2D: fp = m_preload2DTexFragmentProgram; + break; + + case GL_TEXTURE_3D: fp = m_preload3DTexFragmentProgram; + break; + + case GL_TEXTURE_CUBE_MAP: fp = m_preloadCubeTexFragmentProgram; + break; + } + if (!fp) + return; + + CGLMShaderPair *preloadPair = m_pairCache->SelectShaderPair( vp, fp, 0 ); + if (!preloadPair) + return; + + GLhandleARB pairProgram = preloadPair->m_program; + uint pairRevision = preloadPair->m_revision; + + m_boundPair = preloadPair; + m_boundPairProgram = pairProgram; + m_boundPairRevision = pairRevision; + + glUseProgram( (GLuint)pairProgram ); + GLMCheckError(); + + // note the binding (not really bound.. just sitting in the linked active GLSL program) + m_boundProgram[ kGLMVertexProgram ] = vp; + m_boundProgram[ kGLMFragmentProgram ] = fp; + + // almost ready to draw... + + int tmuForPreload = 15; + if(!m_boundPair->m_samplersFixed) + { + if (m_boundPair->m_locSamplers[tmuForPreload] >=0) + { + glUniform1iARB( m_boundPair->m_locSamplers[tmuForPreload], tmuForPreload ); + GLMCheckError(); + } + m_boundPair->m_samplersFixed = true; + } + + // shut down all the generic attribute arrays on the detention level - next real draw will activate them again + m_lastKnownVertexAttribMask = 0; + for( int index=0; index < kGLMVertexAttributeIndexMax; index++ ) + { + glDisableVertexAttribArray( index ); + GLMCheckError(); + } + + + // bind texture + this->BindTexToTMU( tex, 15 ); + + // unbind vertex/index buffers + this->BindBufferToCtx( kGLMVertexBuffer, NULL ); + this->BindBufferToCtx( kGLMIndexBuffer, NULL ); + + // draw + static float posns[] = { 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f }; + + static int indices[] = { 0, 1, 2 }; + + + glEnableVertexAttribArray( 0 ); + GLMCheckError(); + + glVertexAttribPointer( 0, 3, GL_FLOAT, 0, 0, posns ); + GLMCheckError(); + + glDrawRangeElements( GL_TRIANGLES, 0, 3, 3, GL_UNSIGNED_INT, indices); + GLMCheckError(); + + glDisableVertexAttribArray( 0 ); + GLMCheckError(); + + m_lastKnownVertexAttribMask = 0; + m_lastKnownVertexAttribs[0].m_bufferRevision -= 1; // force mismatch so next FlushDrawStates restores the right attrib source + + this->BindTexToTMU( NULL, 15 ); + + tex->m_texPreloaded = true; + #endif +} + + +void GLMContext::SetSamplerTex( int sampler, CGLMTex *tex ) +{ + GLM_FUNC; + CheckCurrent(); + + m_samplers[sampler].m_drawTex = tex; +} + +void GLMContext::SetSamplerParams( int sampler, GLMTexSamplingParams *params ) +{ + GLM_FUNC; + CheckCurrent(); + + m_samplers[sampler].m_samp = *params; +} + + +CGLMFBO *GLMContext::NewFBO( void ) +{ + GLM_FUNC; + MakeCurrent(); + + CGLMFBO *fbo = new CGLMFBO( this ); + + m_fboTable.push_back( fbo ); + + return fbo; +} + +void GLMContext::DelFBO( CGLMFBO *fbo ) +{ + GLM_FUNC; + MakeCurrent(); + + if (m_drawingFBO == fbo) + { + m_drawingFBO = NULL; //poof! + } + + if (m_boundReadFBO == fbo ) + { + this->BindFBOToCtx( NULL, GL_READ_FRAMEBUFFER_EXT ); + m_boundReadFBO = NULL; + } + + if (m_boundDrawFBO == fbo ) + { + this->BindFBOToCtx( NULL, GL_DRAW_FRAMEBUFFER_EXT ); + m_boundDrawFBO = NULL; + } + + std::vector< CGLMFBO * >::iterator p = find( m_fboTable.begin(), m_fboTable.end(), fbo ); + if (p != m_fboTable.end() ) + { + m_fboTable.erase( p ); + } + + delete fbo; +} + +void GLMContext::SetDrawingFBO( CGLMFBO *fbo ) +{ + GLM_FUNC; + CheckCurrent(); + + // might want to validate that fbo object? + m_drawingFBO = fbo; +} + +//=============================================================================== + +CGLMProgram *GLMContext::NewProgram( EGLMProgramType type, char *progString ) +{ + //hushed GLM_FUNC; + + MakeCurrent(); + + CGLMProgram *prog = new CGLMProgram( this, type ); + + prog->SetProgramText( progString ); + bool compile_ok = prog->CompileActiveSources(); + + //AssertOnce( compile_ok ); + + return prog; +} + +void GLMContext::DelProgram( CGLMProgram *prog ) +{ + GLM_FUNC; + + this->MakeCurrent(); + + if (m_drawingProgram[ prog->m_type ] == prog) + { + m_drawingProgram[ prog->m_type ] = NULL; + } + + // make sure to eliminate any cached pairs using this shader + bool purgeResult = m_pairCache->PurgePairsWithShader( prog ); + Assert( !purgeResult ); // very unlikely to trigger + + this->NullProgram(); + + delete prog; +} + +void GLMContext::NullProgram( void ) +{ + // just unbind everything on a prog delete + glSetEnable( GL_VERTEX_PROGRAM_ARB, false ); + glSetEnable( GL_FRAGMENT_PROGRAM_ARB, false ); + + glBindProgramARB( GL_VERTEX_PROGRAM_ARB, 0 ); + glBindProgramARB( GL_FRAGMENT_PROGRAM_ARB, 0 ); + + glUseProgram( 0 ); + m_boundPair = NULL; + m_boundPairRevision = 0xFFFFFFFF; + m_boundPairProgram = (GLhandleARB)0xFFFFFFFF; + + m_boundProgram[ kGLMVertexProgram ] = NULL; + m_boundProgram[ kGLMFragmentProgram ] = NULL; +} + +void GLMContext::SetDrawingProgram( EGLMProgramType type, CGLMProgram *prog ) +{ + GLM_FUNC; + + this->MakeCurrent(); + + if (prog) // OK to pass NULL.. + { + if (type != prog->m_type) + { + Debugger(); + } + } + else + { + // if a null fragment program is passed, we activate our special null program + // thus FP is always always enabled. + if (type==kGLMFragmentProgram) + { + prog = m_nullFragmentProgram; + } + else + { + //Assert(!"Tried to set NULL vertex program"); + } + } + m_drawingProgram[type] = prog; +} + +void GLMContext::SetDrawingLang( EGLMProgramLang lang, bool immediate ) +{ + if ( !m_caps.m_hasDualShaders ) return; // ignore attempts to change language when -glmdualshaders is not engaged + + m_drawingLangAtFrameStart = lang; + if (immediate) + { + this->NullProgram(); + + m_drawingLang = m_drawingLangAtFrameStart; + } +} + +void GLMContext::LinkShaderPair( CGLMProgram *vp, CGLMProgram *fp ) +{ + if ( (m_pairCache) && (m_drawingLang==kGLMGLSL) && (vp && vp->m_descs[kGLMGLSL].m_valid) && (fp && fp->m_descs[kGLMGLSL].m_valid) ) + { + CGLMShaderPair *pair = m_pairCache->SelectShaderPair( vp, fp, 0 ); + + Assert( pair != NULL ); + + this->NullProgram(); // clear out any binds that were done - next draw will set it right + } +} + +void GLMContext::ClearShaderPairCache( void ) +{ + if (m_pairCache) + { + this->NullProgram(); + m_pairCache->Purge(); // bye bye all linked pairs + this->NullProgram(); + } +} + +void GLMContext::QueryShaderPair( int index, GLMShaderPairInfo *infoOut ) +{ + if (m_pairCache) + { + m_pairCache->QueryShaderPair( index, infoOut ); + } + else + { + memset( infoOut, 0, sizeof( *infoOut ) ); + infoOut->m_status = -1; + } +} + +void GLMContext::SetProgramParametersF( EGLMProgramType type, uint baseSlot, float *slotData, uint slotCount ) +{ + GLM_FUNC; + + Assert( baseSlot < kGLMProgramParamFloat4Limit ); + Assert( baseSlot+slotCount <= kGLMProgramParamFloat4Limit ); + + GLMPRINTF(("-S-GLMContext::SetProgramParametersF %s slots %d - %d: ", (type==kGLMVertexProgram) ? "VS" : "FS", baseSlot, baseSlot + slotCount - 1 )); + for( int i=0; i m_programParamsF[type].m_dirtySlotCount) + { + m_programParamsF[type].m_dirtySlotCount = baseSlot+slotCount; + } +} + +void GLMContext::SetProgramParametersB( EGLMProgramType type, uint baseSlot, int *slotData, uint boolCount ) +{ + GLM_FUNC; + + Assert( m_drawingLang == kGLMGLSL ); + Assert( type==kGLMVertexProgram ); + + Assert( baseSlot < kGLMProgramParamBoolLimit ); + Assert( baseSlot+boolCount <= kGLMProgramParamBoolLimit ); + + GLMPRINTF(("-S-GLMContext::SetProgramParametersB %s bools %d - %d: ", (type==kGLMVertexProgram) ? "VS" : "FS", baseSlot, baseSlot + boolCount - 1 )); + for( int i=0; i m_programParamsB[type].m_dirtySlotCount) + { + m_programParamsB[type].m_dirtySlotCount = baseSlot+boolCount; + } +} + +void GLMContext::SetProgramParametersI( EGLMProgramType type, uint baseSlot, int *slotData, uint slotCount ) // groups of 4 ints... +{ + GLM_FUNC; + + Assert( m_drawingLang == kGLMGLSL ); + Assert( type==kGLMVertexProgram ); + + Assert( baseSlot < kGLMProgramParamInt4Limit ); + Assert( baseSlot+slotCount <= kGLMProgramParamInt4Limit ); + + GLMPRINTF(("-S-GLMContext::SetProgramParametersI %s slots %d - %d: ", (type==kGLMVertexProgram) ? "VS" : "FS", baseSlot, baseSlot + slotCount - 1 )); + for( int i=0; i m_programParamsI[type].m_dirtySlotCount) + { + m_programParamsI[type].m_dirtySlotCount = baseSlot+slotCount; + } +} + + +CGLMBuffer *GLMContext::NewBuffer( EGLMBufferType type, uint size, uint options ) +{ + //hushed GLM_FUNC; + + MakeCurrent(); + + CGLMBuffer *prog = new CGLMBuffer( this, type, size, options ); + + return prog; +} + +void GLMContext::DelBuffer( CGLMBuffer *buff ) +{ + GLM_FUNC; + + this->MakeCurrent(); + + for( int index=0; index < kGLMVertexAttributeIndexMax; index++ ) + { + if (m_drawVertexSetup.m_attrs[index].m_buffer == buff) + { + // just clear the enable mask - this will force all the attrs to get re-sent on next sync + m_drawVertexSetup.m_attrMask = 0; + } + } + + if (m_drawIndexBuffer == buff) + { + m_drawIndexBuffer = NULL; + } + + if (m_lastKnownBufferBinds[ buff->m_type ] == buff) + { + // shoot it down + this->BindBufferToCtx( buff->m_type, NULL ); + m_lastKnownBufferBinds[ buff->m_type ] = NULL; + } + + delete buff; +} + + +void GLMContext::SetIndexBuffer( CGLMBuffer *buff ) +{ + GLM_FUNC; + CheckCurrent(); + + m_drawIndexBuffer = buff; + + // draw time is welcome to re-check, but we bind it immediately. + this->BindBufferToCtx( kGLMIndexBuffer, buff ); +} + +GLMVertexSetup g_blank_setup; + +void GLMContext::SetVertexAttributes( GLMVertexSetup *setup ) +{ + GLM_FUNC; + + // we now just latch the vert setup and then execute on it at flushdrawstatestime if shaders are enabled. + if (setup) + { + m_drawVertexSetup = *setup; + } + else + { + memset( &m_drawVertexSetup, 0, sizeof(m_drawVertexSetup) ); + } + + return; +} + +void GLMContext::Clear( bool color, unsigned long colorValue, bool depth, float depthValue, bool stencil, unsigned int stencilValue, GLScissorBox_t *box ) +{ + GLM_FUNC; + m_debugBatchIndex++; // clears are batches too (maybe blits should be also...) + +#if GLMDEBUG + GLMDebugHookInfo info; + memset( &info, 0, sizeof(info) ); + info.m_caller = eClear; + + do + { +#endif + uint mask = 0; + + GLClearColor_t clearcol; + GLClearDepth_t cleardep = { depthValue }; + GLClearStencil_t clearsten = { (GLint)stencilValue }; + + // depth write mask must be saved&restored + GLDepthMask_t olddepthmask; + GLDepthMask_t newdepthmask = { true }; + + // stencil write mask must be saved and restored + GLStencilWriteMask_t oldstenmask; + GLStencilWriteMask_t newstenmask = { ~(GLint)0 }; + + GLColorMaskSingle_t oldcolormask; + GLColorMaskSingle_t newcolormask = { -1,-1,-1,-1 }; // D3D clears do not honor color mask, so force it + + if (color) + { + // #define D3DCOLOR_ARGB(a,r,g,b) ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff))) + + clearcol.r = ((colorValue >> 16) & 0xFF) / 255.0f; //R + clearcol.g = ((colorValue >> 8) & 0xFF) / 255.0f; //G + clearcol.b = ((colorValue ) & 0xFF) / 255.0f; //B + clearcol.a = ((colorValue >> 24) & 0xFF) / 255.0f; //A + + m_ClearColor.Write( &clearcol, true, true ); // no check, no wait + mask |= GL_COLOR_BUFFER_BIT; + + // save and set color mask + m_ColorMaskSingle.Read( &oldcolormask, 0 ); + m_ColorMaskSingle.Write( &newcolormask, true, true ); + } + + if (depth) + { + // get old depth write mask + m_DepthMask.Read( &olddepthmask, 0 ); + m_DepthMask.Write( &newdepthmask, true, true ); + m_ClearDepth.Write( &cleardep, true, true ); // no check, no wait + mask |= GL_DEPTH_BUFFER_BIT; + } + + if (stencil) + { + m_ClearStencil.Write( &clearsten, true, true ); // no check, no wait + mask |= GL_STENCIL_BUFFER_BIT; + + // save and set sten mask + m_StencilWriteMask.Read( &oldstenmask, 0 ); + m_StencilWriteMask.Write( &newstenmask, true, true ); + } + + bool subrect = (box != NULL); + GLScissorEnable_t scissorEnableSave; + GLScissorEnable_t scissorEnableNew = { true }; + + GLScissorBox_t scissorBoxSave; + GLScissorBox_t scissorBoxNew; + + if (subrect) + { + // save current scissorbox and enable + m_ScissorEnable.Read( &scissorEnableSave, 0 ); + m_ScissorBox.Read( &scissorBoxSave, 0 ); + + if(0) + { + // calc new scissorbox as intersection against *box + + // max of the mins + scissorBoxNew.x = std::max(scissorBoxSave.x, box->x); + scissorBoxNew.y = std::max(scissorBoxSave.y, box->y); + + // min of the maxes + scissorBoxNew.width = ( std::min(scissorBoxSave.x+scissorBoxSave.width, box->x+box->width)) - scissorBoxNew.x; + + // height is just min of the max y's, minus the new base Y + scissorBoxNew.height = ( std::min(scissorBoxSave.y+scissorBoxSave.height, box->y+box->height)) - scissorBoxNew.y; + } + else + { + // ignore old scissor box completely. + scissorBoxNew = *box; + } + // set new box and enable + m_ScissorEnable.Write( &scissorEnableNew, true, true ); + m_ScissorBox.Write( &scissorBoxNew, true, true ); + } + + glClear( mask ); + + if (subrect) + { + // put old scissor box and enable back + m_ScissorEnable.Write( &scissorEnableSave, true, true ); + m_ScissorBox.Write( &scissorBoxSave, true, true ); + } + + if (depth) + { + // put old depth write mask + m_DepthMask.Write( &olddepthmask ); + } + + if (color) + { + // put old color write mask + m_ColorMaskSingle.Write( &oldcolormask, true, true ); + } + + if (stencil) + { + // put old sten mask + m_StencilWriteMask.Write( &oldstenmask, true, true ); + } + +#if GLMDEBUG + this->DebugHook( &info ); + } while (info.m_loop); +#endif +} + + +// stolen from glmgrbasics.cpp +extern "C" uint GetCurrentKeyModifiers( void ); +enum ECarbonModKeyIndex +{ + EcmdKeyBit = 8, /* command key down?*/ + EshiftKeyBit = 9, /* shift key down?*/ + EalphaLockBit = 10, /* alpha lock down?*/ + EoptionKeyBit = 11, /* option key down?*/ + EcontrolKeyBit = 12 /* control key down?*/ +}; + +enum ECarbonModKeyMask +{ + EcmdKey = 1 << EcmdKeyBit, + EshiftKey = 1 << EshiftKeyBit, + EalphaLock = 1 << EalphaLockBit, + EoptionKey = 1 << EoptionKeyBit, + EcontrolKey = 1 << EcontrolKeyBit +}; + +#if 0 + static ConVar gl_flushpaircache ("gl_flushpaircache", "0"); + static ConVar gl_paircachestats ("gl_paircachestats", "0"); + static ConVar gl_mtglflush_at_tof ("gl_mtglflush_at_tof", "0"); + static ConVar gl_texlayoutstats ("gl_texlayoutstats", "0" ); +#else + int gl_flushpaircache =0; + int gl_paircachestats =0; + int gl_mtglflush_at_tof =0; + int gl_texlayoutstats =0; +#endif + +void GLMContext::BeginFrame( void ) +{ + GLM_FUNC; + + MakeCurrent(); + + m_debugFrameIndex++; + m_debugBatchIndex = -1; + + // check for lang change at TOF + if (m_caps.m_hasDualShaders) + { + if (m_drawingLang != m_drawingLangAtFrameStart) + { + // language change. unbind everything.. + this->NullProgram(); + + m_drawingLang = m_drawingLangAtFrameStart; + } + } + + // scrub some critical shock absorbers + for( int i=0; i< 16; i++) + { + glDisableVertexAttribArray( i ); // enable GLSL attribute- this is just client state - will be turned back off + GLMCheckError(); + } + m_lastKnownVertexAttribMask = 0; + + //FIXME should we also zap the m_lastKnownAttribs array ? (worst case it just sets them all again on first batch) + + BindBufferToCtx( kGLMVertexBuffer, NULL, true ); + BindBufferToCtx( kGLMIndexBuffer, NULL, true ); + + if (gl_flushpaircache/*.GetInt()*/) + { + // do the flush and then set back to zero + this->ClearShaderPairCache(); + + printf("\n\n##### shader pair cache cleared\n\n"); + gl_flushpaircache = 0; //.SetValue( 0 ); + } + + if (gl_paircachestats/*.GetInt()*/) + { + // do the flush and then set back to zero + this->m_pairCache->DumpStats(); + + gl_paircachestats = 0; //.SetValue( 0 ); + } + + if (gl_texlayoutstats/*.GetInt()*/) + { + this->m_texLayoutTable->DumpStats(); + + gl_texlayoutstats = 0; //.SetValue( 0 ); + } + + if (gl_mtglflush_at_tof/*.GetInt()*/) + { + glFlush(); // TOF flush - skip this if benchmarking, enable it if human playing (smoothness) + } + +#if GLMDEBUG + // init debug hook information + GLMDebugHookInfo info; + memset( &info, 0, sizeof(info) ); + info.m_caller = eBeginFrame; + + do + { + this->DebugHook( &info ); + } while (info.m_loop); + +#endif + +} + +void GLMContext::EndFrame( void ) +{ + GLM_FUNC; + +#if GLMDEBUG + // init debug hook information + GLMDebugHookInfo info; + memset( &info, 0, sizeof(info) ); + info.m_caller = eEndFrame; + + do + { +#endif + if (!m_oneCtxEnable) // if using dual contexts, this flush is needed + { + glFlush(); + } +#if GLMDEBUG + this->DebugHook( &info ); + } while (info.m_loop); +#endif +} + +//=============================================================================== + +CGLMQuery *GLMContext::NewQuery( GLMQueryParams *params ) +{ + CGLMQuery *query = new CGLMQuery( this, params ); + + return query; +} + +void GLMContext::DelQuery( CGLMQuery *query ) +{ + // may want to do some finish/ + delete query; +} + +// static ConVar mat_vsync( "mat_vsync", "0", 0, "Force sync to vertical retrace", true, 0.0, true, 1.0 ); +int mat_vsync = 1; + +//=============================================================================== + +// ConVar glm_nullrefresh_capslock( "glm_nullrefresh_capslock", "0" ); +// ConVar glm_literefresh_capslock( "glm_literefresh_capslock", "0" ); + +// extern ConVar gl_blitmode; +extern int gl_blitmode; + +void GLMContext::Present( CGLMTex *tex ) +{ +#if DX9MODE + GLM_FUNC; + + MakeCurrent(); + + // this is the path whether full screen or windowed... we always blit. + CShowPixelsParams showparams; + memset( &showparams, 0, sizeof(showparams) ); + + showparams.m_srcTexName = tex->m_texName; + showparams.m_width = tex->m_layout->m_key.m_xSize; + showparams.m_height = tex->m_layout->m_key.m_ySize; +// showparams.m_vsyncEnable = m_displayParams.m_vsyncEnable = mat_vsync; //.GetBool(); +// showparams.m_fsEnable = m_displayParams.m_fsEnable; + + // we call showpixels once with the "only sync view" arg set, so we know what the latest surface size is, before trying to do our own blit ! +// showparams.m_onlySyncView = true; +// g_engine->ShowPixels(&showparams); // doesn't actually show anything, just syncs window/fs state (would make a useful separate call) +// showparams.m_onlySyncView = false; + + // blit to GL_BACK done here, not in engine, this lets us do resolve directly if conditions are right + + GLMRect srcRect, dstRect; + + uint dstWidth,dstHeight; + g_engine->DisplayedSize( dstWidth,dstHeight ); + + srcRect.xmin = 0; + srcRect.ymin = 0; + srcRect.xmax = showparams.m_width; + srcRect.ymax = showparams.m_height; + + dstRect.xmin = 0; + dstRect.ymin = 0; + dstRect.xmax = dstWidth; + dstRect.ymax = dstHeight; + + // do not ask for LINEAR if blit is unscaled + // NULL means targeting GL_BACK. Blit2 will break it down into two steps if needed, and will handle resolve, scale, flip. + bool blitScales = (showparams.m_width != dstWidth) || (showparams.m_height != dstHeight); + this->Blit2( tex, &srcRect, 0,0, + NULL, &dstRect, 0,0, + blitScales ? GL_LINEAR : GL_NEAREST ); + + if (m_oneCtxEnable) // if using single context, we need to blast some state so GLM will recover after the FBO fiddlin' + { + BindFBOToCtx( NULL, GL_READ_FRAMEBUFFER_EXT ); + GLMCheckError(); + BindFBOToCtx( NULL, GL_DRAW_FRAMEBUFFER_EXT ); + GLMCheckError(); + } + + g_engine->ShowPixels(&showparams); + + if (m_oneCtxEnable) + { + // put the original FB back in place (both read and draw) + // this bind will hit both read and draw bindings + BindFBOToCtx( m_drawingFBO, GL_READ_FRAMEBUFFER_EXT ); + GLMCheckError(); + BindFBOToCtx( m_drawingFBO, GL_DRAW_FRAMEBUFFER_EXT ); + GLMCheckError(); + + // put em back !! + m_ScissorEnable.Flush( true ); + m_ScissorBox.Flush( true ); + m_ViewportBox.Flush( true ); + } + else + { + MakeCurrent(); + } +#endif +} + + + +//=============================================================================== +// GLMContext protected methods + +// a naive implementation of this would just clear-drawable on the context at entry, +// and then capture and set fullscreen if requested. +// however that would glitch thescreen every time the user changed resolution while staying in full screen. +// but in windowed mode there's really not much to do in here. Yeah, this routine centers around obtaining +// drawables for fullscreen mode, and/or dropping those drawables if we're going back to windowed. + +// um, are we expected to re-make the standard surfaces (color, depthstencil) if the res changes? is that now this routine's job ? + +// so, kick it off with an assessment of whather we were FS previously or not. +// if there was no prior display params latched, then it wasn't. + +// changes in here take place immediately. If you want to defer display changes then that's going to be a different method. +// common assumption is that there will be two places that call this: context create and the implementation of the DX9 Reset method. +// in either case the client code is aware of what it signed up for. + +bool GLMContext::SetDisplayParams( GLMDisplayParams *params ) +{ + m_displayParams = *params; // latch em + m_displayParamsValid = true; + return true; +} + +//extern ConVar gl_singlecontext; // single context mode go-ahead if 10.6.3 or higher +extern int gl_singlecontext; // it's in glmgrbasics.cpp + +//ConVar gl_can_query_fast("gl_can_query_fast", "0"); +int gl_can_query_fast = 1; // assume SLGU + +GLMContext::GLMContext( GLMDisplayParams *params ) +{ +#if DX9MODE + // flag our copy of display params as blank + m_displayParamsValid = false; + + // peek at any CLI options + m_slowAssertEnable = false;//CommandLine()->FindParm("-glmassertslow"); + m_slowSpewEnable = false; //CommandLine()->FindParm("-glmspewslow"); + m_slowCheckEnable = m_slowAssertEnable || m_slowSpewEnable; + + m_drawingLangAtFrameStart = m_drawingLang = kGLMGLSL; // default to GLSL + + // this affects FlushDrawStates which will route program bindings, uniform delivery, sampler setup, and enables accordingly. + + if ( 0 /*CommandLine()->FindParm("-glslmode")*/ ) + { + m_drawingLangAtFrameStart = m_drawingLang = kGLMGLSL; + } + if ( 0 /* CommandLine()->FindParm("-arbmode") && !CommandLine()->FindParm("-glslcontrolflow") */ ) + { + m_drawingLangAtFrameStart = m_drawingLang = kGLMARB; + } + + // proceed with rest of init + + m_nsctx = NULL; + m_ctx = NULL; + + // call engine, ask for the attrib list (also naming the specific renderer ID) and use that to make our context + CGLPixelFormatAttribute *selAttribs = NULL; + uint selWords = 0; + + memset( &m_caps, 0, sizeof( m_caps ) ); + //g_engine->GetDesiredPixelFormatAttribsAndRendererInfo( (uint**)&selAttribs, &selWords, &m_caps ); + g_engine->GetRendererInfo( &m_caps ); + uint selBytes = selWords * sizeof( uint ); + + // call engine, ask it about the window we're targeting, get the NSGLContext back, share against that + PseudoNSGLContextPtr shareNsCtx = g_engine->GetNSGLContextForWindow( (void*)params->m_focusWindow ); + + + // decide if we're going to try single context mode. + m_oneCtxEnable = true; // 10.6 only... //(m_caps.m_osComboVersion >= 0x000A0603) && (gl_singlecontext/*.GetInt()*/ ); + + bool success = false; + if(m_oneCtxEnable) + { + // just steal the window's context + m_nsctx = shareNsCtx; + m_ctx = GetCGLContextFromNSGL( shareNsCtx ); + + success = (m_nsctx != NULL) && (m_ctx != NULL); + } + else + { + // this is the old 10.5.x two-context path.... ugh + success = NewNSGLContext( (unsigned long*)selAttribs, shareNsCtx, &m_nsctx, &m_ctx ); + } + + // If we're compiling for 64-bit with a 32-bit GLint we should only allow the conversion + // between 'this' and GLint if it can fit in the GLint, otherwise consider this to be failure + if ( sizeof(this) > sizeof(GLint) ) + success = ( (uintptr_t)this & 0xFFFFFFFF00000000 ) == 0; + + if (success) + { + //write a cookie into the CGL context leading back to the GLM context object + GLint glm_context_link = (GLint)((uintptr_t)this); + CGLSetParameter( m_ctx, kCGLCPClientStorage, &glm_context_link ); + + // save off the pixel format attributes we used + memcpy(m_pixelFormatAttribs, selAttribs, selBytes ); + } + + if ( !success ) + { + Debugger(); //FIXME #PMB# bad news, maybe exit to shell if this happens + } + + if ( 1 /* CommandLine()->FindParm("-glmspewcaps") */) //FIXME change to '0' later + { + DumpCaps(); + } + + SetDisplayParams( params ); + + m_texLayoutTable = new CGLMTexLayoutTable; + + memset( m_samplers, 0, sizeof( m_samplers ) ); + m_activeTexture = -1; + + m_texLocks.reserve( 16 ); + + // FIXME need a texture tracking table so we can reliably delete CGLMTex objects at context teardown + + m_boundReadFBO = NULL; + m_boundDrawFBO = NULL; + m_drawingFBO = NULL; + + memset( m_boundProgram, 0, sizeof(m_boundProgram) ); + memset( m_drawingProgram, 0, sizeof(m_boundProgram) ); + memset( m_programParamsF , 0, sizeof (m_programParamsF) ); + memset( m_programParamsB , 0, sizeof (m_programParamsB) ); + memset( m_programParamsI , 0, sizeof (m_programParamsI) ); + + m_paramWriteMode = eParamWriteDirtySlotRange; // default to fastest mode + /* + if (CommandLine()->FindParm("-glmwriteallslots")) m_paramWriteMode = eParamWriteAllSlots; + if (CommandLine()->FindParm("-glmwriteshaderslots")) m_paramWriteMode = eParamWriteShaderSlots; + if (CommandLine()->FindParm("-glmwriteshaderslotsoptional")) m_paramWriteMode = eParamWriteShaderSlotsOptional; + if (CommandLine()->FindParm("-glmwritedirtyslotrange")) m_paramWriteMode = eParamWriteDirtySlotRange; + */ + + m_attribWriteMode = eAttribWriteDirty; + + /* + if (CommandLine()->FindParm("-glmwriteallattribs")) m_attribWriteMode = eAttribWriteAll; + if (CommandLine()->FindParm("-glmwritedirtyattribs")) m_attribWriteMode = eAttribWriteDirty; + */ + + m_pairCache = new CGLMShaderPairCache( this ); + m_boundPair = NULL; + m_boundPairRevision = 0xFFFFFFFF; + m_boundPairProgram = (GLhandleARB)0xFFFFFFFF; // GLSL only + + memset( m_lastKnownBufferBinds, 0, sizeof(m_lastKnownBufferBinds) ); + memset( m_lastKnownVertexAttribs, 0, sizeof(m_lastKnownVertexAttribs) ); + m_lastKnownVertexAttribMask = 0; + + // make a null program for use when client asks for NULL FP + m_nullFragmentProgram = this->NewProgram(kGLMFragmentProgram, g_nullFragmentProgramText ); + + // make dummy programs for doing texture preload via dummy draw + m_preloadTexVertexProgram = this->NewProgram(kGLMVertexProgram, g_preloadTexVertexProgramText ); + m_preload2DTexFragmentProgram = this->NewProgram(kGLMFragmentProgram, g_preload2DTexFragmentProgramText ); + m_preload3DTexFragmentProgram = this->NewProgram(kGLMFragmentProgram, g_preload3DTexFragmentProgramText ); + m_preloadCubeTexFragmentProgram = this->NewProgram(kGLMFragmentProgram, g_preloadCubeTexFragmentProgramText ); + + m_drawIndexBuffer = NULL; + + //memset( &m_drawVertexSetup, 0, sizeof(m_drawVertexSetup) ); + SetVertexAttributes( NULL ); // will set up all the entries in m_drawVertexSetup + + m_debugFontTex = NULL; + + // debug state + m_debugFrameIndex = -1; + m_debugBatchIndex = -1; + +#if GLMDEBUG + // ####################################################################################### + + // DebugHook state - we could set these to more interesting values in response to a CLI arg like "startpaused" or something if desired + //m_paused = false; + m_holdFrameBegin = -1; + m_holdFrameEnd = -1; + m_holdBatch = m_holdBatchFrame = -1; + + m_debugDelayEnable = false; + m_debugDelay = 1<<19; // ~0.5 sec delay + + m_autoClearColor = m_autoClearDepth = m_autoClearStencil = false; + m_autoClearColorValues[0] = 0.0; //red + m_autoClearColorValues[1] = 1.0; //green + m_autoClearColorValues[2] = 0.0; //blue + m_autoClearColorValues[3] = 1.0; //alpha + + m_selKnobIndex = 0; + m_selKnobMinValue = -10.0f; + m_selKnobMaxValue = 10.0f; + m_selKnobIncrement = 1/256.0f; + + // ####################################################################################### +#endif + + // make two scratch FBO's for blit purposes + m_blitReadFBO = this->NewFBO(); + m_blitDrawFBO = this->NewFBO(); + + for( int i=0; iNewFBO(); + } + + bool new_mtgl = m_caps.m_hasPerfPackage1; // i.e. 10.6.4 plus new driver + + /* + if ( CommandLine()->FindParm("-glmenablemtgl2") ) + { + new_mtgl = true; + } + + if ( CommandLine()->FindParm("-glmdisablemtgl2") ) + { + new_mtgl = false; + } + */ + + bool mtgl_on = params->m_mtgl; + /* + if (CommandLine()->FindParm("-glmenablemtgl")) + { + mtgl_on = true; + } + + if (CommandLine()->FindParm("-glmdisablemtgl")) + { + mtgl_on = false; + } + */ + + CGLError result = (CGLError)0; + if (mtgl_on) + { + bool ready = false; + + if (new_mtgl) + { + // afterburner + CGLContextEnable kCGLCPGCDMPEngine = ((CGLContextEnable)1314); + result = CGLEnable( m_ctx, kCGLCPGCDMPEngine ); + if (!result) + { + ready = true; // succeeded - no need to try non-MTGL + printf("\nMTGL detected.\n"); + } + else + { + printf("\nMTGL *not* detected, falling back.\n"); + } + } + + if (!ready) + { + // try old MTGL + result = CGLEnable( m_ctx, kCGLCEMPEngine ); + if (!result) + { + printf("\nMTGL has been detected.\n"); + ready = true; // succeeded - no need to try non-MTGL + } + } + } + + // also, set the remote convar "gl_can_query_fast" to 1 if perf package present, else 0. + gl_can_query_fast = m_caps.m_hasPerfPackage1?1:0; //.SetValue( m_caps.m_hasPerfPackage1?1:0 ); + + GLMCheckError(); +#endif +} + +GLMContext::~GLMContext () +{ + // a lot of stuff that needs to be freed / destroyed + + if (m_debugFontTex) + { + this->DelTex( m_debugFontTex ); + m_debugFontTex = NULL; + } + + if ( m_nullFragmentProgram ) + { + this->DelProgram( m_nullFragmentProgram ); + m_nullFragmentProgram = NULL; + } + + // walk m_fboTable and free them up.. + for( std::vector< CGLMFBO * >::iterator p = m_fboTable.begin(); p != m_fboTable.end(); p++ ) + { + CGLMFBO *fbo = *p; + this->DelFBO( fbo ); + } + m_fboTable.clear(); + + if (m_pairCache) + { + delete m_pairCache; + m_pairCache = NULL; + } + + // we need a m_texTable I think.. + + // m_texLayoutTable can be scrubbed once we know that all the tex are freed + + if (m_nsctx && (!m_oneCtxEnable) ) + { + DelNSGLContext( m_nsctx ); + m_nsctx = NULL; + m_ctx = NULL; + } +} + + + +void GLMContext::SelectTMU( int tmu ) +{ + //GLM_FUNC; + + CheckCurrent(); + if (tmu != m_activeTexture) + { + glActiveTexture( GL_TEXTURE0+tmu ); + GLMCheckError(); + + m_activeTexture = tmu; + } +} + +int GLMContext::BindTexToTMU( CGLMTex *tex, int tmu, bool noCheck ) +{ + GLM_FUNC; + GLMPRINTF(("--- GLMContext::BindTexToTMU tex %p GL name %d -> TMU %d ", tex, tex ? tex->m_texName : -1, tmu )); + + CheckCurrent(); + + #if GLMDEBUG + if ( tex && tex->m_debugLabel && (!strcmp( tex->m_debugLabel, "error" ) ) ) + { + static char stop_here = 0; + if (stop_here) + { + stop_here = 1; + } + } + #endif + + if (tex && (tex->m_layout->m_key.m_texFlags & kGLMTexMultisampled) ) + { + if (tex->m_rboDirty) + { + // the texture must be a multisampled render target which has been targeted recently for drawing. + // check that it's not still attached... + Assert( tex->m_rtAttachCount==0 ); + + // let it resolve the MSAA RBO back to the texture + ResolveTex( tex ); + } + } + + SelectTMU( tmu ); + + // if another texture was previously bound there, mark it not bound now + // this should not be skipped + + if (m_samplers[tmu].m_boundTex) + { + m_samplers[tmu].m_boundTex->m_bindPoints &= ~(1<m_layout->m_key.m_texGLTarget, m_samplers[tmu].m_boundTex->m_texName ); + //} + + // note m_samplers[tmu].m_boundTex is now stale but we will step on it shortly + } + + // if texture chosen is different, or if noCheck is set, do the bind + if (tex) + { + // bind new tex and mark it + if ((tex != m_samplers[tmu].m_boundTex) || noCheck) + { + // if not being forced, we should see if the bind point (target) of the departing tex is different. + if (!noCheck) + { + if ( (m_samplers[tmu].m_boundTex) ) + { + // there is an outgoing tex. + // same target? + if ( m_samplers[tmu].m_boundTex->m_layout->m_key.m_texGLTarget != tex->m_layout->m_key.m_texGLTarget ) + { + // no, different target. inbound tex will be set below. Here, just clear the different target of the outbound tex. + glBindTexture( m_samplers[tmu].m_boundTex->m_layout->m_key.m_texGLTarget, 0 ); + } + else + { + // same target, new tex, no work to do. + } + } + } + else + { + // mega scrub + glBindTexture( GL_TEXTURE_1D, 0 ); + glBindTexture( GL_TEXTURE_2D, 0 ); + glBindTexture( GL_TEXTURE_3D, 0 ); + glBindTexture( GL_TEXTURE_CUBE_MAP, 0 ); + } + + glBindTexture( tex->m_layout->m_key.m_texGLTarget, tex->m_texName ); + GLMCheckError(); + } + tex->m_bindPoints |= (1<m_layout->m_key.m_texGLTarget, 0 ); + GLMCheckError(); + } + else + { + // none was bound before, so no action + } + m_samplers[tmu].m_boundTex = NULL; + } + + return 0; +} + +void GLMContext::BindFBOToCtx( CGLMFBO *fbo, GLenum bindPoint ) +{ + GLM_FUNC; + GLMPRINTF(( "--- GLMContext::BindFBOToCtx fbo %p, GL name %d", fbo, (fbo) ? fbo->m_name : -1 )); + + CheckCurrent(); + + bool targetRead = (bindPoint==GL_READ_FRAMEBUFFER_EXT) || (bindPoint==GL_FRAMEBUFFER_EXT); + bool targetDraw = (bindPoint==GL_DRAW_FRAMEBUFFER_EXT) || (bindPoint==GL_FRAMEBUFFER_EXT); + + if (targetRead) + { + if (fbo) // you can pass NULL to go back to no-FBO + { + glBindFramebufferEXT( GL_READ_FRAMEBUFFER_EXT, fbo->m_name ); + GLMCheckError(); + + m_boundReadFBO = fbo; + //dontcare fbo->m_bound = true; + } + else + { + glBindFramebufferEXT( GL_READ_FRAMEBUFFER_EXT, 0 ); + GLMCheckError(); + + m_boundReadFBO = NULL; + } + } + + if (targetDraw) + { + if (fbo) // you can pass NULL to go back to no-FBO + { + glBindFramebufferEXT( GL_DRAW_FRAMEBUFFER_EXT, fbo->m_name ); + GLMCheckError(); + + m_boundDrawFBO = fbo; + //dontcare fbo->m_bound = true; + } + else + { + glBindFramebufferEXT( GL_DRAW_FRAMEBUFFER_EXT, 0 ); + GLMCheckError(); + + m_boundDrawFBO = NULL; + } + } +} + +void GLMContext::BindBufferToCtx( EGLMBufferType type, CGLMBuffer *buff, bool force ) +{ + GLM_FUNC; + GLMPRINTF(( "--- GLMContext::BindBufferToCtx buff %p, GL name %d", buff, (buff) ? buff->m_name : -1 )); + + CheckCurrent(); + + if (!force) + { + // compare desired bind to last known bind, and see if we can bail + if (m_lastKnownBufferBinds[ type ] == buff) + { + return; + } + } + + GLenum target=0; + switch( type ) + { + case kGLMVertexBuffer: target = GL_ARRAY_BUFFER_ARB; break; + case kGLMIndexBuffer: target = GL_ELEMENT_ARRAY_BUFFER_ARB; break; + case kGLMUniformBuffer: target = GL_UNIFORM_BUFFER_EXT; break; + case kGLMPixelBuffer: target = GL_PIXEL_UNPACK_BUFFER_ARB; break; + + default: Assert(!"Unknown buffer type" ); + } + + bool wasBound = false; + bool isBound = false; + + (void)wasBound; + (void)isBound; + + if (m_lastKnownBufferBinds[type]) + { + m_lastKnownBufferBinds[type]->m_bound = false; + m_lastKnownBufferBinds[type] = NULL; + wasBound = true; + } + + if (buff) + { + if (buff->m_buffGLTarget != target) + Debugger(); + + glBindBufferARB( buff->m_buffGLTarget, buff->m_name ); + GLMCheckError(); + + m_lastKnownBufferBinds[ type ] = buff; + buff->m_bound = true; + + isBound = true; + } + else + { + // isBound stays false + // bind name 0 + // note that no buffer is bound in the ctx state + + glBindBufferARB( target, 0 ); + GLMCheckError(); + + m_lastKnownBufferBinds[ type ] = NULL; + } +} + +//ConVar gl_can_mix_shader_gammas( "gl_can_mix_shader_gammas", 0 ); +int gl_can_mix_shader_gammas = 0; + +//ConVar gl_cannot_mix_shader_gammas( "gl_cannot_mix_shader_gammas", 0 ); +int gl_cannot_mix_shader_gammas = 0; + +void GLMContext::FlushDrawStates( bool shadersOn ) // shadersOn = true for draw calls, false for clear calls +{ + GLM_FUNC; + + CheckCurrent(); + + // FBO + if ( (m_drawingFBO != m_boundDrawFBO) || (m_drawingFBO != m_boundReadFBO) ) + { + //GLMPRINTF(("\nGLMContext::FlushDrawStates, setting FBO to %8x(gl %d), was %8x(gl %d)", m_drawingFBO, (m_drawingFBO? m_drawingFBO->m_name: -1),m_boundFBO, (m_boundFBO ? m_boundFBO->m_name : -1) )); + this->BindFBOToCtx( m_drawingFBO, GL_READ_FRAMEBUFFER_EXT ); + this->BindFBOToCtx( m_drawingFBO, GL_DRAW_FRAMEBUFFER_EXT ); + } + + // if drawing FBO has any MSAA attachments, mark them dirty + { + for( int att=kAttColor0; attm_attach[ att ].m_tex) + { + CGLMTex *tex = m_drawingFBO->m_attach[ att ].m_tex; + + if (tex->m_rboName) // is it MSAA + { + // mark it dirty + tex->m_rboDirty = true; + } + } + } + } + + // renderstates + this->FlushStates(); // latched renderstates.. + + // if there is no color target - bail out + // OK, this doesn't work in general - you can't leave the color target floating(null) or you will get FBO errors + //if (!m_boundDrawFBO[0].m_attach[0].m_tex) + //{ + // GLMPRINTF(("-D- GLMContext::FlushDrawStates -> no color target! exiting.. " )); + // return; + //} + + bool tex0_srgb = (m_boundDrawFBO[0].m_attach[0].m_tex->m_layout->m_key.m_texFlags & kGLMTexSRGB) != 0; + + // you can only actually use the sRGB FB state on some systems.. check caps + if (m_caps.m_hasGammaWrites) + { + GLBlendEnableSRGB_t writeSRGBState; + m_BlendEnableSRGB.Read( &writeSRGBState, 0 ); // the client set value, not the API-written value yet.. + bool draw_srgb = writeSRGBState.enable; + + if (draw_srgb) + { + if (tex0_srgb) + { + // good - draw mode and color tex agree + } + else + { + // bad + + // Client has asked to write sRGB into a texture that can't do it. + // there is no way to satisfy this unless we change the RT tex and we avoid doing that. + // (although we might consider a ** ONE TIME ** promotion. + // this shouldn't be a big deal if the tex format is one where it doesn't matter like 32F. + + GLMPRINTF(("-Z- srgb-enabled FBO conflict: attached tex %08x [%s] is not SRGB", m_boundDrawFBO[0].m_attach[0].m_tex, m_boundDrawFBO[0].m_attach[0].m_tex->m_layout->m_layoutSummary )); + + // do we shoot down the srgb-write state for this batch? + // I think the runtime will just ignore it. + } + } + else + { + if (tex0_srgb) + { + // odd - client is not writing sRGB into a texture which *can* do it. + //GLMPRINTF(( "-Z- srgb-disabled FBO conflict: attached tex %08x [%s] is SRGB", m_boundFBO[0].m_attach[0].m_tex, m_boundFBO[0].m_attach[0].m_tex->m_layout->m_layoutSummary )); + //writeSRGBState.enable = true; + //m_BlendEnableSRGB.Write( &writeSRGBState ); + } + else + { + // good - draw mode and color tex agree + } + } + + // now go ahead and flush the SRGB write state for real + // set the noDefer on it too + m_BlendEnableSRGB.Flush( /*true*/ ); + } + // else... FlushDrawStates will work it out via flSRGBWrite in the fragment shader.. + + // textures and sampling + // note we generate a mask of which samplers are running "decode sRGB" mode, to help out the shader pair cache mechanism below. + uint srgbMask = 0; + for( int i=0; im_boundTex != samp->m_drawTex) + { + this->BindTexToTMU( samp->m_drawTex, i ); + samp->m_boundTex = samp->m_drawTex; + } + + // push sampling params? it will check each one individually. + if (samp->m_boundTex) + { + samp->m_boundTex->ApplySamplingParams( &samp->m_samp ); + } + + if (samp->m_samp.m_srgb) + { + srgbMask |= (1<m_descs[ kGLMARB ].m_valid) + { + glSetEnable( GL_VERTEX_PROGRAM_ARB, true ); + glBindProgramARB(GL_VERTEX_PROGRAM_ARB, vp->m_descs[ kGLMARB ].m_object.arb); + GLMCheckError(); + + m_boundProgram[ kGLMVertexProgram ] = vp; + vpgood = true; + } + else + { + //Assert( !"Trying to draw with invalid ARB vertex program" ); + } + } + else + { + //Assert( !"Trying to draw with NULL ARB vertex program" ); + } + } + + // fragment side + { + CGLMProgram *fp = m_drawingProgram[ kGLMFragmentProgram ]; + if (fp) + { + if (fp->m_descs[ kGLMARB ].m_valid) + { + glSetEnable( GL_FRAGMENT_PROGRAM_ARB, true ); + glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, fp->m_descs[ kGLMARB ].m_object.arb); + GLMCheckError(); + + m_boundProgram[ kGLMFragmentProgram ] = fp; + fpgood = true; + } + else + { + //Assert( !"Trying to draw with invalid ARB fragment program" ); + m_boundProgram[ kGLMFragmentProgram ] = NULL; + } + } + else + { + // this is actually OK, we substitute a dummy shader + glSetEnable( GL_FRAGMENT_PROGRAM_ARB, true ); + glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, m_nullFragmentProgram->m_descs[kGLMARB].m_object.arb ); + m_boundProgram[ kGLMFragmentProgram ] = m_nullFragmentProgram; + fpgood = true; + } + } + + if (fpgood & vpgood) + { + // flush parameter values to both stages + // FIXME: this can be optimized by dirty range, since ARB supports single-parameter-bank aka .env + // FIXME: magic numbers, yuk + + glProgramEnvParameters4fvEXT( GL_VERTEX_PROGRAM_ARB, 0, 256, (const GLfloat*)&m_programParamsF[kGLMVertexProgram].m_values[0][0] ); + GLMCheckError(); + + glProgramEnvParameters4fvEXT( GL_FRAGMENT_PROGRAM_ARB, 0, 32, (const GLfloat*)&m_programParamsF[kGLMFragmentProgram].m_values[0][0] ); + GLMCheckError(); + } + else + { + // silence all (clears wind up here for example) + + glBindProgramARB(GL_VERTEX_PROGRAM_ARB, 0 ); + glSetEnable( GL_VERTEX_PROGRAM_ARB, false ); + m_boundProgram[ kGLMVertexProgram ] = NULL; + + glSetEnable( GL_FRAGMENT_PROGRAM_ARB, false ); + glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0 ); + m_boundProgram[ kGLMFragmentProgram ] = NULL; + } +/////////////////////////////////// + + // ARB vert setup. maybe generalize this to handle both ARB and GLSL after we see what GLSL attrib setup looks like. + + //http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribPointer.xml + //http://www.opengl.org/sdk/docs/man/xhtml/glEnableVertexAttribArray.xml + + // for (each attrib) + // if (enable unchanged and off) -> do nothing + // if (enable changed to off) -> disable that array ... set the attrib pointer to nil for clarity + // if (enable changed to on) -> bind the appropriate vertex buffer, set that attrib, log it + // if (enable unchanged and on) -> diff the attrib setup, re-bind if needed, log it + + GLMVertexSetup *setup = &m_drawVertexSetup; + uint relevantMask = setup->m_attrMask; + + for( int index=0; index < kGLMVertexAttributeIndexMax; index++ ) + { + uint mask = 1<m_attrs[index]; // ptr to desired setup + CGLMBuffer * buf = setdesc->m_buffer; // bind buffer + Assert( buf ); + + BindBufferToCtx( kGLMVertexBuffer, buf ); + + glEnableVertexAttribArray( index ); // enable attribute, set pointer. + GLMCheckError(); + + glVertexAttribPointer( index, setdesc->m_datasize, setdesc->m_datatype, setdesc->m_normalized, setdesc->m_stride, (const GLvoid *)(uintptr_t)setdesc->m_offset ); + GLMCheckError(); + //GLMPRINTF(("--- GLMContext::SetVertexAttributes attr %d set to offset/stride %d/%d in buffer %d (normalized=%s)", index, setdesc->m_offset, setdesc->m_stride, setdesc->m_buffer->m_name, setdesc->m_normalized?"true":"false" )); + } + else + { + // disable attribute + glDisableVertexAttribArray( index ); + GLMCheckError(); + //GLMPRINTF((" -- GLMContext::SetVertexAttributes attr %d is disabled", index )); + + // tidy up in case there was garbage? necessary ? + memset ( &setup->m_attrs[index], 0, sizeof(setup->m_attrs[index]) ); + } + } + +/////////////////////////////////// + } + break; + + case kGLMGLSL: + { + // early out if one of the stages is not set. + // draw code needs to watch for this too. + if ( (m_drawingProgram[ kGLMVertexProgram ]==NULL) || (m_drawingProgram[ kGLMFragmentProgram ]==NULL) ) + { + this->NullProgram(); + return; + } + + // examine selected drawing programs for both stages + // try to find a match in thelinked-pair-cache + // if no match, link one + // examine metadata + // get uniform locations for parameters, attributes, and samplers + // put in cache + + // dispatch vertex attribute locations to shader (could be one-time) + // dispatch parameter values to both stages (could be optimized with UBO) + // dispatch sampler locations to shader (need sampler metadata) + + // new way - use the pair cache + + // cook up some extra bits so that we can track different srgb-usages of the same vp/fp pair. + // note that this is only important on some hardware/OS combos. + // let the pair cache decide if it needs to honor the extra key bits or not. + + + // decide if we need to mix extra bits into the lookup key. + bool useExtraKeyBits = m_caps.m_costlyGammaFlips; + + // the "can" variable is allowed to override the static assessment. + if ( gl_can_mix_shader_gammas/*.GetInt()*/ ) + { + useExtraKeyBits = false; + } + + // the "cannot" variable is allowed to override the first two + if ( gl_cannot_mix_shader_gammas/*.GetInt()*/ ) + { + useExtraKeyBits = true; + } + + uint extraKeyBits = 0; + + if (useExtraKeyBits) + { + extraKeyBits = (srgbMask & m_drawingProgram[ kGLMFragmentProgram ]->m_samplerMask); + } + + CGLMShaderPair *newPair = m_pairCache->SelectShaderPair( m_drawingProgram[ kGLMVertexProgram ], m_drawingProgram[ kGLMFragmentProgram ], extraKeyBits ); + GLhandleARB newPairProgram = newPair->m_program; + uint newPairRevision = newPair->m_revision; + + // you cannot only key on the pair address, since pairs get evicted and pair records likely get recycled. + // so key on all three - pair address, program name, revision number + // this will also catch cases where a pair is re-linked (batch debugger / live edit) + + if ( (newPair != m_boundPair) || (newPairProgram != m_boundPairProgram) || (newPairRevision != m_boundPairRevision) ) + { + m_boundPair = newPair; + m_boundPairProgram = newPairProgram; + m_boundPairRevision = newPairRevision; + + glUseProgram( (uintptr_t)newPairProgram ); + GLMCheckError(); + + // set the dirty levels appropriately since the program changed and has never seen any of the current values. + m_programParamsF[kGLMVertexProgram].m_dirtySlotCount = m_drawingProgram[ kGLMVertexProgram ]->m_descs[kGLMGLSL].m_highWater+1; + m_programParamsF[kGLMFragmentProgram].m_dirtySlotCount = m_drawingProgram[ kGLMFragmentProgram ]->m_descs[kGLMGLSL].m_highWater+1; + + // bool and int dirty levels get set to max, we don't have actual high water marks for them + // code which sends the values must clamp on these types. + m_programParamsB[kGLMVertexProgram].m_dirtySlotCount = kGLMProgramParamBoolLimit; + m_programParamsB[kGLMFragmentProgram].m_dirtySlotCount = 0; + + m_programParamsI[kGLMVertexProgram].m_dirtySlotCount = kGLMProgramParamInt4Limit; + m_programParamsI[kGLMFragmentProgram].m_dirtySlotCount = 0; + } + + // note the binding (not really bound.. just sitting in the linked active GLSL program) + m_boundProgram[ kGLMVertexProgram ] = m_drawingProgram[ kGLMVertexProgram ]; + m_boundProgram[ kGLMFragmentProgram ] = m_drawingProgram[ kGLMFragmentProgram ]; + + // now pave the way for drawing + + // parameters - find and set + + // vertex stage -------------------------------------------------------------------- + // find "vc" in VS + GLint vconstLoc = m_boundPair->m_locVertexParams; + if (vconstLoc >=0) + { + #if GLMDEBUG + static uint paramsPushed=0,paramsSkipped=0,callsPushed=0; // things that happened on pushed param trips + static uint callsSkipped=0,paramsSkippedByCallSkip=0; // on unpushed param trips (zero dirty) + + (void)paramsPushed; + (void)paramsSkipped; + (void)callsPushed; + (void)callsSkipped; + (void)paramsSkippedByCallSkip; + #endif + + int slotCountToPush = 0; + int shaderSlots = m_boundPair->m_vertexProg->m_descs[kGLMGLSL].m_highWater+1; + int dirtySlots = m_programParamsF[kGLMVertexProgram].m_dirtySlotCount; + + + switch( m_paramWriteMode ) + { + case eParamWriteAllSlots: slotCountToPush = kGLMVertexProgramParamFloat4Limit; break; + case eParamWriteShaderSlots: slotCountToPush = shaderSlots; break; + + case eParamWriteShaderSlotsOptional: + { + slotCountToPush = shaderSlots; + + // ...unless, we're actually unchanged since last draw + if (dirtySlots == 0) + { + // write none + slotCountToPush = 0; + } + } + break; + + case eParamWriteDirtySlotRange: slotCountToPush = dirtySlots; break; + } + + if (slotCountToPush) + { + glUniform4fv( vconstLoc, slotCountToPush, &m_programParamsF[kGLMVertexProgram].m_values[0][0] ); + GLMCheckError(); + + #if GLMDEBUG + paramsPushed += slotCountToPush; + paramsSkipped += shaderSlots - slotCountToPush; + + callsPushed++; + #endif + } + else + { + #if GLMDEBUG + paramsSkippedByCallSkip += shaderSlots; + + callsSkipped++; + #endif + } + + #if GLMDEBUG && 0 + if (GLMKnob("caps-key",NULL) > 0.0) + { + // spew + GLMPRINTF(("VP callsPushed=%d ( paramsPushed=%d paramsSkipped=%d ) callsSkipped=%d (paramsSkippedByCallSkip=%d)", + callsPushed, paramsPushed, paramsSkipped, callsSkipped, paramsSkippedByCallSkip + )); + } + #endif + + m_programParamsF[kGLMVertexProgram].m_dirtySlotCount = 0; //ack + } + + // see if VS uses i0, b0, b1, b2, b3. + // use a glUniform1i to set any one of these if active. skip all of them if no dirties reported. + // my kingdom for the UBO extension! + + // ------- bools ---------- // + if ( 1 /*m_programParamsB[kGLMVertexProgram].m_dirtySlotCount*/ ) // optimize this later after the float param pushes are proven out + { + GLint vconstBool0Loc = m_boundPair->m_locVertexBool0; //glGetUniformLocationARB( prog, "b0"); + if ( vconstBool0Loc >= 0 ) + { + glUniform1i( vconstBool0Loc, m_programParamsB[kGLMVertexProgram].m_values[0] ); //FIXME magic number + GLMCheckError(); + } + + GLint vconstBool1Loc = m_boundPair->m_locVertexBool1; //glGetUniformLocationARB( prog, "b1"); + if ( vconstBool1Loc >= 0 ) + { + glUniform1i( vconstBool1Loc, m_programParamsB[kGLMVertexProgram].m_values[1] ); //FIXME magic number + GLMCheckError(); + } + + GLint vconstBool2Loc = m_boundPair->m_locVertexBool2; //glGetUniformLocationARB( prog, "b2"); + if ( vconstBool2Loc >= 0 ) + { + glUniform1i( vconstBool2Loc, m_programParamsB[kGLMVertexProgram].m_values[2] ); //FIXME magic number + GLMCheckError(); + } + + GLint vconstBool3Loc = m_boundPair->m_locVertexBool3; //glGetUniformLocationARB( prog, "b3"); + if ( vconstBool3Loc >= 0 ) + { + glUniform1i( vconstBool3Loc, m_programParamsB[kGLMVertexProgram].m_values[3] ); //FIXME magic number + GLMCheckError(); + } + m_programParamsB[kGLMVertexProgram].m_dirtySlotCount = 0; //ack + } + + // ------- int ---------- // + if ( 1 /*m_programParamsI[kGLMVertexProgram].m_dirtySlotCount*/ ) // optimize this later after the float param pushes are proven out + { + GLint vconstInt0Loc = m_boundPair->m_locVertexInteger0; //glGetUniformLocationARB( prog, "i0"); + if ( vconstInt0Loc >= 0 ) + { + glUniform1i( vconstInt0Loc, m_programParamsI[kGLMVertexProgram].m_values[0][0] ); //FIXME magic number + GLMCheckError(); + } + m_programParamsI[kGLMVertexProgram].m_dirtySlotCount = 0; //ack + } + + + // attribs - find and set + // GLSL vert setup - clone/edit of ARB setup. try to re-unify these later. + + GLMVertexSetup *setup = &m_drawVertexSetup; + uint relevantMask = setup->m_attrMask; + + //static char *attribnames[] = { "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15" }; + + CGLMBuffer *loopCurrentBuf = NULL; // local shock absorber for this loop + for( int index=0; index < kGLMVertexAttributeIndexMax; index++ ) + { + uint mask = 1<m_attrs[index]; // ptr to desired setup + + bool writeAttrib = false; + + switch(m_attribWriteMode) + { + case eAttribWriteAll: + writeAttrib = true; + break; + + case eAttribWriteDirty: + static uint hits=0,misses=0; + (void)hits; + (void)misses; + + // first see if we have to do anything at all. + // the equality operator checks buffer name, offset, stride, datatype and normalized. + // we check buffer revision separately, submitter of vertex setup is not expected to provide it (zero is preferred). + // consult the actual buffer directly. + + // note also, we're only doing thi compare when attrib #index is active for this batch. + // previously-active attribs which are becoming disabled need not be checked.. + + GLMVertexAttributeDesc *lastDesc = &m_lastKnownVertexAttribs[index]; + if ( (!(*newDesc == *lastDesc)) || (newDesc->m_buffer->m_revision != lastDesc->m_bufferRevision) ) + { + *lastDesc = *newDesc; // latch new setup + lastDesc->m_bufferRevision = newDesc->m_buffer->m_revision; // including proper revision of the sourcing buffer + + writeAttrib = true; + misses++; + } + else + { + hits++; + } + + #if 0 + if ( ((hits+misses) % 10000)==0) + { + printf("\n** attrib setup hits %d misses %d",hits,misses); + } + #endif + break; + } + + if( writeAttrib ) + { + CGLMBuffer * buf = newDesc->m_buffer; // bind buffer + Assert( buf ); + + if (buf != loopCurrentBuf) + { + BindBufferToCtx( kGLMVertexBuffer, buf ); // (if not already on the bind point of interest) + GLMCheckError(); + + loopCurrentBuf = buf; + } + + glVertexAttribPointer( index, newDesc->m_datasize, newDesc->m_datatype, newDesc->m_normalized, newDesc->m_stride, (const GLvoid *)(uintptr_t)newDesc->m_offset ); + GLMCheckError(); + } + + // enable is checked separately from the attrib binding + if (! (m_lastKnownVertexAttribMask & (1<m_locFragmentParams; + if (fconstLoc >=0) + { + #if GLMDEBUG + static uint paramsPushed=0,paramsSkipped=0,callsPushed=0; // things that happened on pushed param trips + static uint callsSkipped=0,paramsSkippedByCallSkip=0; // on unpushed param trips (zero dirty) + + (void)paramsPushed; + (void)paramsSkipped; + (void)callsPushed; + (void)callsSkipped; + (void)paramsSkippedByCallSkip; + #endif + + int slotCountToPush = 0; + int shaderSlots = m_boundPair->m_fragmentProg->m_descs[kGLMGLSL].m_highWater+1; + int dirtySlots = m_programParamsF[kGLMFragmentProgram].m_dirtySlotCount; + + switch( m_paramWriteMode ) + { + case eParamWriteAllSlots: slotCountToPush = kGLMFragmentProgramParamFloat4Limit; break; + case eParamWriteShaderSlots: slotCountToPush = shaderSlots; break; + + case eParamWriteShaderSlotsOptional: + { + slotCountToPush = shaderSlots; + + // ...unless, we're actually unchanged since last draw + if (dirtySlots == 0) + { + // write none + slotCountToPush = 0; + } + } + break; + + case eParamWriteDirtySlotRange: slotCountToPush = dirtySlots; break; + } + + if (slotCountToPush) + { + glUniform4fv( fconstLoc, slotCountToPush, &m_programParamsF[kGLMFragmentProgram].m_values[0][0] ); + GLMCheckError(); + + #if GLMDEBUG + paramsPushed += slotCountToPush; + paramsSkipped += shaderSlots - slotCountToPush; + + callsPushed++; + #endif + } + else + { + #if GLMDEBUG + paramsSkippedByCallSkip += shaderSlots; + + callsSkipped++; + #endif + } + + #if GLMDEBUG && 0 + if ( 0 && (GLMKnob("caps-key",NULL) > 0.0) ) // turn on as needed + { + // spew + GLMPRINTF(("FP callsPushed=%d ( paramsPushed=%d paramsSkipped=%d ) callsSkipped=%d (paramsSkippedByCallSkip=%d)", + callsPushed, paramsPushed, paramsSkipped, callsSkipped, paramsSkippedByCallSkip + )); + } + #endif + + m_programParamsF[kGLMFragmentProgram].m_dirtySlotCount = 0; //ack + } + + // fake SRGB + if (!m_caps.m_hasGammaWrites) // do we need to think about fake SRGB? + { + if (m_boundPair->m_locFragmentFakeSRGBEnable >= 0) // does the shader have that uniform handy? + { + float desiredValue = m_FakeBlendEnableSRGB ? 1.0 : 0.0; // what should it be set to? + + if (desiredValue != m_boundPair->m_fakeSRGBEnableValue) // and is that different from what it is known to be set to ? + { + glUniform1f( m_boundPair->m_locFragmentFakeSRGBEnable, desiredValue ); // if so, write it + GLMCheckError(); + + m_boundPair->m_fakeSRGBEnableValue = desiredValue; // and recall that we did so + } + } + } + + //samplers + if (m_boundPair) + { + if(!m_boundPair->m_samplersFixed) + { + for( int sampler=0; sampler<16; sampler++) + { + if (m_boundPair->m_locSamplers[sampler] >=0) + { + glUniform1iARB( m_boundPair->m_locSamplers[sampler], sampler ); + GLMCheckError(); + } + } + m_boundPair->m_samplersFixed = true; + } + } + } + break; + + default: + break; + } + } + else + { + this->NullProgram(); + } +} + + +#if GLMDEBUG + +enum EGLMDebugDumpOptions +{ + eDumpBatchInfo, + eDumpSurfaceInfo, + eDumpStackCrawl, + eDumpShaderLinks, +// eDumpShaderText, // we never use this one + eDumpShaderParameters, + eDumpTextureSetup, + eDumpVertexAttribSetup, + eDumpVertexData, + eOpenShadersForEdit +}; + +enum EGLMVertDumpMode +{ + // options that affect eDumpVertexData above + eDumpVertsNoTransformDump, + eDumpVertsTransformedByViewProj, + eDumpVertsTransformedByModelViewProj, + eDumpVertsTransformedByBoneZeroThenViewProj, + eDumpVertsTransformedByBonesThenViewProj, + eLastDumpVertsMode +}; + +const char *g_vertDumpModeNames[] = +{ + "noTransformDump", + "transformedByViewProj", + "transformedByModelViewProj", + "transformedByBoneZeroThenViewProj", + "transformedByBonesThenViewProj" +}; + +static void CopyTilEOL( char *dst, char *src, int dstSize ) +{ + dstSize--; + + int i=0; + while ( (im_caller==eDrawElements) || (info->m_caller==eDrawArrays) ); + const char *batchtype = is_draw ? "draw" : "clear"; + + if (options & (1<m_attach[i].m_tex; + if (tex) + { + GLMPRINTF(("-D- bound FBO (%8x) attachment %d = tex %8x (GL %d) (%s)", fbo, i, tex, tex->m_texName, tex->m_layout->m_layoutSummary )); + } + else + { + // warning if no depthstencil attachment + switch(i) + { + case kAttDepth: + case kAttStencil: + case kAttDepthStencil: + GLMPRINTF(("-D- bound FBO (%8x) attachment %d = NULL, warning!", fbo, i )); + break; + } + } + } + } + + #if 0 // disabled in steamworks sample for the time being + if (options & (1<GetStackCrawl(&cp); + + GLMPRINTF(("-D-" )); + GLMPRINTF(("-D- stack crawl")); + for( int i=0; i< cp.m_frameCount; i++) + { + GLMPRINTF(("-D-\t%s", cp.m_crawlNames[i] )); + } + } + #endif + + if ( (options & (1<m_text, "#//ATTRIBMAP"); + if (attribmap) + { + CopyTilEOL( attribtemp, attribmap, sizeof(attribtemp) ); + } + else + { + strcpy( attribtemp, "no attrib map" ); + } + + char *trans = strstr(vp->m_text, "#// trans#"); + if (trans) + { + CopyTilEOL( transtemp, trans, sizeof(transtemp) ); + } + else + { + strcpy( transtemp, "no translation info" ); + } + + const char *linkpath = "no file link"; + + #if GLMDEBUG && 0 // no editable shader support in example code + linkpath = vp->m_editable->m_mirror->m_path; + + GLMPRINTF(("-D-")); + GLMPRINTF(("-D- ARBVP || GL %d || Path %s ", vp->m_descs[kGLMARB].m_object.arb, linkpath )); + GLMPRINTF(("-D- Attribs %s", attribtemp )); + GLMPRINTF(("-D- Trans %s", transtemp )); + #endif + + /* + if ( (options & (1<m_string, eDebugDump )); + } + */ + } + else + { + GLMPRINTF(("-D- VP (none)" )); + } + + if (fp) + { + char *trans = strstr(fp->m_text, "#// trans#"); + if (trans) + { + CopyTilEOL( transtemp, trans, sizeof(transtemp) ); + } + else + { + strcpy( transtemp, "no translation info" ); + } + + const char *linkpath = "no file link"; + + #if GLMDEBUG && 0 // no editable shader support in example code + linkpath = fp->m_editable->m_mirror->m_path; + + GLMPRINTF(("-D-")); + GLMPRINTF(("-D- FP || GL %d || Path %s ", fp->m_descs[kGLMARB].m_object.arb, linkpath )); + GLMPRINTF(("-D- Trans %s", transtemp )); + #endif + + /* + if ( (options & (1<m_string, eDebugDump)); + } + */ + } + else + { + GLMPRINTF(("-D- FP (none)" )); + } + } + + if ( (options & (1<m_drawVertexSetup; + for( int index=0; index < kGLMVertexAttributeIndexMax; index++ ) + { + usesSkinning |= (setup->m_attrMask & (1<m_vtxAttribMap[index]>>4)== D3DDECLUSAGE_BLENDWEIGHT); + } + if (usesSkinning) + { + upperSlotLimit = 256; + } + + while( slotIndex < upperSlotLimit ) + { + // if slot index is in a masked range, skip it + // if slot index is the start of a matrix, label it, print it, skip ahead 4 slots + for( int maski=0; vmaskranges[maski] >=0; maski+=2) + { + if ( (slotIndex >= vmaskranges[maski]) && (slotIndex <= vmaskranges[maski+1]) ) + { + // that index is masked. set to one past end of range, print a blank line for clarity + slotIndex = vmaskranges[maski+1]+1; + GLMPrintStr("-D- ....."); + } + } + + if (slotIndex < upperSlotLimit) + { + float *values = &m_programParamsF[ kGLMVertexProgram ].m_values[slotIndex][0]; + + #if 0 // Source specific + switch( slotIndex ) + { + case 4: + printmat( "MODELVIEWPROJ", slotIndex, 4, values ); + slotIndex += 4; + break; + + case 8: + printmat( "VIEWPROJ", slotIndex, 4, values ); + slotIndex += 4; + break; + + default: + if (slotIndex>=58) + { + // bone + char bonelabel[100]; + + sprintf(bonelabel, "MODEL_BONE%-2d", (slotIndex-58)/3 ); + printmat( bonelabel, slotIndex, 3, values ); + + slotIndex += 3; + } + else + { + // just print the one slot + GLMPRINTF(("-D- %03d: [ %10.5f %10.5f %10.5f %10.5f ] %s", slotIndex, values[0], values[1], values[2], values[3], label )); + slotIndex++; + } + break; + } + #else + // just print the one slot + GLMPRINTF(("-D- %03d: [ %10.5f %10.5f %10.5f %10.5f ] %s", slotIndex, values[0], values[1], values[2], values[3], label )); + slotIndex++; + #endif + } + } + + // VP stage still, if in GLSL mode, find the bound pair and see if it has live i0, b0-b3 uniforms + if (m_boundPair) // should only be non-NULL in GLSL mode + { + if (m_boundPair->m_locVertexBool0>=0) + { + GLMPRINTF(("-D- GLSL 'b0': %d", m_programParamsB[kGLMVertexProgram].m_values[0] )); + } + + if (m_boundPair->m_locVertexBool1>=0) + { + GLMPRINTF(("-D- GLSL 'b1': %d", m_programParamsB[kGLMVertexProgram].m_values[1] )); + } + + if (m_boundPair->m_locVertexBool2>=0) + { + GLMPRINTF(("-D- GLSL 'b2': %d", m_programParamsB[kGLMVertexProgram].m_values[2] )); + } + + if (m_boundPair->m_locVertexBool3>=0) + { + GLMPRINTF(("-D- GLSL 'b3': %d", m_programParamsB[kGLMVertexProgram].m_values[3] )); + } + + if (m_boundPair->m_locVertexInteger0>=0) + { + GLMPRINTF(("-D- GLSL 'i0': %d", m_programParamsI[kGLMVertexProgram].m_values[0][0] )); + } + } + + GLMPRINTF(("-D-")); + GLMPRINTF(("-D- FP parameters " )); + + static int fmaskranges[] = { 40,41, -1,-1 }; + + slotIndex = 0; + label = ""; + while(slotIndex < 4) // reduced from 40 for example code + { + // if slot index is in a masked range, skip it + // if slot index is the start of a matrix, label it, print it, skip ahead 4 slots + for( int maski=0; fmaskranges[maski] >=0; maski+=2) + { + if ( (slotIndex >= fmaskranges[maski]) && (slotIndex <= fmaskranges[maski+1]) ) + { + // that index is masked. set to one past end of range, print a blank line for clarity + slotIndex = fmaskranges[maski+1]+1; + GLMPrintStr("-D- ....."); + } + } + + if (slotIndex < 40) + { + float *values = &m_programParamsF[ kGLMFragmentProgram ].m_values[slotIndex][0]; + #if 0 //Source specific + switch( slotIndex ) + { + case 0: label = "g_EnvmapTint"; break; + case 1: label = "g_DiffuseModulation"; break; + case 2: label = "g_EnvmapContrast_ShadowTweaks"; break; + case 3: label = "g_EnvmapSaturation_SelfIllumMask (xyz, and w)"; break; + case 4: label = "g_SelfIllumTint_and_BlendFactor (xyz, and w)"; break; + + case 12: label = "g_ShaderControls"; break; + case 13: label = "g_DepthFeatheringConstants"; break; + + case 20: label = "g_EyePos"; break; + case 21: label = "g_FogParams"; break; + case 22: label = "g_FlashlightAttenuationFactors"; break; + case 23: label = "g_FlashlightPos"; break; + case 24: label = "g_FlashlightWorldToTexture"; break; + + case 28: label = "cFlashlightColor"; break; + case 29: label = "g_LinearFogColor"; break; + case 30: label = "cLightScale"; break; + case 31: label = "cFlashlightScreenScale"; break; + + default: + label = ""; + break; + } + #else + label = ""; + #endif + GLMPRINTF(("-D- %03d: [ %10.5f %10.5f %10.5f %10.5f ] %s", slotIndex, values[0], values[1], values[2], values[3], label )); + + slotIndex ++; + } + } + + //if (m_boundPair->m_locFragmentFakeSRGBEnable) + //{ + // GLMPRINTF(("-D- GLSL 'flEnableSRGBWrite': %f", m_boundPair->m_fakeSRGBEnableValue )); + //} + } + + if ( (options & (1<m_layout->m_layoutSummary )); + + GLMPRINTF(("-D- addressMode[ %s %s %s ]", + GLMDecode( eGL_ENUM, samp->m_addressModes[0] ), + GLMDecode( eGL_ENUM, samp->m_addressModes[1] ), + GLMDecode( eGL_ENUM, samp->m_addressModes[2] ) + )); + + GLMPRINTF(("-D- magFilter [ %s ]", GLMDecode( eGL_ENUM, samp->m_magFilter ) )); + GLMPRINTF(("-D- minFilter [ %s ]", GLMDecode( eGL_ENUM, samp->m_minFilter ) )); + GLMPRINTF(("-D- srgb [ %s ]", samp->m_srgb ? "T" : "F" )); + + // add more as needed later.. + } + } + } + + if ( (options & (1<m_drawVertexSetup; + + uint relevantMask = setup->m_attrMask; + for( int index=0; index < kGLMVertexAttributeIndexMax; index++ ) + { + uint mask = 1<m_attrs[index]; + + char sizestr[100]; + if (setdesc->m_datasize < 32) + { + sprintf( sizestr, "%d", setdesc->m_datasize); + } + else + { + strcpy( sizestr, GLMDecode( eGL_ENUM, setdesc->m_datasize ) ); + } + + if (setup->m_vtxAttribMap[index] != 0xBB) + { + GLMPRINTF(("-D- attr=%-2d decl=$%s%1d stride=%-2d offset=%-3d buf=%08x bufbase=%08x size=%s type=%s normalized=%s ", + index, + GLMDecode(eD3D_VTXDECLUSAGE, setup->m_vtxAttribMap[index]>>4 ), + setup->m_vtxAttribMap[index]&0x0F, + setdesc->m_stride, + setdesc->m_offset, + setdesc->m_buffer, + setdesc->m_buffer->m_lastMappedAddress, + sizestr, + GLMDecode( eGL_ENUM, setdesc->m_datatype), + setdesc->m_normalized?"Y":"N" + )); + } + else + { + // the attrib map is referencing an attribute that is not wired up in the vertex setup... + Debugger(); + } + } + } + } + + if ( (options & (1<m_drawVertexSetup; + int start = info->m_drawStart; + int end = info->m_drawEnd; + int endLimit = start + (1<=0) + { + mark += sprintf(mark, "-D- %04d: ", vtxIndex ); + } + + // for transform dumping, we latch values as we spot them + float vtxPos[4]; + int vtxBoneIndices[4]; // only three get used + float vtxBoneWeights[4]; // only three get used and index 2 is synthesized from 0 and 1 + + vtxPos[0] = vtxPos[1] = vtxPos[2] = 0.0; + vtxPos[3] = 1.0; + + vtxBoneIndices[0] = vtxBoneIndices[1] = vtxBoneIndices[2] = vtxBoneIndices[3] = 0; + vtxBoneWeights[0] = vtxBoneWeights[1] = vtxBoneWeights[2] = vtxBoneWeights[3] = 0.0; + + for( int attr = 0; attr < kGLMVertexAttributeIndexMax; attr++ ) + { + if (setup->m_attrMask & (1<m_attrs[ attr ]; + + // print that attribute. + + // on OSX, VB's never move unless resized. You can peek at them when unmapped. Safe enough for debug.. + char *bufferBase = (char*)desc->m_buffer->m_lastMappedAddress; + + uint stride = desc->m_stride; + uint fieldoffset = desc->m_offset; + uint baseoffset = vtxIndex * stride; + + char *attrBase = bufferBase + baseoffset + fieldoffset; + + uint usage = setup->m_vtxAttribMap[attr]>>4; + uint usageindex = setup->m_vtxAttribMap[attr]&0x0F; + + if (vtxIndex <0) + { + mark += sprintf(mark, "[%s%1d @ offs=%04d / strd %03d] ", GLMDecode(eD3D_VTXDECLUSAGE, usage ), usageindex, fieldoffset, stride ); + } + else + { + mark += sprintf(mark, "[%s%1d ", GLMDecode(eD3D_VTXDECLUSAGE, usage ), usageindex ); + + if (desc->m_datasize<32) + { + for( int which = 0; which < desc->m_datasize; which++ ) + { + static const char *fieldname = "xyzw"; + switch( desc->m_datatype ) + { + case GL_FLOAT: + { + float *floatbase = (float*)attrBase; + mark += sprintf(mark, (usage != D3DDECLUSAGE_TEXCOORD) ? "%c%7.3f " : "%c%.3f", fieldname[which], floatbase[which] ); + + if (usage==D3DDECLUSAGE_POSITION) + { + if (which<4) + { + // latch pos + vtxPos[which] = floatbase[which]; + } + } + + if (usage==D3DDECLUSAGE_BLENDWEIGHT) + { + if (which<4) + { + // latch weight + vtxBoneWeights[which] = floatbase[which]; + } + } + } + break; + + case GL_UNSIGNED_BYTE: + { + unsigned char *unchbase = (unsigned char*)attrBase; + mark += sprintf(mark, "%c$%02X ", fieldname[which], unchbase[which] ); + } + break; + + default: + // hold off on other formats for now + mark += sprintf(mark, "%c????? ", fieldname[which] ); + break; + } + } + } + else // special path for BGRA bytes which are expressed in GL by setting the *size* to GL_BGRA (gross large enum) + { + switch(desc->m_datasize) + { + case GL_BGRA: // byte reversed color + { + for( int which = 0; which < 4; which++ ) + { + static const char *fieldname = "BGRA"; + switch( desc->m_datatype ) + { + case GL_UNSIGNED_BYTE: + { + unsigned char *unchbase = (unsigned char*)attrBase; + mark += sprintf(mark, "%c$%02X ", fieldname[which], unchbase[which] ); + + if (usage==D3DDECLUSAGE_BLENDINDICES) + { + if (which<4) + { + // latch index + vtxBoneIndices[which] = unchbase[which]; // ignoring the component reverse which BGRA would inflict, but we also ignore it below so it matches up. + } + } + } + break; + + default: + Debugger(); + break; + } + } + } + break; + } + } + mark += sprintf(mark, "] " ); + } + } + } + GLMPrintStr( buf, eDebugDump ); + + if (vtxIndex >=0) + { + // if transform dumping requested, and we've reached the actual vert dump phase, do it + float vtxout[4]; + const char *translabel = NULL; // NULL means no print... + + switch( g_vertDumpMode ) + { + case eDumpVertsNoTransformDump: break; + + case eDumpVertsTransformedByViewProj: // viewproj is slot 8 + { + float *viewproj = &m_programParamsF[ kGLMVertexProgram ].m_values[8][0]; + transform_dp4( vtxPos, viewproj, 4, vtxout ); + translabel = "post-viewproj"; + } + break; + + case eDumpVertsTransformedByModelViewProj: // modelviewproj is slot 4 + { + float *modelviewproj = &m_programParamsF[ kGLMVertexProgram ].m_values[4][0]; + transform_dp4( vtxPos, modelviewproj, 4, vtxout ); + translabel = "post-modelviewproj"; + } + break; + + case eDumpVertsTransformedByBoneZeroThenViewProj: + { + float postbone[4]; + postbone[3] = 1.0; + + float *bonemat = &m_programParamsF[ kGLMVertexProgram ].m_values[58][0]; + transform_dp4( vtxPos, bonemat, 3, postbone ); + + float *viewproj = &m_programParamsF[ kGLMVertexProgram ].m_values[8][0]; // viewproj is slot 8 + transform_dp4( postbone, viewproj, 4, vtxout ); + + translabel = "post-bone0-viewproj"; + } + break; + + case eDumpVertsTransformedByBonesThenViewProj: + { + float bone[4][4]; // [bone index][bone member] // members are adjacent + + vtxout[0] = vtxout[1] = vtxout[2] = vtxout[3] = 0; + + // unpack the third weight + vtxBoneWeights[2] = 1.0 - (vtxBoneWeights[0] + vtxBoneWeights[1]); + + for( int ibone=0; ibone<3; ibone++ ) + { + int boneindex = vtxBoneIndices[ ibone ]; + float *bonemat = &m_programParamsF[ kGLMVertexProgram ].m_values[58+(boneindex*3)][0]; + + float boneweight = vtxBoneWeights[ibone]; + + float postbonevtx[4]; + + transform_dp4( vtxPos, bonemat, 3, postbonevtx ); + + // add weighted sum into output + for( int which=0; which<4; which++ ) + { + vtxout[which] += boneweight * postbonevtx[which]; + } + } + + // fix W ? do we care ? check shaders to see what they do... + translabel = "post-skin3bone-viewproj"; + } + break; + + default: + break; + } + if(translabel) + { + // for extra credit, do the perspective divide and viewport + + GLMPRINTF(("-D- %-24s: [ %7.4f %7.4f %7.4f %7.4f ]", translabel, vtxout[0],vtxout[1],vtxout[2],vtxout[3] )); + GLMPRINTF(("-D-" )); + } + } + + if (vtxIndex<0) + { + vtxIndex = start-1; // for printing of the data (note it will be incremented at bottom of loop, so bias down by 1) + } + else + { // no more < and > around vert dump lines + //mark += sprintf(mark, "" ); + } + } + } + + if (options & (1<m_editable->OpenInEditor(); + } + + if (m_drawingProgram[ kGLMFragmentProgram ]) + { + m_drawingProgram[ kGLMFragmentProgram ]->m_editable->OpenInEditor(); + } + #endif + } +/* + if (options & (1<<)) + { + } +*/ + // trailer line + GLMPRINTF(("-D- ===================================================================================== end %s %d frame %d", batchtype, m_debugBatchIndex, m_debugFrameIndex )); + + GLMSetIndent(oldIndent); +} + +// here is the table that binds knob numbers to names. change at will. +const char *g_knobnames[] = +{ +/*0*/ "dummy", + +/*1*/ "FB-SRGB", + #if 0 + /*1*/ "tex-U0-bias", // src left + /*2*/ "tex-V0-bias", // src upper + /*3*/ "tex-U1-bias", // src right + /*4*/ "tex-V1-bias", // src bottom + + /*5*/ "pos-X0-bias", // dst left + /*6*/ "pos-Y0-bias", // dst upper + /*7*/ "pos-X1-bias", // dst right + /*8*/ "pos-Y1-bias", // dst bottom + #endif + +}; +int g_knobcount = sizeof( g_knobnames ) / sizeof( g_knobnames[0] ); + +void GLMContext::DebugHook( GLMDebugHookInfo *info ) +{ +#if 0 // disabled in steamworks example for time being + bool debughook = false; + // debug hook is called after an action has taken place. + // that would be the initial action, or a repeat. + // if paused, we stay inside this function until return. + // when returning, we inform the caller if it should repeat its last action or continue. + // there is no global pause state. The rest of the app runs at the best speed it can. + + // initial stuff we do unconditionally + + // increment iteration + info->m_iteration++; // can be thought of as "number of times the caller's action has now occurred - starting at 1" + + // now set initial state guess for the info block (outcome may change below) + info->m_loop = false; + + // check prior hold-conditions to see if any of them hit. + // note we disarm each trigger once the hold has occurred (one-shot style) + + switch( info->m_caller ) + { + case eBeginFrame: + if (debughook) GLMPRINTF(("-D- Caller: BeginFrame" )); + if ( (m_holdFrameBegin>=0) && (m_holdFrameBegin==m_debugFrameIndex) ) // did we hit a frame breakpoint? + { + if (debughook) GLMPRINTF(("-D- BeginFrame trigger match, clearing m_holdFrameBegin, hold=true" )); + + m_holdFrameBegin = -1; + + info->m_holding = true; + } + break; + + case eClear: + if (debughook) GLMPRINTF(("-D- Caller: Clear" )); + if ( (m_holdBatch>=0) && (m_holdBatchFrame>=0) && (m_holdBatch==m_debugBatchIndex) && (m_holdBatchFrame==m_debugFrameIndex) ) + { + if (debughook) GLMPRINTF(("-D- Clear trigger match, clearing m_holdBatch&Frame, hold=true" )); + + m_holdBatch = m_holdBatchFrame = -1; + + info->m_holding = true; + } + break; + + case eDrawElements: + if (debughook) GLMPRINTF(( (info->m_caller==eClear) ? "-D- Caller: Clear" : "-D- Caller: Draw" )); + if ( (m_holdBatch>=0) && (m_holdBatchFrame>=0) && (m_holdBatch==m_debugBatchIndex) && (m_holdBatchFrame==m_debugFrameIndex) ) + { + if (debughook) GLMPRINTF(("-D- Draw trigger match, clearing m_holdBatch&Frame, hold=true" )); + + m_holdBatch = m_holdBatchFrame = -1; + + info->m_holding = true; + } + break; + + case eEndFrame: + if (debughook) GLMPRINTF(("-D- Caller: EndFrame" )); + + // check for any expired batch hold req + if ( (m_holdBatch>=0) && (m_holdBatchFrame>=0) && (m_holdBatchFrame==m_debugFrameIndex) ) + { + // you tried to say 'next batch', but there wasn't one in this frame. + // target first batch of next frame instead + if (debughook) GLMPRINTF(("-D- EndFrame noticed an expired draw hold trigger, rolling to next frame, hold=false")); + + m_holdBatch = 0; + m_holdBatchFrame++; + + info->m_holding = false; + } + + // now check for an explicit hold on end of this frame.. + if ( (m_holdFrameEnd>=0) && (m_holdFrameEnd==m_debugFrameIndex) ) + { + if (debughook) GLMPRINTF(("-D- EndFrame trigger match, clearing m_holdFrameEnd, hold=true" )); + + m_holdFrameEnd = -1; + + info->m_holding = true; + } + break; + } + + // spin until event queue is empty *and* hold is false + + int evtcount=0; + + bool refresh = info->m_holding || m_debugDelayEnable; // only refresh once per initial visit (if paused!) or follow up event input + int breakToDebugger = 0; + // 1 = break to GDB + // 2 = break to OpenGL Profiler if attached + + do + { + if (refresh) + { + if (debughook) GLMPRINTF(("-D- pushing pixels" )); + this->DebugPresent(); // show pixels + + uint minidumpOptions = (1<DebugDump( info, minidumpOptions, g_vertDumpMode ); + + usleep(10000); // lil sleep + + refresh = false; + } + + bool eventCheck = true; // event pull will be skipped if we detect a shader edit being done + // keep editable shaders in sync + #if GLMDEBUG + + bool redrawBatch = false; + if (m_drawingProgram[ kGLMVertexProgram ]) + { + if( m_drawingProgram[ kGLMVertexProgram ]->SyncWithEditable() ) + { + redrawBatch = true; + } + } + + if (m_drawingProgram[ kGLMFragmentProgram ]) + { + if( m_drawingProgram[ kGLMFragmentProgram ]->SyncWithEditable() ) + { + redrawBatch = true; + } + } + + if (redrawBatch) + { + // act as if user pressed the option-\ key + + if (m_drawingLang == kGLMGLSL) + { + // if GLSL mode, force relink - and refresh the pair cache as needed + if (m_boundPair) + { + // fix it in place + m_boundPair->RefreshProgramPair(); + } + } + FlushDrawStates( true ); // this is key, because the linked shader pair may have changed (note call to PurgePairsWithShader in cglmprogram.cpp) + + GLMPRINTF(("-- Shader changed, re-running batch" )); + + m_holdBatch = m_debugBatchIndex; + m_holdBatchFrame = m_debugFrameIndex; + m_debugDelayEnable = false; + + info->m_holding = false; + info->m_loop = true; + + eventCheck = false; + } + #endif + + if(eventCheck) + { + g_extCocoaMgr->PumpWindowsMessageLoop(); + CCocoaEvent evt; + evtcount = g_extCocoaMgr->GetEvents( &evt, 1, true ); // asking for debug events only. + if (evtcount) + { + // print it + if (debughook) GLMPRINTF(("-D- Received debug key '%c' with modifiers %x", evt.m_UnicodeKeyUnmodified, evt.m_ModifierKeyMask )); + + // flag for refresh if we spin again + refresh = 1; + + switch(evt.m_UnicodeKeyUnmodified) + { + case ' ': // toggle pause + // clear all the holds to be sure + m_holdFrameBegin = m_holdFrameEnd = m_holdBatch = m_holdBatchFrame = -1; + info->m_holding = !info->m_holding; + + if (!info->m_holding) + { + m_debugDelayEnable = false; // coming out of pause means no slow mo + } + + GLMPRINTF((info->m_holding ? "-D- Paused." : "-D- Unpaused." )); + break; + + case 'f': // frame advance + GLMPRINTF(("-D- Command: next frame" )); + m_holdFrameBegin = m_debugFrameIndex+1; // stop at top of next numbered frame + m_debugDelayEnable = false; // get there fast + + info->m_holding = false; + break; + + case ']': // ahead 1 batch + case '}': // ahead ten batches + { + int delta = evt.m_UnicodeKeyUnmodified == ']' ? 1 : 10; + m_holdBatch = m_debugBatchIndex+delta; + m_holdBatchFrame = m_debugFrameIndex; + m_debugDelayEnable = false; // get there fast + info->m_holding = false; + GLMPRINTF(("-D- Command: advance %d batches to %d", delta, m_holdBatch )); + } + break; + + case '[': // back one batch + case '{': // back 10 batches + { + int delta = evt.m_UnicodeKeyUnmodified == '[' ? -1 : -10; + m_holdBatch = m_debugBatchIndex + delta; + if (m_holdBatch<0) + { + m_holdBatch = 0; + } + m_holdBatchFrame = m_debugFrameIndex+1; // next frame, but prev batch # + m_debugDelayEnable = false; // get there fast + info->m_holding = false; + GLMPRINTF(("-D- Command: rewind %d batches to %d", delta, m_holdBatch )); + } + break; + + case '\\': // batch rerun + + m_holdBatch = m_debugBatchIndex; + m_holdBatchFrame = m_debugFrameIndex; + m_debugDelayEnable = false; + info->m_holding = false; + info->m_loop = true; + GLMPRINTF(("-D- Command: re-run batch %d", m_holdBatch )); + break; + + case 'c': // toggle auto color clear + m_autoClearColor = !m_autoClearColor; + GLMPRINTF((m_autoClearColor ? "-D- Auto color clear ON" : "-D- Auto color clear OFF" )); + break; + + case 's': // toggle auto stencil clear + m_autoClearStencil = !m_autoClearStencil; + GLMPRINTF((m_autoClearStencil ? "-D- Auto stencil clear ON" : "-D- Auto stencil clear OFF" )); + break; + + case 'd': // toggle auto depth clear + m_autoClearDepth = !m_autoClearDepth; + GLMPRINTF((m_autoClearDepth ? "-D- Auto depth clear ON" : "-D- Auto depth clear OFF" )); + break; + + case '.': // break to debugger or insta-quit + if (evt.m_ModifierKeyMask & (1<m_holding = true; + info->m_loop = true; // so when you come back from debugger, you get another spin (i.e. you enter paused mode) + } + break; + + case 'g': // break to OGLP and enable OGLP logging of spew + if (GLMDetectOGLP()) // if this comes back true, there will be a breakpoint set on glColor4sv. + { + uint channelMask = GLMDetectAvailableChannels(); // will re-assert whether spew goes to OGLP log + + if (channelMask & (1<m_holding = true; + info->m_loop = true; // so when you come back from debugger, you get another spin (i.e. you enter paused mode) + } + } + break; + + case '_': // toggle slow mo + m_debugDelayEnable = !m_debugDelayEnable; + break; + + case '-': // go slower + if (m_debugDelayEnable) + { + // already in slow mo, so lower speed + m_debugDelay <<= 1; // double delay + if (m_debugDelay > (1<<24)) + { + m_debugDelay = (1<<24); + } + } + else + { + // enter slow mo + m_debugDelayEnable = true; + } + break; + + case '=': // go faster + if (m_debugDelayEnable) + { + // already in slow mo, so raise speed + m_debugDelay >>= 1; // halve delay + if (m_debugDelay < (1<<17)) + { + m_debugDelay = (1<<17); + } + } + else + { + // enter slow mo + m_debugDelayEnable = true; + } + break; + + case 'v': + // open vs in editor (foreground pop) + #if GLMDEBUG + if (m_boundProgram[ kGLMVertexProgram ]) + { + m_boundProgram[ kGLMVertexProgram ]->m_editable->OpenInEditor( true ); + } + #endif + break; + + case 'p': + // open fs/ps in editor (foreground pop) + #if GLMDEBUG + if (m_boundProgram[ kGLMFragmentProgram ]) + { + m_boundProgram[ kGLMFragmentProgram ]->m_editable->OpenInEditor( true ); + } + #endif + break; + + case '<': // dump fewer verts + case '>': // dump more verts + { + int delta = (evt.m_UnicodeKeyUnmodified=='>') ? 1 : -1; + g_maxVertsToDumpLog2 = MIN( MAX( g_maxVertsToDumpLog2+delta, 0 ), 16 ); + + // just re-dump the verts + DebugDump( info, 1<= eLastDumpVertsMode) + { + // wrap + newmode = eDumpVertsNoTransformDump; + } + g_vertDumpMode = (EGLMVertDumpMode)newmode; + + GLMPRINTF(("-D- New vert dump mode is %s", g_vertDumpModeNames[g_vertDumpMode] )); + } + break; + + case 'u': // more crawl + { + CStackCrawlParams cp; + memset( &cp, 0, sizeof(cp) ); + cp.m_frameLimit = kMaxCrawlFrames; + + g_extCocoaMgr->GetStackCrawl(&cp); + + GLMPRINTF(("-D-" )); + GLMPRINTF(("-D- extended stack crawl:")); + for( int i=0; i< cp.m_frameCount; i++) + { + GLMPRINTF(("-D-\t%s", cp.m_crawlNames[i] )); + } + } + break; + + case 'q': + DebugDump( info, 0xFFFFFFFF, g_vertDumpMode ); + break; + + + case 'H': + case 'h': + { + // toggle drawing language. hold down shift key to do it immediately. + + if (m_caps.m_hasDualShaders) + { + bool immediate; + + immediate = evt.m_UnicodeKeyUnmodified == 'H'; // (evt.m_ModifierKeyMask & (1<=0) && (flavorSelect m_selKnobMaxValue) + { + val = m_selKnobMaxValue; + } + // send new value back to the knob + GLMKnob( g_knobnames[ m_selKnobIndex ], &val ); + } + + if (evt.m_UnicodeKeyUnmodified == 'z') + { + // zero + val = 0.0f; + + // send new value back to the knob + GLMKnob( g_knobnames[ m_selKnobIndex ], &val ); + } + + GLMPRINTF(("-D- Knob # %d (%s) set to %f (%f/1024.0)", m_selKnobIndex, g_knobnames[ m_selKnobIndex ], val, val * 1024.0 )); + + usleep( 500000 ); + refresh = false; + } + } + break; + + } + } + } + } while( ((evtcount>0) || info->m_holding) && (!breakToDebugger) ); + + if (m_debugDelayEnable) + { + usleep( m_debugDelay ); + } + + if (breakToDebugger) + { + switch (breakToDebugger) + { + case 1: + Debugger(); + break; + + case 2: + short fakecolor[4]; + glColor4sv( fakecolor ); // break to OGLP + break; + } + // re-flush all GLM states so you can fiddle with them in the debugger. then run the batch again and spin.. + FlushStates( true ); + } +#endif +} + +void GLMContext::DebugPresent( void ) +{ + CGLMTex *drawBufferTex = m_drawingFBO->m_attach[kAttColor0].m_tex; + glFinish(); + this->Present( drawBufferTex ); +} + +void GLMContext::DebugClear( void ) +{ + // get old clear color + GLClearColor_t clearcol_orig; + m_ClearColor.Read( &clearcol_orig,0 ); + + // new clear color + GLClearColor_t clearcol; + clearcol.r = m_autoClearColorValues[0]; + clearcol.g = m_autoClearColorValues[1]; + clearcol.b = m_autoClearColorValues[2]; + clearcol.a = m_autoClearColorValues[3]; + m_ClearColor.Write( &clearcol, true, true ); // don't check, don't defer + + uint mask = 0; + + if (m_autoClearColor) mask |= GL_COLOR_BUFFER_BIT; + if (m_autoClearDepth) mask |= GL_DEPTH_BUFFER_BIT; + if (m_autoClearStencil) mask |= GL_STENCIL_BUFFER_BIT; + + glClear( mask ); + glFinish(); + + // put old color back + m_ClearColor.Write( &clearcol_orig, true, true ); // don't check, don't defer +} + +#endif + +void GLMContext::DrawRangeElements( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ) +{ + GLM_FUNC; + +// CheckCurrent(); + + m_debugBatchIndex++; // batch index increments unconditionally on entry + + bool hasVP = m_boundProgram[ kGLMVertexProgram ] != NULL; + bool hasFP = m_boundProgram[ kGLMFragmentProgram ] != NULL; + + void *indicesActual = (void*)indices; + if (m_drawIndexBuffer->m_pseudo) + { + // you have to pass actual address, not offset... shhh... secret + indicesActual = (void*)((uintptr_t)indicesActual + (uintptr_t)m_drawIndexBuffer->m_pseudoBuf); + } + +#if GLMDEBUG + // init debug hook information + GLMDebugHookInfo info; + memset( &info, 0, sizeof(info) ); + info.m_caller = eDrawElements; + + // relay parameters we're operating under + info.m_drawMode = mode; + info.m_drawStart = start; + info.m_drawEnd = end; + info.m_drawCount = count; + info.m_drawType = type; + info.m_drawIndices = indices; + + do + { + // obey global options re pre-draw clear + if (m_autoClearColor || m_autoClearDepth || m_autoClearStencil) + { + GLMPRINTF(("-- DrawRangeElements auto clear" )); + this->DebugClear(); + } + + // always sync with editable shader text prior to draw + #if GLMDEBUG + //FIXME disengage this path if context is in GLSL mode.. + // it will need fixes to get the shader pair re-linked etc if edits happen anyway. + + if (m_boundProgram[ kGLMVertexProgram ]) + { + m_boundProgram[ kGLMVertexProgram ]->SyncWithEditable(); + } + else + { + //AssertOnce(!"drawing with no vertex program bound"); + } + + + if (m_boundProgram[ kGLMFragmentProgram ]) + { + m_boundProgram[ kGLMFragmentProgram ]->SyncWithEditable(); + } + else + { + //AssertOnce(!"drawing with no fragment program bound"); + } + #endif + + // do the drawing + if (hasVP && hasFP) + { + glDrawRangeElements( mode, start, end, count, type, indicesActual ); + GLMCheckError(); + + if (m_slowCheckEnable) + { + CheckNative(); + } + } + this->DebugHook( &info ); + } while (info.m_loop); +#else + if (hasVP && hasFP) + { + glDrawRangeElements( mode, start, end, count, type, indicesActual ); + GLMCheckError(); + + if (m_slowCheckEnable) + { + CheckNative(); + } + } +#endif +} + +void GLMContext::DrawArrays( GLenum mode, GLuint first, GLuint count ) +{ + GLM_FUNC; + + m_debugBatchIndex++; // batch index increments unconditionally on entry + + bool hasVP = m_boundProgram[ kGLMVertexProgram ] != NULL; + bool hasFP = m_boundProgram[ kGLMFragmentProgram ] != NULL; + + // note that the GLMDEBUG path is not wired up here yet + if (hasVP && hasFP) + { + #if GLMDEBUG && 0 + // init debug hook information + GLMDebugHookInfo info; + memset( &info, 0, sizeof(info) ); + info.m_caller = eDrawArrays; + + // relay parameters we're operating under + info.m_drawMode = mode; + info.m_drawStart = first; + info.m_drawEnd = first+count; + info.m_drawCount = count; + info.m_drawType = 0; // no one was using this anyway.. + info.m_drawIndices = NULL; + + glDrawArrays(mode, first, count); + GLMCheckError(); + + DebugDump( &info, 0xFFFFFFFF, g_vertDumpMode ); + #else + glDrawArrays(mode, first, count); + GLMCheckError(); + #endif + + if (m_slowCheckEnable) + { + CheckNative(); + } + } +} + +void GLMContext::CheckNative( void ) +{ + // note that this is available in release. We don't use GLMPRINTF for that reason. + // note we do not get called unless either slow-batch asserting or logging is enabled. + + bool gpuProcessing; + GLint fragmentGPUProcessing, vertexGPUProcessing; + + CGLGetParameter (CGLGetCurrentContext(), kCGLCPGPUFragmentProcessing, &fragmentGPUProcessing); + CGLGetParameter(CGLGetCurrentContext(), kCGLCPGPUVertexProcessing, &vertexGPUProcessing); + + // spews then asserts. + // that way you can enable both, get log output on a pair if it's slow, and then the debugger will pop. + if(m_slowSpewEnable) + { + if ( !vertexGPUProcessing ) + { + m_boundProgram[ kGLMVertexProgram ]->LogSlow( m_drawingLang ); + } + if ( !fragmentGPUProcessing ) + { + m_boundProgram[ kGLMFragmentProgram ]->LogSlow( m_drawingLang ); + } + } + + if(m_slowAssertEnable) + { + if ( !vertexGPUProcessing || !fragmentGPUProcessing) + { + Assert( !"slow batch" ); + } + } +} + + + +// debug font +void GLMContext::GenDebugFontTex( void ) +{ + if(!m_debugFontTex) + { + // make a 128x128 RGBA texture + GLMTexLayoutKey key; + memset( &key, 0, sizeof(key) ); + + key.m_texGLTarget = GL_TEXTURE_2D; + key.m_xSize = 128; + key.m_ySize = 128; + key.m_zSize = 1; + key.m_texFormat = D3DFMT_A8R8G8B8; + key.m_texFlags = 0; + + m_debugFontTex = this->NewTex( &key, "GLM debug font" ); + + + //----------------------------------------------------- + GLMTexLockParams lockreq; + + lockreq.m_tex = m_debugFontTex; + lockreq.m_face = 0; + lockreq.m_mip = 0; + + GLMTexLayoutSlice *slice = &m_debugFontTex->m_layout->m_slices[ lockreq.m_tex->CalcSliceIndex( lockreq.m_face, lockreq.m_mip ) ]; + + lockreq.m_region.xmin = lockreq.m_region.ymin = lockreq.m_region.zmin = 0; + lockreq.m_region.xmax = slice->m_xSize; + lockreq.m_region.ymax = slice->m_ySize; + lockreq.m_region.zmax = slice->m_zSize; + + char *lockAddress; + int yStride; + int zStride; + + m_debugFontTex->Lock( &lockreq, &lockAddress, &yStride, &zStride ); + GLMCheckError(); + + //----------------------------------------------------- + // fetch elements of font data and make texels... we're doing the whole slab so we don't really need the stride info + unsigned long *destTexelPtr = (unsigned long *)lockAddress; + + for( int index = 0; index < 16384; index++ ) + { + if (g_glmDebugFontMap[index] == ' ') + { + // clear + *destTexelPtr = 0x00000000; + } + else + { + // opaque white (drawing code can modulate if desired) + *destTexelPtr = 0xFFFFFFFF; + } + destTexelPtr++; + } + + //----------------------------------------------------- + GLMTexLockParams unlockreq; + + unlockreq.m_tex = m_debugFontTex; + unlockreq.m_face = 0; + unlockreq.m_mip = 0; + + // region need not matter for unlocks + unlockreq.m_region.xmin = unlockreq.m_region.ymin = unlockreq.m_region.zmin = 0; + unlockreq.m_region.xmax = unlockreq.m_region.ymax = unlockreq.m_region.zmax = 0; + + m_debugFontTex->Unlock( &unlockreq ); + GLMCheckError(); + + //----------------------------------------------------- + // change up the tex sampling on this texture to be "nearest" not linear + + //----------------------------------------------------- + + // don't leave texture bound on the TMU + this->BindTexToTMU(NULL, 0 ); + + // also make the index and vertex buffers for use - up to 1K indices and 1K verts + + uint indexBufferSize = 1024*2; + + m_debugFontIndices = this->NewBuffer(kGLMIndexBuffer, indexBufferSize, 0); // two byte indices + + // we go ahead and lock it now, and fill it with indices 0-1023. + char *indices = NULL; + GLMBuffLockParams idxLock; + idxLock.m_offset = 0; + idxLock.m_size = indexBufferSize; + idxLock.m_nonblocking = false; + idxLock.m_discard = false; + m_debugFontIndices->Lock( &idxLock, &indices ); + for( int i=0; i<1024; i++) + { + unsigned short *idxPtr = &((unsigned short*)indices)[i]; + *idxPtr = i; + } + m_debugFontIndices->Unlock(); + + m_debugFontVertices = this->NewBuffer(kGLMVertexBuffer, 1024 * 128, 0); // up to 128 bytes per vert + } +} + +#define MAX_DEBUG_CHARS 256 +struct GLMDebugTextVertex +{ + float x,y,z; + float u,v; + char rgba[4]; +}; + +void GLMContext::DrawDebugText( float x, float y, float z, float drawCharWidth, float drawCharHeight, char *string ) +{ + if (!m_debugFontTex) + { + GenDebugFontTex(); + } + + // setup needed to draw text + + // we're assuming that +x goes left to right on screen, no billboarding math in here + // and that +y goes bottom up + // caller knows projection / rectangle so it gets to decide vertex spacing + + // debug font must be bound to TMU 0 + // texturing enabled + // alpha blending enabled + // generate a quad per character + // characters are 6px wide by 11 px high. + // upper left character in tex is 0x20 + // y axis will need to be flipped for display + + // for any character in 0x20 - 0x7F - here are the needed UV's + + // leftU = ((character % 16) * 6.0f / 128.0f) + // rightU = lowU + (6.0 / 128.0); + // topV = ((character - 0x20) * 11.0f / 128.0f) + // bottomV = lowV + (11.0f / 128.0f) + + int stringlen = strlen( string ); + if (stringlen > MAX_DEBUG_CHARS) + { + stringlen = MAX_DEBUG_CHARS; + } + + // lock + char *vertices = NULL; + GLMBuffLockParams vtxLock; + vtxLock.m_offset = 0; + vtxLock.m_size = 1024 * stringlen; + vtxLock.m_nonblocking = false; + vtxLock.m_discard = false; + m_debugFontVertices->Lock( &vtxLock, &vertices ); + + GLMDebugTextVertex *vtx = (GLMDebugTextVertex*)vertices; + GLMDebugTextVertex *vtxOutPtr = vtx; + + for( int charindex = 0; charindex < stringlen; charindex++ ) + { + float leftU,rightU,topV,bottomV; + + int character = (int)string[charindex]; + character -= 0x20; + if ( (character<0) || (character > 0x7F) ) + { + character = '*' - 0x20; + } + + leftU = ((character & 0x0F) * 6.0f ) / 128.0f; + rightU = leftU + (6.0f / 128.0f); + + topV = ((character >> 4) * 11.0f ) / 128.0f; + bottomV = topV + (11.0f / 128.0f); + + float posx,posy,posz; + + posx = x + (drawCharWidth * (float)charindex); + posy = y; + posz = z; + + // generate four verts + // first vert will be upper left of displayed quad (low X, high Y) then we go clockwise + for( int quadvert = 0; quadvert < 4; quadvert++ ) + { + bool isTop = (quadvert <2); // verts 0 and 1 + bool isLeft = (quadvert & 1) == (quadvert >> 1); // verts 0 and 3 + + vtxOutPtr->x = posx + (isLeft ? 0.0f : drawCharWidth); + vtxOutPtr->y = posy + (isTop ? drawCharHeight : 0.0f); + vtxOutPtr->z = posz; + + vtxOutPtr->u = isLeft ? leftU : rightU; + vtxOutPtr->v = isTop ? topV : bottomV; + + vtxOutPtr++; + } + } + + // verts are done. + // unlock... + + m_debugFontVertices->Unlock(); + + // make a vertex setup + GLMVertexSetup vertSetup; + + // position, color, tc = 0, 3, 8 + vertSetup.m_attrMask = (1<BindTexToTMU( m_debugFontTex, 0 ); + + SelectTMU(0); // somewhat redundant + + glDisable( GL_DEPTH_TEST ); + + glEnable(GL_TEXTURE_2D); + GLMCheckError(); + + if (0) + { + glEnableClientState(GL_VERTEX_ARRAY); + GLMCheckError(); + + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + GLMCheckError(); + + glVertexPointer( 3, GL_FLOAT, sizeof( vtx[0] ), &vtx[0].x ); + GLMCheckError(); + + glClientActiveTexture(GL_TEXTURE0); + GLMCheckError(); + + glTexCoordPointer( 2, GL_FLOAT, sizeof( vtx[0] ), &vtx[0].u ); + GLMCheckError(); + } + else + { + SetVertexAttributes( &vertSetup ); + } + + glDrawArrays( GL_QUADS, 0, stringlen * 4 ); + GLMCheckError(); + + // disable all the input streams + if (0) + { + glDisableClientState(GL_VERTEX_ARRAY); + GLMCheckError(); + + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + GLMCheckError(); + } + else + { + SetVertexAttributes( NULL ); + } + + glDisable(GL_TEXTURE_2D); + GLMCheckError(); + + this->BindTexToTMU( NULL, 0 ); +} + + + +//=============================================================================== + +void GLMgrSelfTests( void ) +{ + return; // until such time as the tests are revised or axed + + // make a new context on renderer 0. + GLMContext *ctx = GLMgr::aGLMgr()->NewContext( 0 ); ////FIXME you can't make contexts this way any more. + if (!ctx) + { + Debugger(); // no go + return; + } + + // make a test object based on that context. + int alltests[] = {0,1,2,3, -1}; + int newtests[] = {3, -1}; + int notests[] = {-1}; + + int *testlist = notests; + + GLMTestParams params; + memset( ¶ms, 0, sizeof(params) ); + + params.m_ctx = ctx; + params.m_testList = testlist; + + params.m_glErrToDebugger = true; + params.m_glErrToConsole = true; + + params.m_intlErrToDebugger = true; + params.m_intlErrToConsole = true; + + params.m_frameCount = 1000; + + GLMTester testobj( ¶ms ); + + testobj.RunTests( ); + + GLMgr::aGLMgr()->DelContext( ctx ); +} + +void GLMContext::SetDefaultStates( void ) +{ + GLM_FUNC; + CheckCurrent(); + + m_AlphaTestEnable.Default(); + m_AlphaTestFunc.Default(); + + m_AlphaToCoverageEnable.Default(); + + m_CullFaceEnable.Default(); + m_CullFrontFace.Default(); + + m_PolygonMode.Default(); + m_DepthBias.Default(); + + m_ClipPlaneEnable.Default(); + m_ClipPlaneEquation.Default(); + + m_ScissorEnable.Default(); + m_ScissorBox.Default(); + + m_ViewportBox.Default(); + m_ViewportDepthRange.Default(); + + m_ColorMaskSingle.Default(); + m_ColorMaskMultiple.Default(); + + m_BlendEnable.Default(); + m_BlendFactor.Default(); + m_BlendEquation.Default(); + m_BlendColor.Default(); + //m_BlendEnableSRGB.Default(); // this isn't useful until there is an FBO bound - in fact it will trip a GL error. + + m_DepthTestEnable.Default(); + m_DepthFunc.Default(); + m_DepthMask.Default(); + + m_StencilTestEnable.Default(); + m_StencilFunc.Default(); + m_StencilOp.Default(); + m_StencilWriteMask.Default(); + + m_ClearColor.Default(); + m_ClearDepth.Default(); + m_ClearStencil.Default(); +} + +void GLMContext::FlushStates( bool noDefer ) +{ + GLM_FUNC; + CheckCurrent(); + + m_AlphaTestEnable.Flush( noDefer ); + m_AlphaTestFunc.Flush( noDefer ); + + m_AlphaToCoverageEnable.Flush( noDefer ); + + m_CullFaceEnable.Flush( noDefer ); + m_CullFrontFace.Flush( noDefer ); + + m_PolygonMode.Flush( noDefer ); + m_DepthBias.Flush( noDefer ); + + #if GLMDEBUG + m_ClipPlaneEnable.Flush( true ); // always push clip state + m_ClipPlaneEquation.Flush( true ); + #else + m_ClipPlaneEnable.Flush( noDefer ); + m_ClipPlaneEquation.Flush( noDefer ); + #endif + + + m_ScissorEnable.Flush( noDefer ); + m_ScissorBox.Flush( noDefer ); + + m_ViewportBox.Flush( noDefer ); + m_ViewportDepthRange.Flush( noDefer ); + + m_ColorMaskSingle.Flush( noDefer ); + m_ColorMaskMultiple.Flush( noDefer ); + + m_BlendEnable.Flush( noDefer ); + m_BlendFactor.Flush( noDefer ); + m_BlendEquation.Flush( noDefer ); + m_BlendColor.Flush( noDefer ); + + // the next call should not occur until we're sure the proper SRGB tex format is underneath the FBO. + // So, we're moving it up to FlushDrawStates so it can happen at just the right time. + //m_BlendEnableSRGB.Flush( noDefer ); + + m_DepthTestEnable.Flush( noDefer ); + m_DepthFunc.Flush( noDefer ); + m_DepthMask.Flush( noDefer ); + + m_StencilTestEnable.Flush( noDefer ); + m_StencilFunc.Flush( noDefer ); + m_StencilOp.Flush( noDefer ); + m_StencilWriteMask.Flush( noDefer ); + + m_ClearColor.Flush( noDefer ); + m_ClearDepth.Flush( noDefer ); + m_ClearStencil.Flush( noDefer ); + + GLMCheckError(); +} + +void GLMContext::VerifyStates ( void ) +{ + GLM_FUNC; + CheckCurrent(); + + // bare bones sanity check, head over to the debugger if our sense of the current context state is not correct + // we should only want to call this after a flush or the checks will flunk. + + if( m_AlphaTestEnable.Check() ) GLMStop(); + if( m_AlphaTestFunc.Check() ) GLMStop(); + + if( m_AlphaToCoverageEnable.Check() ) GLMStop(); + + if( m_CullFaceEnable.Check() ) GLMStop(); + if( m_CullFrontFace.Check() ) GLMStop(); + + if( m_PolygonMode.Check() ) GLMStop(); + if( m_DepthBias.Check() ) GLMStop(); + + if( m_ClipPlaneEnable.Check() ) GLMStop(); + //if( m_ClipPlaneEquation.Check() ) GLMStop(); + + if( m_ScissorEnable.Check() ) GLMStop(); + if( m_ScissorBox.Check() ) GLMStop(); + + + if( m_ViewportBox.Check() ) GLMStop(); + if( m_ViewportDepthRange.Check() ) GLMStop(); + + if( m_ColorMaskSingle.Check() ) GLMStop(); + if( m_ColorMaskMultiple.Check() ) GLMStop(); + + if( m_BlendEnable.Check() ) GLMStop(); + if( m_BlendFactor.Check() ) GLMStop(); + if( m_BlendEquation.Check() ) GLMStop(); + if( m_BlendColor.Check() ) GLMStop(); + + // only do this as caps permit + if (m_caps.m_hasGammaWrites) + { + if( m_BlendEnableSRGB.Check() ) GLMStop(); + } + + if( m_DepthTestEnable.Check() ) GLMStop(); + if( m_DepthFunc.Check() ) GLMStop(); + if( m_DepthMask.Check() ) GLMStop(); + + if( m_StencilTestEnable.Check() ) GLMStop(); + if( m_StencilFunc.Check() ) GLMStop(); + if( m_StencilOp.Check() ) GLMStop(); + if( m_StencilWriteMask.Check() ) GLMStop(); + + if( m_ClearColor.Check() ) GLMStop(); + if( m_ClearDepth.Check() ) GLMStop(); + if( m_ClearStencil.Check() ) GLMStop(); +} + +void GLMContext::WriteAlphaTestEnable( GLAlphaTestEnable_t *src ) +{ + m_AlphaTestEnable.Write( src ); +} + +void GLMContext::WriteAlphaTestFunc( GLAlphaTestFunc_t *src ) +{ + m_AlphaTestFunc.Write( src ); +} + +void GLMContext::WriteAlphaToCoverageEnable( GLAlphaToCoverageEnable_t *src ) +{ + m_AlphaToCoverageEnable.Write( src ); +} + +void GLMContext::WriteCullFaceEnable( GLCullFaceEnable_t *src ) +{ + m_CullFaceEnable.Write( src ); +} + +void GLMContext::WriteCullFrontFace( GLCullFrontFace_t *src ) +{ + m_CullFrontFace.Write( src ); +} + +void GLMContext::WritePolygonMode( GLPolygonMode_t *src ) +{ + m_PolygonMode.Write( src ); +} + +void GLMContext::WriteDepthBias( GLDepthBias_t *src ) +{ + m_DepthBias.Write( src ); +} + +void GLMContext::WriteClipPlaneEnable( GLClipPlaneEnable_t *src, int which ) +{ + m_ClipPlaneEnable.WriteIndex( src, which ); +} + +void GLMContext::WriteClipPlaneEquation( GLClipPlaneEquation_t *src, int which ) +{ + m_ClipPlaneEquation.WriteIndex( src, which ); +} + +void GLMContext::WriteScissorEnable( GLScissorEnable_t *src ) +{ + m_ScissorEnable.Write( src ); +} + +void GLMContext::WriteScissorBox( GLScissorBox_t *src ) +{ + m_ScissorBox.Write( src ); +} + +void GLMContext::WriteViewportBox( GLViewportBox_t *src ) +{ + m_ViewportBox.Write( src ); +} + +void GLMContext::WriteViewportDepthRange( GLViewportDepthRange_t *src ) +{ + m_ViewportDepthRange.Write( src ); +} + +void GLMContext::WriteColorMaskSingle( GLColorMaskSingle_t *src ) +{ + m_ColorMaskSingle.Write( src ); +} + +void GLMContext::WriteColorMaskMultiple( GLColorMaskMultiple_t *src, int which ) +{ + m_ColorMaskMultiple.WriteIndex( src, which ); +} + +void GLMContext::WriteBlendEnable( GLBlendEnable_t *src ) +{ + m_BlendEnable.Write( src ); +} + +void GLMContext::WriteBlendFactor( GLBlendFactor_t *src ) +{ + m_BlendFactor.Write( src ); +} + +void GLMContext::WriteBlendEquation( GLBlendEquation_t *src ) +{ + m_BlendEquation.Write( src ); +} + +void GLMContext::WriteBlendColor( GLBlendColor_t *src ) +{ + m_BlendColor.Write( src ); +} + +void GLMContext::WriteBlendEnableSRGB( GLBlendEnableSRGB_t *src ) +{ + if (m_caps.m_hasGammaWrites) // only if caps allow do we actually push it through to the extension + { + m_BlendEnableSRGB.Write( src ); + } + else + { + m_FakeBlendEnableSRGB = src->enable; + } + // note however that we're still tracking what this mode should be, so FlushDrawStates can look at it and adjust the pixel shader + // if fake SRGB mode is in place (m_caps.m_hasGammaWrites is false) +} + +void GLMContext::WriteDepthTestEnable( GLDepthTestEnable_t *src ) +{ + m_DepthTestEnable.Write( src ); +} + +void GLMContext::WriteDepthFunc( GLDepthFunc_t *src ) +{ + m_DepthFunc.Write( src ); +} + +void GLMContext::WriteDepthMask( GLDepthMask_t *src ) +{ + m_DepthMask.Write( src ); +} + +void GLMContext::WriteStencilTestEnable( GLStencilTestEnable_t *src ) +{ + m_StencilTestEnable.Write( src ); +} + +void GLMContext::WriteStencilFunc( GLStencilFunc_t *src ) +{ + m_StencilFunc.Write( src ); +} + +void GLMContext::WriteStencilOp( GLStencilOp_t *src, int which ) +{ + m_StencilOp.WriteIndex( src, which ); +} + +void GLMContext::WriteStencilWriteMask( GLStencilWriteMask_t *src ) +{ + m_StencilWriteMask.Write( src ); +} + +void GLMContext::WriteClearColor( GLClearColor_t *src ) +{ + m_ClearColor.Write( src ); +} + +void GLMContext::WriteClearDepth( GLClearDepth_t *src ) +{ + m_ClearDepth.Write( src ); +} + +void GLMContext::WriteClearStencil( GLClearStencil_t *src ) +{ + m_ClearStencil.Write( src ); +} + +//=============================================================================== +// template specializations for each type of state + + +// --- GLAlphaTestEnable --- +void GLContextSet( GLAlphaTestEnable_t *src ) +{ + glSetEnable( GL_ALPHA_TEST, src->enable ); +} + +void GLContextGet( GLAlphaTestEnable_t *dst ) +{ + dst->enable = glIsEnabled( GL_ALPHA_TEST ); +} + +void GLContextGetDefault( GLAlphaTestEnable_t *dst ) +{ + dst->enable = GL_FALSE; +} + +// --- GLAlphaTestFunc --- +void GLContextSet( GLAlphaTestFunc_t *src ) +{ + glAlphaFunc( src->func, src->ref ); +} + +void GLContextGet( GLAlphaTestFunc_t *dst ) +{ + glGetEnumv( GL_ALPHA_TEST_FUNC, &dst->func ); + glGetFloatv( GL_ALPHA_TEST_REF, &dst->ref ); +} + +void GLContextGetDefault( GLAlphaTestFunc_t *dst ) +{ + dst->func = GL_ALWAYS; + dst->ref = 0.0f; +} + +// --- GLAlphaToCoverageEnable --- +void GLContextSet( GLAlphaToCoverageEnable_t *src ) +{ + glSetEnable( GL_SAMPLE_ALPHA_TO_COVERAGE_ARB, src->enable ); +} + +void GLContextGet( GLAlphaToCoverageEnable_t *dst ) +{ + dst->enable = glIsEnabled( GL_SAMPLE_ALPHA_TO_COVERAGE_ARB ); +} + +void GLContextGetDefault( GLAlphaToCoverageEnable_t *dst ) +{ + dst->enable = GL_FALSE; +} + +// --- GLCullFaceEnable --- +void GLContextSet( GLCullFaceEnable_t *src ) +{ + glSetEnable( GL_CULL_FACE, src->enable ); +} + +void GLContextGet( GLCullFaceEnable_t *dst ) +{ + dst->enable = glIsEnabled( GL_CULL_FACE ); +} + +void GLContextGetDefault( GLCullFaceEnable_t *dst ) +{ + dst->enable = GL_TRUE; +} + + +// --- GLCullFrontFace --- +void GLContextSet( GLCullFrontFace_t *src ) +{ + glFrontFace( src->value ); // legal values are GL_CW or GL_CCW +} + +void GLContextGet( GLCullFrontFace_t *dst ) +{ + glGetEnumv( GL_FRONT_FACE, &dst->value ); +} + +void GLContextGetDefault( GLCullFrontFace_t *dst ) +{ + dst->value = GL_CCW; +} + + +// --- GLPolygonMode --- +void GLContextSet( GLPolygonMode_t *src ) +{ + glPolygonMode( GL_FRONT, src->values[0] ); + glPolygonMode( GL_BACK, src->values[1] ); +} + +void GLContextGet( GLPolygonMode_t *dst ) +{ + glGetEnumv( GL_POLYGON_MODE, &dst->values[0] ); + +} + +void GLContextGetDefault( GLPolygonMode_t *dst ) +{ + dst->values[0] = dst->values[1] = GL_FILL; +} + + +// --- GLDepthBias --- +// note the implicit enable / disable. +// if you set non zero values, it is enabled, otherwise not. +void GLContextSet( GLDepthBias_t *src ) +{ + bool enable = (src->factor != 0.0f) || (src->units != 0.0f); + + glSetEnable( GL_POLYGON_OFFSET_FILL, enable ); + glPolygonOffset( src->factor, src->units ); +} + +void GLContextGet( GLDepthBias_t *dst ) +{ + glGetFloatv ( GL_POLYGON_OFFSET_FACTOR, &dst->factor ); + glGetFloatv ( GL_POLYGON_OFFSET_UNITS, &dst->units ); +} + +void GLContextGetDefault( GLDepthBias_t *dst ) +{ + dst->factor = 0.0; + dst->units = 0.0; +} + + +// --- GLScissorEnable --- +void GLContextSet( GLScissorEnable_t *src ) +{ + glSetEnable( GL_SCISSOR_TEST, src->enable ); +} + +void GLContextGet( GLScissorEnable_t *dst ) +{ + dst->enable = glIsEnabled( GL_SCISSOR_TEST ); +} + +void GLContextGetDefault( GLScissorEnable_t *dst ) +{ + dst->enable = GL_FALSE; +} + + +// --- GLScissorBox --- +void GLContextSet( GLScissorBox_t *src ) +{ + glScissor ( src->x, src->y, src->width, src->height ); +} + +void GLContextGet( GLScissorBox_t *dst ) +{ + glGetIntegerv ( GL_SCISSOR_BOX, &dst->x ); +} + +void GLContextGetDefault( GLScissorBox_t *dst ) +{ + // hmmmm, good question? we can't really know a good answer so we pick a silly one + // and the client better come back with a better answer later. + dst->x = dst->y = 0; + dst->width = dst->height = 16; +} + + +// --- GLViewportBox --- + +void GLContextSet( GLViewportBox_t *src ) +{ + glViewport (src->x, src->y, src->width, src->height ); +} + +void GLContextGet( GLViewportBox_t *dst ) +{ + glGetIntegerv ( GL_VIEWPORT, &dst->x ); +} + +void GLContextGetDefault( GLViewportBox_t *dst ) +{ + // as with the scissor box, we don't know yet, so pick a silly one and change it later + dst->x = dst->y = 0; + dst->width = dst->height = 16; +} + + +// --- GLViewportDepthRange --- +void GLContextSet( GLViewportDepthRange_t *src ) +{ + glDepthRange ( src->near, src->far ); +} + +void GLContextGet( GLViewportDepthRange_t *dst ) +{ + glGetDoublev ( GL_DEPTH_RANGE, &dst->near ); +} + +void GLContextGetDefault( GLViewportDepthRange_t *dst ) +{ + dst->near = 0.0; + dst->far = 1.0; +} + +// --- GLClipPlaneEnable --- +void GLContextSetIndexed( GLClipPlaneEnable_t *src, int index ) +{ + #if 0 // disabled for sample GLMDEBUG + if (0 /*CommandLine()->FindParm("-caps_noclipplanes")*/) + { + if (GLMKnob("caps-key",NULL) > 0.0) + { + // caps ON means NO clipping + src->enable = false; + } + } + #endif + glSetEnable( GL_CLIP_PLANE0 + index, src->enable ); + GLMCheckError(); +} + +void GLContextGetIndexed( GLClipPlaneEnable_t *dst, int index ) +{ + dst->enable = glIsEnabled( GL_CLIP_PLANE0 + index ); +} + +void GLContextGetDefaultIndexed( GLClipPlaneEnable_t *dst, int index ) +{ + dst->enable = 0; +} + + + +// --- GLClipPlaneEquation --- +void GLContextSetIndexed( GLClipPlaneEquation_t *src, int index ) +{ + // shove into glGlipPlane + GLdouble coeffs[4] = { src->x, src->y, src->z, src->w }; + + glClipPlane( GL_CLIP_PLANE0 + index, coeffs ); + GLMCheckError(); +} + +void GLContextGetIndexed( GLClipPlaneEquation_t *dst, int index ) +{ + Debugger(); // do this later +// glClipPlane( GL_CLIP_PLANE0 + index, coeffs ); +// GLdouble coeffs[4] = { src->x, src->y, src->z, src->w }; +} + +void GLContextGetDefaultIndexed( GLClipPlaneEquation_t *dst, int index ) +{ + dst->x = 1.0; + dst->y = 0.0; + dst->z = 0.0; + dst->w = 0.0; +} + + +// --- GLColorMaskSingle --- +void GLContextSet( GLColorMaskSingle_t *src ) +{ + glColorMask( src->r, src->g, src->b, src->a ); +} + +void GLContextGet( GLColorMaskSingle_t *dst ) +{ + glGetBooleanv( GL_COLOR_WRITEMASK, (GLboolean*)&dst->r); +} + +void GLContextGetDefault( GLColorMaskSingle_t *dst ) +{ + dst->r = dst->g = dst->b = dst->a = 1; +} + + +// --- GLColorMaskMultiple --- +void GLContextSetIndexed( GLColorMaskMultiple_t *src, int index ) +{ + // FIXME: this call is not in the Leopard headers. A runtime-lookup will be needed. + pfnglColorMaskIndexedEXT ( index, src->r, src->g, src->b, src->a ); +} + +void GLContextGetIndexed( GLColorMaskMultiple_t *dst, int index ) +{ + // FIXME: this call is not in the Leopard headers. A runtime-lookup will be needed. + glGetBooleanIndexedvEXT ( GL_COLOR_WRITEMASK, index, (GLboolean*)&dst->r ); +} + +void GLContextGetDefaultIndexed( GLColorMaskMultiple_t *dst, int index ) +{ + dst->r = dst->g = dst->b = dst->a = 1; +} + + +// --- GLBlendEnable --- +void GLContextSet( GLBlendEnable_t *src ) +{ + glSetEnable( GL_BLEND, src->enable ); +} + +void GLContextGet( GLBlendEnable_t *dst ) +{ + dst->enable = glIsEnabled( GL_BLEND ); +} + +void GLContextGetDefault( GLBlendEnable_t *dst ) +{ + dst->enable = GL_FALSE; +} + + +// --- GLBlendFactor --- +void GLContextSet( GLBlendFactor_t *src ) +{ + glBlendFunc ( src->srcfactor, src->dstfactor ); +} + +void GLContextGet( GLBlendFactor_t *dst ) +{ + glGetEnumv ( GL_BLEND_SRC, &dst->srcfactor ); + glGetEnumv ( GL_BLEND_DST, &dst->dstfactor ); +} + +void GLContextGetDefault( GLBlendFactor_t *dst ) +{ + dst->srcfactor = GL_ONE; + dst->dstfactor = GL_ZERO; +} + + +// --- GLBlendEquation --- +void GLContextSet( GLBlendEquation_t *src ) +{ + glBlendEquation ( src->equation ); +} + +void GLContextGet( GLBlendEquation_t *dst ) +{ + glGetEnumv ( GL_BLEND_EQUATION, &dst->equation ); +} + +void GLContextGetDefault( GLBlendEquation_t *dst ) +{ + dst->equation = GL_FUNC_ADD; +} + + +// --- GLBlendColor --- +void GLContextSet( GLBlendColor_t *src ) +{ + glBlendColor ( src->r, src->g, src->b, src->a ); +} + +void GLContextGet( GLBlendColor_t *dst ) +{ + glGetFloatv ( GL_BLEND_COLOR, &dst->r ); +} + +void GLContextGetDefault( GLBlendColor_t *dst ) +{ + //solid white + dst->r = dst->g = dst->b = dst->a = 1.0; +} + + +// --- GLBlendEnableSRGB --- + +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_COLOR_ATTACHMENT0 0x8CE0 + +void GLContextSet( GLBlendEnableSRGB_t *src ) +{ + #if GLMDEBUG + // just check in debug... this is too expensive to look at on MTGL + if (src->enable) + { + GLboolean srgb_capable = false; + glGetBooleanv( GL_FRAMEBUFFER_SRGB_CAPABLE_EXT, &srgb_capable); + + if (src->enable && !srgb_capable) + { + GLMPRINTF(("-Z- srgb-state-set FBO conflict: attempt to enable SRGB on non SRGB capable FBO config")); + } + } + #endif + // this query is not useful unless you have the ARB_framebuffer_srgb ext. + //GLint encoding = 0; + //pfnglGetFramebufferAttachmentParameteriv( GL_DRAW_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, &encoding ); + //GLMCheckError(); + + glSetEnable( GL_FRAMEBUFFER_SRGB_EXT, src->enable ); + GLMCheckError(); +} + +void GLContextGet( GLBlendEnableSRGB_t *dst ) +{ + //dst->enable = glIsEnabled( GL_FRAMEBUFFER_SRGB_EXT ); + dst->enable = true; // wtf ? +} + +void GLContextGetDefault( GLBlendEnableSRGB_t *dst ) +{ + dst->enable = GL_FALSE; +} + + +// --- GLDepthTestEnable --- +void GLContextSet( GLDepthTestEnable_t *src ) +{ + glSetEnable( GL_DEPTH_TEST, src->enable ); +} + +void GLContextGet( GLDepthTestEnable_t *dst ) +{ + dst->enable = glIsEnabled( GL_DEPTH_TEST ); +} + +void GLContextGetDefault( GLDepthTestEnable_t *dst ) +{ + dst->enable = GL_FALSE; +} + + +// --- GLDepthFunc --- +void GLContextSet( GLDepthFunc_t *src ) +{ + glDepthFunc ( src->func ); +} + +void GLContextGet( GLDepthFunc_t *dst ) +{ + glGetEnumv ( GL_DEPTH_FUNC, &dst->func ); +} + +void GLContextGetDefault( GLDepthFunc_t *dst ) +{ + dst->func = GL_GEQUAL; +} + + +// --- GLDepthMask --- +void GLContextSet( GLDepthMask_t *src ) +{ + glDepthMask ( src->mask ); +} + +void GLContextGet( GLDepthMask_t *dst ) +{ + glGetBooleanv ( GL_DEPTH_WRITEMASK, (GLboolean*)&dst->mask ); +} + +void GLContextGetDefault( GLDepthMask_t *dst ) +{ + dst->mask = GL_TRUE; +} + + +// --- GLStencilTestEnable --- +void GLContextSet( GLStencilTestEnable_t *src ) +{ + glSetEnable( GL_STENCIL_TEST, src->enable ); +} + +void GLContextGet( GLStencilTestEnable_t *dst ) +{ + dst->enable = glIsEnabled( GL_STENCIL_TEST ); +} + +void GLContextGetDefault( GLStencilTestEnable_t *dst ) +{ + dst->enable = GL_FALSE; +} + + +// --- GLStencilFunc --- +void GLContextSet( GLStencilFunc_t *src ) +{ + glStencilFuncSeparateATI( src->frontfunc, src->backfunc, src->ref, src->mask); +} + +void GLContextGet( GLStencilFunc_t *dst ) +{ + glGetEnumv ( GL_STENCIL_FUNC, &dst->frontfunc ); + glGetEnumv ( GL_STENCIL_BACK_FUNC_ATI, &dst->backfunc ); + glGetIntegerv ( GL_STENCIL_REF, &dst->ref ); + glGetIntegerv ( GL_STENCIL_VALUE_MASK, (GLint*)&dst->mask ); +} + +void GLContextGetDefault( GLStencilFunc_t *dst ) +{ + dst->frontfunc = GL_ALWAYS; + dst->backfunc = GL_ALWAYS; + dst->ref = 0; + dst->mask = 0xFFFFFFFF; +} + + +// --- GLStencilOp --- indexed 0=front, 1=back + +void GLContextSetIndexed( GLStencilOp_t *src, int index ) +{ + GLenum face = (index==0) ? GL_FRONT : GL_BACK; + + glStencilOpSeparateATI( face, src->sfail, src->dpfail, src->dppass ); +} + +void GLContextGetIndexed( GLStencilOp_t *dst, int index ) +{ + GLenum face = (index==0) ? GL_FRONT : GL_BACK; + + glGetEnumv ( (index==0) ? GL_STENCIL_FAIL : GL_STENCIL_BACK_FAIL_ATI, &dst->sfail ); + glGetEnumv ( (index==0) ? GL_STENCIL_PASS_DEPTH_FAIL : GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI, &dst->dpfail ); + glGetEnumv ( (index==0) ? GL_STENCIL_PASS_DEPTH_PASS : GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI, &dst->dppass ); +} + +void GLContextGetDefaultIndexed( GLStencilOp_t *dst, int index ) +{ + dst->sfail = dst->dpfail = dst->dppass = GL_KEEP; +} + + +// --- GLStencilWriteMask --- +void GLContextSet( GLStencilWriteMask_t *src ) +{ + glStencilMask( src->mask ); +} + +void GLContextGet( GLStencilWriteMask_t *dst ) +{ + glGetIntegerv ( GL_STENCIL_WRITEMASK, &dst->mask ); +} + +void GLContextGetDefault( GLStencilWriteMask_t *dst ) +{ + dst->mask = 0xFFFFFFFF; +} + + +// --- GLClearColor --- +void GLContextSet( GLClearColor_t *src ) +{ + glClearColor( src->r, src->g, src->b, src->a ); +} + +void GLContextGet( GLClearColor_t *dst ) +{ + glGetFloatv ( GL_COLOR_CLEAR_VALUE, &dst->r ); +} + +void GLContextGetDefault( GLClearColor_t *dst ) +{ + dst->r = dst->g = dst->b = 0.5; + dst->a = 1.0; +} + + +// --- GLClearDepth --- +void GLContextSet( GLClearDepth_t *src ) +{ + glClearDepth ( src->d ); +} + +void GLContextGet( GLClearDepth_t *dst ) +{ + glGetDoublev ( GL_DEPTH_CLEAR_VALUE, &dst->d ); +} + +void GLContextGetDefault( GLClearDepth_t *dst ) +{ + dst->d = 1.0; +} + + +// --- GLClearStencil --- +void GLContextSet( GLClearStencil_t *src ) +{ + glClearStencil( src->s ); +} + +void GLContextGet( GLClearStencil_t *dst ) +{ + glGetIntegerv ( GL_STENCIL_CLEAR_VALUE, &dst->s ); +} + +void GLContextGetDefault( GLClearStencil_t *dst ) +{ + dst->s = 0; +} + +//=============================================================================== + + +GLMTester::GLMTester(GLMTestParams *params) +{ + m_params = *params; + + m_drawFBO = NULL; + m_drawColorTex = NULL; + m_drawDepthTex = NULL; +} + +GLMTester::~GLMTester() +{ +} + +void GLMTester::StdSetup( void ) +{ + GLMContext *ctx = m_params.m_ctx; + + m_drawWidth = 1024; + m_drawHeight = 768; + + // make an FBO to draw into and activate it. no depth buffer yet + m_drawFBO = ctx->NewFBO(); + + // make color buffer texture + + GLMTexLayoutKey colorkey; + CGLMTex *colortex; + memset( &colorkey, 0, sizeof(colorkey) ); + + colorkey.m_texGLTarget = GL_TEXTURE_2D; + colorkey.m_xSize = m_drawWidth; + colorkey.m_ySize = m_drawHeight; + colorkey.m_zSize = 1; + + colorkey.m_texFormat = D3DFMT_A8R8G8B8; + colorkey.m_texFlags = kGLMTexRenderable; + + m_drawColorTex = ctx->NewTex( &colorkey ); + + // do not leave that texture bound on the TMU + ctx->BindTexToTMU(NULL, 0 ); + + + // attach color to FBO + GLMFBOTexAttachParams colorParams; + memset( &colorParams, 0, sizeof(colorParams) ); + + colorParams.m_tex = m_drawColorTex; + colorParams.m_face = 0; + colorParams.m_mip = 0; + colorParams.m_zslice= 0; // for clarity.. + + m_drawFBO->TexAttach( &colorParams, kAttColor0 ); + + // check it. + bool ready = m_drawFBO->IsReady(); + InternalError( !ready, "drawing FBO no go"); + + // bind it + ctx->BindFBOToCtx( m_drawFBO, GL_READ_FRAMEBUFFER_EXT ); + ctx->BindFBOToCtx( m_drawFBO, GL_DRAW_FRAMEBUFFER_EXT ); + + glViewport(0, 0, (GLsizei) m_drawWidth, (GLsizei) m_drawHeight ); + CheckGLError("stdsetup viewport"); + + glScissor( 0,0, (GLsizei) m_drawWidth, (GLsizei) m_drawHeight ); + CheckGLError("stdsetup scissor"); + + glOrtho( -1,1, -1,1, -1,1 ); + CheckGLError("stdsetup ortho"); + + // activate debug font + ctx->GenDebugFontTex(); +} + +void GLMTester::StdCleanup( void ) +{ + GLMContext *ctx = m_params.m_ctx; + + // unbind + ctx->BindFBOToCtx( NULL, GL_READ_FRAMEBUFFER_EXT ); + ctx->BindFBOToCtx( NULL, GL_DRAW_FRAMEBUFFER_EXT ); + + // del FBO + if (m_drawFBO) + { + ctx->DelFBO( m_drawFBO ); + m_drawFBO = NULL; + } + + // del tex + if (m_drawColorTex) + { + ctx->DelTex( m_drawColorTex ); + m_drawColorTex = NULL; + } + + if (m_drawDepthTex) + { + ctx->DelTex( m_drawDepthTex ); + m_drawDepthTex = NULL; + } +} + + +void GLMTester::Clear( void ) +{ + GLMContext *ctx = m_params.m_ctx; + ctx->MakeCurrent(); + + glViewport(0, 0, (GLsizei) m_drawWidth, (GLsizei) m_drawHeight ); + glScissor( 0,0, (GLsizei) m_drawWidth, (GLsizei) m_drawHeight ); + glOrtho( -1,1, -1,1, -1,1 ); + CheckGLError("clearing viewport"); + + // clear to black + GLfloat clear_color[4] = { 0.0f, 0.0f, 0.0, 1.0f }; + glClearColor(clear_color[0], clear_color[1], clear_color[2], clear_color[3]); + CheckGLError("clearing color"); + + glClear(GL_COLOR_BUFFER_BIT+GL_DEPTH_BUFFER_BIT+GL_STENCIL_BUFFER_BIT); + CheckGLError("clearing"); + + //glFinish(); + //CheckGLError("clear finish"); +} + +void GLMTester::Present( int seed ) +{ + GLMContext *ctx = m_params.m_ctx; + ctx->Present( m_drawColorTex ); + +} + +void GLMTester::CheckGLError( const char *comment ) +{ + char errbuf[1024]; + + //borrowed from GLMCheckError.. slightly different + + if (!comment) + { + comment = ""; + } + + GLenum errorcode = (GLenum)glGetError(); + GLenum errorcode2 = 0; + if ( errorcode != GL_NO_ERROR ) + { + const char *decodedStr = GLMDecode( eGL_ERROR, errorcode ); + const char *decodedStr2 = ""; + + if ( errorcode == GL_INVALID_FRAMEBUFFER_OPERATION_EXT ) + { + // dig up the more detailed FBO status + errorcode2 = glCheckFramebufferStatusEXT( GL_FRAMEBUFFER_EXT ); + + decodedStr2 = GLMDecode( eGL_ERROR, errorcode2 ); + + sprintf( errbuf, "\n%s - GL Error %08x/%08x = '%s / %s'", comment, errorcode, errorcode2, decodedStr, decodedStr2 ); + } + else + { + sprintf( errbuf, "\n%s - GL Error %08x = '%s'", comment, errorcode, decodedStr ); + } + + if ( m_params.m_glErrToConsole ) + { + printf("%s", errbuf ); + } + + if ( m_params.m_glErrToDebugger ) + { + Debugger(); + } + } +} + +void GLMTester::InternalError( int errcode, const char *comment ) +{ + if (errcode) + { + if (m_params.m_intlErrToConsole) + { + printf("\%s - error %d", comment, errcode ); + } + + if (m_params.m_intlErrToDebugger) + { + Debugger(); + } + } +} + + +void GLMTester::RunTests( void ) +{ + int *testList = m_params.m_testList; + + while( (*testList >=0) && (*testList < 20) ) + { + RunOneTest( *testList++ ); + } +} + +void GLMTester::RunOneTest( int testindex ) +{ + // this might be better with 'ptmf' style + switch(testindex) + { + case 0: Test0(); break; + case 1: Test1(); break; + case 2: Test2(); break; + case 3: Test3(); break; + + default: + Debugger(); // unrecognized + } +} + +// ##################################################################################################################### + +// some fixed lists which may be useful to all tests + +D3DFORMAT g_drawTexFormatsGLMT[] = // -1 terminated +{ + D3DFMT_A8R8G8B8, + D3DFMT_A4R4G4B4, + D3DFMT_X8R8G8B8, + D3DFMT_X1R5G5B5, + D3DFMT_A1R5G5B5, + D3DFMT_L8, + D3DFMT_A8L8, + D3DFMT_R8G8B8, + D3DFMT_A8, + D3DFMT_R5G6B5, + D3DFMT_DXT1, + D3DFMT_DXT3, + D3DFMT_DXT5, + D3DFMT_A32B32G32R32F, + D3DFMT_A16B16G16R16, + + (D3DFORMAT)-1 +}; + +D3DFORMAT g_fboColorTexFormatsGLMT[] = // -1 terminated +{ + D3DFMT_A8R8G8B8, + //D3DFMT_A4R4G4B4, //unsupported + D3DFMT_X8R8G8B8, + D3DFMT_X1R5G5B5, + //D3DFMT_A1R5G5B5, //unsupported + D3DFMT_A16B16G16R16F, + D3DFMT_A32B32G32R32F, + D3DFMT_R5G6B5, + + (D3DFORMAT)-1 +}; + +D3DFORMAT g_fboDepthTexFormatsGLMT[] = // -1 terminated, but note 0 for "no depth" mode +{ + (D3DFORMAT)0, + D3DFMT_D16, + D3DFMT_D24X8, + D3DFMT_D24S8, + + (D3DFORMAT)-1 +}; + + +// ##################################################################################################################### + +void GLMTester::Test0( void ) +{ + // make and delete a bunch of textures. + // lock and unlock them. + // use various combos of - + + // √texel format + // √2D | 3D | cube map + // √mipped / not + // √POT / NPOT + // large / small / square / rect + // square / rect + + GLMContext *ctx = m_params.m_ctx; + ctx->MakeCurrent(); + + std::vector< CGLMTex* > testTextures; // will hold all the built textures + + // test stage loop + // 0 is creation + // 1 is lock/unlock + // 2 is deletion + + for( int teststage = 0; teststage < 3; teststage++) + { + int innerindex = 0; // increment at stage switch + // format loop + for( D3DFORMAT *fmtPtr = g_drawTexFormatsGLMT; *fmtPtr != ((D3DFORMAT)-1); fmtPtr++ ) + { + // form loop + GLenum forms[] = { GL_TEXTURE_2D, GL_TEXTURE_3D, GL_TEXTURE_CUBE_MAP, (GLenum)-1 }; + + for( GLenum *formPtr = forms; *formPtr != ((GLenum)-1); formPtr++ ) + { + // mip loop + for( int mipped = 0; mipped < 2; mipped++ ) + { + // large / square / pot loop + // &4 == large &2 == square &1 == POT + // NOTE you *have to be square* for cube maps. + + for( int aspect = 0; aspect < 8; aspect++ ) + { + switch( teststage ) + { + case 0: + { + GLMTexLayoutKey key; + memset( &key, 0, sizeof(key) ); + + key.m_texGLTarget = *formPtr; + key.m_texFormat = *fmtPtr; + if (mipped) + key.m_texFlags |= kGLMTexMipped; + + // assume big, square, POT, and 3D, then adjust as needed + key.m_xSize = key.m_ySize = key.m_zSize = 256; + + if ( !(aspect&4) ) // big or little ? + { + // little + key.m_xSize >>= 2; + key.m_ySize >>= 2; + key.m_zSize >>= 2; + } + + if ( key.m_texGLTarget != GL_TEXTURE_CUBE_MAP ) + { + if ( !(aspect & 2) ) // square or rect? + { + // rect + key.m_ySize >>= 1; + key.m_zSize >>= 2; + } + } + + if ( !(aspect&1) ) // POT or NPOT? + { + // NPOT + key.m_xSize += 56; + key.m_ySize += 56; + key.m_zSize += 56; + } + + // 2D, 3D, cube map ? + if (key.m_texGLTarget!=GL_TEXTURE_3D) + { + // 2D or cube map: flatten Z extent to one texel + key.m_zSize = 1; + } + else + { + // 3D: knock down Z quite a bit so our test case does not run out of RAM + key.m_zSize >>= 3; + if (!key.m_zSize) + { + key.m_zSize = 1; + } + } + + CGLMTex *newtex = ctx->NewTex( &key ); + CheckGLError( "tex create test"); + InternalError( newtex==NULL, "tex create test" ); + + testTextures.push_back( newtex ); + printf("\n[%5d] created tex %s",innerindex,newtex->m_layout->m_layoutSummary ); + } + break; + + case 1: + { + CGLMTex *ptex = testTextures[innerindex]; + + for( int face=0; face m_layout->m_faceCount; face++) + { + for( int mip=0; mip m_layout->m_mipCount; mip++) + { + GLMTexLockParams lockreq; + + lockreq.m_tex = ptex; + lockreq.m_face = face; + lockreq.m_mip = mip; + + GLMTexLayoutSlice *slice = &ptex->m_layout->m_slices[ ptex->CalcSliceIndex( face, mip ) ]; + + lockreq.m_region.xmin = lockreq.m_region.ymin = lockreq.m_region.zmin = 0; + lockreq.m_region.xmax = slice->m_xSize; + lockreq.m_region.ymax = slice->m_ySize; + lockreq.m_region.zmax = slice->m_zSize; + + char *lockAddress; + int yStride; + int zStride; + + ptex->Lock( &lockreq, &lockAddress, &yStride, &zStride ); + CheckGLError( "tex lock test"); + InternalError( lockAddress==NULL, "null lock address"); + + // write some texels of this flavor: + // red 75% green 40% blue 15% alpha 80% + + GLMGenTexelParams gtp; + + gtp.m_format = ptex->m_layout->m_format->m_d3dFormat; + gtp.m_dest = lockAddress; + gtp.m_chunkCount = (slice->m_xSize * slice->m_ySize * slice->m_zSize) / (ptex->m_layout->m_format->m_chunkSize * ptex->m_layout->m_format->m_chunkSize); + gtp.m_byteCountLimit = slice->m_storageSize; + gtp.r = 0.75; + gtp.g = 0.40; + gtp.b = 0.15; + gtp.a = 0.80; + + GLMGenTexels( >p ); + + InternalError( gtp.m_bytesWritten != gtp.m_byteCountLimit, "byte count mismatch from GLMGenTexels" ); + } + } + + for( int face=0; face m_layout->m_faceCount; face++) + { + for( int mip=0; mip m_layout->m_mipCount; mip++) + { + GLMTexLockParams unlockreq; + + unlockreq.m_tex = ptex; + unlockreq.m_face = face; + unlockreq.m_mip = mip; + + // region need not matter for unlocks + unlockreq.m_region.xmin = unlockreq.m_region.ymin = unlockreq.m_region.zmin = 0; + unlockreq.m_region.xmax = unlockreq.m_region.ymax = unlockreq.m_region.zmax = 0; + + char *lockAddress; + int yStride; + int zStride; + + ptex->Unlock( &unlockreq ); + + CheckGLError( "tex unlock test"); + } + } + printf("\n[%5d] locked/wrote/unlocked tex %s",innerindex, ptex->m_layout->m_layoutSummary ); + } + break; + + case 2: + { + CGLMTex *dtex = testTextures[innerindex]; + + printf("\n[%5d] deleting tex %s",innerindex, dtex->m_layout->m_layoutSummary ); + ctx->DelTex( dtex ); + CheckGLError( "tex delete test"); + } + break; + } // end stage switch + innerindex++; + } // end aspect loop + } // end mip loop + } // end form loop + } // end format loop + } // end stage loop +} + +// ##################################################################################################################### +void GLMTester::Test1( void ) +{ + // FBO exercises + GLMContext *ctx = m_params.m_ctx; + ctx->MakeCurrent(); + + // FBO color format loop + for( D3DFORMAT *colorFmtPtr = g_fboColorTexFormatsGLMT; *colorFmtPtr != ((D3DFORMAT)-1); colorFmtPtr++ ) + { + // FBO depth format loop + for( D3DFORMAT *depthFmtPtr = g_fboDepthTexFormatsGLMT; *depthFmtPtr != ((D3DFORMAT)-1); depthFmtPtr++ ) + { + // mip loop + for( int mipped = 0; mipped < 2; mipped++ ) + { + GLenum forms[] = { GL_TEXTURE_2D, GL_TEXTURE_3D, GL_TEXTURE_CUBE_MAP, (GLenum)-1 }; + + // form loop + for( GLenum *formPtr = forms; *formPtr != ((GLenum)-1); formPtr++ ) + { + //=============================================== make an FBO + CGLMFBO *fbo = ctx->NewFBO(); + + //=============================================== make a color texture + GLMTexLayoutKey colorkey; + memset( &colorkey, 0, sizeof(colorkey) ); + + switch(*formPtr) + { + case GL_TEXTURE_2D: + colorkey.m_texGLTarget = GL_TEXTURE_2D; + colorkey.m_xSize = 800; + colorkey.m_ySize = 600; + colorkey.m_zSize = 1; + break; + + case GL_TEXTURE_3D: + colorkey.m_texGLTarget = GL_TEXTURE_3D; + colorkey.m_xSize = 800; + colorkey.m_ySize = 600; + colorkey.m_zSize = 32; + break; + + case GL_TEXTURE_CUBE_MAP: + colorkey.m_texGLTarget = GL_TEXTURE_CUBE_MAP; + colorkey.m_xSize = 800; + colorkey.m_ySize = 800; // heh, cube maps have to have square sides... + colorkey.m_zSize = 1; + break; + } + + colorkey.m_texFormat = *colorFmtPtr; + colorkey.m_texFlags = kGLMTexRenderable; + // decide if we want mips + if (mipped) + { + colorkey.m_texFlags |= kGLMTexMipped; + } + + CGLMTex *colorTex = ctx->NewTex( &colorkey ); + // Note that GLM will notice the renderable flag, and force texels to be written + // so the FBO will be complete + + //=============================================== attach color + GLMFBOTexAttachParams colorParams; + memset( &colorParams, 0, sizeof(colorParams) ); + + colorParams.m_tex = colorTex; + colorParams.m_face = (colorkey.m_texGLTarget == GL_TEXTURE_CUBE_MAP) ? 2 : 0; // just steer to an alternate face as a test + + colorParams.m_mip = (colorkey.m_texFlags & kGLMTexMipped) ? 2 : 0; // pick non-base mip slice + + colorParams.m_zslice= (colorkey.m_texGLTarget == GL_TEXTURE_3D) ? 3 : 0; // just steer to an alternate slice as a test; + + fbo->TexAttach( &colorParams, kAttColor0 ); + + + //=============================================== optional depth tex + CGLMTex *depthTex = NULL; + + if (*depthFmtPtr > 0 ) + { + GLMTexLayoutKey depthkey; + memset( &depthkey, 0, sizeof(depthkey) ); + + depthkey.m_texGLTarget = GL_TEXTURE_2D; + depthkey.m_xSize = colorkey.m_xSize >> colorParams.m_mip; // scale depth tex to match color tex + depthkey.m_ySize = colorkey.m_ySize >> colorParams.m_mip; + depthkey.m_zSize = 1; + + depthkey.m_texFormat = *depthFmtPtr; + depthkey.m_texFlags = kGLMTexRenderable | kGLMTexIsDepth; // no mips. + if (depthkey.m_texFormat==D3DFMT_D24S8) + { + depthkey.m_texFlags |= kGLMTexIsStencil; + } + + depthTex = ctx->NewTex( &depthkey ); + + + //=============================================== attach depth + GLMFBOTexAttachParams depthParams; + memset( &depthParams, 0, sizeof(depthParams) ); + + depthParams.m_tex = depthTex; + depthParams.m_face = 0; + depthParams.m_mip = 0; + depthParams.m_zslice= 0; + + EGLMFBOAttachment depthAttachIndex = (depthkey.m_texFlags & kGLMTexIsStencil) ? kAttDepthStencil : kAttDepth; + fbo->TexAttach( &depthParams, depthAttachIndex ); + } + + printf("\n FBO:\n color tex %s\n depth tex %s", + colorTex->m_layout->m_layoutSummary, + depthTex ? depthTex->m_layout->m_layoutSummary : "none" + ); + + // see if FBO is happy + bool ready = fbo->IsReady(); + + printf("\n -> %s\n", ready ? "pass" : "fail" ); + + // unbind + ctx->BindFBOToCtx( NULL, GL_READ_FRAMEBUFFER_EXT ); + ctx->BindFBOToCtx( NULL, GL_DRAW_FRAMEBUFFER_EXT ); + + // del FBO + ctx->DelFBO(fbo); + + // del texes + ctx->DelTex( colorTex ); + if (depthTex) ctx->DelTex( depthTex ); + } // end form loop + } // end mip loop + } // end depth loop + } // end color loop +} + +// ##################################################################################################################### + +static int selftest2_seed = 0; // inc this every run to force main thread to teardown/reset display view +void GLMTester::Test2( void ) +{ + GLMContext *ctx = m_params.m_ctx; + ctx->MakeCurrent(); + + this->StdSetup(); // default test case drawing setup + + // draw stuff (loop...) + for( int i=0; iDrawDebugText( posx, posy, 0.0f, charwidth, charheight, text ); + } + glFinish(); + CheckGLError("test2 finish"); + + this->Present( selftest2_seed ); + } + + this->StdCleanup(); + + selftest2_seed++; +} + +// ##################################################################################################################### + +static char g_testVertexProgram01 [] = +{ + "!!ARBvp1.0 \n" + "TEMP vertexClip; \n" + "DP4 vertexClip.x, state.matrix.mvp.row[0], vertex.position; \n" + "DP4 vertexClip.y, state.matrix.mvp.row[1], vertex.position; \n" + "DP4 vertexClip.z, state.matrix.mvp.row[2], vertex.position; \n" + "DP4 vertexClip.w, state.matrix.mvp.row[3], vertex.position; \n" + "ADD vertexClip.y, vertexClip.x, vertexClip.y; \n" + "MOV result.position, vertexClip; \n" + "MOV result.color, vertex.color; \n" + "MOV result.texcoord[0], vertex.texcoord; \n" + "END \n" +}; + +static char g_testFragmentProgram01 [] = +{ + "!!ARBfp1.0 \n" + "TEMP color; \n" + "MUL color, fragment.texcoord[0].y, 2.0; \n" + "ADD color, 1.0, -color; \n" + "ABS color, color; \n" + "ADD result.color, 1.0, -color; \n" + "MOV result.color.a, 1.0; \n" + "END \n" +}; + + +// generic attrib versions.. + +static char g_testVertexProgram01_GA [] = +{ + "!!ARBvp1.0 \n" + "TEMP vertexClip; \n" + "DP4 vertexClip.x, state.matrix.mvp.row[0], vertex.attrib[0]; \n" + "DP4 vertexClip.y, state.matrix.mvp.row[1], vertex.attrib[0]; \n" + "DP4 vertexClip.z, state.matrix.mvp.row[2], vertex.attrib[0]; \n" + "DP4 vertexClip.w, state.matrix.mvp.row[3], vertex.attrib[0]; \n" + "ADD vertexClip.y, vertexClip.x, vertexClip.y; \n" + "MOV result.position, vertexClip; \n" + "MOV result.color, vertex.attrib[3]; \n" + "MOV result.texcoord[0], vertex.attrib[8]; \n" + "END \n" +}; + +static char g_testFragmentProgram01_GA [] = +{ + "!!ARBfp1.0 \n" + "TEMP color; \n" + "TEX color, fragment.texcoord[0], texture[0], 2D;" + //"MUL color, fragment.texcoord[0].y, 2.0; \n" + //"ADD color, 1.0, -color; \n" + //"ABS color, color; \n" + //"ADD result.color, 1.0, -color; \n" + //"MOV result.color.a, 1.0; \n" + "MOV result.color, color; \n" + "END \n" +}; + + +void GLMTester::Test3( void ) +{ + /************************** + XXXXXXXXXXXXXXXXXXXXXX stale test code until we revise the program interface + + GLMContext *ctx = m_params.m_ctx; + ctx->MakeCurrent(); + + this->StdSetup(); // default test case drawing setup + + // make vertex&pixel shader + CGLMProgram *vprog = ctx->NewProgram( kGLMVertexProgram, g_testVertexProgram01_GA ); + ctx->BindProgramToCtx( kGLMVertexProgram, vprog ); + + CGLMProgram *fprog = ctx->NewProgram( kGLMFragmentProgram, g_testFragmentProgram01_GA ); + ctx->BindProgramToCtx( kGLMFragmentProgram, fprog ); + + // draw stuff (loop...) + for( int i=0; iDrawDebugText( posx, posy, 0.0f, charwidth, charheight, text ); + } + glFinish(); + CheckGLError("test3 finish"); + + this->Present( 3333 ); + } + + this->StdCleanup(); + *****************************/ +} + + diff --git a/external/steamworks/glmgr/glmgr.h b/external/steamworks/glmgr/glmgr.h new file mode 100644 index 0000000..5e883a6 --- /dev/null +++ b/external/steamworks/glmgr/glmgr.h @@ -0,0 +1,1031 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ +// +// glmgr.h +// singleton class, common basis for managing GL contexts +// responsible for tracking adapters and contexts +// +//=============================================================================== + +#ifndef GLMGR_H +#define GLMGR_H + +#pragma once + +#include "glmdebug.h" +#include "glmdisplay.h" +#include "glmgrext.h" +#include "glmgrbasics.h" +#include "cglmtex.h" +#include "cglmfbo.h" +#include "cglmprogram.h" +#include "cglmbuffer.h" +#include "cglmquery.h" + + + + +//=============================================================================== +// glue to call out to Obj-C land (these are in glmgrcocoa.mm) + +bool NewNSGLContext( unsigned long *attribs, PseudoNSGLContextPtr nsglShareCtx, PseudoNSGLContextPtr *nsglCtxOut, CGLContextObj *cglCtxOut ); +CGLContextObj GetCGLContextFromNSGL( PseudoNSGLContextPtr nsglCtx ); +void DelNSGLContext( PseudoNSGLContextPtr nsglCtx ); + + +//=============================================================================== + +// parrot the D3D present parameters, more or less... "adapter" translates into "active display index" per the m_activeDisplayCount below. +class GLMDisplayParams +{ + public: + + // presumption, these indices are in sync with the current display DB that GLMgr has handy + //int m_rendererIndex; // index of renderer (-1 if root context) + //int m_displayIndex; // index of display in renderer - for FS + //int m_modeIndex; // index of mode in display - for FS + + void *m_focusWindow; // (VD3DHWND aka WindowRef) - what window does this context display into + + bool m_fsEnable; // fullscreen on or not + bool m_vsyncEnable; // vsync on or not + + // height and width have to match the display mode info if full screen. + + uint m_backBufferWidth; // pixel width (aka screen h-resolution if full screen) + uint m_backBufferHeight; // pixel height (aka screen v-resolution if full screen) + D3DFORMAT m_backBufferFormat; // pixel format + uint m_multiSampleCount; // 0 means no MSAA, 2 means 2x MSAA, etc + // uint m_multiSampleQuality; // no MSAA quality control yet + + bool m_enableAutoDepthStencil; // generally set to 'TRUE' per CShaderDeviceDx8::SetPresentParameters + D3DFORMAT m_autoDepthStencilFormat; + + uint m_fsRefreshHz; // if full screen, this refresh rate (likely 0 for LCD's) + + //uint m_rootRendererID; // only used if m_rendererIndex is -1. + //uint m_rootDisplayMask; // only used if m_rendererIndex is -1. + + bool m_mtgl; // enable multi threaded GL driver +}; + +//=============================================================================== + +class GLMgr +{ +public: + + //=========================================================================== + // class methods - singleton + static void NewGLMgr( void ); // instantiate singleton.. + static GLMgr *aGLMgr( void ); // return singleton.. + static void DelGLMgr( void ); // tear down singleton.. + + //=========================================================================== + // plain methods + + #if 0 // turned all these off while new approach is coded + void RefreshDisplayDB( void ); // blow away old display DB, make a new one + GLMDisplayDB *GetDisplayDB( void ); // get a ptr to the one GLMgr keeps. only valid til next refresh. + + // eligible renderers will be ranked by desirability starting at index 0 within the db + // within each renderer, eligible displays will be ranked some kind of desirability (area? dist from menu bar?) + // within each display, eligible modes will be ranked by descending areas + + // calls supplying indices are implicitly making reference to the current DB + bool CaptureDisplay( int rendIndex, int displayIndex, bool captureAll ); // capture one display or all displays + void ReleaseDisplays( void ); // release all captures + + int GetDisplayMode( int rendIndex, int displayIndex ); // retrieve current display res (returns modeIndex) + void SetDisplayMode( GLMDisplayParams *params ); // set the display res (only useful for FS) + #endif + + GLMContext *NewContext( GLMDisplayParams *params ); // this will have to change + void DelContext( GLMContext *context ); + + // with usage of CGLMacro.h we could dispense with the "current context" thing + // and just declare a member variable of GLMContext, allowing each glXXX call to be routed directly + // to the correct context + void SetCurrentContext( GLMContext *context ); // make current in calling thread only + GLMContext *GetCurrentContext( void ); + +protected: + friend class GLMContext; + + GLMgr(); + ~GLMgr(); +}; + + +//===========================================================================// + +// helper function to do enable or disable in one step +inline void glSetEnable( GLenum which, bool enable ) +{ + if (enable) + glEnable(which); + else + glDisable(which); +} + +// helper function for int vs enum clarity +inline void glGetEnumv( GLenum which, GLenum *dst ) +{ + glGetIntegerv( which, (int*)dst ); +} + +//===========================================================================// +// +// types to support the GLMContext +// +//===========================================================================// + +// Each state set/get path we are providing caching for, needs its own struct and a comparison operator. +// we also provide an enum of how many such types there are, handy for building dirty masks etc. + +// shorthand macros +#define EQ(fff) ( (src.fff) == (fff) ) + +//rasterizer +struct GLAlphaTestEnable_t { GLint enable; bool operator==(const GLAlphaTestEnable_t& src) const { return EQ(enable); } }; +struct GLAlphaTestFunc_t { GLenum func; GLclampf ref; bool operator==(const GLAlphaTestFunc_t& src) const { return EQ(func) && EQ(ref); } }; +struct GLCullFaceEnable_t { GLint enable; bool operator==(const GLCullFaceEnable_t& src) const { return EQ(enable); } }; +struct GLCullFrontFace_t { GLenum value; bool operator==(const GLCullFrontFace_t& src) const { return EQ(value); } }; +struct GLPolygonMode_t { GLenum values[2]; bool operator==(const GLPolygonMode_t& src) const { return EQ(values[0]) && EQ(values[1]); } }; +struct GLDepthBias_t { GLfloat factor; GLfloat units; bool operator==(const GLDepthBias_t& src) const { return EQ(factor) && EQ(units); } }; +struct GLScissorEnable_t { GLint enable; bool operator==(const GLScissorEnable_t& src) const { return EQ(enable); } }; +struct GLScissorBox_t { GLint x,y; GLsizei width, height; bool operator==(const GLScissorBox_t& src) const { return EQ(x) && EQ(y) && EQ(width) && EQ(height); } }; +struct GLAlphaToCoverageEnable_t{ GLint enable; bool operator==(const GLAlphaToCoverageEnable_t& src) const { return EQ(enable); } }; +struct GLViewportBox_t { GLint x,y; GLsizei width, height; bool operator==(const GLViewportBox_t& src) const { return EQ(x) && EQ(y) && EQ(width) && EQ(height); } }; +struct GLViewportDepthRange_t { GLdouble near,far; bool operator==(const GLViewportDepthRange_t& src) const { return EQ(near) && EQ(far); } }; +struct GLClipPlaneEnable_t { GLint enable; bool operator==(const GLClipPlaneEnable_t& src) const { return EQ(enable); } }; +struct GLClipPlaneEquation_t { GLfloat x,y,z,w; bool operator==(const GLClipPlaneEquation_t& src) const { return EQ(x) && EQ(y) && EQ(z) && EQ(w); } }; + +//blend +struct GLColorMaskSingle_t { char r,g,b,a; bool operator==(const GLColorMaskSingle_t& src) const { return EQ(r) && EQ(g) && EQ(b) && EQ(a); } }; +struct GLColorMaskMultiple_t { char r,g,b,a; bool operator==(const GLColorMaskMultiple_t& src) const { return EQ(r) && EQ(g) && EQ(b) && EQ(a); } }; +struct GLBlendEnable_t { GLint enable; bool operator==(const GLBlendEnable_t& src) const { return EQ(enable); } }; +struct GLBlendFactor_t { GLenum srcfactor,dstfactor; bool operator==(const GLBlendFactor_t& src) const { return EQ(srcfactor) && EQ(dstfactor); } }; +struct GLBlendEquation_t { GLenum equation; bool operator==(const GLBlendEquation_t& src) const { return EQ(equation); } }; +struct GLBlendColor_t { GLfloat r,g,b,a; bool operator==(const GLBlendColor_t& src) const { return EQ(r) && EQ(g) && EQ(b) && EQ(a); } }; +struct GLBlendEnableSRGB_t { GLint enable; bool operator==(const GLBlendEnableSRGB_t& src) const { return EQ(enable); } }; + +//depth +struct GLDepthTestEnable_t { GLint enable; bool operator==(const GLDepthTestEnable_t& src) const { return EQ(enable); } }; +struct GLDepthFunc_t { GLenum func; bool operator==(const GLDepthFunc_t& src) const { return EQ(func); } }; +struct GLDepthMask_t { char mask; bool operator==(const GLDepthMask_t& src) const { return EQ(mask); } }; + +//stencil +struct GLStencilTestEnable_t { GLint enable; bool operator==(const GLStencilTestEnable_t& src) const { return EQ(enable); } }; +struct GLStencilFunc_t { GLenum frontfunc, backfunc; GLint ref; GLuint mask; bool operator==(const GLStencilFunc_t& src) const { return EQ(frontfunc) && EQ(backfunc) && EQ(ref) && EQ(mask); } }; +struct GLStencilOp_t { GLenum sfail; GLenum dpfail; GLenum dppass; bool operator==(const GLStencilOp_t& src) const { return EQ(sfail) && EQ(dpfail) && EQ(dppass); } }; +struct GLStencilWriteMask_t { GLint mask; bool operator==(const GLStencilWriteMask_t& src) const { return EQ(mask); } }; + +//clearing +struct GLClearColor_t { GLfloat r,g,b,a; bool operator==(const GLClearColor_t& src) const { return EQ(r) && EQ(g) && EQ(b) && EQ(a); } }; +struct GLClearDepth_t { GLdouble d; bool operator==(const GLClearDepth_t& src) const { return EQ(d); } }; +struct GLClearStencil_t { GLint s; bool operator==(const GLClearStencil_t& src) const { return EQ(s); } }; + +#undef EQ + +enum EGLMStateBlockType +{ + kGLAlphaTestEnable, + kGLAlphaTestFunc, + + kGLCullFaceEnable, + kGLCullFrontFace, + + kGLPolygonMode, + + kGLDepthBias, + + kGLScissorEnable, + kGLScissorBox, + + kGLViewportBox, + kGLViewportDepthRange, + + kGLClipPlaneEnable, + kGLClipPlaneEquation, + + kGLColorMaskSingle, + kGLColorMaskMultiple, + + kGLBlendEnable, + kGLBlendFactor, + kGLBlendEquation, + kGLBlendColor, + kGLBlendEnableSRGB, + + kGLDepthTestEnable, + kGLDepthFunc, + kGLDepthMask, + + kGLStencilTestEnable, + kGLStencilFunc, + kGLStencilOp, + kGLStencilWriteMask, + + kGLClearColor, + kGLClearDepth, + kGLClearStencil, + + kGLAlphaToCoverageEnable, + + kGLMStateBlockLimit +}; + +//===========================================================================// + +// templated functions representing GL R/W bottlenecks +// one set of set/get/getdefault is instantiated for each of the GL*** types above. + +// use these from the non array state objects +template void GLContextSet( T *src ); +template void GLContextGet( T *dst ); +template void GLContextGetDefault( T *dst ); + +// use these from the array state objects +template void GLContextSetIndexed( T *src, int index ); +template void GLContextGetIndexed( T *dst, int index ); +template void GLContextGetDefaultIndexed( T *dst, int index ); + +//===========================================================================// + +// caching state object template. One of these is instantiated in the context per unique struct type above +template class GLState +{ + public: + + GLState() + { + dirty = false; + memset( &data, 0, sizeof(data) ); + }; + + // write: client src into cache + // common case is both false. dirty is calculated, context write is deferred. + void Write( T *src, bool noCompare=false, bool noDefer=false ) + { + if (noCompare) + { + dirty = true; + } + else + { + // only == is implemented, so test for equal and negate + // note, you only set dirty if mismatch, you never clear it until flush + if ( !(data == *src) ) + { + dirty = true; + } + } + + data = *src; + + if (noDefer) + { + Flush( true ); // dirty becomes false + } + }; + + // write cache->context if dirty or forced. + void Flush( bool noDefer=false ) + { + if (dirty || noDefer) + { + GLContextSet( &data ); + GLMCheckError(); + // good place for some error checking here + dirty = false; + } + }; + + // default: write default value to cache, optionally write through + void Default( bool noDefer=false ) + { + GLContextGetDefault( &data ); // read default values directly to our cache copy + dirty = true; + Flush(noDefer); + }; + + // read: sel = 0 for cache, 1 for context + void Read( T *dst, int sel ) + { + if (sel==0) + { + *dst = data; + } + else + { + GLContextGet( dst ); + GLMCheckError(); + } + }; + + // check: verify that context equals cache, return true if mismatched or if illegal values seen + bool Check ( void ) + { + T temp; + bool result; + + GLContextGet( &temp ); + GLMCheckError(); + result = !(temp == data); + return result; + }; + + protected: + T data; + bool dirty; +}; + +// caching state object template - with multiple values behind it that are indexed +template class GLStateArray +{ + public: + + GLStateArray() + { + memset( &dirty, 0, sizeof(dirty) ); + memset( &data, 0, sizeof(data) ); + }; + + // write: client src into cache + // common case is both false. dirty is calculated, context write is deferred. + void WriteIndex( T *src, int index, bool noCompare=false, bool noDefer=false ) + { + if (noCompare) + { + dirty[index] = true; + } + else + { + // only == is implemented, so test for equal and negate + // note, you only set dirty if mismatch, you never clear it until flush + if (! (data[index] == *src) ) + { + dirty[index] = true; + } + } + + data[index] = *src; + + if (noDefer) + { + FlushIndex( index, true ); // dirty becomes false + } + }; + + // write cache->context if dirty or forced. + void FlushIndex( int index, bool noDefer=false ) + { + if (dirty[index] || noDefer) + { + GLContextSetIndexed( &data[index], index ); + GLMCheckError(); + dirty[index] = false; + } + }; + + // write all slots in the array + void Flush( bool noDefer=false ) + { + for( int i=0; i m_AlphaTestEnable; + + GLState m_AlphaTestFunc; + + GLState m_CullFaceEnable; + GLState m_CullFrontFace; + GLState m_PolygonMode; + + GLState m_DepthBias; + + GLStateArray m_ClipPlaneEnable; + GLStateArray m_ClipPlaneEquation; // dxabstract puts them directly into param slot 253(0) and 254(1) + + GLState m_ScissorEnable; + GLState m_ScissorBox; + + GLState m_AlphaToCoverageEnable; + + GLState m_ViewportBox; + GLState m_ViewportDepthRange; + + GLState m_ColorMaskSingle; + GLStateArray m_ColorMaskMultiple; // need an official constant for the color buffers limit + + GLState m_BlendEnable; + GLState m_BlendFactor; + GLState m_BlendEquation; + GLState m_BlendColor; + GLState m_BlendEnableSRGB; // write to this one to transmit intent to write SRGB encoded pixels to drawing FB + bool m_FakeBlendEnableSRGB; // writes to above will be shunted here if fake SRGB is in effect. + + GLState m_DepthTestEnable; + GLState m_DepthFunc; + GLState m_DepthMask; + + GLState m_StencilTestEnable; // global stencil test enable + GLState m_StencilFunc; // holds front and back stencil funcs + GLStateArray m_StencilOp; // indexed: 0=front 1=back + GLState m_StencilWriteMask; + + GLState m_ClearColor; + GLState m_ClearDepth; + GLState m_ClearStencil; + + // texture bindings and sampler setup + int m_activeTexture; // mirror for glActiveTexture + GLMTexSampler m_samplers[GLM_SAMPLER_COUNT]; + + // texture lock tracking - CGLMTex objects share usage of this + std::vector< GLMTexLockDesc > m_texLocks; + + // render target binding - check before draw + // similar to tex sampler mechanism, we track "bound" from "chosen for drawing" separately, + // so binding for creation/setup need not disrupt any notion of what will be used at draw time + + CGLMFBO *m_boundDrawFBO; // FBO on GL_DRAW_FRAMEBUFFER bind point + CGLMFBO *m_boundReadFBO; // FBO on GL_READ_FRAMEBUFFER bind point + // ^ both are set if you bind to GL_FRAMEBUFFER_EXT + + CGLMFBO *m_drawingFBO; // what FBO should be bound at draw time (to both read/draw bp's). + + CGLMFBO *m_blitReadFBO; + CGLMFBO *m_blitDrawFBO; // scratch FBO's for framebuffer blit + + CGLMFBO *m_scratchFBO[ kGLMScratchFBOCount ]; // general purpose FBO's for internal use + + std::vector< CGLMFBO* > m_fboTable; // each live FBO goes in the table + + // program bindings + EGLMProgramLang m_drawingLangAtFrameStart; // selector for start of frame (spills into m_drawingLang) + EGLMProgramLang m_drawingLang; // selector for which language we desire to draw with on the next batch + CGLMProgram *m_drawingProgram[ kGLMNumProgramTypes ]; + + GLMProgramParamsF m_programParamsF[ kGLMNumProgramTypes ]; + GLMProgramParamsB m_programParamsB[ kGLMNumProgramTypes ]; // two banks, but only the vertex one is used + GLMProgramParamsI m_programParamsI[ kGLMNumProgramTypes ]; // two banks, but only the vertex one is used + EGLMParamWriteMode m_paramWriteMode; + + CGLMProgram *m_nullFragmentProgram; // write opaque black. Activate when caller asks for null FP + + CGLMProgram *m_preloadTexVertexProgram; // programs to help preload textures (dummies) + CGLMProgram *m_preload2DTexFragmentProgram; + CGLMProgram *m_preload3DTexFragmentProgram; + CGLMProgram *m_preloadCubeTexFragmentProgram; + + CGLMProgram *m_boundProgram[ kGLMNumProgramTypes ]; + + CGLMShaderPairCache *m_pairCache; // GLSL only + CGLMShaderPair *m_boundPair; // GLSL only + uint m_boundPairRevision; // GLSL only + GLhandleARB m_boundPairProgram; // GLSL only + + // buffer bindings + CGLMBuffer *m_lastKnownBufferBinds[ kGLMNumBufferTypes ]; // tracked per bind point for dupe-bind-absorb + GLMVertexAttributeDesc m_lastKnownVertexAttribs[ kGLMVertexAttributeIndexMax ]; // tracked per attrib for dupe-set-absorb + uint m_lastKnownVertexAttribMask; // tracked for dupe-enable-absorb + + CGLMBuffer *m_drawIndexBuffer; // ... ? do we need dupe tracking for index buffer setup? ? + + GLMVertexSetup m_drawVertexSetup; + + EGLMAttribWriteMode m_attribWriteMode; + + bool m_slowCheckEnable; // turn this on or no native checking is done ("-glmassertslow" or "-glmsspewslow") + bool m_slowAssertEnable; // turn this on to assert on a non-native batch "-glmassertslow" + bool m_slowSpewEnable; // turn this on to log non-native batches to stdout "-glmspewslow" + + // debug font texture + CGLMTex *m_debugFontTex; // might be NULL unless you call GenDebugFontTex + CGLMBuffer *m_debugFontIndices; // up to 1024 indices (256 chars times 4) + CGLMBuffer *m_debugFontVertices; // up to 1024 verts + + // batch/frame debugging support + int m_debugFrameIndex; // init to -1. Increment at BeginFrame + int m_debugBatchIndex; // init to -1. Increment at any draw call + +#if GLMDEBUG + // interactive (DebugHook) debug support + + // using these you can implement frame advance, batch single step, and batch rewind (let it run til next frame and hold on prev batch #) + int m_holdFrameBegin; // -1 if no hold req'd, otherwise # of frame to hold at (at beginframe time) + int m_holdFrameEnd; // -1 if no hold req'd, otherwise # of frame to hold at (at endframe time) + + int m_holdBatch,m_holdBatchFrame; // -1 if no hold, else # of batch&frame to hold at (both must be set) + // these can be expired/cleared to -1 if the frame passes without a hit + // may be desirable to re-pause in that event, as user was expecting a hold to occur + + bool m_debugDelayEnable; // allow sleep delay + uint m_debugDelay; // sleep time per hook call in microseconds (for usleep()) + + // pre-draw global toggles / options + bool m_autoClearColor,m_autoClearDepth,m_autoClearStencil; + float m_autoClearColorValues[4]; + + // debug knobs + int m_selKnobIndex; + float m_selKnobMinValue,m_selKnobMaxValue,m_selKnobIncrement; +#endif + +}; + +struct GLMTestParams +{ + GLMContext *m_ctx; + int *m_testList; // -1 termed + + bool m_glErrToDebugger; + bool m_glErrToConsole; + + bool m_intlErrToDebugger; + bool m_intlErrToConsole; + + int m_frameCount; // how many frames to test. +}; + +class GLMTester +{ + public: + + GLMTester(GLMTestParams *params); + ~GLMTester(); + + + // optionally callable by test routines to get basic drawables wired up + void StdSetup( void ); + void StdCleanup( void ); + + // callable by test routines to clear the frame or present it + void Clear( void ); + void Present( int seed ); + + // error reporting + void CheckGLError( const char *comment ); // obey m_params setting for console / debugger response + void InternalError( int errcode, const char *comment ); // if errcode!=0, obey m_params setting for console / debugger response + + void RunTests(); + + void RunOneTest( int testindex ); + + // test routines themselves + void Test0(); + void Test1(); + void Test2(); + void Test3(); + + GLMTestParams m_params; // copy of caller's params, do not mutate... + + // std-setup stuff + int m_drawWidth, m_drawHeight; + CGLMFBO *m_drawFBO; + CGLMTex *m_drawColorTex; + CGLMTex *m_drawDepthTex; +}; + + +#endif diff --git a/external/steamworks/glmgr/glmgrbasics.cpp b/external/steamworks/glmgr/glmgrbasics.cpp new file mode 100644 index 0000000..2021d17 --- /dev/null +++ b/external/steamworks/glmgr/glmgrbasics.cpp @@ -0,0 +1,4082 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ +// +// glmgrbasics.cpp +// +//=============================================================================== + +#include "glmgrbasics.h" +#include "dxabstract.h" + +#ifdef OSX +// Debugger - 10.8 +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + +#if __MAC_OS_X_VERSION_MAX_ALLOWED <= __MAC_10_6 +#include +#include +#else +#define kCGLCPComment ((CGLContextParameter)1232) +/* param is a pointer to a NULL-terminated C-style string. */ +/* Inserts a context-specific comment into the function trace stream. */ +/* Availability: set only, get is ignored. */ + +#define kCGLCPDumpState ((CGLContextParameter)1233) +/* param ignored. Dumps all the gl state. */ +/* Availability: set only, get is ignored. */ + +#define kCGLCPEnableForceFlush ((CGLContextParameter)1234) +/* param is GL_TRUE to enable "force flush" mode or GL_FALSE to disable. */ +/* Availability: set and get. */ + +#define kCGLGOComment ((CGLGlobalOption)1506) +/* param is a pointer to a NULL-terminated C-style string. */ +/* Inserts a comment in the trace steam that applies to all contexts. */ +/* Availability: set only, get is ignored. */ + +#define kCGLGOEnableFunctionTrace ((CGLGlobalOption)1507) +/* param is GL_TRUE or GL_FALSE */ +/* Turns GL function call tracing on and off */ +/* Availability: set and get */ + +#define kCGLGOResetFunctionTrace ((CGLGlobalOption)1509) +/* param is ignored */ +/* Erases current function trace and starts a new one */ +/* Availability: set only, get is ignored. */ + +#define kCGLGOEnableBreakpoint ((CGLGlobalOption)1514) +/* param is an array of 3 GLints: + param[0] is function ID (see CGLProfilerFunctionEnum.h) + param[1] is the logical OR of kCGLProfBreakBefore or kCGLProfBreakAfter, indicating how + you want the breakpoint to stop: before entering OpenGL, on return from OpenGL, or both. + param[2] is a boolean which turns the breakpoint on or off. + */ +/* Availability: set and get. */ + +#define kCGLProfBreakBefore 0x0001 +#define kCGLProfBreakAfter 0x0002 + +#define kCGLFEglColor4sv 98 + +#endif + +//=============================================================================== +#define TOLOWERC( x ) (( ( x >= 'A' ) && ( x <= 'Z' ) )?( x + 32 ) : x ) +int V_stricmp(const char *s1, const char *s2 ) +{ + uint8 const *pS1 = ( uint8 const * ) s1; + uint8 const *pS2 = ( uint8 const * ) s2; + for(;;) + { + int c1 = *( pS1++ ); + int c2 = *( pS2++ ); + if ( c1 == c2 ) + { + if ( !c1 ) return 0; + } + else + { + if ( ! c2 ) + { + return c1 - c2; + } + c1 = TOLOWERC( c1 ); + c2 = TOLOWERC( c2 ); + if ( c1 != c2 ) + { + return c1 - c2; + } + } + c1 = *( pS1++ ); + c2 = *( pS2++ ); + if ( c1 == c2 ) + { + if ( !c1 ) return 0; + } + else + { + if ( ! c2 ) + { + return c1 - c2; + } + c1 = TOLOWERC( c1 ); + c2 = TOLOWERC( c2 ); + if ( c1 != c2 ) + { + return c1 - c2; + } + } + } +} + +inline unsigned char tolower_fast(unsigned char c) +{ + if ( (c >= 'A') && (c <= 'Z') ) + return c + ('a' - 'A'); + return c; +} + +//----------------------------------------------------------------------------- +// Finds a string in another string with a case insensitive test +//----------------------------------------------------------------------------- +char const* V_stristr( char const* pStr, char const* pSearch ) +{ + //AssertValidStringPtr(pStr); + //AssertValidStringPtr(pSearch); + + if (!pStr || !pSearch) + return 0; + + char const* pLetter = pStr; + + // Check the entire string + while (*pLetter != 0) + { + // Skip over non-matches + if (tolower_fast((unsigned char)*pLetter) == tolower_fast((unsigned char)*pSearch)) + { + // Check for match + char const* pMatch = pLetter + 1; + char const* pTest = pSearch + 1; + while (*pTest != 0) + { + // We've run off the end; don't bother. + if (*pMatch == 0) + return 0; + + if (tolower_fast((unsigned char)*pMatch) != tolower_fast((unsigned char)*pTest)) + break; + + ++pMatch; + ++pTest; + } + + // Found a match! + if (*pTest == 0) + return pLetter; + } + + ++pLetter; + } + + return 0; +} + +char* V_stristr( char* pStr, char const* pSearch ) +{ + //AssertValidStringPtr( pStr ); + //AssertValidStringPtr( pSearch ); + + return (char*)V_stristr( (char const*)pStr, pSearch ); +} + +//=============================================================================== + +// convars for GLM + +//ConVar gl_errorcheckall ( "gl_errorcheckall", "0" ); +//ConVar gl_errorcheckqueries ( "gl_errorcheckqueries", "0" ); + +int gl_errorcheckall = 0; +int gl_errorcheckqueries = 0; + +// this one overrides the other two. +// i.e. you can set this one true, and no errors will be checked, period. +//ConVar gl_errorchecknone ( "gl_errorchecknone", "0" ); +int gl_errorchecknone = 0; + +// this decides whether the engine will try to use fast context mode on 10.6.3 or later. +// fast context mode means that a single GL context is used both for the window and the engine, saving on sync and flushes. +// it's only a suggestion; if the OS is below 10.6.2 it will be ignored. +//ConVar gl_singlecontext ( "gl_singlecontext", "1" ); +int gl_singlecontext = 1; + +//=============================================================================== +// decoding tables for debug + +typedef struct +{ + unsigned long value; + const char *name; +} GLMValueEntry_t; + +#define TERMVALUE 0x31415926 + // terminator for value tables + +#define VE( x ) { x, #x } + // "value entry" + +GLMValueEntry_t g_d3d_devtypes[] = +{ + VE( D3DDEVTYPE_HAL ), + VE( D3DDEVTYPE_REF ), + + VE( TERMVALUE ) +}; + +GLMValueEntry_t g_d3d_formats[] = +{ + VE( D3DFMT_INDEX16 ), + VE( D3DFMT_D16 ), + VE( D3DFMT_D24S8 ), + VE( D3DFMT_A8R8G8B8 ), + VE( D3DFMT_A4R4G4B4 ), + VE( D3DFMT_X8R8G8B8 ), + VE( D3DFMT_R5G6R5 ), + VE( D3DFMT_X1R5G5B5 ), + VE( D3DFMT_A1R5G5B5 ), + VE( D3DFMT_L8 ), + VE( D3DFMT_A8L8 ), + VE( D3DFMT_A ), + VE( D3DFMT_DXT1 ), + VE( D3DFMT_DXT3 ), + VE( D3DFMT_DXT5 ), + VE( D3DFMT_V8U8 ), + VE( D3DFMT_Q8W8V8U8 ), + VE( D3DFMT_X8L8V8U8 ), + VE( D3DFMT_A16B16G16R16F ), + VE( D3DFMT_A16B16G16R16 ), + VE( D3DFMT_R32F ), + VE( D3DFMT_A32B32G32R32F ), + VE( D3DFMT_R8G8B8 ), + VE( D3DFMT_D24X4S4 ), + VE( D3DFMT_A8 ), + VE( D3DFMT_R5G6B5 ), + VE( D3DFMT_D15S1 ), + VE( D3DFMT_D24X8 ), + VE( D3DFMT_VERTEXDATA ), + VE( D3DFMT_INDEX32 ), + + // vendor specific formats (fourcc's) + VE( D3DFMT_NV_INTZ ), + VE( D3DFMT_NV_RAWZ ), + VE( D3DFMT_NV_NULL ), + VE( D3DFMT_ATI_D16 ), + VE( D3DFMT_ATI_D24S8 ), + VE( D3DFMT_ATI_2N ), + VE( D3DFMT_ATI_1N ), + + VE( D3DFMT_UNKNOWN ), + + VE( TERMVALUE ) +}; + +GLMValueEntry_t g_d3d_rtypes[] = +{ + VE( D3DRTYPE_SURFACE ), + VE( D3DRTYPE_TEXTURE ), + VE( D3DRTYPE_VOLUMETEXTURE ), + VE( D3DRTYPE_CUBETEXTURE ), + VE( D3DRTYPE_VERTEXBUFFER ), + VE( D3DRTYPE_INDEXBUFFER ), + + VE( TERMVALUE ) +}; + +GLMValueEntry_t g_d3d_usages[] = +{ + VE( D3DUSAGE_RENDERTARGET ), + VE( D3DUSAGE_DEPTHSTENCIL ), + VE( D3DUSAGE_DYNAMIC ), + VE( D3DUSAGE_AUTOGENMIPMAP ), + //VE( D3DUSAGE_DMAP ), + //VE( D3DUSAGE_QUERY_LEGACYBUMPMAP ), + VE( D3DUSAGE_QUERY_SRGBREAD ), + VE( D3DUSAGE_QUERY_FILTER ), + VE( D3DUSAGE_QUERY_SRGBWRITE ), + VE( D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING ), + VE( D3DUSAGE_QUERY_VERTEXTEXTURE ), + //VE( D3DUSAGE_QUERY_WRAPANDMIP ), + VE( D3DUSAGE_WRITEONLY ), + VE( D3DUSAGE_SOFTWAREPROCESSING ), + VE( D3DUSAGE_DONOTCLIP ), + VE( D3DUSAGE_POINTS ), + VE( D3DUSAGE_RTPATCHES ), + VE( D3DUSAGE_NPATCHES ), + + VE( TERMVALUE ) +}; + +GLMValueEntry_t g_d3d_rstates[] = +{ + VE( D3DRS_ZENABLE ), + VE( D3DRS_FILLMODE ), + VE( D3DRS_SHADEMODE ), + VE( D3DRS_ZWRITEENABLE ), + VE( D3DRS_ALPHATESTENABLE ), + VE( D3DRS_LASTPIXEL ), + VE( D3DRS_SRCBLEND ), + VE( D3DRS_DESTBLEND ), + VE( D3DRS_CULLMODE ), + VE( D3DRS_ZFUNC ), + VE( D3DRS_ALPHAREF ), + VE( D3DRS_ALPHAFUNC ), + VE( D3DRS_DITHERENABLE ), + VE( D3DRS_ALPHABLENDENABLE ), + VE( D3DRS_FOGENABLE ), + VE( D3DRS_SPECULARENABLE ), + VE( D3DRS_FOGCOLOR ), + VE( D3DRS_FOGTABLEMODE ), + VE( D3DRS_FOGSTART ), + VE( D3DRS_FOGEND ), + VE( D3DRS_FOGDENSITY ), + VE( D3DRS_RANGEFOGENABLE ), + VE( D3DRS_STENCILENABLE ), + VE( D3DRS_STENCILFAIL ), + VE( D3DRS_STENCILZFAIL ), + VE( D3DRS_STENCILPASS ), + VE( D3DRS_STENCILFUNC ), + VE( D3DRS_STENCILREF ), + VE( D3DRS_STENCILMASK ), + VE( D3DRS_STENCILWRITEMASK ), + VE( D3DRS_TEXTUREFACTOR ), + VE( D3DRS_WRAP0 ), + VE( D3DRS_WRAP1 ), + VE( D3DRS_WRAP2 ), + VE( D3DRS_WRAP3 ), + VE( D3DRS_WRAP4 ), + VE( D3DRS_WRAP5 ), + VE( D3DRS_WRAP6 ), + VE( D3DRS_WRAP7 ), + VE( D3DRS_CLIPPING ), + VE( D3DRS_LIGHTING ), + VE( D3DRS_AMBIENT ), + VE( D3DRS_FOGVERTEXMODE ), + VE( D3DRS_COLORVERTEX ), + VE( D3DRS_LOCALVIEWER ), + VE( D3DRS_NORMALIZENORMALS ), + VE( D3DRS_DIFFUSEMATERIALSOURCE ), + VE( D3DRS_SPECULARMATERIALSOURCE ), + VE( D3DRS_AMBIENTMATERIALSOURCE ), + VE( D3DRS_EMISSIVEMATERIALSOURCE ), + VE( D3DRS_VERTEXBLEND ), + VE( D3DRS_CLIPPLANEENABLE ), + VE( D3DRS_POINTSIZE ), + VE( D3DRS_POINTSIZE_MIN ), + VE( D3DRS_POINTSPRITEENABLE ), + VE( D3DRS_POINTSCALEENABLE ), + VE( D3DRS_POINTSCALE_A ), + VE( D3DRS_POINTSCALE_B ), + VE( D3DRS_POINTSCALE_C ), + VE( D3DRS_MULTISAMPLEANTIALIAS ), + VE( D3DRS_MULTISAMPLEMASK ), + VE( D3DRS_PATCHEDGESTYLE ), + VE( D3DRS_DEBUGMONITORTOKEN ), + VE( D3DRS_POINTSIZE_MAX ), + VE( D3DRS_INDEXEDVERTEXBLENDENABLE ), + VE( D3DRS_COLORWRITEENABLE ), + VE( D3DRS_TWEENFACTOR ), + VE( D3DRS_BLENDOP ), + VE( D3DRS_POSITIONDEGREE ), + VE( D3DRS_NORMALDEGREE ), + VE( D3DRS_SCISSORTESTENABLE ), + VE( D3DRS_SLOPESCALEDEPTHBIAS ), + VE( D3DRS_ANTIALIASEDLINEENABLE ), + VE( D3DRS_MINTESSELLATIONLEVEL ), + VE( D3DRS_MAXTESSELLATIONLEVEL ), + VE( D3DRS_ADAPTIVETESS_X ), + VE( D3DRS_ADAPTIVETESS_Y ), + VE( D3DRS_ADAPTIVETESS_Z ), + VE( D3DRS_ADAPTIVETESS_W ), + VE( D3DRS_ENABLEADAPTIVETESSELLATION ), + VE( D3DRS_TWOSIDEDSTENCILMODE ), + VE( D3DRS_CCW_STENCILFAIL ), + VE( D3DRS_CCW_STENCILZFAIL ), + VE( D3DRS_CCW_STENCILPASS ), + VE( D3DRS_CCW_STENCILFUNC ), + VE( D3DRS_COLORWRITEENABLE1 ), + VE( D3DRS_COLORWRITEENABLE2 ), + VE( D3DRS_COLORWRITEENABLE3 ), + VE( D3DRS_BLENDFACTOR ), + VE( D3DRS_SRGBWRITEENABLE ), + VE( D3DRS_DEPTHBIAS ), + VE( D3DRS_WRAP8 ), + VE( D3DRS_WRAP9 ), + VE( D3DRS_WRAP10 ), + VE( D3DRS_WRAP11 ), + VE( D3DRS_WRAP12 ), + VE( D3DRS_WRAP13 ), + VE( D3DRS_WRAP14 ), + VE( D3DRS_WRAP15 ), + VE( D3DRS_SEPARATEALPHABLENDENABLE ), + VE( D3DRS_SRCBLENDALPHA ), + VE( D3DRS_DESTBLENDALPHA ), + VE( D3DRS_BLENDOPALPHA ), + + VE( TERMVALUE ) +}; + +GLMValueEntry_t g_d3d_opcodes[] = +{ + VE( D3DSIO_NOP ), + VE( D3DSIO_PHASE ), + VE( D3DSIO_RET ), + VE( D3DSIO_ELSE ), + VE( D3DSIO_ENDIF ), + VE( D3DSIO_ENDLOOP ), + VE( D3DSIO_ENDREP ), + VE( D3DSIO_BREAK ), + VE( D3DSIO_TEXDEPTH ), + VE( D3DSIO_TEXKILL ), + VE( D3DSIO_BEM ), + VE( D3DSIO_TEXBEM ), + VE( D3DSIO_TEXBEML ), + VE( D3DSIO_TEXDP3 ), + VE( D3DSIO_TEXDP3TEX ), + VE( D3DSIO_TEXM3x2DEPTH ), + VE( D3DSIO_TEXM3x2TEX ), + VE( D3DSIO_TEXM3x3 ), + VE( D3DSIO_TEXM3x3PAD ), + VE( D3DSIO_TEXM3x3TEX ), + VE( D3DSIO_TEXM3x3VSPEC ), + VE( D3DSIO_TEXREG2AR ), + VE( D3DSIO_TEXREG2GB ), + VE( D3DSIO_TEXREG2RGB ), + VE( D3DSIO_LABEL ), + VE( D3DSIO_CALL ), + VE( D3DSIO_IF ), + VE( D3DSIO_LOOP ), + VE( D3DSIO_REP ), + VE( D3DSIO_BREAKP ), + VE( D3DSIO_DSX ), + VE( D3DSIO_DSY ), + VE( D3DSIO_NRM ), + VE( D3DSIO_MOVA ), + VE( D3DSIO_MOV ), + VE( D3DSIO_RCP ), + VE( D3DSIO_RSQ ), + VE( D3DSIO_EXP ), + VE( D3DSIO_EXPP ), + VE( D3DSIO_LOG ), + VE( D3DSIO_LOGP ), + VE( D3DSIO_FRC ), + VE( D3DSIO_LIT ), + VE( D3DSIO_ABS ), + VE( D3DSIO_TEXM3x3SPEC ), + VE( D3DSIO_M4x4 ), + VE( D3DSIO_M4x3 ), + VE( D3DSIO_M3x4 ), + VE( D3DSIO_M3x3 ), + VE( D3DSIO_M3x2 ), + VE( D3DSIO_CALLNZ ), + VE( D3DSIO_IFC ), + VE( D3DSIO_BREAKC ), + VE( D3DSIO_SETP ), + VE( D3DSIO_TEXLDL ), + VE( D3DSIO_ADD ), + VE( D3DSIO_SUB ), + VE( D3DSIO_MUL ), + VE( D3DSIO_DP3 ), + VE( D3DSIO_DP4 ), + VE( D3DSIO_MIN ), + VE( D3DSIO_MAX ), + VE( D3DSIO_DST ), + VE( D3DSIO_SLT ), + VE( D3DSIO_SGE ), + VE( D3DSIO_CRS ), + VE( D3DSIO_POW ), + VE( D3DSIO_DP2ADD ), + VE( D3DSIO_LRP ), + VE( D3DSIO_SGN ), + VE( D3DSIO_CND ), + VE( D3DSIO_CMP ), + VE( D3DSIO_SINCOS ), + VE( D3DSIO_MAD ), + VE( D3DSIO_TEXLDD ), + VE( D3DSIO_TEXCOORD ), + VE( D3DSIO_TEX ), + VE( D3DSIO_DCL ), + VE( D3DSTT_UNKNOWN ), + VE( D3DSTT_2D ), + VE( D3DSTT_CUBE ), + VE( D3DSTT_VOLUME ), + VE( D3DSIO_DEFB ), + VE( D3DSIO_DEFI ), + VE( D3DSIO_DEF ), + VE( D3DSIO_COMMENT ), + VE( D3DSIO_END ), +}; + + +GLMValueEntry_t g_d3d_vtxdeclusages[] = +{ + { D3DDECLUSAGE_POSITION ,"POSN" }, // P + { D3DDECLUSAGE_BLENDWEIGHT ,"BLWT" }, // W + { D3DDECLUSAGE_BLENDINDICES ,"BLIX" }, // I + { D3DDECLUSAGE_NORMAL ,"NORM" }, // N + { D3DDECLUSAGE_PSIZE ,"PSIZ" }, // S + { D3DDECLUSAGE_TEXCOORD ,"TEXC" }, // T + { D3DDECLUSAGE_TANGENT ,"TANG" }, // G + { D3DDECLUSAGE_BINORMAL ,"BINO" }, // B + { D3DDECLUSAGE_TESSFACTOR ,"TESS" }, // S + { D3DDECLUSAGE_PLUGH ,"????" }, // ? + { D3DDECLUSAGE_COLOR ,"COLR" }, // C + { D3DDECLUSAGE_FOG ,"FOG " }, // F + { D3DDECLUSAGE_DEPTH ,"DEPT" }, // D + { D3DDECLUSAGE_SAMPLE ,"SAMP" } // M +}; + +GLMValueEntry_t g_d3d_vtxdeclusages_short[] = +{ + { D3DDECLUSAGE_POSITION ,"P" }, + { D3DDECLUSAGE_BLENDWEIGHT ,"W" }, + { D3DDECLUSAGE_BLENDINDICES ,"I" }, + { D3DDECLUSAGE_NORMAL ,"N" }, + { D3DDECLUSAGE_PSIZE ,"S" }, + { D3DDECLUSAGE_TEXCOORD ,"T" }, + { D3DDECLUSAGE_TANGENT ,"G" }, + { D3DDECLUSAGE_BINORMAL ,"B" }, + { D3DDECLUSAGE_TESSFACTOR ,"S" }, + { D3DDECLUSAGE_PLUGH ,"?" }, + { D3DDECLUSAGE_COLOR ,"C" }, + { D3DDECLUSAGE_FOG ,"F" }, + { D3DDECLUSAGE_DEPTH ,"D" }, + { D3DDECLUSAGE_SAMPLE ,"M" } +}; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +GLMValueEntry_t g_cgl_rendids[] = // need to mask with 0xFFFFFF00 to match on these (ex: 8800GT == 0x00022608 +{ + VE( kCGLRendererGenericID ), + VE( kCGLRendererGenericFloatID ), + VE( kCGLRendererAppleSWID ), + VE( kCGLRendererATIRage128ID ), + VE( kCGLRendererATIRadeonID ), + VE( kCGLRendererATIRageProID ), + VE( kCGLRendererATIRadeon8500ID ), + VE( kCGLRendererATIRadeon9700ID ), + VE( kCGLRendererATIRadeonX1000ID ), + VE( kCGLRendererATIRadeonX2000ID ), + VE( kCGLRendererGeForce2MXID ), + VE( kCGLRendererGeForce3ID ), + VE( kCGLRendererGeForceFXID ), // also for GF6 and GF7 + VE( kCGLRendererGeForce8xxxID ), + VE( kCGLRendererVTBladeXP2ID ), + VE( kCGLRendererIntel900ID ), + VE( kCGLRendererMesa3DFXID ), + + VE( TERMVALUE ) +}; +#pragma clang diagnostic pop + +GLMValueEntry_t g_gl_errors[] = +{ + VE( GL_INVALID_ENUM ), + VE( GL_INVALID_VALUE ), + VE( GL_INVALID_OPERATION ), + VE( GL_STACK_OVERFLOW ), + VE( GL_STACK_UNDERFLOW ), + VE( GL_OUT_OF_MEMORY ), + VE( GL_INVALID_FRAMEBUFFER_OPERATION_EXT ), + VE( GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT ), + VE( GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT ), + VE( GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT ), + VE( GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT ), + VE( GL_FRAMEBUFFER_UNSUPPORTED_EXT ), + VE( GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT ), + VE( GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT ) +}; + +// there are some ARB/EXT dupes in this table but that doesn't matter too much +GLMValueEntry_t g_gl_enums[] = +{ + { 0x0000, "GL_ZERO" }, + { 0x0001, "GL_ONE" }, + { 0x0004, "GL_TRIANGLES" }, + { 0x0005, "GL_TRIANGLE_STRIP" }, + { 0x0006, "GL_TRIANGLE_FAN" }, + { 0x0007, "GL_QUADS" }, + { 0x0008, "GL_QUAD_STRIP" }, + { 0x0009, "GL_POLYGON" }, + { 0x0200, "GL_NEVER" }, + { 0x0201, "GL_LESS" }, + { 0x0202, "GL_EQUAL" }, + { 0x0203, "GL_LEQUAL" }, + { 0x0204, "GL_GREATER" }, + { 0x0205, "GL_NOTEQUAL" }, + { 0x0206, "GL_GEQUAL" }, + { 0x0207, "GL_ALWAYS" }, + { 0x0300, "GL_SRC_COLOR" }, + { 0x0301, "GL_ONE_MINUS_SRC_COLOR" }, + { 0x0302, "GL_SRC_ALPHA" }, + { 0x0303, "GL_ONE_MINUS_SRC_ALPHA" }, + { 0x0304, "GL_DST_ALPHA" }, + { 0x0305, "GL_ONE_MINUS_DST_ALPHA" }, + { 0x0306, "GL_DST_COLOR" }, + { 0x0307, "GL_ONE_MINUS_DST_COLOR" }, + { 0x0308, "GL_SRC_ALPHA_SATURATE" }, + { 0x0400, "GL_FRONT_LEFT" }, + { 0x0401, "GL_FRONT_RIGHT" }, + { 0x0402, "GL_BACK_LEFT" }, + { 0x0403, "GL_BACK_RIGHT" }, + { 0x0404, "GL_FRONT" }, + { 0x0405, "GL_BACK" }, + { 0x0406, "GL_LEFT" }, + { 0x0407, "GL_RIGHT" }, + { 0x0408, "GL_FRONT_AND_BACK" }, + { 0x0409, "GL_AUX0" }, + { 0x040A, "GL_AUX1" }, + { 0x040B, "GL_AUX2" }, + { 0x040C, "GL_AUX3" }, + { 0x0500, "GL_INVALID_ENUM" }, + { 0x0501, "GL_INVALID_VALUE" }, + { 0x0502, "GL_INVALID_OPERATION" }, + { 0x0503, "GL_STACK_OVERFLOW" }, + { 0x0504, "GL_STACK_UNDERFLOW" }, + { 0x0505, "GL_OUT_OF_MEMORY" }, + { 0x0506, "GL_INVALID_FRAMEBUFFER_OPERATION" }, + { 0x0600, "GL_2D" }, + { 0x0601, "GL_3D" }, + { 0x0602, "GL_3D_COLOR" }, + { 0x0603, "GL_3D_COLOR_TEXTURE" }, + { 0x0604, "GL_4D_COLOR_TEXTURE" }, + { 0x0700, "GL_PASS_THROUGH_TOKEN" }, + { 0x0701, "GL_POINT_TOKEN" }, + { 0x0702, "GL_LINE_TOKEN" }, + { 0x0703, "GL_POLYGON_TOKEN" }, + { 0x0704, "GL_BITMAP_TOKEN" }, + { 0x0705, "GL_DRAW_PIXEL_TOKEN" }, + { 0x0706, "GL_COPY_PIXEL_TOKEN" }, + { 0x0707, "GL_LINE_RESET_TOKEN" }, + { 0x0800, "GL_EXP" }, + { 0x0801, "GL_EXP2" }, + { 0x0900, "GL_CW" }, + { 0x0901, "GL_CCW" }, + { 0x0A00, "GL_COEFF" }, + { 0x0A01, "GL_ORDER" }, + { 0x0A02, "GL_DOMAIN" }, + { 0x0B00, "GL_CURRENT_COLOR" }, + { 0x0B01, "GL_CURRENT_INDEX" }, + { 0x0B02, "GL_CURRENT_NORMAL" }, + { 0x0B03, "GL_CURRENT_TEXTURE_COORDS" }, + { 0x0B04, "GL_CURRENT_RASTER_COLOR" }, + { 0x0B05, "GL_CURRENT_RASTER_INDEX" }, + { 0x0B06, "GL_CURRENT_RASTER_TEXTURE_COORDS" }, + { 0x0B07, "GL_CURRENT_RASTER_POSITION" }, + { 0x0B08, "GL_CURRENT_RASTER_POSITION_VALID" }, + { 0x0B09, "GL_CURRENT_RASTER_DISTANCE" }, + { 0x0B10, "GL_POINT_SMOOTH" }, + { 0x0B11, "GL_POINT_SIZE" }, + { 0x0B12, "GL_POINT_SIZE_RANGE" }, + { 0x0B12, "GL_SMOOTH_POINT_SIZE_RANGE" }, + { 0x0B13, "GL_POINT_SIZE_GRANULARITY" }, + { 0x0B13, "GL_SMOOTH_POINT_SIZE_GRANULARITY" }, + { 0x0B20, "GL_LINE_SMOOTH" }, + { 0x0B21, "GL_LINE_WIDTH" }, + { 0x0B22, "GL_LINE_WIDTH_RANGE" }, + { 0x0B22, "GL_SMOOTH_LINE_WIDTH_RANGE" }, + { 0x0B23, "GL_LINE_WIDTH_GRANULARITY" }, + { 0x0B23, "GL_SMOOTH_LINE_WIDTH_GRANULARITY" }, + { 0x0B24, "GL_LINE_STIPPLE" }, + { 0x0B25, "GL_LINE_STIPPLE_PATTERN" }, + { 0x0B26, "GL_LINE_STIPPLE_REPEAT" }, + { 0x0B30, "GL_LIST_MODE" }, + { 0x0B31, "GL_MAX_LIST_NESTING" }, + { 0x0B32, "GL_LIST_BASE" }, + { 0x0B33, "GL_LIST_INDEX" }, + { 0x0B40, "GL_POLYGON_MODE" }, + { 0x0B41, "GL_POLYGON_SMOOTH" }, + { 0x0B42, "GL_POLYGON_STIPPLE" }, + { 0x0B43, "GL_EDGE_FLAG" }, + { 0x0B44, "GL_CULL_FACE" }, + { 0x0B45, "GL_CULL_FACE_MODE" }, + { 0x0B46, "GL_FRONT_FACE" }, + { 0x0B50, "GL_LIGHTING" }, + { 0x0B51, "GL_LIGHT_MODEL_LOCAL_VIEWER" }, + { 0x0B52, "GL_LIGHT_MODEL_TWO_SIDE" }, + { 0x0B53, "GL_LIGHT_MODEL_AMBIENT" }, + { 0x0B54, "GL_SHADE_MODEL" }, + { 0x0B55, "GL_COLOR_MATERIAL_FACE" }, + { 0x0B56, "GL_COLOR_MATERIAL_PARAMETER" }, + { 0x0B57, "GL_COLOR_MATERIAL" }, + { 0x0B60, "GL_FOG" }, + { 0x0B61, "GL_FOG_INDEX" }, + { 0x0B62, "GL_FOG_DENSITY" }, + { 0x0B63, "GL_FOG_START" }, + { 0x0B64, "GL_FOG_END" }, + { 0x0B65, "GL_FOG_MODE" }, + { 0x0B66, "GL_FOG_COLOR" }, + { 0x0B70, "GL_DEPTH_RANGE" }, + { 0x0B71, "GL_DEPTH_TEST" }, + { 0x0B72, "GL_DEPTH_WRITEMASK" }, + { 0x0B73, "GL_DEPTH_CLEAR_VALUE" }, + { 0x0B74, "GL_DEPTH_FUNC" }, + { 0x0B80, "GL_ACCUM_CLEAR_VALUE" }, + { 0x0B90, "GL_STENCIL_TEST" }, + { 0x0B91, "GL_STENCIL_CLEAR_VALUE" }, + { 0x0B92, "GL_STENCIL_FUNC" }, + { 0x0B93, "GL_STENCIL_VALUE_MASK" }, + { 0x0B94, "GL_STENCIL_FAIL" }, + { 0x0B95, "GL_STENCIL_PASS_DEPTH_FAIL" }, + { 0x0B96, "GL_STENCIL_PASS_DEPTH_PASS" }, + { 0x0B97, "GL_STENCIL_REF" }, + { 0x0B98, "GL_STENCIL_WRITEMASK" }, + { 0x0BA0, "GL_MATRIX_MODE" }, + { 0x0BA1, "GL_NORMALIZE" }, + { 0x0BA2, "GL_VIEWPORT" }, + { 0x0BA3, "GL_MODELVIEW_STACK_DEPTH" }, + { 0x0BA4, "GL_PROJECTION_STACK_DEPTH" }, + { 0x0BA5, "GL_TEXTURE_STACK_DEPTH" }, + { 0x0BA6, "GL_MODELVIEW_MATRIX" }, + { 0x0BA7, "GL_PROJECTION_MATRIX" }, + { 0x0BA8, "GL_TEXTURE_MATRIX" }, + { 0x0BB0, "GL_ATTRIB_STACK_DEPTH" }, + { 0x0BB1, "GL_CLIENT_ATTRIB_STACK_DEPTH" }, + { 0x0BC0, "GL_ALPHA_TEST" }, + { 0x0BC1, "GL_ALPHA_TEST_FUNC" }, + { 0x0BC2, "GL_ALPHA_TEST_REF" }, + { 0x0BD0, "GL_DITHER" }, + { 0x0BE0, "GL_BLEND_DST" }, + { 0x0BE1, "GL_BLEND_SRC" }, + { 0x0BE2, "GL_BLEND" }, + { 0x0BF0, "GL_LOGIC_OP_MODE" }, + { 0x0BF1, "GL_INDEX_LOGIC_OP" }, + { 0x0BF2, "GL_COLOR_LOGIC_OP" }, + { 0x0C00, "GL_AUX_BUFFERS" }, + { 0x0C01, "GL_DRAW_BUFFER" }, + { 0x0C02, "GL_READ_BUFFER" }, + { 0x0C10, "GL_SCISSOR_BOX" }, + { 0x0C11, "GL_SCISSOR_TEST" }, + { 0x0C20, "GL_INDEX_CLEAR_VALUE" }, + { 0x0C21, "GL_INDEX_WRITEMASK" }, + { 0x0C22, "GL_COLOR_CLEAR_VALUE" }, + { 0x0C23, "GL_COLOR_WRITEMASK" }, + { 0x0C30, "GL_INDEX_MODE" }, + { 0x0C31, "GL_RGBA_MODE" }, + { 0x0C32, "GL_DOUBLEBUFFER" }, + { 0x0C33, "GL_STEREO" }, + { 0x0C40, "GL_RENDER_MODE" }, + { 0x0C50, "GL_PERSPECTIVE_CORRECTION_HINT" }, + { 0x0C51, "GL_POINT_SMOOTH_HINT" }, + { 0x0C52, "GL_LINE_SMOOTH_HINT" }, + { 0x0C53, "GL_POLYGON_SMOOTH_HINT" }, + { 0x0C54, "GL_FOG_HINT" }, + { 0x0C60, "GL_TEXTURE_GEN_S" }, + { 0x0C61, "GL_TEXTURE_GEN_T" }, + { 0x0C62, "GL_TEXTURE_GEN_R" }, + { 0x0C63, "GL_TEXTURE_GEN_Q" }, + { 0x0C70, "GL_PIXEL_MAP_I_TO_I" }, + { 0x0C71, "GL_PIXEL_MAP_S_TO_S" }, + { 0x0C72, "GL_PIXEL_MAP_I_TO_R" }, + { 0x0C73, "GL_PIXEL_MAP_I_TO_G" }, + { 0x0C74, "GL_PIXEL_MAP_I_TO_B" }, + { 0x0C75, "GL_PIXEL_MAP_I_TO_A" }, + { 0x0C76, "GL_PIXEL_MAP_R_TO_R" }, + { 0x0C77, "GL_PIXEL_MAP_G_TO_G" }, + { 0x0C78, "GL_PIXEL_MAP_B_TO_B" }, + { 0x0C79, "GL_PIXEL_MAP_A_TO_A" }, + { 0x0CB0, "GL_PIXEL_MAP_I_TO_I_SIZE" }, + { 0x0CB1, "GL_PIXEL_MAP_S_TO_S_SIZE" }, + { 0x0CB2, "GL_PIXEL_MAP_I_TO_R_SIZE" }, + { 0x0CB3, "GL_PIXEL_MAP_I_TO_G_SIZE" }, + { 0x0CB4, "GL_PIXEL_MAP_I_TO_B_SIZE" }, + { 0x0CB5, "GL_PIXEL_MAP_I_TO_A_SIZE" }, + { 0x0CB6, "GL_PIXEL_MAP_R_TO_R_SIZE" }, + { 0x0CB7, "GL_PIXEL_MAP_G_TO_G_SIZE" }, + { 0x0CB8, "GL_PIXEL_MAP_B_TO_B_SIZE" }, + { 0x0CB9, "GL_PIXEL_MAP_A_TO_A_SIZE" }, + { 0x0CF0, "GL_UNPACK_SWAP_BYTES" }, + { 0x0CF1, "GL_UNPACK_LSB_FIRST" }, + { 0x0CF2, "GL_UNPACK_ROW_LENGTH" }, + { 0x0CF3, "GL_UNPACK_SKIP_ROWS" }, + { 0x0CF4, "GL_UNPACK_SKIP_PIXELS" }, + { 0x0CF5, "GL_UNPACK_ALIGNMENT" }, + { 0x0D00, "GL_PACK_SWAP_BYTES" }, + { 0x0D01, "GL_PACK_LSB_FIRST" }, + { 0x0D02, "GL_PACK_ROW_LENGTH" }, + { 0x0D03, "GL_PACK_SKIP_ROWS" }, + { 0x0D04, "GL_PACK_SKIP_PIXELS" }, + { 0x0D05, "GL_PACK_ALIGNMENT" }, + { 0x0D10, "GL_MAP_COLOR" }, + { 0x0D11, "GL_MAP_STENCIL" }, + { 0x0D12, "GL_INDEX_SHIFT" }, + { 0x0D13, "GL_INDEX_OFFSET" }, + { 0x0D14, "GL_RED_SCALE" }, + { 0x0D15, "GL_RED_BIAS" }, + { 0x0D16, "GL_ZOOM_X" }, + { 0x0D17, "GL_ZOOM_Y" }, + { 0x0D18, "GL_GREEN_SCALE" }, + { 0x0D19, "GL_GREEN_BIAS" }, + { 0x0D1A, "GL_BLUE_SCALE" }, + { 0x0D1B, "GL_BLUE_BIAS" }, + { 0x0D1C, "GL_ALPHA_SCALE" }, + { 0x0D1D, "GL_ALPHA_BIAS" }, + { 0x0D1E, "GL_DEPTH_SCALE" }, + { 0x0D1F, "GL_DEPTH_BIAS" }, + { 0x0D30, "GL_MAX_EVAL_ORDER" }, + { 0x0D31, "GL_MAX_LIGHTS" }, + { 0x0D32, "GL_MAX_CLIP_PLANES" }, + { 0x0D33, "GL_MAX_TEXTURE_SIZE" }, + { 0x0D34, "GL_MAX_PIXEL_MAP_TABLE" }, + { 0x0D35, "GL_MAX_ATTRIB_STACK_DEPTH" }, + { 0x0D36, "GL_MAX_MODELVIEW_STACK_DEPTH" }, + { 0x0D37, "GL_MAX_NAME_STACK_DEPTH" }, + { 0x0D38, "GL_MAX_PROJECTION_STACK_DEPTH" }, + { 0x0D39, "GL_MAX_TEXTURE_STACK_DEPTH" }, + { 0x0D3A, "GL_MAX_VIEWPORT_DIMS" }, + { 0x0D3B, "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH" }, + { 0x0D50, "GL_SUBPIXEL_BITS" }, + { 0x0D51, "GL_INDEX_BITS" }, + { 0x0D52, "GL_RED_BITS" }, + { 0x0D53, "GL_GREEN_BITS" }, + { 0x0D54, "GL_BLUE_BITS" }, + { 0x0D55, "GL_ALPHA_BITS" }, + { 0x0D56, "GL_DEPTH_BITS" }, + { 0x0D57, "GL_STENCIL_BITS" }, + { 0x0D58, "GL_ACCUM_RED_BITS" }, + { 0x0D59, "GL_ACCUM_GREEN_BITS" }, + { 0x0D5A, "GL_ACCUM_BLUE_BITS" }, + { 0x0D5B, "GL_ACCUM_ALPHA_BITS" }, + { 0x0D70, "GL_NAME_STACK_DEPTH" }, + { 0x0D80, "GL_AUTO_NORMAL" }, + { 0x0D90, "GL_MAP1_COLOR_4" }, + { 0x0D91, "GL_MAP1_INDEX" }, + { 0x0D92, "GL_MAP1_NORMAL" }, + { 0x0D93, "GL_MAP1_TEXTURE_COORD_1" }, + { 0x0D94, "GL_MAP1_TEXTURE_COORD_2" }, + { 0x0D95, "GL_MAP1_TEXTURE_COORD_3" }, + { 0x0D96, "GL_MAP1_TEXTURE_COORD_4" }, + { 0x0D97, "GL_MAP1_VERTEX_3" }, + { 0x0D98, "GL_MAP1_VERTEX_4" }, + { 0x0DB0, "GL_MAP2_COLOR_4" }, + { 0x0DB1, "GL_MAP2_INDEX" }, + { 0x0DB2, "GL_MAP2_NORMAL" }, + { 0x0DB3, "GL_MAP2_TEXTURE_COORD_1" }, + { 0x0DB4, "GL_MAP2_TEXTURE_COORD_2" }, + { 0x0DB5, "GL_MAP2_TEXTURE_COORD_3" }, + { 0x0DB6, "GL_MAP2_TEXTURE_COORD_4" }, + { 0x0DB7, "GL_MAP2_VERTEX_3" }, + { 0x0DB8, "GL_MAP2_VERTEX_4" }, + { 0x0DD0, "GL_MAP1_GRID_DOMAIN" }, + { 0x0DD1, "GL_MAP1_GRID_SEGMENTS" }, + { 0x0DD2, "GL_MAP2_GRID_DOMAIN" }, + { 0x0DD3, "GL_MAP2_GRID_SEGMENTS" }, + { 0x0DE0, "GL_TEXTURE_1D" }, + { 0x0DE1, "GL_TEXTURE_2D" }, + { 0x0DF0, "GL_FEEDBACK_BUFFER_POINTER" }, + { 0x0DF1, "GL_FEEDBACK_BUFFER_SIZE" }, + { 0x0DF2, "GL_FEEDBACK_BUFFER_TYPE" }, + { 0x0DF3, "GL_SELECTION_BUFFER_POINTER" }, + { 0x0DF4, "GL_SELECTION_BUFFER_SIZE" }, + { 0x1000, "GL_TEXTURE_WIDTH" }, + { 0x1001, "GL_TEXTURE_HEIGHT" }, + { 0x1003, "GL_TEXTURE_INTERNAL_FORMAT" }, + { 0x1004, "GL_TEXTURE_BORDER_COLOR" }, + { 0x1005, "GL_TEXTURE_BORDER" }, + { 0x1100, "GL_DONT_CARE" }, + { 0x1101, "GL_FASTEST" }, + { 0x1102, "GL_NICEST" }, + { 0x1200, "GL_AMBIENT" }, + { 0x1201, "GL_DIFFUSE" }, + { 0x1202, "GL_SPECULAR" }, + { 0x1203, "GL_POSITION" }, + { 0x1204, "GL_SPOT_DIRECTION" }, + { 0x1205, "GL_SPOT_EXPONENT" }, + { 0x1206, "GL_SPOT_CUTOFF" }, + { 0x1207, "GL_CONSTANT_ATTENUATION" }, + { 0x1208, "GL_LINEAR_ATTENUATION" }, + { 0x1209, "GL_QUADRATIC_ATTENUATION" }, + { 0x1300, "GL_COMPILE" }, + { 0x1301, "GL_COMPILE_AND_EXECUTE" }, + { 0x1400, "GL_BYTE " }, + { 0x1401, "GL_UBYTE" }, + { 0x1402, "GL_SHORT" }, + { 0x1403, "GL_USHRT" }, + { 0x1404, "GL_INT " }, + { 0x1405, "GL_UINT " }, + { 0x1406, "GL_FLOAT" }, + { 0x1407, "GL_2_BYTES" }, + { 0x1408, "GL_3_BYTES" }, + { 0x1409, "GL_4_BYTES" }, + { 0x140A, "GL_DOUBLE" }, + { 0x140B, "GL_HALF_FLOAT" }, + { 0x1500, "GL_CLEAR" }, + { 0x1501, "GL_AND" }, + { 0x1502, "GL_AND_REVERSE" }, + { 0x1503, "GL_COPY" }, + { 0x1504, "GL_AND_INVERTED" }, + { 0x1505, "GL_NOOP" }, + { 0x1506, "GL_XOR" }, + { 0x1507, "GL_OR" }, + { 0x1508, "GL_NOR" }, + { 0x1509, "GL_EQUIV" }, + { 0x150A, "GL_INVERT" }, + { 0x150B, "GL_OR_REVERSE" }, + { 0x150C, "GL_COPY_INVERTED" }, + { 0x150D, "GL_OR_INVERTED" }, + { 0x150E, "GL_NAND" }, + { 0x150F, "GL_SET" }, + { 0x1600, "GL_EMISSION" }, + { 0x1601, "GL_SHININESS" }, + { 0x1602, "GL_AMBIENT_AND_DIFFUSE" }, + { 0x1603, "GL_COLOR_INDEXES" }, + { 0x1700, "GL_MODELVIEW" }, + { 0x1700, "GL_MODELVIEW0_ARB" }, + { 0x1701, "GL_PROJECTION" }, + { 0x1702, "GL_TEXTURE" }, + { 0x1800, "GL_COLOR" }, + { 0x1801, "GL_DEPTH" }, + { 0x1802, "GL_STENCIL" }, + { 0x1900, "GL_COLOR_INDEX" }, + { 0x1901, "GL_STENCIL_INDEX" }, + { 0x1902, "GL_DEPTH_COMPONENT" }, + { 0x1903, "GL_RED" }, + { 0x1904, "GL_GREEN" }, + { 0x1905, "GL_BLUE" }, + { 0x1906, "GL_ALPHA" }, + { 0x1907, "GL_RGB" }, + { 0x1908, "GL_RGBA" }, + { 0x1909, "GL_LUMINANCE" }, + { 0x190A, "GL_LUMINANCE_ALPHA" }, + { 0x1A00, "GL_BITMAP" }, + { 0x1B00, "GL_POINT" }, + { 0x1B01, "GL_LINE" }, + { 0x1B02, "GL_FILL" }, + { 0x1C00, "GL_RENDER" }, + { 0x1C01, "GL_FEEDBACK" }, + { 0x1C02, "GL_SELECT" }, + { 0x1D00, "GL_FLAT" }, + { 0x1D01, "GL_SMOOTH" }, + { 0x1E00, "GL_KEEP" }, + { 0x1E01, "GL_REPLACE" }, + { 0x1E02, "GL_INCR" }, + { 0x1E03, "GL_DECR" }, + { 0x1F00, "GL_VENDOR" }, + { 0x1F01, "GL_RENDERER" }, + { 0x1F02, "GL_VERSION" }, + { 0x1F03, "GL_EXTENSIONS" }, + { 0x2000, "GL_S" }, + { 0x2001, "GL_T" }, + { 0x2002, "GL_R" }, + { 0x2003, "GL_Q" }, + { 0x2100, "GL_MODULATE" }, + { 0x2101, "GL_DECAL" }, + { 0x2200, "GL_TEXTURE_ENV_MODE" }, + { 0x2201, "GL_TEXTURE_ENV_COLOR" }, + { 0x2300, "GL_TEXTURE_ENV" }, + { 0x2400, "GL_EYE_LINEAR" }, + { 0x2401, "GL_OBJECT_LINEAR" }, + { 0x2402, "GL_SPHERE_MAP" }, + { 0x2500, "GL_TEXTURE_GEN_MODE" }, + { 0x2501, "GL_OBJECT_PLANE" }, + { 0x2502, "GL_EYE_PLANE" }, + { 0x2600, "GL_NEAREST" }, + { 0x2601, "GL_LINEAR" }, + { 0x2700, "GL_NEAREST_MIPMAP_NEAREST" }, + { 0x2701, "GL_LINEAR_MIPMAP_NEAREST" }, + { 0x2702, "GL_NEAREST_MIPMAP_LINEAR" }, + { 0x2703, "GL_LINEAR_MIPMAP_LINEAR" }, + { 0x2800, "GL_TEXTURE_MAG_FILTER" }, + { 0x2801, "GL_TEXTURE_MIN_FILTER" }, + { 0x2802, "GL_TEXTURE_WRAP_S" }, + { 0x2803, "GL_TEXTURE_WRAP_T" }, + { 0x2900, "GL_CLAMP" }, + { 0x2901, "GL_REPEAT" }, + { 0x2A00, "GL_POLYGON_OFFSET_UNITS" }, + { 0x2A01, "GL_POLYGON_OFFSET_POINT" }, + { 0x2A02, "GL_POLYGON_OFFSET_LINE" }, + { 0x2A10, "GL_R3_G3_B2" }, + { 0x2A20, "GL_V2F" }, + { 0x2A21, "GL_V3F" }, + { 0x2A22, "GL_C4UB_V2F" }, + { 0x2A23, "GL_C4UB_V3F" }, + { 0x2A24, "GL_C3F_V3F" }, + { 0x2A25, "GL_N3F_V3F" }, + { 0x2A26, "GL_C4F_N3F_V3F" }, + { 0x2A27, "GL_T2F_V3F" }, + { 0x2A28, "GL_T4F_V4F" }, + { 0x2A29, "GL_T2F_C4UB_V3F" }, + { 0x2A2A, "GL_T2F_C3F_V3F" }, + { 0x2A2B, "GL_T2F_N3F_V3F" }, + { 0x2A2C, "GL_T2F_C4F_N3F_V3F" }, + { 0x2A2D, "GL_T4F_C4F_N3F_V4F" }, + { 0x3000, "GL_CLIP_PLANE0" }, + { 0x3001, "GL_CLIP_PLANE1" }, + { 0x3002, "GL_CLIP_PLANE2" }, + { 0x3003, "GL_CLIP_PLANE3" }, + { 0x3004, "GL_CLIP_PLANE4" }, + { 0x3005, "GL_CLIP_PLANE5" }, + { 0x4000, "GL_LIGHT0" }, + { 0x4001, "GL_LIGHT1" }, + { 0x4002, "GL_LIGHT2" }, + { 0x4003, "GL_LIGHT3" }, + { 0x4004, "GL_LIGHT4" }, + { 0x4005, "GL_LIGHT5" }, + { 0x4006, "GL_LIGHT6" }, + { 0x4007, "GL_LIGHT7" }, + { 0x8000, "GL_ABGR_EXT" }, + { 0x8001, "GL_CONSTANT_COLOR" }, + { 0x8002, "GL_ONE_MINUS_CONSTANT_COLOR" }, + { 0x8003, "GL_CONSTANT_ALPHA" }, + { 0x8004, "GL_ONE_MINUS_CONSTANT_ALPHA" }, + { 0x8005, "GL_BLEND_COLOR" }, + { 0x8006, "GL_FUNC_ADD" }, + { 0x8007, "GL_MIN" }, + { 0x8008, "GL_MAX" }, + { 0x8009, "GL_BLEND_EQUATION_RGB" }, + { 0x8009, "GL_BLEND_EQUATION" }, + { 0x800A, "GL_FUNC_SUBTRACT" }, + { 0x800B, "GL_FUNC_REVERSE_SUBTRACT" }, + { 0x8010, "GL_CONVOLUTION_1D" }, + { 0x8011, "GL_CONVOLUTION_2D" }, + { 0x8012, "GL_SEPARABLE_2D" }, + { 0x8013, "GL_CONVOLUTION_BORDER_MODE" }, + { 0x8014, "GL_CONVOLUTION_FILTER_SCALE" }, + { 0x8015, "GL_CONVOLUTION_FILTER_BIAS" }, + { 0x8016, "GL_REDUCE" }, + { 0x8017, "GL_CONVOLUTION_FORMAT" }, + { 0x8018, "GL_CONVOLUTION_WIDTH" }, + { 0x8019, "GL_CONVOLUTION_HEIGHT" }, + { 0x801A, "GL_MAX_CONVOLUTION_WIDTH" }, + { 0x801B, "GL_MAX_CONVOLUTION_HEIGHT" }, + { 0x801C, "GL_POST_CONVOLUTION_RED_SCALE" }, + { 0x801D, "GL_POST_CONVOLUTION_GREEN_SCALE" }, + { 0x801E, "GL_POST_CONVOLUTION_BLUE_SCALE" }, + { 0x801F, "GL_POST_CONVOLUTION_ALPHA_SCALE" }, + { 0x8020, "GL_POST_CONVOLUTION_RED_BIAS" }, + { 0x8021, "GL_POST_CONVOLUTION_GREEN_BIAS" }, + { 0x8022, "GL_POST_CONVOLUTION_BLUE_BIAS" }, + { 0x8023, "GL_POST_CONVOLUTION_ALPHA_BIAS" }, + { 0x8024, "GL_HISTOGRAM" }, + { 0x8025, "GL_PROXY_HISTOGRAM" }, + { 0x8026, "GL_HISTOGRAM_WIDTH" }, + { 0x8027, "GL_HISTOGRAM_FORMAT" }, + { 0x8028, "GL_HISTOGRAM_RED_SIZE" }, + { 0x8029, "GL_HISTOGRAM_GREEN_SIZE" }, + { 0x802A, "GL_HISTOGRAM_BLUE_SIZE" }, + { 0x802B, "GL_HISTOGRAM_ALPHA_SIZE" }, + { 0x802C, "GL_HISTOGRAM_LUMINANCE_SIZE" }, + { 0x802D, "GL_HISTOGRAM_SINK" }, + { 0x802E, "GL_MINMAX" }, + { 0x802F, "GL_MINMAX_FORMAT" }, + { 0x8030, "GL_MINMAX_SINK" }, + { 0x8031, "GL_TABLE_TOO_LARGE" }, + { 0x8032, "GL_UNSIGNED_BYTE_3_3_2" }, + { 0x8033, "GL_UNSIGNED_SHORT_4_4_4_4" }, + { 0x8034, "GL_UNSIGNED_SHORT_5_5_5_1" }, + { 0x8035, "GL_UNSIGNED_INT_8_8_8_8" }, + { 0x8036, "GL_UNSIGNED_INT_10_10_10_2" }, + { 0x8037, "GL_POLYGON_OFFSET_FILL" }, + { 0x8038, "GL_POLYGON_OFFSET_FACTOR" }, + { 0x803A, "GL_RESCALE_NORMAL" }, + { 0x803B, "GL_ALPHA4" }, + { 0x803C, "GL_ALPHA8" }, + { 0x803D, "GL_ALPHA12" }, + { 0x803E, "GL_ALPHA16" }, + { 0x803F, "GL_LUMINANCE4" }, + { 0x8040, "GL_LUMINANCE8" }, + { 0x8041, "GL_LUMINANCE12" }, + { 0x8042, "GL_LUMINANCE16" }, + { 0x8043, "GL_LUMINANCE4_ALPHA4" }, + { 0x8044, "GL_LUMINANCE6_ALPHA2" }, + { 0x8045, "GL_LUMINANCE8_ALPHA8" }, + { 0x8046, "GL_LUMINANCE12_ALPHA4" }, + { 0x8047, "GL_LUMINANCE12_ALPHA12" }, + { 0x8048, "GL_LUMINANCE16_ALPHA16" }, + { 0x8049, "GL_INTENSITY" }, + { 0x804A, "GL_INTENSITY4" }, + { 0x804B, "GL_INTENSITY8" }, + { 0x804C, "GL_INTENSITY12" }, + { 0x804D, "GL_INTENSITY16" }, + { 0x804F, "GL_RGB4" }, + { 0x8050, "GL_RGB5" }, + { 0x8051, "GL_RGB8" }, + { 0x8052, "GL_RGB10" }, + { 0x8053, "GL_RGB12" }, + { 0x8054, "GL_RGB16" }, + { 0x8055, "GL_RGBA2" }, + { 0x8056, "GL_RGBA4" }, + { 0x8057, "GL_RGB5_A1" }, + { 0x8058, "GL_RGBA8" }, + { 0x8059, "GL_RGB10_A2" }, + { 0x805A, "GL_RGBA12" }, + { 0x805B, "GL_RGBA16" }, + { 0x805C, "GL_TEXTURE_RED_SIZE" }, + { 0x805D, "GL_TEXTURE_GREEN_SIZE" }, + { 0x805E, "GL_TEXTURE_BLUE_SIZE" }, + { 0x805F, "GL_TEXTURE_ALPHA_SIZE" }, + { 0x8060, "GL_TEXTURE_LUMINANCE_SIZE" }, + { 0x8061, "GL_TEXTURE_INTENSITY_SIZE" }, + { 0x8063, "GL_PROXY_TEXTURE_1D" }, + { 0x8064, "GL_PROXY_TEXTURE_2D" }, + { 0x8066, "GL_TEXTURE_PRIORITY" }, + { 0x8067, "GL_TEXTURE_RESIDENT" }, + { 0x8068, "GL_TEXTURE_BINDING_1D" }, + { 0x8069, "GL_TEXTURE_BINDING_2D" }, + { 0x806A, "GL_TEXTURE_BINDING_3D" }, + { 0x806B, "GL_PACK_SKIP_IMAGES" }, + { 0x806C, "GL_PACK_IMAGE_HEIGHT" }, + { 0x806D, "GL_UNPACK_SKIP_IMAGES" }, + { 0x806E, "GL_UNPACK_IMAGE_HEIGHT" }, + { 0x806F, "GL_TEXTURE_3D" }, + { 0x8070, "GL_PROXY_TEXTURE_3D" }, + { 0x8071, "GL_TEXTURE_DEPTH" }, + { 0x8072, "GL_TEXTURE_WRAP_R" }, + { 0x8073, "GL_MAX_3D_TEXTURE_SIZE" }, + { 0x8074, "GL_VERTEX_ARRAY" }, + { 0x8075, "GL_NORMAL_ARRAY" }, + { 0x8076, "GL_COLOR_ARRAY" }, + { 0x8077, "GL_INDEX_ARRAY" }, + { 0x8078, "GL_TEXTURE_COORD_ARRAY" }, + { 0x8079, "GL_EDGE_FLAG_ARRAY" }, + { 0x807A, "GL_VERTEX_ARRAY_SIZE" }, + { 0x807B, "GL_VERTEX_ARRAY_TYPE" }, + { 0x807C, "GL_VERTEX_ARRAY_STRIDE" }, + { 0x807E, "GL_NORMAL_ARRAY_TYPE" }, + { 0x807F, "GL_NORMAL_ARRAY_STRIDE" }, + { 0x8081, "GL_COLOR_ARRAY_SIZE" }, + { 0x8082, "GL_COLOR_ARRAY_TYPE" }, + { 0x8083, "GL_COLOR_ARRAY_STRIDE" }, + { 0x8085, "GL_INDEX_ARRAY_TYPE" }, + { 0x8086, "GL_INDEX_ARRAY_STRIDE" }, + { 0x8088, "GL_TEXTURE_COORD_ARRAY_SIZE" }, + { 0x8089, "GL_TEXTURE_COORD_ARRAY_TYPE" }, + { 0x808A, "GL_TEXTURE_COORD_ARRAY_STRIDE" }, + { 0x808C, "GL_EDGE_FLAG_ARRAY_STRIDE" }, + { 0x808E, "GL_VERTEX_ARRAY_POINTER" }, + { 0x808F, "GL_NORMAL_ARRAY_POINTER" }, + { 0x8090, "GL_COLOR_ARRAY_POINTER" }, + { 0x8091, "GL_INDEX_ARRAY_POINTER" }, + { 0x8092, "GL_TEXTURE_COORD_ARRAY_POINTER" }, + { 0x8093, "GL_EDGE_FLAG_ARRAY_POINTER" }, + { 0x809D, "GL_MULTISAMPLE_ARB" }, + { 0x809D, "GL_MULTISAMPLE" }, + { 0x809E, "GL_SAMPLE_ALPHA_TO_COVERAGE_ARB" }, + { 0x809E, "GL_SAMPLE_ALPHA_TO_COVERAGE" }, + { 0x809F, "GL_SAMPLE_ALPHA_TO_ONE_ARB" }, + { 0x809F, "GL_SAMPLE_ALPHA_TO_ONE" }, + { 0x80A0, "GL_SAMPLE_COVERAGE_ARB" }, + { 0x80A0, "GL_SAMPLE_COVERAGE" }, + { 0x80A0, "GL_SAMPLE_MASK_EXT" }, + { 0x80A1, "GL_1PASS_EXT" }, + { 0x80A2, "GL_2PASS_0_EXT" }, + { 0x80A3, "GL_2PASS_1_EXT" }, + { 0x80A4, "GL_4PASS_0_EXT" }, + { 0x80A5, "GL_4PASS_1_EXT" }, + { 0x80A6, "GL_4PASS_2_EXT" }, + { 0x80A7, "GL_4PASS_3_EXT" }, + { 0x80A8, "GL_SAMPLE_BUFFERS" }, + { 0x80A9, "GL_SAMPLES" }, + { 0x80AA, "GL_SAMPLE_COVERAGE_VALUE" }, + { 0x80AB, "GL_SAMPLE_COVERAGE_INVERT" }, + { 0x80AC, "GL_SAMPLE_PATTERN_EXT" }, + { 0x80B1, "GL_COLOR_MATRIX" }, + { 0x80B2, "GL_COLOR_MATRIX_STACK_DEPTH" }, + { 0x80B3, "GL_MAX_COLOR_MATRIX_STACK_DEPTH" }, + { 0x80B4, "GL_POST_COLOR_MATRIX_RED_SCALE" }, + { 0x80B5, "GL_POST_COLOR_MATRIX_GREEN_SCALE" }, + { 0x80B6, "GL_POST_COLOR_MATRIX_BLUE_SCALE" }, + { 0x80B7, "GL_POST_COLOR_MATRIX_ALPHA_SCALE" }, + { 0x80B8, "GL_POST_COLOR_MATRIX_RED_BIAS" }, + { 0x80B9, "GL_POST_COLOR_MATRIX_GREEN_BIAS" }, + { 0x80BA, "GL_POST_COLOR_MATRIX_BLUE_BIAS" }, + { 0x80BB, "GL_POST_COLOR_MATRIX_ALPHA_BIAS" }, + { 0x80BF, "GL_TEXTURE_COMPARE_FAIL_VALUE_ARB" }, + { 0x80C8, "GL_BLEND_DST_RGB" }, + { 0x80C9, "GL_BLEND_SRC_RGB" }, + { 0x80CA, "GL_BLEND_DST_ALPHA" }, + { 0x80CB, "GL_BLEND_SRC_ALPHA" }, + { 0x80CC, "GL_422_EXT" }, + { 0x80CD, "GL_422_REV_EXT" }, + { 0x80CE, "GL_422_AVERAGE_EXT" }, + { 0x80CF, "GL_422_REV_AVERAGE_EXT" }, + { 0x80D0, "GL_COLOR_TABLE" }, + { 0x80D1, "GL_POST_CONVOLUTION_COLOR_TABLE" }, + { 0x80D2, "GL_POST_COLOR_MATRIX_COLOR_TABLE" }, + { 0x80D3, "GL_PROXY_COLOR_TABLE" }, + { 0x80D4, "GL_PROXY_POST_CONVOLUTION_COLOR_TABLE" }, + { 0x80D5, "GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE" }, + { 0x80D6, "GL_COLOR_TABLE_SCALE" }, + { 0x80D7, "GL_COLOR_TABLE_BIAS" }, + { 0x80D8, "GL_COLOR_TABLE_FORMAT" }, + { 0x80D9, "GL_COLOR_TABLE_WIDTH" }, + { 0x80DA, "GL_COLOR_TABLE_RED_SIZE" }, + { 0x80DB, "GL_COLOR_TABLE_GREEN_SIZE" }, + { 0x80DC, "GL_COLOR_TABLE_BLUE_SIZE" }, + { 0x80DD, "GL_COLOR_TABLE_ALPHA_SIZE" }, + { 0x80DE, "GL_COLOR_TABLE_LUMINANCE_SIZE" }, + { 0x80DF, "GL_COLOR_TABLE_INTENSITY_SIZE" }, + { 0x80E0, "GL_BGR_EXT" }, + { 0x80E0, "GL_BGR" }, + { 0x80E1, "GL_BGRA_EXT" }, + { 0x80E1, "GL_BGRA" }, + { 0x80E1, "GL_BGRA" }, + { 0x80E2, "GL_COLOR_INDEX1_EXT" }, + { 0x80E3, "GL_COLOR_INDEX2_EXT" }, + { 0x80E4, "GL_COLOR_INDEX4_EXT" }, + { 0x80E5, "GL_COLOR_INDEX8_EXT" }, + { 0x80E6, "GL_COLOR_INDEX12_EXT" }, + { 0x80E7, "GL_COLOR_INDEX16_EXT" }, + { 0x80E8, "GL_MAX_ELEMENTS_VERTICES_EXT" }, + { 0x80E8, "GL_MAX_ELEMENTS_VERTICES" }, + { 0x80E9, "GL_MAX_ELEMENTS_INDICES_EXT" }, + { 0x80E9, "GL_MAX_ELEMENTS_INDICES" }, + { 0x80ED, "GL_TEXTURE_INDEX_SIZE_EXT" }, + { 0x80F0, "GL_CLIP_VOLUME_CLIPPING_HINT_EXT" }, + { 0x8126, "GL_POINT_SIZE_MIN_ARB" }, + { 0x8126, "GL_POINT_SIZE_MIN" }, + { 0x8127, "GL_POINT_SIZE_MAX_ARB" }, + { 0x8127, "GL_POINT_SIZE_MAX" }, + { 0x8128, "GL_POINT_FADE_THRESHOLD_SIZE_ARB" }, + { 0x8128, "GL_POINT_FADE_THRESHOLD_SIZE" }, + { 0x8129, "GL_POINT_DISTANCE_ATTENUATION_ARB" }, + { 0x8129, "GL_POINT_DISTANCE_ATTENUATION" }, + { 0x812D, "GL_CLAMP_TO_BORDER_ARB" }, + { 0x812D, "GL_CLAMP_TO_BORDER" }, + { 0x812F, "GL_CLAMP_TO_EDGE" }, + { 0x813A, "GL_TEXTURE_MIN_LOD" }, + { 0x813B, "GL_TEXTURE_MAX_LOD" }, + { 0x813C, "GL_TEXTURE_BASE_LEVEL" }, + { 0x813D, "GL_TEXTURE_MAX_LEVEL" }, + { 0x8151, "GL_CONSTANT_BORDER" }, + { 0x8153, "GL_REPLICATE_BORDER" }, + { 0x8154, "GL_CONVOLUTION_BORDER_COLOR" }, + { 0x8191, "GL_GENERATE_MIPMAP" }, + { 0x8192, "GL_GENERATE_MIPMAP_HINT" }, + { 0x81A5, "GL_DEPTH_COMPONENT16_ARB" }, + { 0x81A5, "GL_DEPTH_COMPONENT16" }, + { 0x81A6, "GL_DEPTH_COMPONENT24_ARB" }, + { 0x81A6, "GL_DEPTH_COMPONENT24" }, + { 0x81A7, "GL_DEPTH_COMPONENT32_ARB" }, + { 0x81A7, "GL_DEPTH_COMPONENT32" }, + { 0x81A8, "GL_ARRAY_ELEMENT_LOCK_FIRST_EXT" }, + { 0x81A9, "GL_ARRAY_ELEMENT_LOCK_COUNT_EXT" }, + { 0x81AA, "GL_CULL_VERTEX_EXT" }, + { 0x81AB, "GL_CULL_VERTEX_EYE_POSITION_EXT" }, + { 0x81AC, "GL_CULL_VERTEX_OBJECT_POSITION_EXT" }, + { 0x81AD, "GL_IUI_V2F_EXT" }, + { 0x81AE, "GL_IUI_V3F_EXT" }, + { 0x81AF, "GL_IUI_N3F_V2F_EXT" }, + { 0x81B0, "GL_IUI_N3F_V3F_EXT" }, + { 0x81B1, "GL_T2F_IUI_V2F_EXT" }, + { 0x81B2, "GL_T2F_IUI_V3F_EXT" }, + { 0x81B3, "GL_T2F_IUI_N3F_V2F_EXT" }, + { 0x81B4, "GL_T2F_IUI_N3F_V3F_EXT" }, + { 0x81B5, "GL_INDEX_TEST_EXT" }, + { 0x81B6, "GL_INDEX_TEST_FUNC_EXT" }, + { 0x81B7, "GL_INDEX_TEST_REF_EXT" }, + { 0x81B8, "GL_INDEX_MATERIAL_EXT" }, + { 0x81B9, "GL_INDEX_MATERIAL_PARAMETER_EXT" }, + { 0x81BA, "GL_INDEX_MATERIAL_FACE_EXT" }, + { 0x81F8, "GL_LIGHT_MODEL_COLOR_CONTROL_EXT" }, + { 0x81F8, "GL_LIGHT_MODEL_COLOR_CONTROL" }, + { 0x81F9, "GL_SINGLE_COLOR_EXT" }, + { 0x81F9, "GL_SINGLE_COLOR" }, + { 0x81FA, "GL_SEPARATE_SPECULAR_COLOR_EXT" }, + { 0x81FA, "GL_SEPARATE_SPECULAR_COLOR" }, + { 0x81FB, "GL_SHARED_TEXTURE_PALETTE_EXT" }, + { 0x8210, "GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING" }, + { 0x8211, "GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE" }, + { 0x8212, "GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE" }, + { 0x8213, "GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE" }, + { 0x8214, "GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE" }, + { 0x8215, "GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE" }, + { 0x8216, "GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE" }, + { 0x8217, "GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE" }, + { 0x8218, "GL_FRAMEBUFFER_DEFAULT" }, + { 0x8219, "GL_FRAMEBUFFER_UNDEFINED" }, + { 0x821A, "GL_DEPTH_STENCIL_ATTACHMENT" }, + { 0x8225, "GL_COMPRESSED_RED" }, + { 0x8226, "GL_COMPRESSED_RG" }, + { 0x8227, "GL_RG" }, + { 0x8228, "GL_RG_INTEGER" }, + { 0x8229, "GL_R8" }, + { 0x822A, "GL_R16" }, + { 0x822B, "GL_RG8" }, + { 0x822C, "GL_RG16" }, + { 0x822D, "GL_R16F" }, + { 0x822E, "GL_R32F" }, + { 0x822F, "GL_RG16F" }, + { 0x8230, "GL_RG32F" }, + { 0x8231, "GL_R8I" }, + { 0x8232, "GL_R8UI" }, + { 0x8233, "GL_R16I" }, + { 0x8234, "GL_R16UI" }, + { 0x8235, "GL_R32I" }, + { 0x8236, "GL_R32UI" }, + { 0x8237, "GL_RG8I" }, + { 0x8238, "GL_RG8UI" }, + { 0x8239, "GL_RG16I" }, + { 0x823A, "GL_RG16UI" }, + { 0x823B, "GL_RG32I" }, + { 0x823C, "GL_RG32UI" }, + { 0x8330, "GL_PIXEL_TRANSFORM_2D_EXT" }, + { 0x8331, "GL_PIXEL_MAG_FILTER_EXT" }, + { 0x8332, "GL_PIXEL_MIN_FILTER_EXT" }, + { 0x8333, "GL_PIXEL_CUBIC_WEIGHT_EXT" }, + { 0x8334, "GL_CUBIC_EXT" }, + { 0x8335, "GL_AVERAGE_EXT" }, + { 0x8336, "GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT" }, + { 0x8337, "GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT" }, + { 0x8338, "GL_PIXEL_TRANSFORM_2D_MATRIX_EXT" }, + { 0x8349, "GL_FRAGMENT_MATERIAL_EXT" }, + { 0x834A, "GL_FRAGMENT_NORMAL_EXT" }, + { 0x834C, "GL_FRAGMENT_COLOR_EXT" }, + { 0x834D, "GL_ATTENUATION_EXT" }, + { 0x834E, "GL_SHADOW_ATTENUATION_EXT" }, + { 0x834F, "GL_TEXTURE_APPLICATION_MODE_EXT" }, + { 0x8350, "GL_TEXTURE_LIGHT_EXT" }, + { 0x8351, "GL_TEXTURE_MATERIAL_FACE_EXT" }, + { 0x8352, "GL_TEXTURE_MATERIAL_PARAMETER_EXT" }, + { 0x8362, "GL_UNSIGNED_BYTE_2_3_3_REV" }, + { 0x8363, "GL_UNSIGNED_SHORT_5_6_5" }, + { 0x8364, "GL_UNSIGNED_SHORT_5_6_5_REV" }, + { 0x8365, "GL_UNSIGNED_SHORT_4_4_4_4_REV" }, + { 0x8366, "GL_UNSIGNED_SHORT_1_5_5_5_REV" }, + { 0x8367, "GL_UNSIGNED_INT_8_8_8_8_REV" }, + { 0x8368, "GL_UNSIGNED_INT_2_10_10_10_REV" }, + { 0x8370, "GL_MIRRORED_REPEAT_ARB" }, + { 0x8370, "GL_MIRRORED_REPEAT" }, + { 0x83F0, "GL_COMPRESSED_RGB_S3TC_DXT1_EXT" }, + { 0x83F1, "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT" }, + { 0x83F2, "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT" }, + { 0x83F3, "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT" }, + { 0x8439, "GL_TANGENT_ARRAY_EXT" }, + { 0x843A, "GL_BINORMAL_ARRAY_EXT" }, + { 0x843B, "GL_CURRENT_TANGENT_EXT" }, + { 0x843C, "GL_CURRENT_BINORMAL_EXT" }, + { 0x843E, "GL_TANGENT_ARRAY_TYPE_EXT" }, + { 0x843F, "GL_TANGENT_ARRAY_STRIDE_EXT" }, + { 0x8440, "GL_BINORMAL_ARRAY_TYPE_EXT" }, + { 0x8441, "GL_BINORMAL_ARRAY_STRIDE_EXT" }, + { 0x8442, "GL_TANGENT_ARRAY_POINTER_EXT" }, + { 0x8443, "GL_BINORMAL_ARRAY_POINTER_EXT" }, + { 0x8444, "GL_MAP1_TANGENT_EXT" }, + { 0x8445, "GL_MAP2_TANGENT_EXT" }, + { 0x8446, "GL_MAP1_BINORMAL_EXT" }, + { 0x8447, "GL_MAP2_BINORMAL_EXT" }, + { 0x8450, "GL_FOG_COORD_SRC" }, + { 0x8450, "GL_FOG_COORDINATE_SOURCE_EXT" }, + { 0x8450, "GL_FOG_COORDINATE_SOURCE" }, + { 0x8451, "GL_FOG_COORD" }, + { 0x8451, "GL_FOG_COORDINATE_EXT" }, + { 0x8451, "GL_FOG_COORDINATE" }, + { 0x8452, "GL_FRAGMENT_DEPTH_EXT" }, + { 0x8452, "GL_FRAGMENT_DEPTH" }, + { 0x8453 , "GL_CURRENT_FOG_COORD" }, + { 0x8453 , "GL_CURRENT_FOG_COORDINATE" }, + { 0x8453, "GL_CURRENT_FOG_COORDINATE_EXT" }, + { 0x8454, "GL_FOG_COORD_ARRAY_TYPE" }, + { 0x8454, "GL_FOG_COORDINATE_ARRAY_TYPE_EXT" }, + { 0x8454, "GL_FOG_COORDINATE_ARRAY_TYPE" }, + { 0x8455, "GL_FOG_COORD_ARRAY_STRIDE" }, + { 0x8455, "GL_FOG_COORDINATE_ARRAY_STRIDE_EXT" }, + { 0x8455, "GL_FOG_COORDINATE_ARRAY_STRIDE" }, + { 0x8456, "GL_FOG_COORD_ARRAY_POINTER" }, + { 0x8456, "GL_FOG_COORDINATE_ARRAY_POINTER_EXT" }, + { 0x8456, "GL_FOG_COORDINATE_ARRAY_POINTER" }, + { 0x8457, "GL_FOG_COORD_ARRAY" }, + { 0x8457, "GL_FOG_COORDINATE_ARRAY_EXT" }, + { 0x8457, "GL_FOG_COORDINATE_ARRAY" }, + { 0x8458, "GL_COLOR_SUM_ARB" }, + { 0x8458, "GL_COLOR_SUM_EXT" }, + { 0x8458, "GL_COLOR_SUM" }, + { 0x8459, "GL_CURRENT_SECONDARY_COLOR_EXT" }, + { 0x8459, "GL_CURRENT_SECONDARY_COLOR" }, + { 0x845A, "GL_SECONDARY_COLOR_ARRAY_SIZE_EXT" }, + { 0x845A, "GL_SECONDARY_COLOR_ARRAY_SIZE" }, + { 0x845B, "GL_SECONDARY_COLOR_ARRAY_TYPE_EXT" }, + { 0x845B, "GL_SECONDARY_COLOR_ARRAY_TYPE" }, + { 0x845C, "GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT" }, + { 0x845C, "GL_SECONDARY_COLOR_ARRAY_STRIDE" }, + { 0x845D, "GL_SECONDARY_COLOR_ARRAY_POINTER_EXT" }, + { 0x845D, "GL_SECONDARY_COLOR_ARRAY_POINTER" }, + { 0x845E, "GL_SECONDARY_COLOR_ARRAY_EXT" }, + { 0x845E, "GL_SECONDARY_COLOR_ARRAY" }, + { 0x845F, "GL_CURRENT_RASTER_SECONDARY_COLOR" }, + { 0x846D, "GL_ALIASED_POINT_SIZE_RANGE" }, + { 0x846E, "GL_ALIASED_LINE_WIDTH_RANGE" }, + { 0x84C0, "GL_TEXTURE0" }, + { 0x84C1, "GL_TEXTURE1" }, + { 0x84C2, "GL_TEXTURE2" }, + { 0x84C3, "GL_TEXTURE3" }, + { 0x84C4, "GL_TEXTURE4" }, + { 0x84C5, "GL_TEXTURE5" }, + { 0x84C6, "GL_TEXTURE6" }, + { 0x84C7, "GL_TEXTURE7" }, + { 0x84C8, "GL_TEXTURE8" }, + { 0x84C9, "GL_TEXTURE9" }, + { 0x84CA, "GL_TEXTURE10" }, + { 0x84CB, "GL_TEXTURE11" }, + { 0x84CC, "GL_TEXTURE12" }, + { 0x84CD, "GL_TEXTURE13" }, + { 0x84CE, "GL_TEXTURE14" }, + { 0x84CF, "GL_TEXTURE15" }, + { 0x84D0, "GL_TEXTURE16" }, + { 0x84D1, "GL_TEXTURE17" }, + { 0x84D2, "GL_TEXTURE18" }, + { 0x84D3, "GL_TEXTURE19" }, + { 0x84D4, "GL_TEXTURE20" }, + { 0x84D5, "GL_TEXTURE21" }, + { 0x84D6, "GL_TEXTURE22" }, + { 0x84D7, "GL_TEXTURE23" }, + { 0x84D8, "GL_TEXTURE24" }, + { 0x84D9, "GL_TEXTURE25" }, + { 0x84DA, "GL_TEXTURE26" }, + { 0x84DB, "GL_TEXTURE27" }, + { 0x84DC, "GL_TEXTURE28" }, + { 0x84DD, "GL_TEXTURE29" }, + { 0x84DE, "GL_TEXTURE30" }, + { 0x84DF, "GL_TEXTURE31" }, + { 0x84E0, "GL_ACTIVE_TEXTURE" }, + { 0x84E1, "GL_CLIENT_ACTIVE_TEXTURE" }, + { 0x84E2, "GL_MAX_TEXTURE_UNITS" }, + { 0x84E3, "GL_TRANSPOSE_MODELVIEW_MATRIX" }, + { 0x84E4, "GL_TRANSPOSE_PROJECTION_MATRIX" }, + { 0x84E5, "GL_TRANSPOSE_TEXTURE_MATRIX" }, + { 0x84E6, "GL_TRANSPOSE_COLOR_MATRIX" }, + { 0x84E7, "GL_SUBTRACT" }, + { 0x84E8, "GL_MAX_RENDERBUFFER_SIZE" }, + { 0x84E9, "GL_COMPRESSED_ALPHA" }, + { 0x84EA, "GL_COMPRESSED_LUMINANCE" }, + { 0x84EB, "GL_COMPRESSED_LUMINANCE_ALPHA" }, + { 0x84EC, "GL_COMPRESSED_INTENSITY" }, + { 0x84ED, "GL_COMPRESSED_RGB" }, + { 0x84EE, "GL_COMPRESSED_RGBA" }, + { 0x84EF, "GL_TEXTURE_COMPRESSION_HINT" }, + { 0x84F5, "GL_TEXTURE_RECTANGLE_EXT" }, + { 0x84F6, "GL_TEXTURE_BINDING_RECTANGLE_EXT" }, + { 0x84F7, "GL_PROXY_TEXTURE_RECTANGLE_EXT" }, + { 0x84F8, "GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT" }, + { 0x84F9, "GL_DEPTH_STENCIL" }, + { 0x84FA, "GL_UNSIGNED_INT_24_8" }, + { 0x84FD, "GL_MAX_TEXTURE_LOD_BIAS" }, + { 0x84FE, "GL_TEXTURE_MAX_ANISOTROPY_EXT" }, + { 0x84FF, "GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT" }, + { 0x8500, "GL_TEXTURE_FILTER_CONTROL" }, + { 0x8501, "GL_TEXTURE_LOD_BIAS" }, + { 0x8502, "GL_MODELVIEW1_STACK_DEPTH_EXT" }, + { 0x8506, "GL_MODELVIEW_MATRIX1_EXT" }, + { 0x8507, "GL_INCR_WRAP" }, + { 0x8508, "GL_DECR_WRAP" }, + { 0x8509, "GL_VERTEX_WEIGHTING_EXT" }, + { 0x850A, "GL_MODELVIEW1_ARB" }, + { 0x850B, "GL_CURRENT_VERTEX_WEIGHT_EXT" }, + { 0x850C, "GL_VERTEX_WEIGHT_ARRAY_EXT" }, + { 0x850D, "GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT" }, + { 0x850E, "GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT" }, + { 0x850F, "GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT" }, + { 0x8510, "GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT" }, + { 0x8511, "GL_NORMAL_MAP_ARB" }, + { 0x8511, "GL_NORMAL_MAP_EXT" }, + { 0x8511, "GL_NORMAL_MAP" }, + { 0x8512, "GL_REFLECTION_MAP_ARB" }, + { 0x8512, "GL_REFLECTION_MAP_EXT" }, + { 0x8512, "GL_REFLECTION_MAP" }, + { 0x8513, "GL_TEXTURE_CUBE_MAP_ARB" }, + { 0x8513, "GL_TEXTURE_CUBE_MAP_EXT" }, + { 0x8513, "GL_TEXTURE_CUBE_MAP" }, + { 0x8514, "GL_TEXTURE_BINDING_CUBE_MAP_ARB" }, + { 0x8514, "GL_TEXTURE_BINDING_CUBE_MAP_EXT" }, + { 0x8514, "GL_TEXTURE_BINDING_CUBE_MAP" }, + { 0x8515, "GL_TEXTURE_CUBE_MAP_POSITIVE_X" }, + { 0x8516, "GL_TEXTURE_CUBE_MAP_NEGATIVE_X" }, + { 0x8517, "GL_TEXTURE_CUBE_MAP_POSITIVE_Y" }, + { 0x8518, "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y" }, + { 0x8519, "GL_TEXTURE_CUBE_MAP_POSITIVE_Z" }, + { 0x851A, "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z" }, + { 0x851B, "GL_PROXY_TEXTURE_CUBE_MAP" }, + { 0x851C, "GL_MAX_CUBE_MAP_TEXTURE_SIZE" }, + { 0x851D, "GL_VERTEX_ARRAY_RANGE_APPLE" }, + { 0x851E, "GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE" }, + { 0x851F, "GL_VERTEX_ARRAY_STORAGE_HINT_APPLE" }, + { 0x8520, "GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE" }, + { 0x8521, "GL_VERTEX_ARRAY_RANGE_POINTER_APPLE" }, + { 0x8570, "GL_COMBINE_ARB" }, + { 0x8570, "GL_COMBINE_EXT" }, + { 0x8570, "GL_COMBINE" }, + { 0x8571, "GL_COMBINE_RGB_ARB" }, + { 0x8571, "GL_COMBINE_RGB_EXT" }, + { 0x8571, "GL_COMBINE_RGB" }, + { 0x8572, "GL_COMBINE_ALPHA_ARB" }, + { 0x8572, "GL_COMBINE_ALPHA_EXT" }, + { 0x8572, "GL_COMBINE_ALPHA" }, + { 0x8573, "GL_RGB_SCALE_ARB" }, + { 0x8573, "GL_RGB_SCALE_EXT" }, + { 0x8573, "GL_RGB_SCALE" }, + { 0x8574, "GL_ADD_SIGNED_ARB" }, + { 0x8574, "GL_ADD_SIGNED_EXT" }, + { 0x8574, "GL_ADD_SIGNED" }, + { 0x8575, "GL_INTERPOLATE_ARB" }, + { 0x8575, "GL_INTERPOLATE_EXT" }, + { 0x8575, "GL_INTERPOLATE" }, + { 0x8576, "GL_CONSTANT_ARB" }, + { 0x8576, "GL_CONSTANT_EXT" }, + { 0x8576, "GL_CONSTANT" }, + { 0x8577, "GL_PRIMARY_COLOR_ARB" }, + { 0x8577, "GL_PRIMARY_COLOR_EXT" }, + { 0x8577, "GL_PRIMARY_COLOR" }, + { 0x8578, "GL_PREVIOUS_ARB" }, + { 0x8578, "GL_PREVIOUS_EXT" }, + { 0x8578, "GL_PREVIOUS" }, + { 0x8580, "GL_SOURCE0_RGB_ARB" }, + { 0x8580, "GL_SOURCE0_RGB_EXT" }, + { 0x8580, "GL_SOURCE0_RGB" }, + { 0x8580, "GL_SRC0_RGB" }, + { 0x8581, "GL_SOURCE1_RGB_ARB" }, + { 0x8581, "GL_SOURCE1_RGB_EXT" }, + { 0x8581, "GL_SOURCE1_RGB" }, + { 0x8581, "GL_SRC1_RGB" }, + { 0x8582, "GL_SOURCE2_RGB_ARB" }, + { 0x8582, "GL_SOURCE2_RGB_EXT" }, + { 0x8582, "GL_SOURCE2_RGB" }, + { 0x8582, "GL_SRC2_RGB" }, + { 0x8583, "GL_SOURCE3_RGB_ARB" }, + { 0x8583, "GL_SOURCE3_RGB_EXT" }, + { 0x8583, "GL_SOURCE3_RGB" }, + { 0x8583, "GL_SRC3_RGB" }, + { 0x8584, "GL_SOURCE4_RGB_ARB" }, + { 0x8584, "GL_SOURCE4_RGB_EXT" }, + { 0x8584, "GL_SOURCE4_RGB" }, + { 0x8584, "GL_SRC4_RGB" }, + { 0x8585, "GL_SOURCE5_RGB_ARB" }, + { 0x8585, "GL_SOURCE5_RGB_EXT" }, + { 0x8585, "GL_SOURCE5_RGB" }, + { 0x8585, "GL_SRC5_RGB" }, + { 0x8586, "GL_SOURCE6_RGB_ARB" }, + { 0x8586, "GL_SOURCE6_RGB_EXT" }, + { 0x8586, "GL_SOURCE6_RGB" }, + { 0x8586, "GL_SRC6_RGB" }, + { 0x8587, "GL_SOURCE7_RGB_ARB" }, + { 0x8587, "GL_SOURCE7_RGB_EXT" }, + { 0x8587, "GL_SOURCE7_RGB" }, + { 0x8587, "GL_SRC7_RGB" }, + { 0x8588, "GL_SOURCE0_ALPHA_ARB" }, + { 0x8588, "GL_SOURCE0_ALPHA_EXT" }, + { 0x8588, "GL_SOURCE0_ALPHA" }, + { 0x8588, "GL_SRC0_ALPHA" }, + { 0x8589, "GL_SOURCE1_ALPHA_ARB" }, + { 0x8589, "GL_SOURCE1_ALPHA_EXT" }, + { 0x8589, "GL_SOURCE1_ALPHA" }, + { 0x8589, "GL_SRC1_ALPHA" }, + { 0x858A, "GL_SOURCE2_ALPHA_ARB" }, + { 0x858A, "GL_SOURCE2_ALPHA_EXT" }, + { 0x858A, "GL_SOURCE2_ALPHA" }, + { 0x858A, "GL_SRC2_ALPHA" }, + { 0x858B, "GL_SOURCE3_ALPHA_ARB" }, + { 0x858B, "GL_SOURCE3_ALPHA_EXT" }, + { 0x858B, "GL_SOURCE3_ALPHA" }, + { 0x858B, "GL_SRC3_ALPHA" }, + { 0x858C, "GL_SOURCE4_ALPHA_ARB" }, + { 0x858C, "GL_SOURCE4_ALPHA_EXT" }, + { 0x858C, "GL_SOURCE4_ALPHA" }, + { 0x858C, "GL_SRC4_ALPHA" }, + { 0x858D, "GL_SOURCE5_ALPHA_ARB" }, + { 0x858D, "GL_SOURCE5_ALPHA_EXT" }, + { 0x858D, "GL_SOURCE5_ALPHA" }, + { 0x858D, "GL_SRC5_ALPHA" }, + { 0x858E, "GL_SOURCE6_ALPHA_ARB" }, + { 0x858E, "GL_SOURCE6_ALPHA_EXT" }, + { 0x858E, "GL_SOURCE6_ALPHA" }, + { 0x858E, "GL_SRC6_ALPHA" }, + { 0x858F, "GL_SOURCE7_ALPHA_ARB" }, + { 0x858F, "GL_SOURCE7_ALPHA_EXT" }, + { 0x858F, "GL_SOURCE7_ALPHA" }, + { 0x858F, "GL_SRC7_ALPHA" }, + { 0x8590, "GL_OPERAND0_RGB_ARB" }, + { 0x8590, "GL_OPERAND0_RGB_EXT" }, + { 0x8590, "GL_OPERAND0_RGB" }, + { 0x8591, "GL_OPERAND1_RGB_ARB" }, + { 0x8591, "GL_OPERAND1_RGB_EXT" }, + { 0x8591, "GL_OPERAND1_RGB" }, + { 0x8592, "GL_OPERAND2_RGB_ARB" }, + { 0x8592, "GL_OPERAND2_RGB_EXT" }, + { 0x8592, "GL_OPERAND2_RGB" }, + { 0x8593, "GL_OPERAND3_RGB_ARB" }, + { 0x8593, "GL_OPERAND3_RGB_EXT" }, + { 0x8593, "GL_OPERAND3_RGB" }, + { 0x8594, "GL_OPERAND4_RGB_ARB" }, + { 0x8594, "GL_OPERAND4_RGB_EXT" }, + { 0x8594, "GL_OPERAND4_RGB" }, + { 0x8595, "GL_OPERAND5_RGB_ARB" }, + { 0x8595, "GL_OPERAND5_RGB_EXT" }, + { 0x8595, "GL_OPERAND5_RGB" }, + { 0x8596, "GL_OPERAND6_RGB_ARB" }, + { 0x8596, "GL_OPERAND6_RGB_EXT" }, + { 0x8596, "GL_OPERAND6_RGB" }, + { 0x8597, "GL_OPERAND7_RGB_ARB" }, + { 0x8597, "GL_OPERAND7_RGB_EXT" }, + { 0x8597, "GL_OPERAND7_RGB" }, + { 0x8598, "GL_OPERAND0_ALPHA_ARB" }, + { 0x8598, "GL_OPERAND0_ALPHA_EXT" }, + { 0x8598, "GL_OPERAND0_ALPHA" }, + { 0x8599, "GL_OPERAND1_ALPHA_ARB" }, + { 0x8599, "GL_OPERAND1_ALPHA_EXT" }, + { 0x8599, "GL_OPERAND1_ALPHA" }, + { 0x859A, "GL_OPERAND2_ALPHA_ARB" }, + { 0x859A, "GL_OPERAND2_ALPHA_EXT" }, + { 0x859A, "GL_OPERAND2_ALPHA" }, + { 0x859B, "GL_OPERAND3_ALPHA_ARB" }, + { 0x859B, "GL_OPERAND3_ALPHA_EXT" }, + { 0x859B, "GL_OPERAND3_ALPHA" }, + { 0x859C, "GL_OPERAND4_ALPHA_ARB" }, + { 0x859C, "GL_OPERAND4_ALPHA_EXT" }, + { 0x859C, "GL_OPERAND4_ALPHA" }, + { 0x859D, "GL_OPERAND5_ALPHA_ARB" }, + { 0x859D, "GL_OPERAND5_ALPHA_EXT" }, + { 0x859D, "GL_OPERAND5_ALPHA" }, + { 0x859E, "GL_OPERAND6_ALPHA_ARB" }, + { 0x859E, "GL_OPERAND6_ALPHA_EXT" }, + { 0x859E, "GL_OPERAND6_ALPHA" }, + { 0x859F, "GL_OPERAND7_ALPHA_ARB" }, + { 0x859F, "GL_OPERAND7_ALPHA_EXT" }, + { 0x859F, "GL_OPERAND7_ALPHA" }, + { 0x85AE, "GL_PERTURB_EXT" }, + { 0x85AF, "GL_TEXTURE_NORMAL_EXT" }, + { 0x85B4, "GL_STORAGE_CLIENT_APPLE" }, + { 0x85B5, "GL_VERTEX_ARRAY_BINDING_APPLE" }, + { 0x85BD, "GL_STORAGE_PRIVATE_APPLE" }, + { 0x85BE, "GL_STORAGE_CACHED_APPLE" }, + { 0x85BF, "GL_STORAGE_SHARED_APPLE" }, + { 0x8620, "GL_VERTEX_PROGRAM_ARB" }, + { 0x8620, "GL_VERTEX_PROGRAM_NV" }, + { 0x8621, "GL_VERTEX_STATE_PROGRAM_NV" }, + { 0x8622, "GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB" }, + { 0x8622, "GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB" }, + { 0x8622, "GL_VERTEX_ATTRIB_ARRAY_ENABLED" }, + { 0x8623, "GL_ATTRIB_ARRAY_SIZE_NV" }, + { 0x8623, "GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB" }, + { 0x8623, "GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB" }, + { 0x8623, "GL_VERTEX_ATTRIB_ARRAY_SIZE" }, + { 0x8624, "GL_ATTRIB_ARRAY_STRIDE_NV" }, + { 0x8624, "GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB" }, + { 0x8624, "GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB" }, + { 0x8624, "GL_VERTEX_ATTRIB_ARRAY_STRIDE" }, + { 0x8625, "GL_ATTRIB_ARRAY_TYPE_NV" }, + { 0x8625, "GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB" }, + { 0x8625, "GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB" }, + { 0x8625, "GL_VERTEX_ATTRIB_ARRAY_TYPE" }, + { 0x8626, "GL_CURRENT_ATTRIB_NV" }, + { 0x8626, "GL_CURRENT_VERTEX_ATTRIB_ARB" }, + { 0x8626, "GL_CURRENT_VERTEX_ATTRIB_ARB" }, + { 0x8626, "GL_CURRENT_VERTEX_ATTRIB" }, + { 0x8627, "GL_PROGRAM_LENGTH_ARB" }, + { 0x8627, "GL_PROGRAM_LENGTH_NV" }, + { 0x8628, "GL_PROGRAM_STRING_ARB" }, + { 0x8628, "GL_PROGRAM_STRING_NV" }, + { 0x8629, "GL_MODELVIEW_PROJECTION_NV" }, + { 0x862A, "GL_IDENTITY_NV" }, + { 0x862B, "GL_INVERSE_NV" }, + { 0x862C, "GL_TRANSPOSE_NV" }, + { 0x862D, "GL_INVERSE_TRANSPOSE_NV" }, + { 0x862E, "GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB" }, + { 0x862E, "GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV" }, + { 0x862F, "GL_MAX_PROGRAM_MATRICES_ARB" }, + { 0x862F, "GL_MAX_TRACK_MATRICES_NV" }, + { 0x8630, "GL_MATRIX0_NV" }, + { 0x8631, "GL_MATRIX1_NV" }, + { 0x8632, "GL_MATRIX2_NV" }, + { 0x8633, "GL_MATRIX3_NV" }, + { 0x8634, "GL_MATRIX4_NV" }, + { 0x8635, "GL_MATRIX5_NV" }, + { 0x8636, "GL_MATRIX6_NV" }, + { 0x8637, "GL_MATRIX7_NV" }, + { 0x8640, "GL_CURRENT_MATRIX_STACK_DEPTH_ARB" }, + { 0x8640, "GL_CURRENT_MATRIX_STACK_DEPTH_NV" }, + { 0x8641, "GL_CURRENT_MATRIX_ARB" }, + { 0x8641, "GL_CURRENT_MATRIX_NV" }, + { 0x8642, "GL_PROGRAM_POINT_SIZE_EXT" }, + { 0x8642, "GL_VERTEX_PROGRAM_POINT_SIZE_ARB" }, + { 0x8642, "GL_VERTEX_PROGRAM_POINT_SIZE_ARB" }, + { 0x8642, "GL_VERTEX_PROGRAM_POINT_SIZE_NV" }, + { 0x8642, "GL_VERTEX_PROGRAM_POINT_SIZE" }, + { 0x8643, "GL_VERTEX_PROGRAM_TWO_SIDE_ARB" }, + { 0x8643, "GL_VERTEX_PROGRAM_TWO_SIDE_ARB" }, + { 0x8643, "GL_VERTEX_PROGRAM_TWO_SIDE_NV" }, + { 0x8643, "GL_VERTEX_PROGRAM_TWO_SIDE" }, + { 0x8644, "GL_PROGRAM_PARAMETER_NV" }, + { 0x8645, "GL_ATTRIB_ARRAY_POINTER_NV" }, + { 0x8645, "GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB" }, + { 0x8645, "GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB" }, + { 0x8645, "GL_VERTEX_ATTRIB_ARRAY_POINTER" }, + { 0x8646, "GL_PROGRAM_TARGET_NV" }, + { 0x8647, "GL_PROGRAM_RESIDENT_NV" }, + { 0x8648, "GL_TRACK_MATRIX_NV" }, + { 0x8649, "GL_TRACK_MATRIX_TRANSFORM_NV" }, + { 0x864A, "GL_VERTEX_PROGRAM_BINDING_NV" }, + { 0x864B, "GL_PROGRAM_ERROR_POSITION_ARB" }, + { 0x864B, "GL_PROGRAM_ERROR_POSITION_NV" }, + { 0x8650, "GL_VERTEX_ATTRIB_ARRAY0_NV" }, + { 0x8651, "GL_VERTEX_ATTRIB_ARRAY1_NV" }, + { 0x8652, "GL_VERTEX_ATTRIB_ARRAY2_NV" }, + { 0x8653, "GL_VERTEX_ATTRIB_ARRAY3_NV" }, + { 0x8654, "GL_VERTEX_ATTRIB_ARRAY4_NV" }, + { 0x8655, "GL_VERTEX_ATTRIB_ARRAY5_NV" }, + { 0x8656, "GL_VERTEX_ATTRIB_ARRAY6_NV" }, + { 0x8657, "GL_VERTEX_ATTRIB_ARRAY7_NV" }, + { 0x8658, "GL_VERTEX_ATTRIB_ARRAY8_NV" }, + { 0x8659, "GL_VERTEX_ATTRIB_ARRAY9_NV" }, + { 0x865A, "GL_VERTEX_ATTRIB_ARRAY10_NV" }, + { 0x865B, "GL_VERTEX_ATTRIB_ARRAY11_NV" }, + { 0x865C, "GL_VERTEX_ATTRIB_ARRAY12_NV" }, + { 0x865D, "GL_VERTEX_ATTRIB_ARRAY13_NV" }, + { 0x865E, "GL_VERTEX_ATTRIB_ARRAY14_NV" }, + { 0x865F, "GL_VERTEX_ATTRIB_ARRAY15_NV" }, + { 0x8660, "GL_MAP1_VERTEX_ATTRIB0_4_NV" }, + { 0x8661, "GL_MAP1_VERTEX_ATTRIB1_4_NV" }, + { 0x8662, "GL_MAP1_VERTEX_ATTRIB2_4_NV" }, + { 0x8663, "GL_MAP1_VERTEX_ATTRIB3_4_NV" }, + { 0x8664, "GL_MAP1_VERTEX_ATTRIB4_4_NV" }, + { 0x8665, "GL_MAP1_VERTEX_ATTRIB5_4_NV" }, + { 0x8666, "GL_MAP1_VERTEX_ATTRIB6_4_NV" }, + { 0x8667, "GL_MAP1_VERTEX_ATTRIB7_4_NV" }, + { 0x8668, "GL_MAP1_VERTEX_ATTRIB8_4_NV" }, + { 0x8669, "GL_MAP1_VERTEX_ATTRIB9_4_NV" }, + { 0x866A, "GL_MAP1_VERTEX_ATTRIB10_4_NV" }, + { 0x866B, "GL_MAP1_VERTEX_ATTRIB11_4_NV" }, + { 0x866C, "GL_MAP1_VERTEX_ATTRIB12_4_NV" }, + { 0x866D, "GL_MAP1_VERTEX_ATTRIB13_4_NV" }, + { 0x866E, "GL_MAP1_VERTEX_ATTRIB14_4_NV" }, + { 0x866F, "GL_MAP1_VERTEX_ATTRIB15_4_NV" }, + { 0x8670, "GL_MAP2_VERTEX_ATTRIB0_4_NV" }, + { 0x8671, "GL_MAP2_VERTEX_ATTRIB1_4_NV" }, + { 0x8672, "GL_MAP2_VERTEX_ATTRIB2_4_NV" }, + { 0x8673, "GL_MAP2_VERTEX_ATTRIB3_4_NV" }, + { 0x8674, "GL_MAP2_VERTEX_ATTRIB4_4_NV" }, + { 0x8675, "GL_MAP2_VERTEX_ATTRIB5_4_NV" }, + { 0x8676, "GL_MAP2_VERTEX_ATTRIB6_4_NV" }, + { 0x8677, "GL_MAP2_VERTEX_ATTRIB7_4_NV" }, + { 0x8677, "GL_PROGRAM_BINDING_ARB" }, + { 0x8677, "GL_PROGRAM_NAME_ARB" }, + { 0x8678, "GL_MAP2_VERTEX_ATTRIB8_4_NV" }, + { 0x8679, "GL_MAP2_VERTEX_ATTRIB9_4_NV" }, + { 0x867A, "GL_MAP2_VERTEX_ATTRIB10_4_NV" }, + { 0x867B, "GL_MAP2_VERTEX_ATTRIB11_4_NV" }, + { 0x867C, "GL_MAP2_VERTEX_ATTRIB12_4_NV" }, + { 0x867D, "GL_MAP2_VERTEX_ATTRIB13_4_NV" }, + { 0x867E, "GL_MAP2_VERTEX_ATTRIB14_4_NV" }, + { 0x867F, "GL_MAP2_VERTEX_ATTRIB15_4_NV" }, + { 0x86A0, "GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB" }, + { 0x86A0, "GL_TEXTURE_COMPRESSED_IMAGE_SIZE" }, + { 0x86A1, "GL_TEXTURE_COMPRESSED_ARB" }, + { 0x86A1, "GL_TEXTURE_COMPRESSED" }, + { 0x86A2, "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB" }, + { 0x86A2, "GL_NUM_COMPRESSED_TEXTURE_FORMATS" }, + { 0x86A3, "GL_COMPRESSED_TEXTURE_FORMATS_ARB" }, + { 0x86A3, "GL_COMPRESSED_TEXTURE_FORMATS" }, + { 0x86A4, "GL_MAX_VERTEX_UNITS_ARB" }, + { 0x86A5, "GL_ACTIVE_VERTEX_UNITS_ARB" }, + { 0x86A6, "GL_WEIGHT_SUM_UNITY_ARB" }, + { 0x86A7, "GL_VERTEX_BLEND_ARB" }, + { 0x86A8, "GL_CURRENT_WEIGHT_ARB" }, + { 0x86A9, "GL_WEIGHT_ARRAY_TYPE_ARB" }, + { 0x86AA, "GL_WEIGHT_ARRAY_STRIDE_ARB" }, + { 0x86AB, "GL_WEIGHT_ARRAY_SIZE_ARB" }, + { 0x86AC, "GL_WEIGHT_ARRAY_POINTER_ARB" }, + { 0x86AD, "GL_WEIGHT_ARRAY_ARB" }, + { 0x86AE, "GL_DOT3_RGB_ARB" }, + { 0x86AE, "GL_DOT3_RGB" }, + { 0x86AF, "GL_DOT3_RGBA_ARB" }, + { 0x86AF, "GL_DOT3_RGBA" }, + { 0x8722, "GL_MODELVIEW2_ARB" }, + { 0x8723, "GL_MODELVIEW3_ARB" }, + { 0x8724, "GL_MODELVIEW4_ARB" }, + { 0x8725, "GL_MODELVIEW5_ARB" }, + { 0x8726, "GL_MODELVIEW6_ARB" }, + { 0x8727, "GL_MODELVIEW7_ARB" }, + { 0x8728, "GL_MODELVIEW8_ARB" }, + { 0x8729, "GL_MODELVIEW9_ARB" }, + { 0x872A, "GL_MODELVIEW10_ARB" }, + { 0x872B, "GL_MODELVIEW11_ARB" }, + { 0x872C, "GL_MODELVIEW12_ARB" }, + { 0x872D, "GL_MODELVIEW13_ARB" }, + { 0x872E, "GL_MODELVIEW14_ARB" }, + { 0x872F, "GL_MODELVIEW15_ARB" }, + { 0x8730, "GL_MODELVIEW16_ARB" }, + { 0x8731, "GL_MODELVIEW17_ARB" }, + { 0x8732, "GL_MODELVIEW18_ARB" }, + { 0x8733, "GL_MODELVIEW19_ARB" }, + { 0x8734, "GL_MODELVIEW20_ARB" }, + { 0x8735, "GL_MODELVIEW21_ARB" }, + { 0x8736, "GL_MODELVIEW22_ARB" }, + { 0x8737, "GL_MODELVIEW23_ARB" }, + { 0x8738, "GL_MODELVIEW24_ARB" }, + { 0x8739, "GL_MODELVIEW25_ARB" }, + { 0x873A, "GL_MODELVIEW26_ARB" }, + { 0x873B, "GL_MODELVIEW27_ARB" }, + { 0x873C, "GL_MODELVIEW28_ARB" }, + { 0x873D, "GL_MODELVIEW29_ARB" }, + { 0x873E, "GL_MODELVIEW30_ARB" }, + { 0x873F, "GL_MODELVIEW31_ARB" }, + { 0x8742, "GL_MIRROR_CLAMP_EXT" }, + { 0x8743, "GL_MIRROR_CLAMP_TO_EDGE_EXT" }, + { 0x8764, "GL_BUFFER_SIZE_ARB" }, + { 0x8764, "GL_BUFFER_SIZE" }, + { 0x8765, "GL_BUFFER_USAGE_ARB" }, + { 0x8765, "GL_BUFFER_USAGE" }, + { 0x8780, "GL_VERTEX_SHADER_EXT" }, + { 0x8781, "GL_VERTEX_SHADER_BINDING_EXT" }, + { 0x8782, "GL_OP_INDEX_EXT" }, + { 0x8783, "GL_OP_NEGATE_EXT" }, + { 0x8784, "GL_OP_DOT3_EXT" }, + { 0x8785, "GL_OP_DOT4_EXT" }, + { 0x8786, "GL_OP_MUL_EXT" }, + { 0x8787, "GL_OP_ADD_EXT" }, + { 0x8788, "GL_OP_MADD_EXT" }, + { 0x8789, "GL_OP_FRAC_EXT" }, + { 0x878A, "GL_OP_MAX_EXT" }, + { 0x878B, "GL_OP_MIN_EXT" }, + { 0x878C, "GL_OP_SET_GE_EXT" }, + { 0x878D, "GL_OP_SET_LT_EXT" }, + { 0x878E, "GL_OP_CLAMP_EXT" }, + { 0x878F, "GL_OP_FLOOR_EXT" }, + { 0x8790, "GL_OP_ROUND_EXT" }, + { 0x8791, "GL_OP_EXP_BASE_2_EXT" }, + { 0x8792, "GL_OP_LOG_BASE_2_EXT" }, + { 0x8793, "GL_OP_POWER_EXT" }, + { 0x8794, "GL_OP_RECIP_EXT" }, + { 0x8795, "GL_OP_RECIP_SQRT_EXT" }, + { 0x8796, "GL_OP_SUB_EXT" }, + { 0x8797, "GL_OP_CROSS_PRODUCT_EXT" }, + { 0x8798, "GL_OP_MULTIPLY_MATRIX_EXT" }, + { 0x8799, "GL_OP_MOV_EXT" }, + { 0x879A, "GL_OUTPUT_VERTEX_EXT" }, + { 0x879B, "GL_OUTPUT_COLOR0_EXT" }, + { 0x879C, "GL_OUTPUT_COLOR1_EXT" }, + { 0x879D, "GL_OUTPUT_TEXTURE_COORD0_EXT" }, + { 0x879E, "GL_OUTPUT_TEXTURE_COORD1_EXT" }, + { 0x879F, "GL_OUTPUT_TEXTURE_COORD2_EXT" }, + { 0x87A0, "GL_OUTPUT_TEXTURE_COORD3_EXT" }, + { 0x87A1, "GL_OUTPUT_TEXTURE_COORD4_EXT" }, + { 0x87A2, "GL_OUTPUT_TEXTURE_COORD5_EXT" }, + { 0x87A3, "GL_OUTPUT_TEXTURE_COORD6_EXT" }, + { 0x87A4, "GL_OUTPUT_TEXTURE_COORD7_EXT" }, + { 0x87A5, "GL_OUTPUT_TEXTURE_COORD8_EXT" }, + { 0x87A6, "GL_OUTPUT_TEXTURE_COORD9_EXT" }, + { 0x87A7, "GL_OUTPUT_TEXTURE_COORD10_EXT" }, + { 0x87A8, "GL_OUTPUT_TEXTURE_COORD11_EXT" }, + { 0x87A9, "GL_OUTPUT_TEXTURE_COORD12_EXT" }, + { 0x87AA, "GL_OUTPUT_TEXTURE_COORD13_EXT" }, + { 0x87AB, "GL_OUTPUT_TEXTURE_COORD14_EXT" }, + { 0x87AC, "GL_OUTPUT_TEXTURE_COORD15_EXT" }, + { 0x87AD, "GL_OUTPUT_TEXTURE_COORD16_EXT" }, + { 0x87AE, "GL_OUTPUT_TEXTURE_COORD17_EXT" }, + { 0x87AF, "GL_OUTPUT_TEXTURE_COORD18_EXT" }, + { 0x87B0, "GL_OUTPUT_TEXTURE_COORD19_EXT" }, + { 0x87B1, "GL_OUTPUT_TEXTURE_COORD20_EXT" }, + { 0x87B2, "GL_OUTPUT_TEXTURE_COORD21_EXT" }, + { 0x87B3, "GL_OUTPUT_TEXTURE_COORD22_EXT" }, + { 0x87B4, "GL_OUTPUT_TEXTURE_COORD23_EXT" }, + { 0x87B5, "GL_OUTPUT_TEXTURE_COORD24_EXT" }, + { 0x87B6, "GL_OUTPUT_TEXTURE_COORD25_EXT" }, + { 0x87B7, "GL_OUTPUT_TEXTURE_COORD26_EXT" }, + { 0x87B8, "GL_OUTPUT_TEXTURE_COORD27_EXT" }, + { 0x87B9, "GL_OUTPUT_TEXTURE_COORD28_EXT" }, + { 0x87BA, "GL_OUTPUT_TEXTURE_COORD29_EXT" }, + { 0x87BB, "GL_OUTPUT_TEXTURE_COORD30_EXT" }, + { 0x87BC, "GL_OUTPUT_TEXTURE_COORD31_EXT" }, + { 0x87BD, "GL_OUTPUT_FOG_EXT" }, + { 0x87BE, "GL_SCALAR_EXT" }, + { 0x87BF, "GL_VECTOR_EXT" }, + { 0x87C0, "GL_MATRIX_EXT" }, + { 0x87C1, "GL_VARIANT_EXT" }, + { 0x87C2, "GL_INVARIANT_EXT" }, + { 0x87C3, "GL_LOCAL_CONSTANT_EXT" }, + { 0x87C4, "GL_LOCAL_EXT" }, + { 0x87C5, "GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT" }, + { 0x87C6, "GL_MAX_VERTEX_SHADER_VARIANTS_EXT" }, + { 0x87C7, "GL_MAX_VERTEX_SHADER_INVARIANTS_EXT" }, + { 0x87C8, "GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT" }, + { 0x87C9, "GL_MAX_VERTEX_SHADER_LOCALS_EXT" }, + { 0x87CA, "GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT" }, + { 0x87CB, "GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT" }, + { 0x87CC, "GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT" }, + { 0x87CD, "GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT" }, + { 0x87CE, "GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT" }, + { 0x87CF, "GL_VERTEX_SHADER_INSTRUCTIONS_EXT" }, + { 0x87D0, "GL_VERTEX_SHADER_VARIANTS_EXT" }, + { 0x87D1, "GL_VERTEX_SHADER_INVARIANTS_EXT" }, + { 0x87D2, "GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT" }, + { 0x87D3, "GL_VERTEX_SHADER_LOCALS_EXT" }, + { 0x87D4, "GL_VERTEX_SHADER_OPTIMIZED_EXT" }, + { 0x87D5, "GL_X_EXT" }, + { 0x87D6, "GL_Y_EXT" }, + { 0x87D7, "GL_Z_EXT" }, + { 0x87D8, "GL_W_EXT" }, + { 0x87D9, "GL_NEGATIVE_X_EXT" }, + { 0x87DA, "GL_NEGATIVE_Y_EXT" }, + { 0x87DB, "GL_NEGATIVE_Z_EXT" }, + { 0x87DC, "GL_NEGATIVE_W_EXT" }, + { 0x87DF, "GL_NEGATIVE_ONE_EXT" }, + { 0x87E0, "GL_NORMALIZED_RANGE_EXT" }, + { 0x87E1, "GL_FULL_RANGE_EXT" }, + { 0x87E2, "GL_CURRENT_VERTEX_EXT" }, + { 0x87E3, "GL_MVP_MATRIX_EXT" }, + { 0x87E4, "GL_VARIANT_VALUE_EXT" }, + { 0x87E5, "GL_VARIANT_DATATYPE_EXT" }, + { 0x87E6, "GL_VARIANT_ARRAY_STRIDE_EXT" }, + { 0x87E7, "GL_VARIANT_ARRAY_TYPE_EXT" }, + { 0x87E8, "GL_VARIANT_ARRAY_EXT" }, + { 0x87E9, "GL_VARIANT_ARRAY_POINTER_EXT" }, + { 0x87EA, "GL_INVARIANT_VALUE_EXT" }, + { 0x87EB, "GL_INVARIANT_DATATYPE_EXT" }, + { 0x87EC, "GL_LOCAL_CONSTANT_VALUE_EXT" }, + { 0x87Ed, "GL_LOCAL_CONSTANT_DATATYPE_EXT" }, + { 0x8800, "GL_STENCIL_BACK_FUNC_ATI" }, + { 0x8800, "GL_STENCIL_BACK_FUNC" }, + { 0x8801, "GL_STENCIL_BACK_FAIL_ATI" }, + { 0x8801, "GL_STENCIL_BACK_FAIL" }, + { 0x8802, "GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI" }, + { 0x8802, "GL_STENCIL_BACK_PASS_DEPTH_FAIL" }, + { 0x8803, "GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI" }, + { 0x8803, "GL_STENCIL_BACK_PASS_DEPTH_PASS" }, + { 0x8804, "GL_FRAGMENT_PROGRAM_ARB" }, + { 0x8805, "GL_PROGRAM_ALU_INSTRUCTIONS_ARB" }, + { 0x8806, "GL_PROGRAM_TEX_INSTRUCTIONS_ARB" }, + { 0x8807, "GL_PROGRAM_TEX_INDIRECTIONS_ARB" }, + { 0x8808, "GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB" }, + { 0x8809, "GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB" }, + { 0x880A, "GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB" }, + { 0x880B, "GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB" }, + { 0x880C, "GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB" }, + { 0x880D, "GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB" }, + { 0x880E, "GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB" }, + { 0x880F, "GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB" }, + { 0x8810, "GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB" }, + { 0x8814, "GL_RGBA_FLOAT32_APPLE" }, + { 0x8814, "GL_RGBA_FLOAT32_ATI" }, + { 0x8814, "GL_RGBA32F_ARB" }, + { 0x8815, "GL_RGB_FLOAT32_APPLE" }, + { 0x8815, "GL_RGB_FLOAT32_ATI" }, + { 0x8815, "GL_RGB32F_ARB" }, + { 0x8816, "GL_ALPHA_FLOAT32_APPLE" }, + { 0x8816, "GL_ALPHA_FLOAT32_ATI" }, + { 0x8816, "GL_ALPHA32F_ARB" }, + { 0x8817, "GL_INTENSITY_FLOAT32_APPLE" }, + { 0x8817, "GL_INTENSITY_FLOAT32_ATI" }, + { 0x8817, "GL_INTENSITY32F_ARB" }, + { 0x8818, "GL_LUMINANCE_FLOAT32_APPLE" }, + { 0x8818, "GL_LUMINANCE_FLOAT32_ATI" }, + { 0x8818, "GL_LUMINANCE32F_ARB" }, + { 0x8819, "GL_LUMINANCE_ALPHA_FLOAT32_APPLE" }, + { 0x8819, "GL_LUMINANCE_ALPHA_FLOAT32_ATI" }, + { 0x8819, "GL_LUMINANCE_ALPHA32F_ARB" }, + { 0x881A, "GL_RGBA_FLOAT16_APPLE" }, + { 0x881A, "GL_RGBA_FLOAT16_ATI" }, + { 0x881A, "GL_RGBA16F_ARB" }, + { 0x881B, "GL_RGB_FLOAT16_APPLE" }, + { 0x881B, "GL_RGB_FLOAT16_ATI" }, + { 0x881B, "GL_RGB16F_ARB" }, + { 0x881C, "GL_ALPHA_FLOAT16_APPLE" }, + { 0x881C, "GL_ALPHA_FLOAT16_ATI" }, + { 0x881C, "GL_ALPHA16F_ARB" }, + { 0x881D, "GL_INTENSITY_FLOAT16_APPLE" }, + { 0x881D, "GL_INTENSITY_FLOAT16_ATI" }, + { 0x881D, "GL_INTENSITY16F_ARB" }, + { 0x881E, "GL_LUMINANCE_FLOAT16_APPLE" }, + { 0x881E, "GL_LUMINANCE_FLOAT16_ATI" }, + { 0x881E, "GL_LUMINANCE16F_ARB" }, + { 0x881F, "GL_LUMINANCE_ALPHA_FLOAT16_APPLE" }, + { 0x881F, "GL_LUMINANCE_ALPHA_FLOAT16_ATI" }, + { 0x881F, "GL_LUMINANCE_ALPHA16F_ARB" }, + { 0x8820, "GL_RGBA_FLOAT_MODE_ARB" }, + { 0x8824, "GL_MAX_DRAW_BUFFERS_ARB" }, + { 0x8824, "GL_MAX_DRAW_BUFFERS" }, + { 0x8825, "GL_DRAW_BUFFER0_ARB" }, + { 0x8825, "GL_DRAW_BUFFER0" }, + { 0x8826, "GL_DRAW_BUFFER1_ARB" }, + { 0x8826, "GL_DRAW_BUFFER1" }, + { 0x8827, "GL_DRAW_BUFFER2_ARB" }, + { 0x8827, "GL_DRAW_BUFFER2" }, + { 0x8828, "GL_DRAW_BUFFER3_ARB" }, + { 0x8828, "GL_DRAW_BUFFER3" }, + { 0x8829, "GL_DRAW_BUFFER4_ARB" }, + { 0x8829, "GL_DRAW_BUFFER4" }, + { 0x882A, "GL_DRAW_BUFFER5_ARB" }, + { 0x882A, "GL_DRAW_BUFFER5" }, + { 0x882B, "GL_DRAW_BUFFER6_ARB" }, + { 0x882B, "GL_DRAW_BUFFER6" }, + { 0x882C, "GL_DRAW_BUFFER7_ARB" }, + { 0x882C, "GL_DRAW_BUFFER7" }, + { 0x882D, "GL_DRAW_BUFFER8_ARB" }, + { 0x882D, "GL_DRAW_BUFFER8" }, + { 0x882E, "GL_DRAW_BUFFER9_ARB" }, + { 0x882E, "GL_DRAW_BUFFER9" }, + { 0x882F, "GL_DRAW_BUFFER10_ARB" }, + { 0x882F, "GL_DRAW_BUFFER10" }, + { 0x8830, "GL_DRAW_BUFFER11_ARB" }, + { 0x8830, "GL_DRAW_BUFFER11" }, + { 0x8831, "GL_DRAW_BUFFER12_ARB" }, + { 0x8831, "GL_DRAW_BUFFER12" }, + { 0x8832, "GL_DRAW_BUFFER13_ARB" }, + { 0x8832, "GL_DRAW_BUFFER13" }, + { 0x8833, "GL_DRAW_BUFFER14_ARB" }, + { 0x8833, "GL_DRAW_BUFFER14" }, + { 0x8834, "GL_DRAW_BUFFER15_ARB" }, + { 0x8834, "GL_DRAW_BUFFER15" }, + { 0x883D, "GL_ALPHA_BLEND_EQUATION_ATI" }, + { 0x883D, "GL_BLEND_EQUATION_ALPHA_EXT" }, + { 0x883D, "GL_BLEND_EQUATION_ALPHA" }, + { 0x884A, "GL_TEXTURE_DEPTH_SIZE_ARB" }, + { 0x884A, "GL_TEXTURE_DEPTH_SIZE" }, + { 0x884B, "GL_DEPTH_TEXTURE_MODE_ARB" }, + { 0x884B, "GL_DEPTH_TEXTURE_MODE" }, + { 0x884C, "GL_TEXTURE_COMPARE_MODE_ARB" }, + { 0x884C, "GL_TEXTURE_COMPARE_MODE" }, + { 0x884D, "GL_TEXTURE_COMPARE_FUNC_ARB" }, + { 0x884D, "GL_TEXTURE_COMPARE_FUNC" }, + { 0x884E, "GL_COMPARE_R_TO_TEXTURE_ARB" }, + { 0x884E, "GL_COMPARE_R_TO_TEXTURE" }, + { 0x884E, "GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT" }, + { 0x8861, "GL_POINT_SPRITE_ARB" }, + { 0x8861, "GL_POINT_SPRITE" }, + { 0x8862, "GL_COORD_REPLACE_ARB" }, + { 0x8862, "GL_COORD_REPLACE" }, + { 0x8864, "GL_QUERY_COUNTER_BITS_ARB" }, + { 0x8864, "GL_QUERY_COUNTER_BITS" }, + { 0x8865, "GL_CURRENT_QUERY_ARB" }, + { 0x8865, "GL_CURRENT_QUERY" }, + { 0x8866, "GL_QUERY_RESULT_ARB" }, + { 0x8866, "GL_QUERY_RESULT" }, + { 0x8867, "GL_QUERY_RESULT_AVAILABLE_ARB" }, + { 0x8867, "GL_QUERY_RESULT_AVAILABLE" }, + { 0x8869, "GL_MAX_VERTEX_ATTRIBS_ARB" }, + { 0x8869, "GL_MAX_VERTEX_ATTRIBS_ARB" }, + { 0x8869, "GL_MAX_VERTEX_ATTRIBS" }, + { 0x886A, "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB" }, + { 0x886A, "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB" }, + { 0x886A, "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED" }, + { 0x8871, "GL_MAX_TEXTURE_COORDS_ARB" }, + { 0x8871, "GL_MAX_TEXTURE_COORDS_ARB" }, + { 0x8871, "GL_MAX_TEXTURE_COORDS_ARB" }, + { 0x8871, "GL_MAX_TEXTURE_COORDS" }, + { 0x8872, "GL_MAX_TEXTURE_IMAGE_UNITS_ARB" }, + { 0x8872, "GL_MAX_TEXTURE_IMAGE_UNITS_ARB" }, + { 0x8872, "GL_MAX_TEXTURE_IMAGE_UNITS_ARB" }, + { 0x8872, "GL_MAX_TEXTURE_IMAGE_UNITS" }, + { 0x8874, "GL_PROGRAM_ERROR_STRING_ARB" }, + { 0x8875, "GL_PROGRAM_FORMAT_ASCII_ARB" }, + { 0x8876, "GL_PROGRAM_FORMAT_ARB" }, + { 0x8890, "GL_DEPTH_BOUNDS_TEST_EXT" }, + { 0x8891, "GL_DEPTH_BOUNDS_EXT" }, + { 0x8892, "GL_ARRAY_BUFFER_ARB" }, + { 0x8892, "GL_ARRAY_BUFFER" }, + { 0x8893, "GL_ELEMENT_ARRAY_BUFFER_ARB" }, + { 0x8893, "GL_ELEMENT_ARRAY_BUFFER" }, + { 0x8894, "GL_ARRAY_BUFFER_BINDING_ARB" }, + { 0x8894, "GL_ARRAY_BUFFER_BINDING" }, + { 0x8895, "GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB" }, + { 0x8895, "GL_ELEMENT_ARRAY_BUFFER_BINDING" }, + { 0x8896, "GL_VERTEX_ARRAY_BUFFER_BINDING_ARB" }, + { 0x8896, "GL_VERTEX_ARRAY_BUFFER_BINDING" }, + { 0x8897, "GL_NORMAL_ARRAY_BUFFER_BINDING_ARB" }, + { 0x8897, "GL_NORMAL_ARRAY_BUFFER_BINDING" }, + { 0x8898, "GL_COLOR_ARRAY_BUFFER_BINDING_ARB" }, + { 0x8898, "GL_COLOR_ARRAY_BUFFER_BINDING" }, + { 0x8899, "GL_INDEX_ARRAY_BUFFER_BINDING_ARB" }, + { 0x8899, "GL_INDEX_ARRAY_BUFFER_BINDING" }, + { 0x889A, "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB" }, + { 0x889A, "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING" }, + { 0x889B, "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB" }, + { 0x889B, "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING" }, + { 0x889C, "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB" }, + { 0x889C, "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING" }, + { 0x889D, "GL_FOG_COORD_ARRAY_BUFFER_BINDING_ARB" }, + { 0x889D, "GL_FOG_COORD_ARRAY_BUFFER_BINDING" }, + { 0x889D, "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB" }, + { 0x889D, "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING" }, + { 0x889E, "GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB" }, + { 0x889E, "GL_WEIGHT_ARRAY_BUFFER_BINDING" }, + { 0x889F, "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB" }, + { 0x889F, "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING" }, + { 0x88A0, "GL_PROGRAM_INSTRUCTIONS_ARB" }, + { 0x88A1, "GL_MAX_PROGRAM_INSTRUCTIONS_ARB" }, + { 0x88A2, "GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB" }, + { 0x88A3, "GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB" }, + { 0x88A4, "GL_PROGRAM_TEMPORARIES_ARB" }, + { 0x88A5, "GL_MAX_PROGRAM_TEMPORARIES_ARB" }, + { 0x88A6, "GL_PROGRAM_NATIVE_TEMPORARIES_ARB" }, + { 0x88A7, "GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB" }, + { 0x88A8, "GL_PROGRAM_PARAMETERS_ARB" }, + { 0x88A9, "GL_MAX_PROGRAM_PARAMETERS_ARB" }, + { 0x88AA, "GL_PROGRAM_NATIVE_PARAMETERS_ARB" }, + { 0x88AB, "GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB" }, + { 0x88AC, "GL_PROGRAM_ATTRIBS_ARB" }, + { 0x88AD, "GL_MAX_PROGRAM_ATTRIBS_ARB" }, + { 0x88AE, "GL_PROGRAM_NATIVE_ATTRIBS_ARB" }, + { 0x88AF, "GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB" }, + { 0x88B0, "GL_PROGRAM_ADDRESS_REGISTERS_ARB" }, + { 0x88B1, "GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB" }, + { 0x88B2, "GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB" }, + { 0x88B3, "GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB" }, + { 0x88B4, "GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB" }, + { 0x88B5, "GL_MAX_PROGRAM_ENV_PARAMETERS_ARB" }, + { 0x88B6, "GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB" }, + { 0x88B7, "GL_TRANSPOSE_CURRENT_MATRIX_ARB" }, + { 0x88B8, "GL_READ_ONLY_ARB" }, + { 0x88B8, "GL_READ_ONLY" }, + { 0x88B9, "GL_WRITE_ONLY_ARB" }, + { 0x88B9, "GL_WRITE_ONLY" }, + { 0x88BA, "GL_READ_WRITE_ARB" }, + { 0x88BA, "GL_READ_WRITE" }, + { 0x88BB, "GL_BUFFER_ACCESS_ARB" }, + { 0x88BB, "GL_BUFFER_ACCESS" }, + { 0x88BC, "GL_BUFFER_MAPPED_ARB" }, + { 0x88BC, "GL_BUFFER_MAPPED" }, + { 0x88BD, "GL_BUFFER_MAP_POINTER_ARB" }, + { 0x88BD, "GL_BUFFER_MAP_POINTER" }, + { 0x88C0, "GL_MATRIX0_ARB" }, + { 0x88C1, "GL_MATRIX1_ARB" }, + { 0x88C2, "GL_MATRIX2_ARB" }, + { 0x88C3, "GL_MATRIX3_ARB" }, + { 0x88C4, "GL_MATRIX4_ARB" }, + { 0x88C5, "GL_MATRIX5_ARB" }, + { 0x88C6, "GL_MATRIX6_ARB" }, + { 0x88C7, "GL_MATRIX7_ARB" }, + { 0x88C8, "GL_MATRIX8_ARB" }, + { 0x88C9, "GL_MATRIX9_ARB" }, + { 0x88CA, "GL_MATRIX10_ARB" }, + { 0x88CB, "GL_MATRIX11_ARB" }, + { 0x88CC, "GL_MATRIX12_ARB" }, + { 0x88CD, "GL_MATRIX13_ARB" }, + { 0x88CE, "GL_MATRIX14_ARB" }, + { 0x88CF, "GL_MATRIX15_ARB" }, + { 0x88D0, "GL_MATRIX16_ARB" }, + { 0x88D1, "GL_MATRIX17_ARB" }, + { 0x88D2, "GL_MATRIX18_ARB" }, + { 0x88D3, "GL_MATRIX19_ARB" }, + { 0x88D4, "GL_MATRIX20_ARB" }, + { 0x88D5, "GL_MATRIX21_ARB" }, + { 0x88D6, "GL_MATRIX22_ARB" }, + { 0x88D7, "GL_MATRIX23_ARB" }, + { 0x88D8, "GL_MATRIX24_ARB" }, + { 0x88D9, "GL_MATRIX25_ARB" }, + { 0x88DA, "GL_MATRIX26_ARB" }, + { 0x88DB, "GL_MATRIX27_ARB" }, + { 0x88DC, "GL_MATRIX28_ARB" }, + { 0x88DD, "GL_MATRIX29_ARB" }, + { 0x88DE, "GL_MATRIX30_ARB" }, + { 0x88DF, "GL_MATRIX31_ARB" }, + { 0x88E0, "GL_STREAM_DRAW_ARB" }, + { 0x88E0, "GL_STREAM_DRAW" }, + { 0x88E1, "GL_STREAM_READ_ARB" }, + { 0x88E1, "GL_STREAM_READ" }, + { 0x88E2, "GL_STREAM_COPY_ARB" }, + { 0x88E2, "GL_STREAM_COPY" }, + { 0x88E4, "GL_STATIC_DRAW_ARB" }, + { 0x88E4, "GL_STATIC_DRAW" }, + { 0x88E5, "GL_STATIC_READ_ARB" }, + { 0x88E5, "GL_STATIC_READ" }, + { 0x88E6, "GL_STATIC_COPY_ARB" }, + { 0x88E6, "GL_STATIC_COPY" }, + { 0x88E8, "GL_DYNAMIC_DRAW_ARB" }, + { 0x88E8, "GL_DYNAMIC_DRAW" }, + { 0x88E9, "GL_DYNAMIC_READ_ARB" }, + { 0x88E9, "GL_DYNAMIC_READ" }, + { 0x88EA, "GL_DYNAMIC_COPY_ARB" }, + { 0x88EA, "GL_DYNAMIC_COPY" }, + { 0x88EB, "GL_PIXEL_PACK_BUFFER_ARB" }, + { 0x88EB, "GL_PIXEL_PACK_BUFFER" }, + { 0x88EC, "GL_PIXEL_UNPACK_BUFFER_ARB" }, + { 0x88EC, "GL_PIXEL_UNPACK_BUFFER" }, + { 0x88ED, "GL_PIXEL_PACK_BUFFER_BINDING_ARB" }, + { 0x88ED, "GL_PIXEL_PACK_BUFFER_BINDING" }, + { 0x88EF, "GL_PIXEL_UNPACK_BUFFER_BINDING_ARB" }, + { 0x88EF, "GL_PIXEL_UNPACK_BUFFER_BINDING" }, + { 0x88F0, "GL_DEPTH24_STENCIL8_EXT" }, + { 0x88F0, "GL_DEPTH24_STENCIL8" }, + { 0x88F1, "GL_TEXTURE_STENCIL_SIZE_EXT" }, + { 0x88F1, "GL_TEXTURE_STENCIL_SIZE" }, + { 0x88FD, "GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT" }, + { 0x88FE, "GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB" }, + { 0x88FF, "GL_MAX_ARRAY_TEXTURE_LAYERS_EXT" }, + { 0x8904, "GL_MIN_PROGRAM_TEXEL_OFFSET_EXT" }, + { 0x8905, "GL_MAX_PROGRAM_TEXEL_OFFSET_EXT" }, + { 0x8910, "GL_STENCIL_TEST_TWO_SIDE_EXT" }, + { 0x8911, "GL_ACTIVE_STENCIL_FACE_EXT" }, + { 0x8912, "GL_MIRROR_CLAMP_TO_BORDER_EXT" }, + { 0x8914, "GL_SAMPLES_PASSED_ARB" }, + { 0x8914, "GL_SAMPLES_PASSED" }, + { 0x891A, "GL_CLAMP_VERTEX_COLOR_ARB" }, + { 0x891B, "GL_CLAMP_FRAGMENT_COLOR_ARB" }, + { 0x891C, "GL_CLAMP_READ_COLOR_ARB" }, + { 0x891D, "GL_FIXED_ONLY_ARB" }, + { 0x8920, "GL_FRAGMENT_SHADER_EXT" }, + { 0x896D, "GL_SECONDARY_INTERPOLATOR_EXT" }, + { 0x896E, "GL_NUM_FRAGMENT_REGISTERS_EXT" }, + { 0x896F, "GL_NUM_FRAGMENT_CONSTANTS_EXT" }, + { 0x8A0C, "GL_ELEMENT_ARRAY_APPLE" }, + { 0x8A0D, "GL_ELEMENT_ARRAY_TYPE_APPLE" }, + { 0x8A0E, "GL_ELEMENT_ARRAY_POINTER_APPLE" }, + { 0x8A0F, "GL_COLOR_FLOAT_APPLE" }, + { 0x8A11, "GL_UNIFORM_BUFFER" }, + { 0x8A28, "GL_UNIFORM_BUFFER_BINDING" }, + { 0x8A29, "GL_UNIFORM_BUFFER_START" }, + { 0x8A2A, "GL_UNIFORM_BUFFER_SIZE" }, + { 0x8A2B, "GL_MAX_VERTEX_UNIFORM_BLOCKS" }, + { 0x8A2C, "GL_MAX_GEOMETRY_UNIFORM_BLOCKS" }, + { 0x8A2D, "GL_MAX_FRAGMENT_UNIFORM_BLOCKS" }, + { 0x8A2E, "GL_MAX_COMBINED_UNIFORM_BLOCKS" }, + { 0x8A2F, "GL_MAX_UNIFORM_BUFFER_BINDINGS" }, + { 0x8A30, "GL_MAX_UNIFORM_BLOCK_SIZE" }, + { 0x8A31, "GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS" }, + { 0x8A32, "GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS" }, + { 0x8A33, "GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS" }, + { 0x8A34, "GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT" }, + { 0x8A35, "GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH" }, + { 0x8A36, "GL_ACTIVE_UNIFORM_BLOCKS" }, + { 0x8A37, "GL_UNIFORM_TYPE" }, + { 0x8A38, "GL_UNIFORM_SIZE" }, + { 0x8A39, "GL_UNIFORM_NAME_LENGTH" }, + { 0x8A3A, "GL_UNIFORM_BLOCK_INDEX" }, + { 0x8A3B, "GL_UNIFORM_OFFSET" }, + { 0x8A3C, "GL_UNIFORM_ARRAY_STRIDE" }, + { 0x8A3D, "GL_UNIFORM_MATRIX_STRIDE" }, + { 0x8A3E, "GL_UNIFORM_IS_ROW_MAJOR" }, + { 0x8A3F, "GL_UNIFORM_BLOCK_BINDING" }, + { 0x8A40, "GL_UNIFORM_BLOCK_DATA_SIZE" }, + { 0x8A41, "GL_UNIFORM_BLOCK_NAME_LENGTH" }, + { 0x8A42, "GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS" }, + { 0x8A43, "GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES" }, + { 0x8A44, "GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER" }, + { 0x8A45, "GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER" }, + { 0x8A46, "GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER" }, + { 0x8B30, "GL_FRAGMENT_SHADER_ARB" }, + { 0x8B30, "GL_FRAGMENT_SHADER" }, + { 0x8B31, "GL_VERTEX_SHADER_ARB" }, + { 0x8B31, "GL_VERTEX_SHADER" }, + { 0x8B40, "GL_PROGRAM_OBJECT_ARB" }, + { 0x8B48, "GL_SHADER_OBJECT_ARB" }, + { 0x8B49, "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB" }, + { 0x8B49, "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS" }, + { 0x8B4A, "GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB" }, + { 0x8B4A, "GL_MAX_VERTEX_UNIFORM_COMPONENTS" }, + { 0x8B4B, "GL_MAX_VARYING_COMPONENTS_EXT" }, + { 0x8B4B, "GL_MAX_VARYING_FLOATS_ARB" }, + { 0x8B4B, "GL_MAX_VARYING_FLOATS" }, + { 0x8B4C, "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB" }, + { 0x8B4C, "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS" }, + { 0x8B4D, "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB" }, + { 0x8B4D, "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS" }, + { 0x8B4E, "GL_OBJECT_TYPE_ARB" }, + { 0x8B4F, "GL_OBJECT_SUBTYPE_ARB" }, + { 0x8B4F, "GL_SHADER_TYPE" }, + { 0x8B50, "GL_FLOAT_VEC2_ARB" }, + { 0x8B50, "GL_FLOAT_VEC2" }, + { 0x8B51, "GL_FLOAT_VEC3_ARB" }, + { 0x8B51, "GL_FLOAT_VEC3" }, + { 0x8B52, "GL_FLOAT_VEC4_ARB" }, + { 0x8B52, "GL_FLOAT_VEC4" }, + { 0x8B53, "GL_INT_VEC2_ARB" }, + { 0x8B53, "GL_INT_VEC2" }, + { 0x8B54, "GL_INT_VEC3_ARB" }, + { 0x8B54, "GL_INT_VEC3" }, + { 0x8B55, "GL_INT_VEC4_ARB" }, + { 0x8B55, "GL_INT_VEC4" }, + { 0x8B56, "GL_BOOL_ARB" }, + { 0x8B56, "GL_BOOL" }, + { 0x8B57, "GL_BOOL_VEC2_ARB" }, + { 0x8B57, "GL_BOOL_VEC2" }, + { 0x8B58, "GL_BOOL_VEC3_ARB" }, + { 0x8B58, "GL_BOOL_VEC3" }, + { 0x8B59, "GL_BOOL_VEC4_ARB" }, + { 0x8B59, "GL_BOOL_VEC4" }, + { 0x8B5A, "GL_FLOAT_MAT2_ARB" }, + { 0x8B5A, "GL_FLOAT_MAT2" }, + { 0x8B5B, "GL_FLOAT_MAT3_ARB" }, + { 0x8B5B, "GL_FLOAT_MAT3" }, + { 0x8B5C, "GL_FLOAT_MAT4_ARB" }, + { 0x8B5C, "GL_FLOAT_MAT4" }, + { 0x8B5D, "GL_SAMPLER_1D_ARB" }, + { 0x8B5D, "GL_SAMPLER_1D" }, + { 0x8B5E, "GL_SAMPLER_2D_ARB" }, + { 0x8B5E, "GL_SAMPLER_2D" }, + { 0x8B5F, "GL_SAMPLER_3D_ARB" }, + { 0x8B5F, "GL_SAMPLER_3D" }, + { 0x8B60, "GL_SAMPLER_CUBE_ARB" }, + { 0x8B60, "GL_SAMPLER_CUBE" }, + { 0x8B61, "GL_SAMPLER_1D_SHADOW_ARB" }, + { 0x8B61, "GL_SAMPLER_1D_SHADOW" }, + { 0x8B62, "GL_SAMPLER_2D_SHADOW_ARB" }, + { 0x8B62, "GL_SAMPLER_2D_SHADOW" }, + { 0x8B63, "GL_SAMPLER_2D_RECT_ARB" }, + { 0x8B64, "GL_SAMPLER_2D_RECT_SHADOW_ARB" }, + { 0x8B65, "GL_FLOAT_MAT2x3" }, + { 0x8B66, "GL_FLOAT_MAT2x4" }, + { 0x8B67, "GL_FLOAT_MAT3x2" }, + { 0x8B68, "GL_FLOAT_MAT3x4" }, + { 0x8B69, "GL_FLOAT_MAT4x2" }, + { 0x8B6A, "GL_FLOAT_MAT4x3" }, + { 0x8B80, "GL_DELETE_STATUS" }, + { 0x8B80, "GL_OBJECT_DELETE_STATUS_ARB" }, + { 0x8B81, "GL_COMPILE_STATUS" }, + { 0x8B81, "GL_OBJECT_COMPILE_STATUS_ARB" }, + { 0x8B82, "GL_LINK_STATUS" }, + { 0x8B82, "GL_OBJECT_LINK_STATUS_ARB" }, + { 0x8B83, "GL_OBJECT_VALIDATE_STATUS_ARB" }, + { 0x8B83, "GL_VALIDATE_STATUS" }, + { 0x8B84, "GL_INFO_LOG_LENGTH" }, + { 0x8B84, "GL_OBJECT_INFO_LOG_LENGTH_ARB" }, + { 0x8B85, "GL_ATTACHED_SHADERS" }, + { 0x8B85, "GL_OBJECT_ATTACHED_OBJECTS_ARB" }, + { 0x8B86, "GL_ACTIVE_UNIFORMS" }, + { 0x8B86, "GL_OBJECT_ACTIVE_UNIFORMS_ARB" }, + { 0x8B87, "GL_ACTIVE_UNIFORM_MAX_LENGTH" }, + { 0x8B87, "GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB" }, + { 0x8B88, "GL_OBJECT_SHADER_SOURCE_LENGTH_ARB" }, + { 0x8B88, "GL_SHADER_SOURCE_LENGTH" }, + { 0x8B89, "GL_ACTIVE_ATTRIBUTES" }, + { 0x8B89, "GL_OBJECT_ACTIVE_ATTRIBUTES_ARB" }, + { 0x8B8A, "GL_ACTIVE_ATTRIBUTE_MAX_LENGTH" }, + { 0x8B8A, "GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB" }, + { 0x8B8B, "GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB" }, + { 0x8B8B, "GL_FRAGMENT_SHADER_DERIVATIVE_HINT" }, + { 0x8B8C, "GL_SHADING_LANGUAGE_VERSION_ARB" }, + { 0x8B8C, "GL_SHADING_LANGUAGE_VERSION" }, + { 0x8B8D, "GL_CURRENT_PROGRAM" }, + { 0x8C10, "GL_TEXTURE_RED_TYPE_ARB" }, + { 0x8C10, "GL_TEXTURE_RED_TYPE" }, + { 0x8C11, "GL_TEXTURE_GREEN_TYPE_ARB" }, + { 0x8C11, "GL_TEXTURE_GREEN_TYPE" }, + { 0x8C12, "GL_TEXTURE_BLUE_TYPE_ARB" }, + { 0x8C12, "GL_TEXTURE_BLUE_TYPE" }, + { 0x8C13, "GL_TEXTURE_ALPHA_TYPE_ARB" }, + { 0x8C13, "GL_TEXTURE_ALPHA_TYPE" }, + { 0x8C14, "GL_TEXTURE_LUMINANCE_TYPE_ARB" }, + { 0x8C15, "GL_TEXTURE_INTENSITY_TYPE_ARB" }, + { 0x8C16, "GL_TEXTURE_DEPTH_TYPE_ARB" }, + { 0x8C16, "GL_TEXTURE_DEPTH_TYPE" }, + { 0x8C17, "GL_UNSIGNED_NORMALIZED_ARB" }, + { 0x8C17, "GL_UNSIGNED_NORMALIZED" }, + { 0x8C18, "GL_TEXTURE_1D_ARRAY_EXT" }, + { 0x8C19, "GL_PROXY_TEXTURE_1D_ARRAY_EXT" }, + { 0x8C1A, "GL_TEXTURE_2D_ARRAY_EXT" }, + { 0x8C1B, "GL_PROXY_TEXTURE_2D_ARRAY_EXT" }, + { 0x8C1C, "GL_TEXTURE_BINDING_1D_ARRAY_EXT" }, + { 0x8C1D, "GL_TEXTURE_BINDING_2D_ARRAY_EXT" }, + { 0x8C29, "GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT" }, + { 0x8C3A, "GL_R11F_G11F_B10F_EXT" }, + { 0x8C3B, "GL_UNSIGNED_INT_10F_11F_11F_REV_EXT" }, + { 0x8C3C, "GL_RGBA_SIGNED_COMPONENTS_EXT" }, + { 0x8C3D, "GL_RGB9_E5_EXT" }, + { 0x8C3E, "GL_UNSIGNED_INT_5_9_9_9_REV_EXT" }, + { 0x8C3F, "GL_TEXTURE_SHARED_SIZE_EXT" }, + { 0x8C40, "GL_SRGB_EXT" }, + { 0x8C40, "GL_SRGB" }, + { 0x8C41, "GL_SRGB8_EXT" }, + { 0x8C41, "GL_SRGB8" }, + { 0x8C42, "GL_SRGB_ALPHA_EXT" }, + { 0x8C42, "GL_SRGB_ALPHA" }, + { 0x8C43, "GL_SRGB8_ALPHA8_EXT" }, + { 0x8C43, "GL_SRGB8_ALPHA8" }, + { 0x8C44, "GL_SLUMINANCE_ALPHA_EXT" }, + { 0x8C44, "GL_SLUMINANCE_ALPHA" }, + { 0x8C45, "GL_SLUMINANCE8_ALPHA8_EXT" }, + { 0x8C45, "GL_SLUMINANCE8_ALPHA8" }, + { 0x8C46, "GL_SLUMINANCE_EXT" }, + { 0x8C46, "GL_SLUMINANCE" }, + { 0x8C47, "GL_SLUMINANCE8_EXT" }, + { 0x8C47, "GL_SLUMINANCE8" }, + { 0x8C48, "GL_COMPRESSED_SRGB_EXT" }, + { 0x8C48, "GL_COMPRESSED_SRGB" }, + { 0x8C49, "GL_COMPRESSED_SRGB_ALPHA_EXT" }, + { 0x8C49, "GL_COMPRESSED_SRGB_ALPHA" }, + { 0x8C4A, "GL_COMPRESSED_SLUMINANCE_EXT" }, + { 0x8C4A, "GL_COMPRESSED_SLUMINANCE" }, + { 0x8C4B, "GL_COMPRESSED_SLUMINANCE_ALPHA_EXT" }, + { 0x8C4B, "GL_COMPRESSED_SLUMINANCE_ALPHA" }, + { 0x8C4C, "GL_COMPRESSED_SRGB_S3TC_DXT1_EXT" }, + { 0x8C4D, "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT" }, + { 0x8C4E, "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT" }, + { 0x8C4F, "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT" }, + { 0x8C76, "GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT" }, + { 0x8C7F, "GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT" }, + { 0x8C80, "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT" }, + { 0x8C83, "GL_TRANSFORM_FEEDBACK_VARYINGS_EXT" }, + { 0x8C84, "GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT" }, + { 0x8C85, "GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT" }, + { 0x8C87, "GL_PRIMITIVES_GENERATED_EXT" }, + { 0x8C88, "GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT" }, + { 0x8C89, "GL_RASTERIZER_DISCARD_EXT" }, + { 0x8C8A, "GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT" }, + { 0x8C8B, "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT" }, + { 0x8C8C, "GL_INTERLEAVED_ATTRIBS_EXT" }, + { 0x8C8D, "GL_SEPARATE_ATTRIBS_EXT" }, + { 0x8C8E, "GL_TRANSFORM_FEEDBACK_BUFFER_EXT" }, + { 0x8C8F, "GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT" }, + { 0x8CA0, "GL_POINT_SPRITE_COORD_ORIGIN" }, + { 0x8CA1, "GL_LOWER_LEFT" }, + { 0x8CA2, "GL_UPPER_LEFT" }, + { 0x8CA3, "GL_STENCIL_BACK_REF" }, + { 0x8CA4, "GL_STENCIL_BACK_VALUE_MASK" }, + { 0x8CA5, "GL_STENCIL_BACK_WRITEMASK" }, + { 0x8CA6, "GL_DRAW_FRAMEBUFFER_BINDING_EXT" }, + { 0x8CA6, "GL_FRAMEBUFFER_BINDING_EXT" }, + { 0x8CA6, "GL_FRAMEBUFFER_BINDING" }, + { 0x8CA7, "GL_RENDERBUFFER_BINDING_EXT" }, + { 0x8CA7, "GL_RENDERBUFFER_BINDING" }, + { 0x8CA8, "GL_READ_FRAMEBUFFER_EXT" }, + { 0x8CA8, "GL_READ_FRAMEBUFFER" }, + { 0x8CA9, "GL_DRAW_FRAMEBUFFER_EXT" }, + { 0x8CA9, "GL_DRAW_FRAMEBUFFER" }, + { 0x8CAA, "GL_READ_FRAMEBUFFER_BINDING_EXT" }, + { 0x8CAA, "GL_READ_FRAMEBUFFER_BINDING" }, + { 0x8CAB, "GL_RENDERBUFFER_SAMPLES_EXT" }, + { 0x8CAB, "GL_RENDERBUFFER_SAMPLES" }, + { 0x8CAC, "GL_DEPTH_COMPONENT32F" }, + { 0x8CAD, "GL_DEPTH32F_STENCIL8" }, + { 0x8CD0, "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT" }, + { 0x8CD0, "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE" }, + { 0x8CD1, "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT" }, + { 0x8CD1, "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME" }, + { 0x8CD2, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT" }, + { 0x8CD2, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL" }, + { 0x8CD3, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT" }, + { 0x8CD3, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE" }, + { 0x8CD4, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT" }, + { 0x8CD4, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT" }, + { 0x8CD4, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER" }, + { 0x8CD5, "GL_FRAMEBUFFER_COMPLETE_EXT" }, + { 0x8CD5, "GL_FRAMEBUFFER_COMPLETE" }, + { 0x8CD6, "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT" }, + { 0x8CD6, "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT" }, + { 0x8CD7, "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT" }, + { 0x8CD7, "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT" }, + { 0x8CD9, "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT" }, + { 0x8CDA, "GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT" }, + { 0x8CDB, "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT" }, + { 0x8CDB, "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER" }, + { 0x8CDC, "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT" }, + { 0x8CDC, "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER" }, + { 0x8CDD, "GL_FRAMEBUFFER_UNSUPPORTED_EXT" }, + { 0x8CDD, "GL_FRAMEBUFFER_UNSUPPORTED" }, + { 0x8CDF, "GL_MAX_COLOR_ATTACHMENTS_EXT" }, + { 0x8CDF, "GL_MAX_COLOR_ATTACHMENTS" }, + { 0x8CE0, "GL_COLOR_ATTACHMENT0_EXT" }, + { 0x8CE0, "GL_COLOR_ATTACHMENT0" }, + { 0x8CE1, "GL_COLOR_ATTACHMENT1_EXT" }, + { 0x8CE1, "GL_COLOR_ATTACHMENT1" }, + { 0x8CE2, "GL_COLOR_ATTACHMENT2_EXT" }, + { 0x8CE2, "GL_COLOR_ATTACHMENT2" }, + { 0x8CE3, "GL_COLOR_ATTACHMENT3_EXT" }, + { 0x8CE3, "GL_COLOR_ATTACHMENT3" }, + { 0x8CE4, "GL_COLOR_ATTACHMENT4_EXT" }, + { 0x8CE4, "GL_COLOR_ATTACHMENT4" }, + { 0x8CE5, "GL_COLOR_ATTACHMENT5_EXT" }, + { 0x8CE5, "GL_COLOR_ATTACHMENT5" }, + { 0x8CE6, "GL_COLOR_ATTACHMENT6_EXT" }, + { 0x8CE6, "GL_COLOR_ATTACHMENT6" }, + { 0x8CE7, "GL_COLOR_ATTACHMENT7_EXT" }, + { 0x8CE7, "GL_COLOR_ATTACHMENT7" }, + { 0x8CE8, "GL_COLOR_ATTACHMENT8_EXT" }, + { 0x8CE8, "GL_COLOR_ATTACHMENT8" }, + { 0x8CE9, "GL_COLOR_ATTACHMENT9_EXT" }, + { 0x8CE9, "GL_COLOR_ATTACHMENT9" }, + { 0x8CEA, "GL_COLOR_ATTACHMENT10_EXT" }, + { 0x8CEA, "GL_COLOR_ATTACHMENT10" }, + { 0x8CEB, "GL_COLOR_ATTACHMENT11_EXT" }, + { 0x8CEB, "GL_COLOR_ATTACHMENT11" }, + { 0x8CEC, "GL_COLOR_ATTACHMENT12_EXT" }, + { 0x8CEC, "GL_COLOR_ATTACHMENT12" }, + { 0x8CED, "GL_COLOR_ATTACHMENT13_EXT" }, + { 0x8CED, "GL_COLOR_ATTACHMENT13" }, + { 0x8CEE, "GL_COLOR_ATTACHMENT14_EXT" }, + { 0x8CEE, "GL_COLOR_ATTACHMENT14" }, + { 0x8CEF, "GL_COLOR_ATTACHMENT15_EXT" }, + { 0x8CEF, "GL_COLOR_ATTACHMENT15" }, + { 0x8D00, "GL_DEPTH_ATTACHMENT_EXT" }, + { 0x8D00, "GL_DEPTH_ATTACHMENT" }, + { 0x8D20, "GL_STENCIL_ATTACHMENT_EXT" }, + { 0x8D20, "GL_STENCIL_ATTACHMENT" }, + { 0x8D40, "GL_FRAMEBUFFER_EXT" }, + { 0x8D40, "GL_FRAMEBUFFER" }, + { 0x8D41, "GL_RENDERBUFFER_EXT" }, + { 0x8D41, "GL_RENDERBUFFER" }, + { 0x8D42, "GL_RENDERBUFFER_WIDTH_EXT" }, + { 0x8D42, "GL_RENDERBUFFER_WIDTH" }, + { 0x8D43, "GL_RENDERBUFFER_HEIGHT_EXT" }, + { 0x8D43, "GL_RENDERBUFFER_HEIGHT" }, + { 0x8D44, "GL_RENDERBUFFER_INTERNAL_FORMAT_EXT" }, + { 0x8D44, "GL_RENDERBUFFER_INTERNAL_FORMAT" }, + { 0x8D46, "GL_STENCIL_INDEX1_EXT" }, + { 0x8D46, "GL_STENCIL_INDEX1" }, + { 0x8D47, "GL_STENCIL_INDEX4_EXT" }, + { 0x8D47, "GL_STENCIL_INDEX4" }, + { 0x8D48, "GL_STENCIL_INDEX8_EXT" }, + { 0x8D48, "GL_STENCIL_INDEX8" }, + { 0x8D49, "GL_STENCIL_INDEX16_EXT" }, + { 0x8D49, "GL_STENCIL_INDEX16" }, + { 0x8D50, "GL_RENDERBUFFER_RED_SIZE_EXT" }, + { 0x8D50, "GL_RENDERBUFFER_RED_SIZE" }, + { 0x8D51, "GL_RENDERBUFFER_GREEN_SIZE_EXT" }, + { 0x8D51, "GL_RENDERBUFFER_GREEN_SIZE" }, + { 0x8D52, "GL_RENDERBUFFER_BLUE_SIZE_EXT" }, + { 0x8D52, "GL_RENDERBUFFER_BLUE_SIZE" }, + { 0x8D53, "GL_RENDERBUFFER_ALPHA_SIZE_EXT" }, + { 0x8D53, "GL_RENDERBUFFER_ALPHA_SIZE" }, + { 0x8D54, "GL_RENDERBUFFER_DEPTH_SIZE_EXT" }, + { 0x8D54, "GL_RENDERBUFFER_DEPTH_SIZE" }, + { 0x8D55, "GL_RENDERBUFFER_STENCIL_SIZE_EXT" }, + { 0x8D55, "GL_RENDERBUFFER_STENCIL_SIZE" }, + { 0x8D56, "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT" }, + { 0x8D56, "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE" }, + { 0x8D57, "GL_MAX_SAMPLES_EXT" }, + { 0x8D57, "GL_MAX_SAMPLES" }, + { 0x8D70, "GL_RGBA32UI_EXT" }, + { 0x8D71, "GL_RGB32UI_EXT" }, + { 0x8D72, "GL_ALPHA32UI_EXT" }, + { 0x8D73, "GL_INTENSITY32UI_EXT" }, + { 0x8D74, "GL_LUMINANCE32UI_EXT" }, + { 0x8D75, "GL_LUMINANCE_ALPHA32UI_EXT" }, + { 0x8D76, "GL_RGBA16UI_EXT" }, + { 0x8D77, "GL_RGB16UI_EXT" }, + { 0x8D78, "GL_ALPHA16UI_EXT" }, + { 0x8D79, "GL_INTENSITY16UI_EXT" }, + { 0x8D7A, "GL_LUMINANCE16UI_EXT" }, + { 0x8D7B, "GL_LUMINANCE_ALPHA16UI_EXT" }, + { 0x8D7C, "GL_RGBA8UI_EXT" }, + { 0x8D7D, "GL_RGB8UI_EXT" }, + { 0x8D7E, "GL_ALPHA8UI_EXT" }, + { 0x8D7F, "GL_INTENSITY8UI_EXT" }, + { 0x8D80, "GL_LUMINANCE8UI_EXT" }, + { 0x8D81, "GL_LUMINANCE_ALPHA8UI_EXT" }, + { 0x8D82, "GL_RGBA32I_EXT" }, + { 0x8D83, "GL_RGB32I_EXT" }, + { 0x8D84, "GL_ALPHA32I_EXT" }, + { 0x8D85, "GL_INTENSITY32I_EXT" }, + { 0x8D86, "GL_LUMINANCE32I_EXT" }, + { 0x8D87, "GL_LUMINANCE_ALPHA32I_EXT" }, + { 0x8D88, "GL_RGBA16I_EXT" }, + { 0x8D89, "GL_RGB16I_EXT" }, + { 0x8D8A, "GL_ALPHA16I_EXT" }, + { 0x8D8B, "GL_INTENSITY16I_EXT" }, + { 0x8D8C, "GL_LUMINANCE16I_EXT" }, + { 0x8D8D, "GL_LUMINANCE_ALPHA16I_EXT" }, + { 0x8D8E, "GL_RGBA8I_EXT" }, + { 0x8D8F, "GL_RGB8I_EXT" }, + { 0x8D90, "GL_ALPHA8I_EXT" }, + { 0x8D91, "GL_INTENSITY8I_EXT" }, + { 0x8D92, "GL_LUMINANCE8I_EXT" }, + { 0x8D93, "GL_LUMINANCE_ALPHA8I_EXT" }, + { 0x8D94, "GL_RED_INTEGER_EXT" }, + { 0x8D95, "GL_GREEN_INTEGER_EXT" }, + { 0x8D96, "GL_BLUE_INTEGER_EXT" }, + { 0x8D97, "GL_ALPHA_INTEGER_EXT" }, + { 0x8D98, "GL_RGB_INTEGER_EXT" }, + { 0x8D99, "GL_RGBA_INTEGER_EXT" }, + { 0x8D9A, "GL_BGR_INTEGER_EXT" }, + { 0x8D9B, "GL_BGRA_INTEGER_EXT" }, + { 0x8D9C, "GL_LUMINANCE_INTEGER_EXT" }, + { 0x8D9D, "GL_LUMINANCE_ALPHA_INTEGER_EXT" }, + { 0x8D9E, "GL_RGBA_INTEGER_MODE_EXT" }, + { 0x8DA7, "GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT" }, + { 0x8DA8, "GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT" }, + { 0x8DA9, "GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT" }, + { 0x8DAD, "GL_FLOAT_32_UNSIGNED_INT_24_8_REV" }, + { 0x8DB9, "GL_FRAMEBUFFER_SRGB_EXT" }, + { 0x8DBA, "GL_FRAMEBUFFER_SRGB_CAPABLE_EXT" }, + { 0x8DBB, "GL_COMPRESSED_RED_RGTC1" }, + { 0x8DBC, "GL_COMPRESSED_SIGNED_RED_RGTC1" }, + { 0x8DBD, "GL_COMPRESSED_RG_RGTC2" }, + { 0x8DBE, "GL_COMPRESSED_SIGNED_RG_RGTC2" }, + { 0x8DC0, "GL_SAMPLER_1D_ARRAY_EXT" }, + { 0x8DC1, "GL_SAMPLER_2D_ARRAY_EXT" }, + { 0x8DC2, "GL_SAMPLER_BUFFER_EXT" }, + { 0x8DC3, "GL_SAMPLER_1D_ARRAY_SHADOW_EXT" }, + { 0x8DC4, "GL_SAMPLER_2D_ARRAY_SHADOW_EXT" }, + { 0x8DC5, "GL_SAMPLER_CUBE_SHADOW_EXT" }, + { 0x8DC6, "GL_UNSIGNED_INT_VEC2_EXT" }, + { 0x8DC7, "GL_UNSIGNED_INT_VEC3_EXT" }, + { 0x8DC8, "GL_UNSIGNED_INT_VEC4_EXT" }, + { 0x8DC9, "GL_INT_SAMPLER_1D_EXT" }, + { 0x8DCA, "GL_INT_SAMPLER_2D_EXT" }, + { 0x8DCB, "GL_INT_SAMPLER_3D_EXT" }, + { 0x8DCC, "GL_INT_SAMPLER_CUBE_EXT" }, + { 0x8DCD, "GL_INT_SAMPLER_2D_RECT_EXT" }, + { 0x8DCE, "GL_INT_SAMPLER_1D_ARRAY_EXT" }, + { 0x8DCF, "GL_INT_SAMPLER_2D_ARRAY_EXT" }, + { 0x8DD0, "GL_INT_SAMPLER_BUFFER_EXT" }, + { 0x8DD1, "GL_UNSIGNED_INT_SAMPLER_1D_EXT" }, + { 0x8DD2, "GL_UNSIGNED_INT_SAMPLER_2D_EXT" }, + { 0x8DD3, "GL_UNSIGNED_INT_SAMPLER_3D_EXT" }, + { 0x8DD4, "GL_UNSIGNED_INT_SAMPLER_CUBE_EXT" }, + { 0x8DD5, "GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT" }, + { 0x8DD6, "GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT" }, + { 0x8DD7, "GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT" }, + { 0x8DD8, "GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT" }, + { 0x8DD9, "GL_GEOMETRY_SHADER_EXT" }, + { 0x8DDA, "GL_GEOMETRY_VERTICES_OUT_EXT" }, + { 0x8DDB, "GL_GEOMETRY_INPUT_TYPE_EXT" }, + { 0x8DDC, "GL_GEOMETRY_OUTPUT_TYPE_EXT" }, + { 0x8DDD, "GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT" }, + { 0x8DDE, "GL_MAX_VERTEX_VARYING_COMPONENTS_EXT" }, + { 0x8DDF, "GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT" }, + { 0x8DE0, "GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT" }, + { 0x8DE1, "GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT" }, + { 0x8DE2, "GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT" }, + { 0x8DE3, "GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT" }, + { 0x8DE4, "GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT" }, + { 0x8DED, "GL_MAX_BINDABLE_UNIFORM_SIZE_EXT" }, + { 0x8DEE, "GL_UNIFORM_BUFFER_EXT" }, + { 0x8DEF, "GL_UNIFORM_BUFFER_BINDING_EXT" }, + { 0x8E4C, "GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT" }, + { 0x8E4D, "GL_FIRST_VERTEX_CONVENTION_EXT" }, + { 0x8E4E, "GL_LAST_VERTEX_CONVENTION_EXT" }, + { 0x8E4F, "GL_PROVOKING_VERTEX_EXT" }, + + VE( TERMVALUE ) +}; + +GLMValueEntry_t g_gl_renderers[] = +{ + { 0x00020200, "Generic" }, + { 0x00020400, "GenericFloat" }, + { 0x00020600, "AppleSW" }, + { 0x00021000, "ATIRage128" }, + { 0x00021200, "ATIRadeon" }, + { 0x00021400, "ATIRagePro" }, + { 0x00021600, "ATIRadeon8500" }, + { 0x00021800, "ATIRadeon9700" }, + { 0x00021900, "ATIRadeonX1000" }, + { 0x00021A00, "ATIRadeonX2000" }, + { 0x00022000, "NVGeForce2MX" }, + { 0x00022200, "NVGeForce3" }, + { 0x00022400, "NVGeForceFX" }, + { 0x00022600, "NVGeForce8xxx" }, + { 0x00023000, "VTBladeXP2" }, + { 0x00024000, "Intel900" }, + { 0x00024200, "IntelX3100" }, + { 0x00040000, "Mesa3DFX" }, + + VE( TERMVALUE ) +}; + + +//=============================================================================== +// decode helper funcs + +char s_glmStrScratch[65536]; +int s_glmStrCursor = 0; + +const char * GLMDecode( GLMThing_t thingtype, unsigned long value ) +{ + GLMValueEntry_t *table = NULL; + + switch( thingtype ) + { + case eD3D_DEVTYPE: table = g_d3d_devtypes; + break; + + case eD3D_FORMAT: table = g_d3d_formats; + break; + + case eD3D_RTYPE: table = g_d3d_rtypes; + break; + + case eD3D_USAGE: table = g_d3d_usages; + break; + + case eD3D_RSTATE: table = g_d3d_rstates; + break; + + case eD3D_SIO: table = g_d3d_opcodes; + break; + + case eD3D_VTXDECLUSAGE: table = g_d3d_vtxdeclusages; + break; + + case eCGL_RENDID: table = g_cgl_rendids; + break; + + case eGL_ERROR: table = g_gl_errors; + break; + + case eGL_ENUM: table = g_gl_enums; + break; + + case eGL_RENDERER: table = g_gl_renderers; + break; + + default: + GLMStop(); + return "UNKNOWNTYPE"; + break; + } + + if (table) + { + while( table->value != TERMVALUE ) + { + if (table->value == value) + { + return table->name; + } + table++; + } + } + return "UNKNOWN"; +} + +const char *GLMDecodeMask( GLMThing_t kind, unsigned long value ) +{ + // if cursor to scratch buffer is within 1K of EOB, rewind + // nobody is going to decode 63K of flag string values in a single call.. + + // this means that strings returned by this function have a short lifetime.. print them and do not save the pointer.. + + if ( (sizeof(s_glmStrScratch) - s_glmStrCursor) < 1000 ) + { + s_glmStrCursor = 0; + } + + char *start = &s_glmStrScratch[ s_glmStrCursor ]; + char *dest = start; + char first = 1; + + DWORD mask = (1L<<31); + while(mask) + { + if (mask & value) + { + sprintf(dest,"%s%s", (first) ? "" : "|", GLMDecode( kind, value&mask ) ); + first = 0; + + dest += strlen(dest); // leaves dest pointing at the end null + } + mask >>= 1; + } + s_glmStrCursor = (dest - s_glmStrScratch) + 1; // +1 so the next decoded flag set doesn't land on the ending null + return start; + +} + +#undef VE +#undef TERMVALUE + +//=============================================================================== + +bool GLMDetectOGLP( void ) +{ + bool result; + + GLint forceFlush; + CGLError error = CGLGetParameter(CGLGetCurrentContext(), kCGLCPEnableForceFlush, &forceFlush); + result = error == 0; + if (result) + { + // enable a breakpoint on color4sv + GLint oglp_bkpt[3] = { kCGLFEglColor4sv, kCGLProfBreakBefore, 1 }; + + CGLSetGlobalOption( kCGLGOEnableBreakpoint, oglp_bkpt ); + } + + return result; +} + + +// from http://blog.timac.org/?p=190 + +#include +#include +#include +#include + +// From Technical Q&A QA1361 +// Returns true if the current process +// is being debugged (either running +// under the debugger or has a debugger +// attached post facto). + +bool GLMDetectGDB( void ) // aka AmIBeingDebugged() +{ + bool result; + int junk; + int mib[4]; + struct kinfo_proc info; + size_t size; + + // Initialize the flags so that, + // if sysctl fails for some bizarre + // reason, we get a predictable result. + + info.kp_proc.p_flag = 0; + + // Initialize mib, which tells sysctl the info + // we want, in this case we're looking for + // information about a specific process ID. + + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PID; + mib[3] = getpid(); + + // Call sysctl. + + size = sizeof(info); + junk = sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0); + (void)junk; + + assert(junk == 0); + + // We're being debugged if the P_TRACED + // flag is set. + + result = ( (info.kp_proc.p_flag & P_TRACED) != 0 ); + + return result; +} + + +uint GLMDetectAvailableChannels( void ) +{ + uint result = 0; + + // printf is always available (except maybe in release... ?) + result |= (1 << ePrintf); + + // gdb + if (GLMDetectGDB()) + { + result |= (1 << eDebugger); + printf("\n############# GDB Detected"); + } + + // oglp + if (GLMDetectOGLP()) + { + result |= (1 << eGLProfiler); + printf("\n############# OGLP Detected"); + } + + return result; +} + + +#if GLMDEBUG + +static bool g_debugInitDone = false; +static uint g_glmDebugChannelMask = 0; // which output channels are available (can be more than one) +static uint g_glmDebugFlavorMask = 0; // which message flavors are enabled for output (can be more than one) + + // following funcs vanish if GLMDEBUG not set + +void GLMDebugInitialize( bool forceReinit ) +{ + if ( !g_debugInitDone || forceReinit ) + { + // detect channels + uint channelMask = GLMDetectAvailableChannels(); + + // finally, disable all of them if commandline did not say "enable spew" + if (0 /* !CommandLine()->FindParm("-glmspew") */) //FIXME change back to 1 later + { + channelMask = 0; + } + + // set the output channel mask + GLMDebugChannelMask( &channelMask ); + + // if any channels are enabled, enable some output + if ( channelMask ) + { + // start mostly quiet unless the -glmbootspew option is there + if ( 0 /*CommandLine()->FindParm( "-glmbootspew" )*/ ) + { + g_glmDebugFlavorMask = 0xFFFFFFFF; + } + else + { + g_glmDebugFlavorMask = + (1< < + // | (1<-M- and it will indent and be filterable + { + // comment + flavor = eComment; + } + else if (strnstr(str, "-D-", 4)) + { + // debug dump + flavor = eDebugDump; + } + else if (strnstr(str, "-M-", 4)) + { + // matrix data + flavor = eMatrixData; + } + else if (strnstr(str, "-S-", 4)) + { + // shader data + flavor = eShaderData; + } + else if (strnstr(str, "-F-", 4)) + { + // framebuf data + flavor = eFrameBufData; + } + else if (strnstr(str, "-X-", 4)) + { + // DirectX data + flavor = eDXStuff; + } + else if (strnstr(str, "-A-", 4)) + { + // allocation data + flavor = eAllocations; + } + else if (strnstr(str, "-Z-", 4)) + { + // allocation data + flavor = eSlowness; + } + else if (str[0] == '<' || str[0] == '>') + { + // entry/exit (aka tenure) + flavor = eTenure; + } + + return flavor; +} + +void GLMPrintfVA( const char *fmt, va_list vargs ) +{ + // if no channels open, return + uint channelMask = GLMDebugChannelMask(); + if (!channelMask) + return; + + // if "all flavors" is off, return + uint flavorMask = GLMDebugFlavorMask(); + if (! ( flavorMask & (1<' - raise indent level after print. + // if first char is a '<' - lower indent level before print. + + char buf[100000]; + + if (fmt[0] == '<') + { + GLMIncIndent( -1 ); + } + + memset( buf, '\t', g_glm_indent ); + vsprintf( buf+g_glm_indent, fmt, vargs ); + GLMStringOut( buf ); + + if (fmt[0] == '>') + { + GLMIncIndent( 1 ); + } +} + +void GLMPrintf( const char *fmt, ... ) +{ + // if no channels open, return + uint channelMask = GLMDebugChannelMask(); + if (!channelMask) + return; + + // if "all flavors" is off, return + uint flavorMask = GLMDebugFlavorMask(); + if (! ( flavorMask & (1<' - raise indent level after print. + // if first char is a '<' - lower indent level before print. + + char buf[64000]; + + if (str[0] == '<') + { + GLMIncIndent( -1 ); + } + + memset( buf, '\t', g_glm_indent ); + + if (strlen(str) < sizeof(buf)-g_glm_indent-1) + { + strcpy( buf + g_glm_indent, str ); + } + else + { + Debugger(); + } + + + GLMStringOut( buf ); // single string out with indenting + + if (str[0] == '>') + { + GLMIncIndent( 1 ); + } +} + + +void GLMPrintText( const char *str, EGLMDebugFlavor flavor, uint options ) +{ + // if no channels open, return + uint channelMask = GLMDebugChannelMask(); + if (!channelMask) + return; + + // if "all flavors" is off, return + uint flavorMask = GLMDebugFlavorMask(); + if (! ( flavorMask & (1<0) + { + if (g_glm_indent > g_glm_indent_max) + { + g_glm_indent = g_glm_indent_max; + } + } + else + { + if (g_glm_indent < 0) + { + g_glm_indent = 0; + } + } + return g_glm_indent; +} + +int GLMGetIndent( void ) +{ + return g_glm_indent; +} + +void GLMSetIndent( int indent ) +{ + g_glm_indent = indent; +} + +#endif + +// PIX tracking - you can call these outside of GLMDEBUG=true +char sg_pPIXName[128]; + +void GLMBeginPIXEvent( const char *str ) +{ + V_strncpy( sg_pPIXName, str, 128 ); + + /* + if (CommandLine()->FindParm("-glmpix2oglp")) + { + char temp[256]; + // route PIX event strings to OGLP + sprintf( temp,"> %s",sg_pPIXName ); + CGLSetOption( kCGLGOComment, (GLint)temp ); + } + */ +} + +void GLMEndPIXEvent( void ) +{ + /* + if (CommandLine()->FindParm("-glmpix2oglp")) + { + char temp[256]; + // route PIX event strings to OGLP + sprintf( temp,"< %s",sg_pPIXName ); + CGLSetOption( kCGLGOComment, (GLint)temp ); + } + */ + sg_pPIXName[0] = '\0'; +} + + + + +//=============================================================================== + +// helpers for CGLSetOption - no op if no profiler +void GLMProfilerClearTrace( void ) +{ + CGLSetOption( kCGLGOResetFunctionTrace, 0 ); +} + +void GLMProfilerEnableTrace( bool enable ) +{ + CGLSetOption( kCGLGOEnableFunctionTrace, enable ? GL_TRUE : GL_FALSE ); +} + +// helpers for CGLSetParameter - no op if no profiler +void GLMProfilerDumpState( void ) +{ + CGLContextObj curr = CGLGetCurrentContext(); + CGLSetParameter( curr, kCGLCPDumpState, (const GLint*)1 ); +} + + +//=============================================================================== + +CGLMFileMirror::CGLMFileMirror( char *fullpath ) +{ + m_path = strdup( fullpath ); + m_data = (char *)malloc(1); + m_size = 0; + UpdateStatInfo(); + if (m_exists) + { + ReadFile(); + } +} + +CGLMFileMirror::~CGLMFileMirror( ) +{ + if (m_path) + { + free (m_path); + m_path = NULL; + } + + if (m_data) + { + free (m_data); + m_data = NULL; + } +} + +bool CGLMFileMirror::HasData( void ) +{ + return (m_size != 0); +} + + +// return direct pointer to buffer. Will be invalidated if file is re-loaded or if data is written to +void CGLMFileMirror::GetData( char **dataPtr, uint *dataSizePtr ) +{ + *dataPtr = m_data; + *dataSizePtr = m_size; +} + + +void CGLMFileMirror::SetData( char *data, uint dataSize ) +{ + if (m_data) + { + free( m_data ); + m_data = NULL; + } + + m_size = dataSize; + + m_data = (char *)malloc( m_size +1 ); + m_data[ m_size ] = 0; // extra NULL terminator, no charge + + memcpy( m_data, data, m_size ); // copy data in + + WriteFile(); // keep disk copy sync'd +} + +static bool stat_diff( struct stat *a, struct stat *b ) +{ + if (a->st_size != b->st_size) + { + return true; + } + + if (memcmp( &a->st_mtimespec, &b->st_mtimespec, sizeof( struct timespec ) ) ) + { + return true; + } + + return false; +} + +bool CGLMFileMirror::PollForChanges( void ) +{ + // snapshot old stat + bool old_exists = m_exists; + struct stat old_stat = m_stat; + + (void)old_exists; + + UpdateStatInfo(); + + if (m_exists) + { + if ( stat_diff( &old_stat, &m_stat ) ) + { + // initial difference detected. continue to poll at 0.1s intervals until it stops changing, then read it. + int stablecount = 0; + do + { + usleep(100000); + + struct stat last_stat = m_stat; + UpdateStatInfo(); + + if (stat_diff( &last_stat, &m_stat )) + { + stablecount = 0; + } + else + { + stablecount++; + } + } while(stablecount<3); + + // changes have settled down, now re-read it + ReadFile(); + return true; + } + else + { + return false; // no change + } + } + else + { + // file does not exist. remake it. not considered to be a change. + WriteFile(); + return false; + } +} + + + +void CGLMFileMirror::UpdateStatInfo( void ) +{ + // stat the path + struct stat newstat; + memset (&newstat, 0, sizeof(newstat) ); + int result = stat( m_path, &newstat ); + + if (!result) + { + m_exists = true; + m_stat = newstat; + } + else + { + m_exists = false; + memset( &m_stat, 0, sizeof( m_stat ) ); + } +} + + +void CGLMFileMirror::ReadFile( void ) +{ + // unconditional - we discard any old buffer, make a new one, + UpdateStatInfo(); + + if (m_data) + { + free( m_data ); + m_data = NULL; + } + + if (m_exists) + { + FILE *infile = fopen( m_path, "rb" ); + if (infile) + { + // get size from stat + m_size = m_stat.st_size; + + m_data = (char *)malloc( m_size +1 ); + m_data[ m_size ] = 0; // extra NULL terminator, no charge + + fread( m_data, 1, m_size, infile ); + + fclose( infile ); + } + else + { + GLMDebugger(); // ouch + } + + } + else + { + // hmmmmmm + m_data = (char *)malloc(1); + m_data[0] = 0; + m_size = 0; + } +} + + +void CGLMFileMirror::WriteFile( void ) +{ + FILE *outfile = fopen( m_path, "wb" ); + + if (outfile) + { + fwrite( m_data, 1, m_size, outfile ); + fclose( outfile ); + + UpdateStatInfo(); // sets m_stat and m_exists + } + else + { + GLMDebugger(); // ouch + } +} + +void CGLMFileMirror::OpenInEditor( bool foreground ) +{ + char temp[64000]; + + // pass -b if no desire to bring editor to foreground + sprintf(temp,"/usr/bin/bbedit %s %s", foreground ? "" : "-b", m_path ); + system( temp ); +} + + + +CGLMEditableTextItem::CGLMEditableTextItem( char *text, uint size, bool forceOverwrite, char *prefix, char *suffix ) +{ + // clone input text (exact size copy) + m_origSize = size; + m_origText = (char *)malloc( m_origSize ); + memcpy( m_origText, text, m_origSize ); + + // null out munged form til we generate it + m_mungedSize = 0; + m_mungedText = NULL; + + // null out mirror until we create it + m_mirrorBaseName = NULL; + m_mirrorFullPath = NULL; + m_mirror = NULL; + + GenHashOfOrigText(); // will fill out m_origDigest + GenMungedText( false ); + GenBaseNameAndFullPath( prefix, suffix ); // figure out where the mirror will go + + if (!strcmp(m_mirrorBaseName, "96c7e9d2faf76b1148f7274afd684d4b.fsh")) + { + printf("\nhello there\n"); + } + + // make the mirror from the filename. + // see if there was any content on disk + // if so, honor that content *unless* the force-option is set. + m_mirror = new CGLMFileMirror( m_mirrorFullPath ); + + // the logic is simple. + // the only time we will choose the copy on disk, is if + // a - forceOverwrite is false + // AND b - the copy on disk is bigger than 10 bytes. + + bool replaceDiskCopy = true; + + char *mirrorData = NULL; + uint mirrorSize = 0; + + if (!forceOverwrite) + { + if (m_mirror->HasData()) + { + // peek at it, and use it if it is more than some minimum number of bytes. + m_mirror->GetData( &mirrorData, &mirrorSize ); + if (mirrorSize > 10) + { + replaceDiskCopy = false; + } + } + } + + if (replaceDiskCopy) + { + // push our generated data to the mirror - disk copy is overwritten + m_mirror->SetData( m_mungedText, m_mungedSize ); + } + else + { + GenMungedText( true ); + } + +} + +CGLMEditableTextItem::~CGLMEditableTextItem( ) +{ + if (m_origText) + { + free (m_origText); + } + + if (m_mungedText) + { + free (m_mungedText); + } + + if (m_mirrorBaseName) + { + free (m_mirrorBaseName); + } + + if (m_mirrorFullPath) + { + free (m_mirrorFullPath); + } + + if (m_mirror) + { + free( m_mirror ); + } +} + +bool CGLMEditableTextItem::HasData( void ) +{ + return m_mirror->HasData(); +} + +bool CGLMEditableTextItem::PollForChanges( void ) +{ + bool changed = m_mirror->PollForChanges(); + if (changed) + { + // re-gen munged text from mirror (means "copy") + GenMungedText( true ); + } + return changed; +} + +void CGLMEditableTextItem::GetCurrentText( char **textOut, uint *sizeOut ) +{ + if (!m_mungedText) GLMDebugger(); + + *textOut = m_mungedText; + *sizeOut = m_mungedSize; +} + +void CGLMEditableTextItem::OpenInEditor( bool foreground ) +{ + m_mirror->OpenInEditor( foreground ); +} + + +void CGLMEditableTextItem::GenHashOfOrigText( void ) +{ + // bring this code back if you need the live shader edit/debug mode. + #if 0 + MD5Context_t md5ctx; + MD5Init( &md5ctx ); + MD5Update( &md5ctx, (unsigned char*)m_origText, m_origSize ); + MD5Final( m_origDigest, &md5ctx ); + #endif +} + + +void CGLMEditableTextItem::GenBaseNameAndFullPath( char *prefix, char *suffix ) +{ + // bring this code back if you need the live shader edit/debug mode. + #if 0 + // base name is hash digest in hex, plus the suffix. + char temp[5000]; + + V_binarytohex( m_origDigest, sizeof(m_origDigest), temp, sizeof( temp ) ); + if (suffix) + { + strcat( temp, suffix ); + } + if (m_mirrorBaseName) free(m_mirrorBaseName); + m_mirrorBaseName = strdup( temp ); + + sprintf( temp, "%s%s", prefix, m_mirrorBaseName ); + if (m_mirrorFullPath) free(m_mirrorFullPath); + m_mirrorFullPath = strdup( temp ); + #endif +} + + +void CGLMEditableTextItem::GenMungedText( bool fromMirror ) +{ + if (fromMirror) + { + // just import the text as is from the mirror file. + + char *mirrorData = NULL; + uint mirrorSize = 0; + + if (m_mirror->HasData()) + { + // peek at it, and use it if it is more than some minimum number of bytes. + m_mirror->GetData( &mirrorData, &mirrorSize ); + + if (m_mungedText) + { + free( m_mungedText ); + m_mungedText = NULL; + } + + m_mungedText = (char *)malloc( mirrorSize+1 ); + m_mungedText[ mirrorSize ] = 0; + memcpy( m_mungedText, mirrorData, mirrorSize ); + + m_mungedSize = mirrorSize; + } + else + { + GLMDebugger(); + } + } + else + { + #if 1 + // we don't actually clone/munge any more. + if (m_mungedText) + { + free( m_mungedText ); + m_mungedText = NULL; + } + + m_mungedText = (char *)malloc( m_origSize+1 ); + m_mungedText[ m_origSize ] = 0; + memcpy( m_mungedText, m_origText, m_origSize ); + + m_mungedSize = m_origSize; + + #else + // take pure 'orig' text that came in from the engine, and clone it + // do not clone the first line + char temp[100000]; + char *dst = temp; + char *lim = &temp[ sizeof(temp) ]; + + // zero temp + memset( temp, 0, sizeof(temp) ); + + // write orig text to temp + if (m_origSize >= (sizeof(temp)/2) ) + { + GLMDebugger(); + } + + memcpy( dst, m_origText, m_origSize ); + dst += m_origSize; + + // add a newline if the last character wasn't + if ( (*(dst-1)) != '\n' ) + { + *dst++ = '\n'; + } + + // walk orig text again and copy it over, with these caveats + // don't copy the first line + // insert a # before all the other lines. + char *src = temp; + + // walk to end of first line + char *firstNewline = strchr( src, '\n' ); + if (!firstNewline) + { + GLMDebugger(); + } + else + { + // advance 'src' to that newline- we're not copying the !! line + src = firstNewline; + } + + + // now walk the rest - insert a # after each newline + while( (dst < lim) && ((src-temp) < m_origSize) ) + { + switch( *src ) + { + case '\n': + *dst++ = *src++; + *dst++ = '#'; + break; + + default: + *dst++ = *src++; + } + } + if (dst >= lim) + { + GLMDebugger(); + } + + // final newline + *dst++ = '\n'; + + // copyout + if (m_mungedText) + { + free( m_mungedText ); + m_mungedText = NULL; + } + + m_mungedSize = dst - temp; + m_mungedText = (char *)malloc( m_mungedSize ); + memcpy( m_mungedText, temp, m_mungedSize ); + #endif + } +} + +//=============================================================================== + +// class for cracking multi-part text blobs +// sections are demarcated by beginning-of-line markers submitted in a table by the caller +// typically +// asm flavors have first-line rules so we use those tags as is +// !!ARBvp (etc) +// !!ARBfp (etc) +// //!!GLSLF // slashes required +// //!GLSLV + +// maybe also introduce "present but disabled" markers like these +// -!!ARBvp (etc) +// -!!ARBfp (etc) +// -//!!GLSLF +// -//!GLSLV + +// resolved. there is no default section for text that doesn't have a marker in front of it. mark it or miss it. + +CGLMTextSectioner::CGLMTextSectioner( const char *text, int textLength, const char **markers ) +{ + // find lines + // for each line, see if it starts with a marker + // if so, open a new section based at that line + + GLMTextSection *curSection = NULL; // no current section until we see a marker + + const char *cursor = text; + const char *textLimit = text+textLength; + + int foundMarker; + const char **markerCursor; + while( cursor < textLimit ) + { + // top of loop. cursor points to start of a line. + // find the end of the line and keep that handy. + const char *eol = strchr( cursor, '\n' ); + int charsInLine = (eol) ? (eol-cursor)+1 : strlen(cursor); + + //see if any of the marker strings is located here. + foundMarker = -1; + markerCursor = markers; + + while( (foundMarker<0) && (*markerCursor!=NULL) ) + { + // see if the n'th marker is a hit + int markerLen = strlen(*markerCursor); + + if (!strncmp( cursor, *markerCursor, markerLen ) ) + { + // hit + foundMarker = markerCursor - markers; + } + markerCursor++; + } + + // outcome is either "marker spotted" or "no". + // if marker seen, open new section using that marker. + // else, grow active section if underway. + // then, move cursor to next line. + + if (foundMarker >= 0) + { + // found marker. start new section. + // no need to do anything special with prior section - it was up to date before seeing this marker. + GLMTextSection temp; + + temp.m_markerIndex = foundMarker; + temp.m_textOffset = cursor - text; // text includes the marker + temp.m_textLength = charsInLine; // this line goes in the tally, later lines add to it + + m_sectionTable.push_back( temp ); + + curSection = &m_sectionTable[ m_sectionTable.size() - 1 ]; + } + else + { + // add this line to current section if live + if (curSection) + { + curSection->m_textLength += charsInLine; + } + } + cursor += charsInLine; + } +} + +CGLMTextSectioner::~CGLMTextSectioner( ) +{ + // not much to do. +} + + +int CGLMTextSectioner::Count( void ) +{ + return m_sectionTable.size(); +} + +void CGLMTextSectioner::GetSection( int index, uint *offsetOut, uint *lengthOut, int *markerIndexOut ) +{ + Assert( index < m_sectionTable.Count() ); + + GLMTextSection *section = &m_sectionTable[ index ]; + + *offsetOut = section->m_textOffset; + *lengthOut = section->m_textLength; + *markerIndexOut = section->m_markerIndex; +} + +//=============================================================================== + +// how to make a compiled-in font: +// a. type in a matrix of characters in your fav editor +// b. take a screen shot of the characters (128x128 pixels in this case) +// c. export as TIFF raw. +// d. hex dump it +// e. column-copy just the hex data +// f. find and replace: chop out all the spaces and line feeds, change FFFFFF and 000000 to your marker chars of choice. +// g. wrap each line with quotes and a comma. + +unsigned char g_glmDebugFontMap[ 128 * 128 ] = +{ +" * " +" * * * * * " +" * * * * * *** * * ** * * * * * " +" * * * ***** * * * * * * * * * * * * * * * * " +" * * * * * * * * * * * * * *** * * " +" * ***** *** * * * * * * * ***** ***** * " +" * * * * * * * * * * * * * * * " +" * * * * * * * * * * * ** ** * " +" * *** * * ** * * * ** ** * " +" * * * * * " +" * " +" " +" " +" *** * *** *** * ***** *** ***** *** *** * * *** " +"* * ** * * * * ** * * * * * * * ** ** * * * * " +"* ** * * * * * **** **** * * * * * ** ** * ***** * * " +"* * * * * ** * * * * * * *** * * * * * " +"** * * * * ***** * * * * * * **** * ***** * * " +"* * * * * * * * * * * * * * * ** ** * * " +" *** * ***** *** * *** *** * *** *** ** ** * * * " +" * " +" * " +" " +" *** " +"* * *** **** *** **** ***** ***** *** * * * * * * * * * * * *** " +"* * * * * * * * * * * * * * * * * * * * * ** ** ** * * * " +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * " +"*** * ***** **** * * * **** **** * ** ***** * * ** * * * * ** * * " +"* ** * * * * * * * * * * * * * * * * * * * * * * * * * " +"* * * * * * * * * * * * * * * * * * * * * * * * * * * " +"* * * * **** *** **** ***** * *** * * * *** * * ***** * * * * *** " +" *** " +" " +" * " +" ** * ** * " +"**** *** **** *** ***** * * * * * * * * * * ***** * * * * * " +"* * * * * * * * * * * * * * * * * * * * * * * * * " +"* * * * * * * * * * * * * * * * * * * * * " +"**** * * **** *** * * * * * * * * * * * * * * " +"* * * * * * * * * * * * * * * * * * * * " +"* * * * * * * * * * * ** ** * * * * * * * " +"* *** * * *** * *** * * * * * * ***** * * * ****** " +" * ** * ** " +" " +" " +" * " +" * * * ** * * * * * " +" * * * * * * * " +" **** **** *** **** *** *** **** **** * * * * * **** * ** *** " +" * * * * * * * * * * * * * * * * * * * * * * * ** * * * " +" * * * * * * * ***** * * * * * * * *** * * * * * * * * " +" * ** * * * * * * * * * * * * * * * * * * * * * * * " +" ** * **** **** **** **** * **** * * * * * * ** * * * * * *** " +" * * " +" *** ** " +" * " +" ** * ** " +" * * * * ** * " +" * * * * * ** *** " +"**** **** * ** **** **** * * * * * * * * * * * ***** * * * ***** " +"* * * * ** * * * * * * * * * * * * * * * ** * ** ***** " +"* * * * * *** * * * * * * * * * * * * * * * ***** " +"* * * * * * * * ** * * * * * * * * * * * * * *** " +"**** **** * **** ** ** * * * * * * **** ***** * * * " +"* * * ** * ** " +"* * *** * " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +}; + + + + + + + + diff --git a/external/steamworks/glmgr/glmgrbasics.h b/external/steamworks/glmgr/glmgrbasics.h new file mode 100644 index 0000000..574ed81 --- /dev/null +++ b/external/steamworks/glmgr/glmgrbasics.h @@ -0,0 +1,512 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ +// +// glmgrbasics.h +// types, common headers, forward declarations, utilities +// +//=============================================================================== + +#ifndef GLMBASICS_H +#define GLMBASICS_H + +#pragma once + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +//#include +#include +#include +#include + +#include "imageformat.h" +#include "glmdebug.h" + +#ifndef Assert +#define Assert(x) +#endif + +//=============================================================================== + +// some portability shims to eliminate dependencies on partcular segments of Valve code + +typedef int8_t int8; +typedef uint8_t uint8; +typedef int16_t int16; +typedef uint16_t uint16; +typedef int32_t int32; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; + +class CUtlBuffer +{ +public: + enum BufferFlags_t + { + TEXT_BUFFER = 0x1, // Describes how get + put work (as strings, or binary) + //EXTERNAL_GROWABLE = 0x2, // This is used w/ external buffers and causes the utlbuf to switch to reallocatable memory if an overflow happens when Putting. + //CONTAINS_CRLF = 0x4, // For text buffers only, does this contain \n or \n\r? + //READ_ONLY = 0x8, // For external buffers; prevents null termination from happening. + //AUTO_TABS_DISABLED = 0x10, // Used to disable/enable push/pop tabs + }; + + CUtlBuffer( int growSize = 0, int initSize = 0, int nFlags = 0 ) + { + // grow size and init flags are ignored. + m_buf.reserve( initSize ); + }; + + CUtlBuffer( const void* pBuffer, int size, int nFlags = 0 ) + { + m_buf.reserve ( size ); + memcpy( &m_buf[0], pBuffer, size ); + } + + // This one isn't actually defined so that we catch contructors that are trying to pass a bool in as the third param. + CUtlBuffer( const void *pBuffer, int size, bool crap ); + + ~CUtlBuffer() + { + } + + char* Base( void ) + { + return &m_buf[0]; + } + + uint32 Size( void ) + { + return m_buf.size(); + } + + void EnsureCapacity( int num ) + { + m_buf.resize( num ); + } + + void AppendString( const char* pString ) + { + int appendlen = strlen( pString ); // count of characters, null terminator not included + if (Size()) + { + // append to non empty string + EnsureCapacity( Size() + appendlen + 1); + //printf("\n **(a) appending \n---\n%s\n---\n to \n---\n%s\n---\n", pString, Base() ); + strcat( Base(), pString ); // gets NULL terminated + } + else + { + EnsureCapacity( Size() + appendlen + 1); + //printf("\n **(b) appending \n---\n%s\n---\n to \n---\n%s\n---\n", pString, Base() ); + strcpy( Base(), pString ); + } + } + +private: + CUtlBuffer(); + + std::vector m_buf; +}; + +class CUtlString +{ +public: + CUtlString() + { + m_str = ""; + } + + CUtlString( const char *str ) + { + m_str = std::string( str ); + } + + ~CUtlString( ) + { + } + + const char* String( void ) + { + return m_str.c_str(); + } + + operator const char * () { return m_str.c_str(); } //conversion operator + +private: + + std::string m_str; +}; + +#undef ARRAYSIZE +#define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0])) + +#define strcat_s(dst,lim,src) strcat(dst,src ) + +#define V_strcat(dst,lim,src) strcat(dst,src) +#define V_vsnprintf(a,b,c,d) vsprintf(a,c,d) // double check this +#define V_snprintf snprintf +#define V_strncpy strncpy +#define V_strcmp strcmp +#define V_strlen strlen +#define V_strstr strstr +#define __cdecl + +#define V_memset(dst,count,val) memset(dst,count,val) + +int V_stricmp(const char *s1, const char *s2 ); +char const* V_stristr( char const* pStr, char const* pSearch ); + +//=============================================================================== +// types + + // 3-d integer box (used for texture lock/unlock etc) +struct GLMRegion +{ + int xmin,xmax; + int ymin,ymax; + int zmin,zmax; +}; + +struct GLMRect // follows GL convention - if coming from the D3D rect you will need to fiddle the Y's +{ + int xmin; // left + int ymin; // bottom + int xmax; // right + int ymax; // top +}; + +// macros + +//#define GLMassert(x) assert(x) + +// forward decls +class GLMgr; // singleton +class GLMContext; // GL context +class CGLMContextTester; // testing class +class CGLMTex; +class CGLMFBO; +class CGLMProgram; +class CGLMBuffer; + + +// utilities + +typedef enum +{ + // D3D codes + eD3D_DEVTYPE, + eD3D_FORMAT, + eD3D_RTYPE, + eD3D_USAGE, + eD3D_RSTATE, // render state + eD3D_SIO, // D3D shader bytecode + eD3D_VTXDECLUSAGE, + + // CGL codes + eCGL_RENDID, + + // OpenGL error codes + eGL_ERROR, + + // OpenGL enums + eGL_ENUM, + eGL_RENDERER + +} GLMThing_t; + +const char* GLMDecode( GLMThing_t type, unsigned long value ); // decode a numeric const +const char* GLMDecodeMask( GLMThing_t type, unsigned long value ); // decode a bitmask + +void GLMStop( void ); // aka Debugger() +void GLMCheckError( bool noStop = false, bool noLog= false ); +void GLMEnableTrace( bool on ); + +//=============================================================================== +// debug channels + +enum EGLMDebugChannel +{ + ePrintf, + eDebugger, + eGLProfiler +}; + +#if GLMDEBUG + // make all these prototypes disappear in non GLMDEBUG + void GLMDebugInitialize( bool forceReinit=false ); + + bool GLMDetectOGLP( void ); + bool GLMDetectGDB( void ); + uint GLMDetectAvailableChannels( void ); + + uint GLMDebugChannelMask( uint *newValue = NULL ); + // note that GDB and OGLP can both come and go during run - forceCheck will allow that to be detected. + // mask returned is in form of 1< < + eComment, // 3 one off messages --- + eMatrixData, // 4 matrix data -M- + eShaderData, // 5 shader data (params) -S- + eFrameBufData, // 6 FBO data (attachments) -F- + eDXStuff, // 7 dxabstract spew -X- + eAllocations, // 8 tracking allocs and frees -A- + eSlowness, // 9 slow things happening (srgb flips..) -Z- + eDefaultFlavor, // not specified (no marker) + eFlavorCount +}; +uint GLMDebugFlavorMask( uint *newValue = NULL ); + +//=============================================================================== +// output functions + +// make all these prototypes disappear in non GLMDEBUG +#if GLMDEBUG + // these are unconditional outputs, they don't interrogate the string + void GLMStringOut( const char *string ); + void GLMStringOutIndented( const char *string, int indentColumns ); + + // these will look at the string to guess its flavor: <, >, ---, -M-, -S- + void GLMPrintfVA( const char *fmt, va_list vargs ); + void GLMPrintf( const char *fmt, ... ); + + // these take an explicit flavor with a default value + void GLMPrintStr( const char *str, EGLMDebugFlavor flavor = eDefaultFlavor ); + + #define GLMPRINTTEXT_NUMBEREDLINES 0x80000000 + void GLMPrintText( const char *str, EGLMDebugFlavor flavor = eDefaultFlavor, uint options=0 ); // indent each newline + + int GLMIncIndent( int indentDelta ); + int GLMGetIndent( void ); + void GLMSetIndent( int indent ); + +#endif + +// expose these in release now +// Mimic PIX events so we can decorate debug spew +void GLMBeginPIXEvent( const char *str ); +void GLMEndPIXEvent( void ); + +//=============================================================================== +// other stuff + +#if GLMDEBUG +inline void GLMDebugger( void ) +{ + if (GLMDebugChannelMask() & (1<%s", m_funcName ); + }; + + // more advanced version lets you pass args (i.e. called parameters or anything else of interest) + // no macro for this one, since no easy way to pass through the args as well as the funcname + GLMFuncLogger( const char *funcName, char *fmt, ... ) + { + m_funcName = funcName; + m_earlyOut = false; + + // this acts like GLMPrintf here + // all the indent policy is down in GLMPrintfVA + // which means we need to inject a ">" at the front of the format string to make this work... sigh. + + char modifiedFmt[2000]; + modifiedFmt[0] = '>'; + strcpy( modifiedFmt+1, fmt ); + + va_list vargs; + va_start(vargs, fmt); + GLMPrintfVA( modifiedFmt, vargs ); + va_end( vargs ); + } + + ~GLMFuncLogger( ) + { + if (m_earlyOut) + { + GLMPrintf( "<%s (early out)", m_funcName ); + } + else + { + GLMPrintf( "<%s", m_funcName ); + } + }; + + void EarlyOut( void ) + { + m_earlyOut = true; + }; + + const char *m_funcName; // set at construction time + bool m_earlyOut; +}; + +// handy macro to go with the function tracking class +#define GLM_FUNC GLMFuncLogger _logger_ ( __FUNCTION__ ) +#else +#define GLM_FUNC +#endif + + +// class to keep an in-memory mirror of a file which may be getting edited during run +class CGLMFileMirror +{ +public: + CGLMFileMirror( char *fullpath ); // just associates mirror with file. if file exists it will be read. + //if non existent it will be created with size zero + ~CGLMFileMirror( ); + + bool HasData( void ); // see if data avail + void GetData( char **dataPtr, uint *dataSizePtr ); // read it out + void SetData( char *data, uint dataSize ); // put data in (and write it to disk) + bool PollForChanges( void ); // check disk copy. If different, read it back in and return true. + + void UpdateStatInfo( void ); // make sure stat info is current for our file + void ReadFile( void ); + void WriteFile( void ); + + void OpenInEditor( bool foreground=false ); // pass TRUE if you would like the editor to pop to foreground + + /// how about a "wait for change" method.. + + char *m_path; // fullpath to file + bool m_exists; + struct stat m_stat; // stat results for the file (last time checked) + + char *m_data; // content of file + uint m_size; // length of content + +}; + +// class based on the file mirror, that makes it easy to edit them outside the app. + +// it receives an initial block of text from the engine, and hashes it. ("orig") +// it munges it by duplicating all the text after the "!!" line, and appending it in commented form. ("munged") +// a mirror file is activated, using a filename based on the hash from the orig text. +// if there is already content on disk matching that filename, use that content *unless* the 'blitz' parameter is set. +// (i.e. engine is instructing this subsystem to wipe out any old/modified variants of the text) + +#ifndef MD5_DIGEST_LENGTH +#define MD5_DIGEST_LENGTH 16 +#endif + +class CGLMEditableTextItem +{ +public: + CGLMEditableTextItem( char *text, uint size, bool forceOverwrite, char *prefix, char *suffix = NULL ); // create a text blob from text source, optional filename suffix + ~CGLMEditableTextItem( ); + + bool HasData( void ); + bool PollForChanges( void ); // return true if stale i.e. you need to get a new edition + void GetCurrentText( char **textOut, uint *sizeOut ); // query for read access to the active blob (could be the original, could be external edited copy) + void OpenInEditor( bool foreground=false ); // call user attention to this text + + // internal methods + void GenHashOfOrigText( void ); + void GenBaseNameAndFullPath( char *prefix, char *suffix ); + void GenMungedText( bool fromMirror ); + + // members + // orig + uint m_origSize; + char *m_origText; // what was submitted + unsigned char m_origDigest[MD5_DIGEST_LENGTH]; // digest of what was submitted + + // munged + uint m_mungedSize; + char *m_mungedText; // re-processed edition, initial content submission to the file mirror + + // mirror + char *m_mirrorBaseName; // generated from the hash of the orig text, plus the label / prefix + char *m_mirrorFullPath; // base name + CGLMFileMirror *m_mirror; // file mirror itself. holds "official" copy for GetCurrentText to return. +}; + + +// debug font +extern unsigned char g_glmDebugFontMap[16384]; + +// class for cracking multi-part text blobs +// sections are demarcated by beginning-of-line markers submitted in a table by the caller + +struct GLMTextSection +{ + int m_markerIndex; // based on table of markers passed in to constructor + uint m_textOffset; // where is the text - offset + int m_textLength; // how big is the section +}; + +class CGLMTextSectioner +{ +public: + CGLMTextSectioner( const char *text, int textSize, const char **markers ); // constructor finds all the sections + ~CGLMTextSectioner( ); + + int Count( void ); // how many sections found + void GetSection( int index, uint *offsetOut, uint *lengthOut, int *markerIndexOut ); + // find section, size, what marker + // note that more than one section can be marked similarly. + // so policy isn't made here, you walk the sections and decide what to do if there are dupes. + + //members + + //section table + std::vector< GLMTextSection > m_sectionTable; +}; + +#endif diff --git a/external/steamworks/glmgr/glmgrcocoa.mm b/external/steamworks/glmgr/glmgrcocoa.mm new file mode 100644 index 0000000..254b1a2 --- /dev/null +++ b/external/steamworks/glmgr/glmgrcocoa.mm @@ -0,0 +1,1550 @@ +//========= Copyright 1996-2009, Valve Corporation, All rights reserved. ============// +// +// Purpose: provide some call-out glue to ObjC from the C++ GLMgr code +// +// $Revision: $ +// $NoKeywords: $ +//=============================================================================// + + +#include +#undef MIN +#undef MAX +#define DONT_DEFINE_BOOL // Don't define BOOL! +//#include "tier0/threadtools.h" +//#include "tier1/interface.h" +//#include "tier1/strtools.h" +//#include "tier1/utllinkedlist.h" +#include "glmgr.h" + +// Debugger - 10.8 +// CGDisplayModeCopyPixelEncoding - 10.11 +// CGDisplayIOServicePort - 10.9 +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +//=============================================================================== + +void __checkgl__( void ) +{ +#if GLMDEBUG + GLenum errorcode = (GLenum)glGetError(); + if (errorcode != GL_NO_ERROR) + { + Debugger(); + printf("\nGL Error %d",errorcode); + } +#endif +} + + +void swap(GLMRendererInfo*& a, GLMRendererInfo*& b) +{ + GLMRendererInfo* temp = a; + a = b; + b = temp; +} + +void swap(GLMDisplayInfo*& a, GLMDisplayInfo*& b) +{ + GLMDisplayInfo* temp = a; + a = b; + b = temp; +} + +void swap(GLMDisplayMode*& a, GLMDisplayMode*& b) +{ + GLMDisplayMode* temp = a; + a = b; + b = temp; +} + +// ------------------------------------------------------------------------------------ // +// some helper functions + +// this one makes a new context +bool GLMDetectSLGU( void ); +bool GLMDetectSLGU( void ) +{ + CGLError cgl_error = (CGLError)0; + bool result = false; + + CGLContextObj oldctx = CGLGetCurrentContext(); + + static CGLPixelFormatAttribute attribs[] = + { + kCGLPFADoubleBuffer, + kCGLPFANoRecovery, + kCGLPFAAccelerated, + kCGLPFADepthSize, + (CGLPixelFormatAttribute)0, + kCGLPFAColorSize, + (CGLPixelFormatAttribute)32, + + (CGLPixelFormatAttribute)0 // list term + }; + + CGLPixelFormatObj pixfmtobj = NULL; + GLint npix; + + CGLContextObj ctxobj = NULL; + + cgl_error = CGLChoosePixelFormat( attribs, &pixfmtobj, &npix ); + if (!cgl_error) + { + // got pixel format, make a context + + cgl_error = CGLCreateContext( pixfmtobj, NULL, &ctxobj ); + if (!cgl_error) + { + CGLSetCurrentContext( ctxobj ); + + // now do the test + + _CGLContextParameter kCGLCPGCDMPEngine = ((_CGLContextParameter)1314); + + GLint dummyval = 0; + cgl_error = CGLGetParameter( CGLGetCurrentContext(), kCGLCPGCDMPEngine, &dummyval ); + + result = (!cgl_error); + + // all done, go back to old context, and destroy the temp one + CGLSetCurrentContext( oldctx ); + CGLDestroyContext( ctxobj ); + } + + // destroy the pixel format obj + CGLDestroyPixelFormat( pixfmtobj ); + } + + return result; +} + + +bool GLMDetectScaledResolveMode( uint osComboVersion, bool hasSLGU ); +bool GLMDetectScaledResolveMode( uint osComboVersion, bool hasSLGU ) +{ + bool result = false; + + // note this function assumes a current context on the renderer in question + // and that FB blit and SLGU are present.. + + if (!hasSLGU) + return false; + + if (osComboVersion <= 0x000A0604) // we know no one has it before 10.6.5 + return false; + + bool forceTrickyTest = true; // for debug + if ( (osComboVersion < 0x000A0606) || forceTrickyTest) + { + // make two FBO's + GLuint fbos[2]; + GLuint rbos[2]; + int extent = 64; + + // make two render buffers + + for( int fbi = 0; fbi < 2; fbi++ ) + { + glGenFramebuffersEXT( 1, &fbos[fbi] ); __checkgl__(); + glBindFramebufferEXT( fbi ? GL_DRAW_FRAMEBUFFER_EXT : GL_READ_FRAMEBUFFER_EXT , fbos[fbi] ); __checkgl__(); + + glGenRenderbuffersEXT( 1, &rbos[fbi] ); __checkgl__(); + glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, rbos[fbi] ); __checkgl__(); + + // make it multisampled if 0 + if (!fbi) + { + glRenderbufferStorageMultisampleEXT( GL_RENDERBUFFER_EXT, 2, GL_RGBA8, extent,extent ); __checkgl__(); + } + else + { + glRenderbufferStorageEXT( GL_RENDERBUFFER_EXT, GL_RGBA8, extent,extent ); __checkgl__(); + } + + // attach it + // #0 gets to be read and multisampled + // #1 gets to be draw and multisampled + glFramebufferRenderbufferEXT( fbi ? GL_DRAW_FRAMEBUFFER_EXT : GL_READ_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, rbos[fbi] ); __checkgl__(); + } + // now test + while( glGetError() ) // clear error queue + { + ; + } + + // now do the dummy blit + glBlitFramebufferEXT( 0,0,extent,extent, 0,0,extent,extent, GL_COLOR_BUFFER_BIT, XGL_SCALED_RESOLVE_FASTEST_EXT ); + + // type of error we get back lets us know what the outcome is. + // invalid enum error -> unsupported + // no error or invalid op -> supported + + GLenum errorcode = (GLenum)glGetError(); + switch(errorcode) + { + // expected outcomes. + + // positive + case GL_NO_ERROR: + case GL_INVALID_OPERATION: + result = true; // new scaled resolve detected + break; + + default: + result = false; // no scaled resolve + break; + } + + // unbind and wipe stuff + + glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, 0 ); __checkgl__(); + + for( int xfbi = 0; xfbi < 2; xfbi++ ) + { + // unbind FBO + glBindFramebufferEXT( xfbi ? GL_DRAW_FRAMEBUFFER_EXT : GL_READ_FRAMEBUFFER_EXT , 0 ); __checkgl__(); + + // del FBO and RBO + glDeleteFramebuffersEXT( 1, &fbos[xfbi] ); __checkgl__(); + glDeleteRenderbuffersEXT( 1, &rbos[xfbi] ); __checkgl__(); + } + } + else + { + // in 10.6.6 and later, just check for the ext string. + char *gl_ext_string = (char*)glGetString(GL_EXTENSIONS); + + result = strstr(gl_ext_string, "GL_EXT_framebuffer_multisample_blit_scaled") != NULL; + } + + return result; // no SLGU, no scaled resolve blit even possible +} + + +// ------------------------------------------------------------------------------------ // +// some glue to let GLMgr call into NS/ObjC classes. +// ------------------------------------------------------------------------------------ // + +bool NewNSGLContext( unsigned long *attribs, PseudoNSGLContextPtr nsglShareCtx, PseudoNSGLContextPtr *nsglCtxOut, CGLContextObj *cglCtxOut ) +{ + NSAutoreleasePool *tempPool = [[NSAutoreleasePool alloc] init ]; + NSOpenGLPixelFormat *pixFmt = NULL; + NSOpenGLContext *nsglCtx = NULL; + + bool result = true; // optimism + + if (result) + { + pixFmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:(NSOpenGLPixelFormatAttribute*)attribs]; + if (!pixFmt) + { + Debugger(); // bad news + result = false; + } + } + + if (result) + { + nsglCtx = [[NSOpenGLContext alloc] initWithFormat: pixFmt shareContext: (NSOpenGLContext*) nsglShareCtx ]; + if (!nsglCtx) + { + Debugger(); + result = false; + } + } + + if (result) + { + [nsglCtx makeCurrentContext]; + + *nsglCtxOut = nsglCtx; + *cglCtxOut = (CGLContextObj)[ (NSOpenGLContext*)nsglCtx CGLContextObj ]; + } + else + { + *nsglCtxOut = NULL; + *cglCtxOut = NULL; + } + + [tempPool release]; + + return result; +} + +CGLContextObj GetCGLContextFromNSGL( PseudoNSGLContextPtr nsglCtx ) +{ + return (CGLContextObj)[ (NSOpenGLContext*)nsglCtx CGLContextObj]; +} + +void DelNSGLContext( PseudoNSGLContextPtr nsglCtx ) +{ + [ (NSOpenGLContext*)nsglCtx release ]; +} + + + + +// ------------------------------------------------------------------------------------ // + +// GLMDisplayDB stuff hoisted from appframework (cocoamgr) + +//=============================================================================== +// GLMDisplayMode, GLMDisplayInfo, GLMRendererInfo, GLMDisplayDB methods + +GLMDisplayMode::GLMDisplayMode( uint width, uint height, uint refreshHz ) +{ + m_info.m_modePixelWidth = width; + m_info.m_modePixelHeight = height; + m_info.m_modeRefreshHz = refreshHz; +} + +GLMDisplayMode::~GLMDisplayMode() +{ + // empty +} + +void GLMDisplayMode::Dump( int which ) +{ + GLMPRINTF(("\n # %-2d width=%-4d height=%-4d refreshHz=%-2d", which, m_info.m_modePixelWidth, m_info.m_modePixelHeight, m_info.m_modeRefreshHz )); +} + + +//=============================================================================== + +GLMDisplayInfo::GLMDisplayInfo( CGDirectDisplayID displayID, CGOpenGLDisplayMask displayMask ) +{ + m_info.m_cgDisplayID = displayID; + m_info.m_glDisplayMask = displayMask; + + // extract info about this display such as pixel width and height + m_info.m_displayPixelWidth = (uint)CGDisplayPixelsWide( m_info.m_cgDisplayID ); + m_info.m_displayPixelHeight = (uint)CGDisplayPixelsHigh( m_info.m_cgDisplayID ); + + m_modes = NULL; +} + +GLMDisplayInfo::~GLMDisplayInfo( void ) +{ + if (m_modes) + { + // delete all the new'd display modes + for( std::vector< GLMDisplayMode * >::iterator p = m_modes->begin(); p != m_modes->end(); p++ ) + { + delete *p; + } + delete m_modes; + m_modes = NULL; + } +} + +struct DisplayModeLessThan +{ + bool operator ()(GLMDisplayMode *A, GLMDisplayMode *B) + { + bool bigger = false; + bool smaller = true; + + // check refreshrate - higher should win + if ( A->m_info.m_modeRefreshHz > B->m_info.m_modeRefreshHz ) + { + return bigger; + } + else if ( A->m_info.m_modeRefreshHz < B->m_info.m_modeRefreshHz ) + { + return smaller; + } + + // check area - larger mode should win + int areaa = A->m_info.m_modePixelWidth * A->m_info.m_modePixelHeight; + int areab = B->m_info.m_modePixelWidth * B->m_info.m_modePixelHeight; + + if ( areaa > areab ) + { + return bigger; + } + else if ( areaa < areab ) + { + return smaller; + } + + return false; // equal rank + } +}; + +void GLMDisplayInfo::PopulateModes( void ) +{ + Assert( !m_modes ); + m_modes = new std::vector< GLMDisplayMode* >; + + if ( CFArrayRef modeList = CGDisplayCopyAllDisplayModes( m_info.m_cgDisplayID, nullptr ) ) + { + // examine each mode + CFIndex count = CFArrayGetCount( modeList ); + + for (CFIndex i = 0; i < count; i++) + { + long depth = 0; + Boolean usable, stretched = false; + + CGDisplayModeRef mode= (CGDisplayModeRef)CFArrayGetValueAtIndex (modeList, i); + + CFStringRef pixEnc = CGDisplayModeCopyPixelEncoding(mode); + if(CFStringCompare(pixEnc, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) + depth = 32; + else if(CFStringCompare(pixEnc, CFSTR(IO16BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) + depth = 16; + else if(CFStringCompare(pixEnc, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) + depth = 8; + + usable = CGDisplayModeIsUsableForDesktopGUI( mode ); + uint32_t ioFlags = CGDisplayModeGetIOFlags(mode); + stretched = ioFlags & kDisplayModeStretchedFlag ? true : false; + + if ( usable && (!stretched) && (depth==32) ) + { + long modeHeight = CGDisplayModeGetHeight( mode ); + long modeWidth = CGDisplayModeGetWidth( mode ); + long refreshrate = CGDisplayModeGetRefreshRate( mode ); + + if ( (modeHeight >= 384) && (modeWidth >= 512) ) + { + GLMDisplayMode *newmode = new GLMDisplayMode( modeWidth, modeHeight, refreshrate ); + m_modes->push_back( newmode ); + } + } + CGDisplayModeRelease( mode ); + } + } + + // now sort the modes + // primary key is refresh rate + // secondary key is area + + sort( m_modes->begin(), m_modes->end(), DisplayModeLessThan() ); +} + + +void GLMDisplayInfo::Dump( int which ) +{ + GLMPRINTF(("\n #%d: GLMDisplayInfo @ %08x, cg-id=%p display-mask=%08x pixwidth=%d pixheight=%d", which, this, m_info.m_cgDisplayID, m_info.m_glDisplayMask, m_info.m_displayPixelWidth, m_info.m_displayPixelHeight )); + + int i=0; + for( std::vector< GLMDisplayMode * >::iterator p = m_modes->begin(); p != m_modes->end(); p++ ) + { + (*p)->Dump(i); + i++; + } +} + + +//=============================================================================== + +GLMRendererInfo::GLMRendererInfo( GLMRendererInfoFields *info ) +{ + NSAutoreleasePool *tempPool = [[NSAutoreleasePool alloc] init ]; + + // absorb info obtained so far by caller + m_info = *info; + m_displays = NULL; + + // gather more info using a dummy context + unsigned int attribs[] = + { + kCGLPFADoubleBuffer, kCGLPFANoRecovery, kCGLPFAAccelerated, + kCGLPFADepthSize, 0, + kCGLPFAColorSize, 32, + kCGLPFARendererID, static_cast(info->m_rendererID), + 0 + }; + + NSOpenGLPixelFormat *pixFmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:(NSOpenGLPixelFormatAttribute*)attribs]; + NSOpenGLContext *nsglCtx = [[NSOpenGLContext alloc] initWithFormat: pixFmt shareContext: NULL ]; + + [nsglCtx makeCurrentContext]; + + // run queries. + char *gl_ext_string = (char*)glGetString(GL_EXTENSIONS); + + uint vers = m_info.m_osComboVersion; + + //------------------------------------------------------------------- + // booleans + //------------------------------------------------------------------- + // gamma writes. + m_info.m_hasGammaWrites = true; + if ( vers < 0x000A0600 ) // pre 10.6.0, no SRGB write - see http://developer.apple.com/graphicsimaging/opengl/capabilities/GLInfo_1058.html + { + m_info.m_hasGammaWrites = false; + } + + if (m_info.m_atiR5xx) + { + m_info.m_hasGammaWrites = false; // it just don't, even post 10.6.3 + } + + // if CLI option for fake SRGB mode is enabled, turn off this cap, act like we do not have EXT FB SRGB + if (0 /* CommandLine()->FindParm("-glmenablefakesrgb") */) + { + m_info.m_hasGammaWrites = false; + } + + // extension string *could* be checked, but on 10.6.3 the ext string is not there, but the func *is* + + //------------------------------------------------------------------- + // mixed attach sizes for FBO + m_info.m_hasMixedAttachmentSizes = true; + if ( vers < 0x000A0603 ) // pre 10.6.3, no mixed attach sizes + { + m_info.m_hasMixedAttachmentSizes = false; + } + else + { + if (!strstr(gl_ext_string, "GL_ARB_framebuffer_object")) + { + // ARB_framebuffer_object not available + m_info.m_hasMixedAttachmentSizes = false; + } + } + // also check ext string + + //------------------------------------------------------------------- + // BGRA vert attribs + m_info.m_hasBGRA = true; + if ( vers < 0x000A0603 ) // pre 10.6.3, no BGRA attribs + { + m_info.m_hasBGRA = false; + } + else + { + if (!strstr(gl_ext_string, "EXT_vertex_array_bgra")) + { + // EXT_vertex_array_bgra not available + m_info.m_hasBGRA = false; + } + } + + //------------------------------------------------------------------- + m_info.m_hasNewFullscreenMode = true; + if ( vers < 0x000A0600 ) // pre 10.6.0, no clever window server full screen mode + { + m_info.m_hasNewFullscreenMode = false; + } + + //------------------------------------------------------------------- + m_info.m_hasNativeClipVertexMode = true; + // this one uses a heuristic, and allows overrides in case the heuristic is wrong + // or someone wants to try a beta driver or something. + + // known bad combinations get turned off here.. + + // any ATI hardware... + // TURNED OFF OS CHECK if (m_info.m_osComboVersion <= 0x000A0603) + // still believe to be broken in 10.6.4 + { + if (m_info.m_ati) + { + m_info.m_hasNativeClipVertexMode = false; + } + } + + // R500, forever.. + if (m_info.m_atiR5xx) + { + m_info.m_hasNativeClipVertexMode = false; + } + + // if user disabled them + if (0 /* CommandLine()->FindParm("-glmdisableclipplanes") */) + { + m_info.m_hasNativeClipVertexMode = false; + } + + // or maybe enabled them.. + if (0 /* CommandLine()->FindParm("-glmenableclipplanes") */) + { + m_info.m_hasNativeClipVertexMode = true; + } + + //------------------------------------------------------------------- + m_info.m_hasOcclusionQuery = true; + if (!strstr(gl_ext_string, "ARB_occlusion_query")) + { + m_info.m_hasOcclusionQuery = false; // you don't got it! + } + + //------------------------------------------------------------------- + m_info.m_hasFramebufferBlit = true; + if (!strstr(gl_ext_string, "EXT_framebuffer_blit")) + { + m_info.m_hasFramebufferBlit = false; // you know you don't got it! + } + + //------------------------------------------------------------------- + m_info.m_maxAniso = 4; //FIXME needs real query + + //------------------------------------------------------------------- + m_info.m_hasBindableUniforms = true; + if (!strstr(gl_ext_string, "EXT_bindable_uniform")) + { + m_info.m_hasBindableUniforms = false; + } + m_info.m_hasBindableUniforms = false; // hardwiring this path to false until we see how to accelerate it properly + + //------------------------------------------------------------------- + m_info.m_hasUniformBuffers = true; + if (!strstr(gl_ext_string, "ARB_uniform_buffer")) + { + m_info.m_hasUniformBuffers = false; + } + + //------------------------------------------------------------------- + // test for performance pack (10.6.4+) + + bool perfPackageDetected = GLMDetectSLGU(); + + if (perfPackageDetected) + { + m_info.m_hasPerfPackage1 = true; + } + + if (0 /* CommandLine()->FindParm("-glmenableperfpackage") */) // force it on + { + m_info.m_hasPerfPackage1 = true; + } + + if (0 /* CommandLine()->FindParm("-glmdisableperfpackage") */) // force it off + { + m_info.m_hasPerfPackage1 = false; + } + + + //------------------------------------------------------------------- + // runtime options that aren't negotiable once set + + m_info.m_hasDualShaders = 0; /*CommandLine()->FindParm("-glmdualshaders"); */ + + //------------------------------------------------------------------- + // "can'ts " + + m_info.m_cantBlitReliably = m_info.m_intel; //FIXME X3100&10.6.3 has problems blitting.. adjust this if bug fixed in 10.6.4 + if (0 /*CommandLine()->FindParm("-glmenabletrustblit") */) + { + m_info.m_cantBlitReliably = false; // we trust the blit, so set the cant-blit cap to false + } + if (0 /* CommandLine()->FindParm("-glmdisabletrustblit") */) + { + m_info.m_cantBlitReliably = true; // we do not trust the blit, so set the cant-blit cap to true + } + + //m_info.m_cantAttachSRGB = (m_info.m_nv && m_info.m_osComboVersion < 0x000A0600); //NV drivers won't accept SRGB tex on an FBO color target in 10.5.8 + //m_info.m_cantAttachSRGB = (m_info.m_ati && m_info.m_osComboVersion < 0x000A0600); //... does ATI have the same problem? + m_info.m_cantAttachSRGB = (m_info.m_osComboVersion < 0x000A0600); // across the board on 10.5.x actually.. + + // MSAA resolve issues + m_info.m_cantResolveFlipped = false; // initial stance + + if (m_info.m_nv) + { + // we're going to mark it 'broken' unless perf package 1 (10.6.4+) is present + if (!m_info.m_hasPerfPackage1) + { + m_info.m_cantResolveFlipped = true; + } + } + + // this is just the private assessment of whather scaled resolve is available. + // the activation of it will stay tied to the gl_minify_resolve_mode / gl_magnify_resolve_mode convars in glmgr + if ( 1 /* CommandLine()->FindParm("-gl_enable_scaled_resolve") */ ) + { + bool scaledResolveDetected = GLMDetectScaledResolveMode( m_info.m_osComboVersion, m_info.m_hasPerfPackage1 ); + m_info.m_cantResolveScaled = !scaledResolveDetected; + } + else + { + m_info.m_cantResolveScaled = true; + } + + // and you can force it to be "available" if you really want to.. + if ( 0 /* CommandLine()->FindParm("-gl_force_enable_scaled_resolve") */ ) + { + m_info.m_cantResolveScaled = false; + } + + // gamma decode impacting shader codegen + m_info.m_costlyGammaFlips = false; + if (m_info.m_osComboVersion < 0x000A0600) // if Leopard + m_info.m_costlyGammaFlips = true; + + if (m_info.m_atiR5xx) // or r5xx - always + m_info.m_costlyGammaFlips = true; + + if ( (m_info.m_atiR6xx) && (m_info.m_osComboVersion < 0x000A0605) ) // or r6xx prior to 10.6.5 + m_info.m_costlyGammaFlips = true; + + [nsglCtx release]; + [pixFmt release]; + + [tempPool release]; +} + +GLMRendererInfo::~GLMRendererInfo( void ) +{ + if (m_displays) + { + // delete all the new'd renderer infos that the table tracks + for( std::vector< GLMDisplayInfo * >::iterator p = m_displays->begin(); p != m_displays->end(); p++ ) + { + delete *p; + } + delete m_displays; + m_displays = NULL; + } +} + +struct DisplayInfoLessThan +{ + bool operator ()(GLMDisplayInfo *A, GLMDisplayInfo *B) + { + bool bigger = false; + bool smaller = true; + + // check main-ness - main should win + + uint maskOfMainDisplay = CGDisplayIDToOpenGLDisplayMask( CGMainDisplayID() ); + //Assert( maskOfMainDisplay==1 ); // just curious + + int mainscreena = (*A).m_info.m_glDisplayMask & maskOfMainDisplay; + int mainscreenb = (*B).m_info.m_glDisplayMask & maskOfMainDisplay; + + if ( mainscreena > mainscreenb ) + { + return bigger; + } + else if ( mainscreena < mainscreenb ) + { + return smaller; + } + + // check area - larger screen should win + int areaa = (*A).m_info.m_displayPixelWidth * (*A).m_info.m_displayPixelHeight; + int areab = (*B).m_info.m_displayPixelWidth * (*B).m_info.m_displayPixelHeight; + + if ( areaa > areab ) + { + return bigger; + } + else if ( areaa < areab ) + { + return smaller; + } + + return false; // equal rank + } +}; + +void GLMRendererInfo::PopulateDisplays( void ) +{ + Assert( !m_displays ); + m_displays = new std::vector< GLMDisplayInfo* >; + + for( int i=0; i<32; i++) + { + // check mask to see if the selected display intersects this renderer + CGOpenGLDisplayMask dspMask = (CGOpenGLDisplayMask)(1<= 512) && (CGDisplayPixelsHigh( cgid ) >= 384) ) + { + GLMDisplayInfo *newdisp = new GLMDisplayInfo( cgid, dspMask ); + m_displays->push_back( newdisp ); + } + } + } + + // now sort the table of displays. + sort( m_displays->begin(), m_displays->end(), DisplayInfoLessThan() ); + + // then go back and ask each display to populate its display mode table. + for( std::vector< GLMDisplayInfo * >::iterator p = m_displays->begin(); p != m_displays->end(); p++ ) + { + (*p)->PopulateModes(); + } +} + +const char *CheesyRendererDecode( uint value ) +{ + switch(value) + { + case 0x00020200 : return "Generic"; + case 0x00020400 : return "GenericFloat"; + case 0x00020600 : return "AppleSW"; + case 0x00021000 : return "ATIRage128"; + case 0x00021200 : return "ATIRadeon"; + case 0x00021400 : return "ATIRagePro"; + case 0x00021600 : return "ATIRadeon8500"; + case 0x00021800 : return "ATIRadeon9700"; + case 0x00021900 : return "ATIRadeonX1000"; + case 0x00021A00 : return "ATIRadeonX2000"; + case 0x00022000 : return "NVGeForce2MX"; + case 0x00022200 : return "NVGeForce3"; + case 0x00022400 : return "NVGeForceFX"; + case 0x00022600 : return "NVGeForce8xxx"; + case 0x00023000 : return "VTBladeXP2"; + case 0x00024000 : return "Intel900"; + case 0x00024200 : return "IntelX3100"; + case 0x00040000 : return "Mesa3DFX"; + + default: return "UNKNOWN"; + } +} + +extern const char *GLMDecode( GLMThing_t thingtype, unsigned long value ); + +void GLMRendererInfo::Dump( int which ) +{ + GLMPRINTF(("\n #%d: GLMRendererInfo @ %08x, renderer-id=%s(%08x) display-mask=%08x vram=%dMB", + which, this, + CheesyRendererDecode( m_info.m_rendererID & 0x00FFFF00 ), m_info.m_rendererID, + m_info.m_displayMask, + m_info.m_vidMemory >> 20 + )); + GLMPRINTF(("\n VendorID=%04x DeviceID=%04x Model=%s", + m_info.m_pciVendorID, + m_info.m_pciDeviceID, + m_info.m_pciModelString + )); + + int i=0; + for( std::vector< GLMDisplayInfo * >::iterator p = m_displays->begin(); p != m_displays->end(); p++ ) + { + (*p)->Dump(i); + i++; + } +} + + +//=============================================================================== + + +GLMDisplayDB::GLMDisplayDB ( void ) +{ + m_renderers = NULL; +} + +GLMDisplayDB::~GLMDisplayDB ( void ) +{ + if (m_renderers) + { + // delete all the new'd renderer infos that the table tracks + for( std::vector< GLMRendererInfo * >::iterator p = m_renderers->begin(); p != m_renderers->end(); p++ ) + { + delete (*p); + } + delete m_renderers; + m_renderers = NULL; + } +} + +struct RendererInfoLessThan +{ + bool operator ()(GLMRendererInfo *A, GLMRendererInfo *B) + { + bool bigger = false; + bool smaller = true; + + // check VRAM + if ( A->m_info.m_vidMemory > B->m_info.m_vidMemory ) + { + return bigger; + } + else if ( A->m_info.m_vidMemory < B->m_info.m_vidMemory ) + { + return smaller; + } + + // check MSAA limit + if ( A->m_info.m_maxSamples > B->m_info.m_maxSamples ) + { + return bigger; + } + else if ( A->m_info.m_maxSamples < B->m_info.m_maxSamples ) + { + return smaller; + } + + return false; // equal rank + } +}; + +void GLMDisplayDB::PopulateRenderers( void ) +{ + Assert( !m_renderers ); + m_renderers = new std::vector< GLMRendererInfo* >; + + // now walk the renderer list + // find the eligible ones and insert them into vector + // if more than one, sort the vector by desirability with favorite at 0 + // then ask each renderer object to populate its displays + + // turns out how you have to do this is to walk the display mask 1<: unknown error code: invalid display" + // we can fix that by getting the active display mask first. + if (!cgl_err) + { + // walk the renderers that can hit this display + // add to table if not already in table, and minimums met + + for( int j=0; j MAC_OS_X_VERSION_10_9 + NSOperatingSystemVersion osVersion = [[NSProcessInfo processInfo] operatingSystemVersion]; + vMajor = osVersion.majorVersion; + vMinor = osVersion.minorVersion; + vMinorMinor = osVersion.patchVersion; +#else + OSStatus gestalt_err = 0; + gestalt_err = Gestalt(gestaltSystemVersionMajor, &vMajor); + Assert(!gestalt_err); + + gestalt_err = Gestalt(gestaltSystemVersionMinor, &vMinor); + Assert(!gestalt_err); + + gestalt_err = Gestalt(gestaltSystemVersionBugFix, &vMinorMinor); + Assert(!gestalt_err); +#endif + //encode into one quantity - 10.6.3 becomes 0x000A0603 + fields.m_osComboVersion = (vMajor << 16) | (vMinor << 8) | (vMinorMinor); + + if (0 /* CommandLine()->FindParm("-fakeleopard") */) + { + // lie + fields.m_osComboVersion = 0x000A0508; + } + + if (fields.m_osComboVersion < 0x000A0508) + { + // no support below 10.5.8 + // we'll wind up with no valid renderers and give up + selected = false; + } + } + + if (selected) + { + // gather more info from IOKit + // cribbed from http://developer.apple.com/mac/library/samplecode/VideoHardwareInfo/listing3.html + + CFDataRef vendorID, deviceID, model; + io_registry_entry_t dspPort; + + // Get the I/O Kit service port for the display + dspPort = CGDisplayIOServicePort( cgid ); + + // Get the information for the device + // The vendor ID, device ID, and model are all available as properties of the hardware's I/O Kit service port + + vendorID = (CFDataRef)IORegistryEntrySearchCFProperty(dspPort,kIOServicePlane,CFSTR("vendor-id"), kCFAllocatorDefault,kIORegistryIterateRecursively | kIORegistryIterateParents); + deviceID = (CFDataRef)IORegistryEntrySearchCFProperty(dspPort,kIOServicePlane,CFSTR("device-id"), kCFAllocatorDefault,kIORegistryIterateRecursively | kIORegistryIterateParents); + model = (CFDataRef)IORegistryEntrySearchCFProperty(dspPort,kIOServicePlane,CFSTR("model"), kCFAllocatorDefault,kIORegistryIterateRecursively | kIORegistryIterateParents); + + // Send the appropriate data to the outputs checking to validate the data + if(vendorID) + { + fields.m_pciVendorID = *((UInt32*)CFDataGetBytePtr(vendorID)); + CFRelease( vendorID ); + vendorID = NULL; + } + else + { + fields.m_pciVendorID = 0; + } + + if(deviceID) + { + fields.m_pciDeviceID = *((UInt32*)CFDataGetBytePtr(deviceID)); + CFRelease( deviceID ); + deviceID = NULL; + } + else + { + fields.m_pciDeviceID = 0; + } + + if(model) + { + int length = CFDataGetLength(model); + (void)length; + + char *data = (char*)CFDataGetBytePtr(model); + strncpy( fields.m_pciModelString, data, sizeof(fields.m_pciModelString) ); + CFRelease( model ); + model = NULL; + } + else + { + strncpy( fields.m_pciModelString, "UnknownModel", sizeof(fields.m_pciModelString) ); + } + + + // iterate through IOAccelerators til we find one that matches the vendorid and deviceid of this renderer (ugh!) + // this provides the driver version string which can in turn be used to uniquely identify bad drivers and special case for them + // first example to date - forcing vsync on 10.6.4 + NV + + { + io_iterator_t ioIterator = (io_iterator_t)0; + kern_return_t ioResult = 0; + bool ioDone = false; + + ioResult = IOServiceGetMatchingServices( kIOMasterPortDefault, IOServiceMatching("IOAccelerator"), &ioIterator ); + if( ioResult == KERN_SUCCESS ) + { + io_service_t ioAccelerator = (io_service_t)0; + + while( ( !ioDone ) && ( ioAccelerator = IOIteratorNext( ioIterator ) ) ) + { + io_service_t ioDevice; + + ioDevice = 0; + ioResult = IORegistryEntryGetParentEntry( ioAccelerator, kIOServicePlane, &ioDevice); + + CFDataRef this_vendorID, this_deviceID; + + if(ioResult == KERN_SUCCESS) + { + this_vendorID = (CFDataRef)IORegistryEntryCreateCFProperty(ioDevice, CFSTR("vendor-id"), kCFAllocatorDefault, kNilOptions ); + this_deviceID = (CFDataRef)IORegistryEntryCreateCFProperty(ioDevice, CFSTR("device-id"), kCFAllocatorDefault, kNilOptions ); + + if (this_vendorID && this_deviceID) // null check.. + { + // see if it matches. if so, do our business (get the extended version string), set ioDone, call it a day + unsigned short this_vendorIDValue = *(unsigned short*)CFDataGetBytePtr(this_vendorID); + unsigned short this_deviceIDValue = *(unsigned short*)CFDataGetBytePtr(this_deviceID); + + if ( (fields.m_pciVendorID == this_vendorIDValue) && (fields.m_pciDeviceID == this_deviceIDValue) ) + { + // see if it matches. if so, do our business (get the extended version string), set ioDone, call it a day + unsigned short* this_vendorIDBytes = (unsigned short*)CFDataGetBytePtr( this_vendorID ); + unsigned short* this_deviceIDBytes = (unsigned short*)CFDataGetBytePtr( this_deviceID ); + + if (this_vendorIDBytes && this_deviceIDBytes) // null check... + { + this_vendorIDValue = *this_vendorIDBytes; + this_deviceIDValue = *this_deviceIDBytes; + + if ( (fields.m_pciVendorID == this_vendorIDValue) && (fields.m_pciDeviceID == this_deviceIDValue) ) + { + // match, stop looking + ioDone = true; + + // get extended info + CFStringRef this_ioglName = (CFStringRef)IORegistryEntryCreateCFProperty( ioAccelerator, CFSTR("IOGLBundleName"), kCFAllocatorDefault, kNilOptions ); + + NSString *bundlePath = [ NSString stringWithFormat:@"/System/Library/Extensions/%@.bundle", this_ioglName ]; + + NSDictionary* this_driverDict = [ [NSBundle bundleWithPath: bundlePath] infoDictionary ]; + if (this_driverDict) + { + NSString* this_driverInfo = [ this_driverDict objectForKey:@"CFBundleGetInfoString" ]; + if ( this_driverInfo ) + { + const char* theString = [ this_driverInfo UTF8String ]; + + strncpy(fields.m_driverInfoString, theString, sizeof( fields.m_driverInfoString ) ); + } + } + + // [bundlePath release]; + + CFRelease(this_ioglName); + } + } + + CFRelease(this_vendorID); + CFRelease(this_deviceID); + } + } + } + } + + IOObjectRelease(ioAccelerator); + } + + IOObjectRelease(ioIterator); + } + + // generate shorthand bools + switch( fields.m_pciVendorID ) + { + case 0x1002: //ATI + { + fields.m_ati = true; + + // http://www.pcidatabase.com/search.php?device_search_str=radeon&device_search.x=0&device_search.y=0&device_search=search+devices + + // Mac-relevant ATI R5xx PCI device ID's lie in this range: 0x7100 - 0x72FF + // X1600, X1900, X1950 + if ( (fields.m_pciDeviceID >= 0x7100) && (fields.m_pciDeviceID <= 0x72ff) ) + { + fields.m_atiR5xx = true; + } + + // R6xx PCI device ID's lie in these ranges: + // 0x94C1 - 0x9515 ... also 0x9581 - 0x9713 + // 2400HD, 2600HD, 3870, et al + if ( + ( (fields.m_pciDeviceID >= 0x94C1) && (fields.m_pciDeviceID <= 0x9515) ) + || ( (fields.m_pciDeviceID >= 0x9581) && (fields.m_pciDeviceID <= 0x9713) ) + ) + { + fields.m_atiR6xx = true; + } + + // R7xx PCI device ID's lie in: 0x9440 - 0x9460, also 9480-94b5. + // why there is an HD5000 at 9462, I dunno. Don't think that's an R8xx part. + if ( + ( (fields.m_pciDeviceID >= 0x9440) && (fields.m_pciDeviceID <= 0x9460) ) + || ( (fields.m_pciDeviceID >= 0x9480) && (fields.m_pciDeviceID <= 0x94B5) ) + ) + { + fields.m_atiR7xx = true; + } + + // R8xx: 0x6898-0x68BE + if ( (fields.m_pciDeviceID >= 0x6898) && (fields.m_pciDeviceID <= 0x68Be) ) + { + fields.m_atiR8xx = true; + } + + #if 0 + // turned off, but we could use this for cross check. + // we could also use the bit encoding of the renderer ID to ferret out a geberation clue. + + // string-scan for each generation + // this could be a lot better if we got the precise PCI ID's used and/or cross-ref'd that against the driver name + if (strstr("X1600", fields.m_pciModelString) || strstr("X1900", fields.m_pciModelString) || strstr("X1950", fields.m_pciModelString) ) + { + fields.m_atiR5xx = true; + } + + if (strstr("2600", fields.m_pciModelString) || strstr("3870", fields.m_pciModelString) || strstr("X2000", fields.m_pciModelString) ) + { + fields.m_atiR6xx = true; + } + + if (strstr("4670", fields.m_pciModelString) || strstr("4650", fields.m_pciModelString) || strstr("4850", fields.m_pciModelString)|| strstr("4870", fields.m_pciModelString) ) + { + fields.m_atiR7xx = true; + } + #endif + } + break; + + case 0x8086: //INTC + { + fields.m_intel = true; + + switch( fields.m_pciDeviceID ) + { + case 0x27A6: fields.m_intel95x = true; break; // GMA 950 + case 0x2A02: fields.m_intel3100 = true; break; // X3100 + + default: + { + if (fields.m_pciDeviceID > 0x2A02) // assume ascending ID's for newer devices + { + fields.m_intelNewer = true; + } + } + } + } + break; + + case 0x10DE: //NV + { + fields.m_nv = true; + + // G7x: 0x0391 0x393 0x0395 (7300/7600 GT) 0x009D (Quadro FX) + if ( (fields.m_pciDeviceID == 0x0391) || (fields.m_pciDeviceID == 0x0393) || (fields.m_pciDeviceID == 0x0395) || (fields.m_pciDeviceID == 0x009D) ) + { + fields.m_nvG7x = true; + } + + // G8x: 0400-04ff, also 0x5E1 (GTX280) through 0x08FF + if ( + ( (fields.m_pciDeviceID >= 0x0400) && (fields.m_pciDeviceID <= 0x04ff) ) + || ( (fields.m_pciDeviceID >= 0x05E1) && (fields.m_pciDeviceID <= 0x08ff) ) + ) + { + fields.m_nvG8x = true; + } + + if ( fields.m_pciDeviceID > 0x0900 ) + { + fields.m_nvNewer = true; + } + + // detect the specific revision of NV driver in 10.6.4 that caused all the grief + if (strstr(fields.m_driverInfoString, "1.6.16.11 (19.5.8f01)")) + { + fields.m_badDriver1064NV = true; + } + } + break; + } + } + + if (selected) + { + // dupe check + for( std::vector< GLMRendererInfo * >::iterator p = m_renderers->begin(); p != m_renderers->end(); p++ ) + { + uint rendid = (*p)->m_info.m_rendererID; + + if ( rendid == fields.m_rendererID ) + { + // don't add to table, it's a dupe + selected = false; + } + } + } + + if (selected) + { + // criteria check + if (fields.m_fullscreen==0) + selected = false; + if (fields.m_accelerated==0) + selected = false; + if (fields.m_windowed==0) + selected = false; + } + + // we need something here that will exclude the renderer if it does not have any good displays attached. + + Assert( fields.m_displayMask != 0 ); + + if (selected) + { + // add to table + // note this constructor makes a dummy context just long enough to query remaining fields in the m_info. + GLMRendererInfo *newinfo = new GLMRendererInfo( &fields ); + m_renderers->push_back( newinfo ); + } + } + if (cgl_rend) + { + CGLDestroyRendererInfo( cgl_rend ); + } + } + } + } + + // now sort the table. + sort( m_renderers->begin(), m_renderers->end(), RendererInfoLessThan() ); + + // then go back and ask each renderer to populate its display info table. + for( std::vector< GLMRendererInfo * >::iterator p = m_renderers->begin(); p != m_renderers->end(); p++ ) + { + (*p)->PopulateDisplays(); + } +} + +void GLMDisplayDB::PopulateFakeAdapters( uint realRendererIndex ) // fake adapters = one real adapter times however many displays are on it +{ + // presumption is that renderers have been populated. + Assert( GetRendererCount() > 0 ); + Assert( realRendererIndex < GetRendererCount() ); + + m_fakeAdapters.clear(); + + // for( int r = 0; r < GetRendererCount(); r++ ) + int r = realRendererIndex; + { + for( int d = 0; d < GetDisplayCount( r ); d++ ) + { + GLMFakeAdapter temp; + + temp.m_rendererIndex = r; + temp.m_displayIndex = d; + + m_fakeAdapters.push_back( temp ); + } + } +} + +void GLMDisplayDB::Populate(void) +{ + this->PopulateRenderers(); + + // passing in zero here, constrains the set of fake adapters (GL renderer + a display) to the ones using the highest ranked renderer. + //FIXME introduce some kind of convar allowing selection of other GPU's in the system. + + int realRendererIndex = 0; + + /* + if (CommandLine()->FindParm("-glmrenderer0")) + realRendererIndex = 0; + if (CommandLine()->FindParm("-glmrenderer1")) + realRendererIndex = 1; + if (CommandLine()->FindParm("-glmrenderer2")) + realRendererIndex = 2; + if (CommandLine()->FindParm("-glmrenderer3")) + realRendererIndex = 3; + */ + + if (realRendererIndex >= GetRendererCount()) + { + // fall back to 0 + realRendererIndex = 0; + } + + this->PopulateFakeAdapters( 0 ); + + #if GLMDEBUG + this->Dump(); + #endif +} + + + +int GLMDisplayDB::GetFakeAdapterCount( void ) +{ + return m_fakeAdapters.size(); +} + +bool GLMDisplayDB::GetFakeAdapterInfo( int fakeAdapterIndex, int *rendererOut, int *displayOut, GLMRendererInfoFields *rendererInfoOut, GLMDisplayInfoFields *displayInfoOut ) +{ + if (fakeAdapterIndex >= GetFakeAdapterCount() ) + { + *rendererOut = 0; + *displayOut = 0; + return true; // fail + } + + *rendererOut = m_fakeAdapters[fakeAdapterIndex].m_rendererIndex; + *displayOut = m_fakeAdapters[fakeAdapterIndex].m_displayIndex; + + bool rendResult = GetRendererInfo( *rendererOut, rendererInfoOut ); + bool dispResult = GetDisplayInfo( *rendererOut, *displayOut, displayInfoOut ); + + return rendResult || dispResult; +} + + +int GLMDisplayDB::GetRendererCount( void ) +{ + return m_renderers->size(); +} + +bool GLMDisplayDB::GetRendererInfo( int rendererIndex, GLMRendererInfoFields *infoOut ) +{ + memset( infoOut, 0, sizeof( GLMRendererInfoFields ) ); + + if (rendererIndex >= GetRendererCount()) + return true; // fail + + GLMRendererInfo *rendInfo = (*m_renderers)[rendererIndex]; + *infoOut = rendInfo->m_info; + + return false; +} + +int GLMDisplayDB::GetDisplayCount( int rendererIndex ) +{ + if (rendererIndex >= GetRendererCount()) + return 0; // fail + + GLMRendererInfo *rendInfo = (*m_renderers)[rendererIndex]; + + return rendInfo->m_displays->size(); +} + +bool GLMDisplayDB::GetDisplayInfo( int rendererIndex, int displayIndex, GLMDisplayInfoFields *infoOut ) +{ + memset( infoOut, 0, sizeof( GLMDisplayInfoFields ) ); + + if (rendererIndex >= GetRendererCount()) + return true; // fail + + if (displayIndex >= GetDisplayCount(rendererIndex)) + return true; // fail + + GLMDisplayInfo *displayInfo = (*(*m_renderers)[rendererIndex]->m_displays)[displayIndex]; + *infoOut = displayInfo->m_info; + + return false; +} + +int GLMDisplayDB::GetModeCount( int rendererIndex, int displayIndex ) +{ + if (rendererIndex >= GetRendererCount()) + return 0; // fail + + if (displayIndex >= GetDisplayCount(rendererIndex)) + return 0; // fail + + GLMDisplayInfo *displayInfo = (*(*m_renderers)[rendererIndex]->m_displays)[displayIndex]; + + return displayInfo->m_modes->size(); +} + +bool GLMDisplayDB::GetModeInfo( int rendererIndex, int displayIndex, int modeIndex, GLMDisplayModeInfoFields *infoOut ) +{ + memset( infoOut, 0, sizeof( GLMDisplayModeInfoFields ) ); + + if (rendererIndex >= GetRendererCount()) + return true; // fail + + if (displayIndex >= GetDisplayCount(rendererIndex)) + return true; // fail + + if (modeIndex >= GetModeCount(rendererIndex,displayIndex)) + return true; // fail + + if (modeIndex>=0) + { + GLMDisplayMode *displayModeInfo = (*(*(*m_renderers)[rendererIndex]->m_displays)[displayIndex]->m_modes)[ modeIndex ]; + *infoOut = displayModeInfo->m_info; + } + else + { + // passing modeIndex = -1 means "tell me about current mode".. + + GLMRendererInfo *rendInfo = (*m_renderers)[ rendererIndex ]; + GLMDisplayInfo *dispinfo = (*rendInfo ->m_displays)[displayIndex]; + CGDirectDisplayID cgid = dispinfo->m_info.m_cgDisplayID; + + CGDisplayModeRef cgMode = CGDisplayCopyDisplayMode( cgid ); + + // get the mode number from the mode dict (using system mode numbering, not our sorted numbering) + if (cgMode) + { + // grab the width and height, I am unclear on whether this is the displayed FB width or the display device width. + int screenWidth=CGDisplayModeGetWidth( cgMode ); + int screenHeight=CGDisplayModeGetHeight( cgMode ); + int refreshHz=CGDisplayModeGetRefreshRate( cgMode ); + + GLMPRINTF(( "-D- GLMDisplayDB::GetModeInfo sees mode-index=%d, width=%d, height=%d on CGID %08x (display index %d on rendererindex %d)", + modeIndex, + screenWidth, + screenHeight, + cgid, + displayIndex, + rendererIndex )); + + // now match + int foundIndex = -1; + (void)foundIndex; + + int i=0; + for( std::vector< GLMDisplayMode * >::iterator p = (*dispinfo).m_modes->begin(); p != (*dispinfo).m_modes->end(); p++ ) + { + GLMDisplayMode *mode = (*p); + + if (mode->m_info.m_modePixelWidth == screenWidth) + { + if (mode->m_info.m_modePixelHeight == screenHeight) + { + if (mode->m_info.m_modeRefreshHz == refreshHz) + { + foundIndex = i; + *infoOut = mode->m_info; + return false; + } + } + } + i++; + } + } + + // if we get here, we could not find the mode + memset( infoOut, 0, sizeof( *infoOut ) ); + return true; // fail + } + return false; +} + + +void GLMDisplayDB::Dump( void ) +{ + GLMPRINTF(("\n GLMDisplayDB @ %08x ",this )); + + int i=0; + for( std::vector< GLMRendererInfo * >::iterator p = m_renderers->begin(); p != m_renderers->end(); p++ ) + { + (*p)->Dump(i); + i++; + } +} + + diff --git a/external/steamworks/glmgr/glmgrext.cpp b/external/steamworks/glmgr/glmgrext.cpp new file mode 100644 index 0000000..7690b03 --- /dev/null +++ b/external/steamworks/glmgr/glmgrext.cpp @@ -0,0 +1,107 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ +// +// glmgrext.h +// helper file for extension testing and runtime importing of entry points +// +//=============================================================================== + +#include +#include +#include +#include +#include +#include "glmgr.h" + +PFNglColorMaskIndexedEXT pfnglColorMaskIndexedEXT; +PFNglEnableIndexedEXT pfnglEnableIndexedEXT; +PFNglDisableIndexedEXT pfnglDisableIndexedEXT; +PFNglGetFramebufferAttachmentParameteriv pfnglGetFramebufferAttachmentParameteriv; +PFNglUniformBufferEXT pfnglUniformBufferEXT; + +// NSSymbol was deprecated in 10.5. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +void * NSGLGetProcAddress (const char *name) +{ + NSSymbol symbol; + char *symbolName = (char *)malloc (strlen (name) + 2); + strcpy(symbolName + 1, name); + symbolName[0] = '_'; + symbol = NULL; + if (NSIsSymbolNameDefined (symbolName)) + symbol = NSLookupAndBindSymbol (symbolName); + free (symbolName); + return symbol ? NSAddressOfSymbol (symbol) : NULL; +} + +#pragma clang diagnostic pop + +void GLMSetupExtensions( void ) +{ + pfnglColorMaskIndexedEXT = (PFNglColorMaskIndexedEXT) NSGLGetProcAddress( "glColorMaskIndexedEXT" ); + pfnglEnableIndexedEXT = (PFNglEnableIndexedEXT) NSGLGetProcAddress( "glEnableIndexedEXT" ); + pfnglDisableIndexedEXT = (PFNglDisableIndexedEXT) NSGLGetProcAddress( "glDisableIndexedEXT" ); + + pfnglGetFramebufferAttachmentParameteriv = (PFNglGetFramebufferAttachmentParameteriv) NSGLGetProcAddress( "glGetFramebufferAttachmentParameteriv" ); + + pfnglUniformBufferEXT = (PFNglUniformBufferEXT) NSGLGetProcAddress( "glUniformBufferEXT" ); +} + +/* +#define INSTANTIATE_GL_IMPORTS +#include "glmgr.h" // will include glmgrext.h +#undef INSTANTIATE_GL_IMPORTS + + +// helper class for looking up function names +// see http://andrewtolbert.com/svn/personal/OpenGLSuperBible/shared/gltools.cpp +// also http://developer.apple.com/mac/library/DOCUMENTATION/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_entrypts/opengl_entrypts.html + +class CFunctionImporter +{ +public: + CFBundleRef m_bundle; + + CFunctionImporter( CFStringRef bundleID ) // for example CFSTR("com.apple.OpenGL") + { + m_bundle = CFBundleGetBundleWithIdentifier( bundleID ); + if ( m_bundle ) + CFRetain( m_bundle ); + } + + ~CFunctionImporter() + { + if( m_bundle ) + { + CFRelease(m_bundle); + m_bundle = NULL; + } + } + + void *FindFunctionByName(CFStringRef name) // ex CFSTR("glColorMaskedIndexedEXT") + { + void *result = NULL; + if (m_bundle) + { + result = CFBundleGetFunctionPointerForName(m_bundle, name); + } + return result; + } +}; + + +void GLMSetupExtensions( void ) +{ + CFunctionImporter importer( CFSTR("com.apple.OpenGL") ); + + #define DO_IMPORT(name) name = (name##FuncPtr)importer.FindFunctionByName( CFSTR(#name) ); + + #ifndef GL_EXT_draw_buffers2 + // FIXME we're not checking for the extension string yet, we're just grabbing func ptrs + DO_IMPORT(glColorMaskIndexedEXT); + DO_IMPORT(glEnableIndexedEXT); + DO_IMPORT(glDisableIndexedEXT); + #endif +} +*/ diff --git a/external/steamworks/glmgr/glmgrext.h b/external/steamworks/glmgr/glmgrext.h new file mode 100644 index 0000000..1b918ff --- /dev/null +++ b/external/steamworks/glmgr/glmgrext.h @@ -0,0 +1,101 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ +// +// glmgrext.h +// helper file for extension testing and runtime importing of entry points +// +//=============================================================================== + +#pragma once + +#include +#include + +// #define symbol INSTANTIATE_GL_IMPORTS controls whether the following macro "GL_IMPORT" writes externs or writes decls +// normally only glmgr.cpp sets that symbol and includes this file + +// to simplify usage, a function ptr type must exist for every entry point, following the name##FuncPtr convention. + +#ifdef INSTANTIATE_GL_IMPORTS + #define GL_IMPORT( name ) name##FuncPtr name = 0 +#else + #define GL_IMPORT( name ) extern name##FuncPtr name; +#endif + + +// before declaring each import, check to see if the EXT symbol is in effect, +// and if so, don't do it! + +#ifndef GL_EXT_draw_buffers2 + typedef void (* glColorMaskIndexedEXTFuncPtr) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); + typedef void (* glEnableIndexedEXTFuncPtr) (GLenum target, GLuint index); + typedef void (* glDisableIndexedEXTFuncPtr) (GLenum target, GLuint index); + + GL_IMPORT(glColorMaskIndexedEXT); + GL_IMPORT(glEnableIndexedEXT); + GL_IMPORT(glDisableIndexedEXT); +#endif + +#ifndef GL_EXT_framebuffer_sRGB + #define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 + #define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA +#endif + +#ifndef ARB_texture_rg + #define GL_COMPRESSED_RED 0x8225 + #define GL_COMPRESSED_RG 0x8226 + #define GL_RG 0x8227 + #define GL_RG_INTEGER 0x8228 + #define GL_R8 0x8229 + #define GL_R16 0x822A + #define GL_RG8 0x822B + #define GL_RG16 0x822C + #define GL_R16F 0x822D + #define GL_R32F 0x822E + #define GL_RG16F 0x822F + #define GL_RG32F 0x8230 + #define GL_R8I 0x8231 + #define GL_R8UI 0x8232 + #define GL_R16I 0x8233 + #define GL_R16UI 0x8234 + #define GL_R32I 0x8235 + #define GL_R32UI 0x8236 + #define GL_RG8I 0x8237 + #define GL_RG8UI 0x8238 + #define GL_RG16I 0x8239 + #define GL_RG16UI 0x823A + #define GL_RG32I 0x823B + #define GL_RG32UI 0x823C +#endif + +#ifndef GL_EXT_bindable_uniform + #define GL_UNIFORM_BUFFER_EXT 0x8DEE +#endif + +// unpublished extension enums (thus the "X") + +// from EXT_framebuffer_multisample_blit_scaled.. +#define XGL_SCALED_RESOLVE_FASTEST_EXT 0x90BA +#define XGL_SCALED_RESOLVE_NICEST_EXT 0x90BB + + +void * NSGLGetProcAddress (const char *name); + +// call this to find all the entry points. +void GLMSetupExtensions( void ); + + + +typedef void (*PFNglColorMaskIndexedEXT)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (*PFNglEnableIndexedEXT)(GLenum target, GLuint index); +typedef void (*PFNglDisableIndexedEXT)(GLenum target, GLuint index); +typedef void (*PFNglUniformBufferEXT)(GLuint program, GLint location, GLuint buffer); + +extern PFNglColorMaskIndexedEXT pfnglColorMaskIndexedEXT; +extern PFNglEnableIndexedEXT pfnglEnableIndexedEXT; +extern PFNglDisableIndexedEXT pfnglDisableIndexedEXT; +extern PFNglUniformBufferEXT pfnglUniformBufferEXT; + + +typedef void (*PFNglGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint *params); +extern PFNglGetFramebufferAttachmentParameteriv pfnglGetFramebufferAttachmentParameteriv; + diff --git a/external/steamworks/glmgr/imageformat.h b/external/steamworks/glmgr/imageformat.h new file mode 100644 index 0000000..3912fb8 --- /dev/null +++ b/external/steamworks/glmgr/imageformat.h @@ -0,0 +1,523 @@ +//===== Copyright 1996-2005, Valve Corporation, All rights reserved. ======// +// +// Purpose: +// +//===========================================================================// + +#ifndef IMAGEFORMAT_H +#define IMAGEFORMAT_H + +#ifdef _WIN32 +#pragma once +#endif + +#include + +enum NormalDecodeMode_t +{ + NORMAL_DECODE_NONE = 0, + NORMAL_DECODE_ATI2N = 1, + NORMAL_DECODE_ATI2N_ALPHA = 2 +}; + +// Forward declaration +#ifdef _WIN32 +typedef enum _D3DFORMAT D3DFORMAT; +#endif + +//----------------------------------------------------------------------------- +// The various image format types +//----------------------------------------------------------------------------- + +// don't bitch that inline functions aren't used!!!! +#pragma warning(disable : 4514) + +enum ImageFormat +{ + IMAGE_FORMAT_UNKNOWN = -1, + IMAGE_FORMAT_RGBA8888 = 0, + IMAGE_FORMAT_ABGR8888, + IMAGE_FORMAT_RGB888, + IMAGE_FORMAT_BGR888, + IMAGE_FORMAT_RGB565, + IMAGE_FORMAT_I8, + IMAGE_FORMAT_IA88, + IMAGE_FORMAT_P8, + IMAGE_FORMAT_A8, + IMAGE_FORMAT_RGB888_BLUESCREEN, + IMAGE_FORMAT_BGR888_BLUESCREEN, + IMAGE_FORMAT_ARGB8888, + IMAGE_FORMAT_BGRA8888, + IMAGE_FORMAT_DXT1, + IMAGE_FORMAT_DXT3, + IMAGE_FORMAT_DXT5, + IMAGE_FORMAT_BGRX8888, + IMAGE_FORMAT_BGR565, + IMAGE_FORMAT_BGRX5551, + IMAGE_FORMAT_BGRA4444, + IMAGE_FORMAT_DXT1_ONEBITALPHA, + IMAGE_FORMAT_BGRA5551, + IMAGE_FORMAT_UV88, + IMAGE_FORMAT_UVWQ8888, + IMAGE_FORMAT_RGBA16161616F, + IMAGE_FORMAT_RGBA16161616, + IMAGE_FORMAT_UVLX8888, + IMAGE_FORMAT_R32F, // Single-channel 32-bit floating point + IMAGE_FORMAT_RGB323232F, + IMAGE_FORMAT_RGBA32323232F, + + // Depth-stencil texture formats for shadow depth mapping + IMAGE_FORMAT_NV_DST16, // + IMAGE_FORMAT_NV_DST24, // + IMAGE_FORMAT_NV_INTZ, // Vendor-specific depth-stencil texture + IMAGE_FORMAT_NV_RAWZ, // formats for shadow depth mapping + IMAGE_FORMAT_ATI_DST16, // + IMAGE_FORMAT_ATI_DST24, // + IMAGE_FORMAT_NV_NULL, // Dummy format which takes no video memory + + // Compressed normal map formats + IMAGE_FORMAT_ATI2N, // One-surface ATI2N / DXN format + IMAGE_FORMAT_ATI1N, // Two-surface ATI1N format + +#if defined( _X360 ) + // Depth-stencil texture formats + IMAGE_FORMAT_X360_DST16, + IMAGE_FORMAT_X360_DST24, + IMAGE_FORMAT_X360_DST24F, + // supporting these specific formats as non-tiled for procedural cpu access + IMAGE_FORMAT_LINEAR_BGRX8888, + IMAGE_FORMAT_LINEAR_RGBA8888, + IMAGE_FORMAT_LINEAR_ABGR8888, + IMAGE_FORMAT_LINEAR_ARGB8888, + IMAGE_FORMAT_LINEAR_BGRA8888, + IMAGE_FORMAT_LINEAR_RGB888, + IMAGE_FORMAT_LINEAR_BGR888, + IMAGE_FORMAT_LINEAR_BGRX5551, + IMAGE_FORMAT_LINEAR_I8, + IMAGE_FORMAT_LINEAR_RGBA16161616, + + IMAGE_FORMAT_LE_BGRX8888, + IMAGE_FORMAT_LE_BGRA8888, +#endif + + NUM_IMAGE_FORMATS +}; + +#if defined( POSIX ) || defined( DX_TO_GL_ABSTRACTION ) +typedef enum _D3DFORMAT + { + D3DFMT_INDEX16, + D3DFMT_D16, + D3DFMT_D24S8, + D3DFMT_A8R8G8B8, + D3DFMT_A4R4G4B4, + D3DFMT_X8R8G8B8, + D3DFMT_R5G6R5, + D3DFMT_X1R5G5B5, + D3DFMT_A1R5G5B5, + D3DFMT_L8, + D3DFMT_A8L8, + D3DFMT_A, + D3DFMT_DXT1, + D3DFMT_DXT3, + D3DFMT_DXT5, + D3DFMT_V8U8, + D3DFMT_Q8W8V8U8, + D3DFMT_X8L8V8U8, + D3DFMT_A16B16G16R16F, + D3DFMT_A16B16G16R16, + D3DFMT_R32F, + D3DFMT_A32B32G32R32F, + D3DFMT_R8G8B8, + D3DFMT_D24X4S4, + D3DFMT_A8, + D3DFMT_R5G6B5, + D3DFMT_D15S1, + D3DFMT_D24X8, + D3DFMT_VERTEXDATA, + D3DFMT_INDEX32, + + // adding fake D3D format names for the vendor specific ones (eases debugging/logging) + + // NV shadow depth tex + D3DFMT_NV_INTZ = 0x5a544e49, // MAKEFOURCC('I','N','T','Z') + D3DFMT_NV_RAWZ = 0x5a574152, // MAKEFOURCC('R','A','W','Z') + + // NV null tex + D3DFMT_NV_NULL = 0x4c4c554e, // MAKEFOURCC('N','U','L','L') + + // ATI shadow depth tex + D3DFMT_ATI_D16 = 0x36314644, // MAKEFOURCC('D','F','1','6') + D3DFMT_ATI_D24S8 = 0x34324644, // MAKEFOURCC('D','F','2','4') + + // ATI 1N and 2N compressed tex + D3DFMT_ATI_2N = 0x32495441, // MAKEFOURCC('A', 'T', 'I', '2') + D3DFMT_ATI_1N = 0x31495441, // MAKEFOURCC('A', 'T', 'I', '1') + + D3DFMT_UNKNOWN + } D3DFORMAT; +#endif + +//----------------------------------------------------------------------------- +// Color structures +//----------------------------------------------------------------------------- + +struct BGRA8888_t +{ + unsigned char b; // change the order of names to change the + unsigned char g; // order of the output ARGB or BGRA, etc... + unsigned char r; // Last one is MSB, 1st is LSB. + unsigned char a; + inline BGRA8888_t& operator=( const BGRA8888_t& in ) + { + *( unsigned int * )this = *( unsigned int * )∈ + return *this; + } +}; + +struct RGBA8888_t +{ + unsigned char r; // change the order of names to change the + unsigned char g; // order of the output ARGB or BGRA, etc... + unsigned char b; // Last one is MSB, 1st is LSB. + unsigned char a; + inline RGBA8888_t& operator=( const BGRA8888_t& in ) + { + r = in.r; + g = in.g; + b = in.b; + a = in.a; + return *this; + } +}; + +struct RGB888_t +{ + unsigned char r; + unsigned char g; + unsigned char b; + inline RGB888_t& operator=( const BGRA8888_t& in ) + { + r = in.r; + g = in.g; + b = in.b; + return *this; + } + inline bool operator==( const RGB888_t& in ) const + { + return ( r == in.r ) && ( g == in.g ) && ( b == in.b ); + } + inline bool operator!=( const RGB888_t& in ) const + { + return ( r != in.r ) || ( g != in.g ) || ( b != in.b ); + } +}; + +struct BGR888_t +{ + unsigned char b; + unsigned char g; + unsigned char r; + inline BGR888_t& operator=( const BGRA8888_t& in ) + { + r = in.r; + g = in.g; + b = in.b; + return *this; + } +}; + +// 360 uses this structure for x86 dxt decoding +#if defined( _X360 ) +#pragma bitfield_order( push, lsb_to_msb ) +#endif +struct BGR565_t +{ + unsigned short b : 5; // order of names changes + unsigned short g : 6; // byte order of output to 32 bit + unsigned short r : 5; + inline BGR565_t& operator=( const BGRA8888_t& in ) + { + r = in.r >> 3; + g = in.g >> 2; + b = in.b >> 3; + return *this; + } + inline BGR565_t &Set( int red, int green, int blue ) + { + r = red >> 3; + g = green >> 2; + b = blue >> 3; + return *this; + } +}; +#if defined( _X360 ) +#pragma bitfield_order( pop ) +#endif + +struct BGRA5551_t +{ + unsigned short b : 5; // order of names changes + unsigned short g : 5; // byte order of output to 32 bit + unsigned short r : 5; + unsigned short a : 1; + inline BGRA5551_t& operator=( const BGRA8888_t& in ) + { + r = in.r >> 3; + g = in.g >> 3; + b = in.b >> 3; + a = in.a >> 7; + return *this; + } +}; + +struct BGRA4444_t +{ + unsigned short b : 4; // order of names changes + unsigned short g : 4; // byte order of output to 32 bit + unsigned short r : 4; + unsigned short a : 4; + inline BGRA4444_t& operator=( const BGRA8888_t& in ) + { + r = in.r >> 4; + g = in.g >> 4; + b = in.b >> 4; + a = in.a >> 4; + return *this; + } +}; + +struct RGBX5551_t +{ + unsigned short r : 5; + unsigned short g : 5; + unsigned short b : 5; + unsigned short x : 1; + inline RGBX5551_t& operator=( const BGRA8888_t& in ) + { + r = in.r >> 3; + g = in.g >> 3; + b = in.b >> 3; + return *this; + } +}; + +//----------------------------------------------------------------------------- +// some important constants +//----------------------------------------------------------------------------- +#define ARTWORK_GAMMA ( 2.2f ) +#define IMAGE_MAX_DIM ( 2048 ) + + +//----------------------------------------------------------------------------- +// information about each image format +//----------------------------------------------------------------------------- +struct ImageFormatInfo_t +{ + char* m_pName; + int m_NumBytes; + int m_NumRedBits; + int m_NumGreeBits; + int m_NumBlueBits; + int m_NumAlphaBits; + bool m_IsCompressed:1; + bool m_IsFloat:1; +}; + + +//----------------------------------------------------------------------------- +// Various methods related to pixelmaps and color formats +//----------------------------------------------------------------------------- +namespace ImageLoader +{ + + bool GetInfo( const char *fileName, int *width, int *height, enum ImageFormat *imageFormat, float *sourceGamma ); + int GetMemRequired( int width, int height, int depth, ImageFormat imageFormat, bool mipmap ); + int GetMipMapLevelByteOffset( int width, int height, enum ImageFormat imageFormat, int skipMipLevels, int nDepth = 1 ); + void GetMipMapLevelDimensions( int *width, int *height, int skipMipLevels ); + int GetNumMipMapLevels( int width, int height, int depth = 1 ); + bool Load( unsigned char *imageData, const char *fileName, int width, int height, enum ImageFormat imageFormat, float targetGamma, bool mipmap ); + bool Load( unsigned char *imageData, FILE *fp, int width, int height, + enum ImageFormat imageFormat, float targetGamma, bool mipmap ); + + // convert from any image format to any other image format. + // return false if the conversion cannot be performed. + // Strides denote the number of bytes per each line, + // by default assumes width * # of bytes per pixel + bool ConvertImageFormat( const unsigned char *src, enum ImageFormat srcImageFormat, + unsigned char *dst, enum ImageFormat dstImageFormat, + int width, int height, int srcStride = 0, int dstStride = 0 ); + + // must be used in conjunction with ConvertImageFormat() to pre-swap and post-swap + void PreConvertSwapImageData( unsigned char *pImageData, int nImageSize, ImageFormat imageFormat, int width = 0, int stride = 0 ); + void PostConvertSwapImageData( unsigned char *pImageData, int nImageSize, ImageFormat imageFormat, int width = 0, int stride = 0 ); + void ByteSwapImageData( unsigned char *pImageData, int nImageSize, ImageFormat imageFormat, int width = 0, int stride = 0 ); + bool IsFormatValidForConversion( ImageFormat fmt ); + + //----------------------------------------------------------------------------- + // convert back and forth from D3D format to ImageFormat, regardless of + // whether it's supported or not + //----------------------------------------------------------------------------- + ImageFormat D3DFormatToImageFormat( D3DFORMAT format ); + D3DFORMAT ImageFormatToD3DFormat( ImageFormat format ); + + // Flags for ResampleRGBA8888 + enum + { + RESAMPLE_NORMALMAP = 0x1, + RESAMPLE_ALPHATEST = 0x2, + RESAMPLE_NICE_FILTER = 0x4, + RESAMPLE_CLAMPS = 0x8, + RESAMPLE_CLAMPT = 0x10, + RESAMPLE_CLAMPU = 0x20, + }; + + struct ResampleInfo_t + { + + ResampleInfo_t() : m_nFlags(0), m_flAlphaThreshhold(0.4f), m_flAlphaHiFreqThreshhold(0.4f), m_nSrcDepth(1), m_nDestDepth(1) + { + m_flColorScale[0] = 1.0f, m_flColorScale[1] = 1.0f, m_flColorScale[2] = 1.0f, m_flColorScale[3] = 1.0f; + m_flColorGoal[0] = 0.0f, m_flColorGoal[1] = 0.0f, m_flColorGoal[2] = 0.0f, m_flColorGoal[3] = 0.0f; + } + + unsigned char *m_pSrc; + unsigned char *m_pDest; + + int m_nSrcWidth; + int m_nSrcHeight; + int m_nSrcDepth; + + int m_nDestWidth; + int m_nDestHeight; + int m_nDestDepth; + + float m_flSrcGamma; + float m_flDestGamma; + + float m_flColorScale[4]; // Color scale factors RGBA + float m_flColorGoal[4]; // Color goal values RGBA DestColor = ColorGoal + scale * (SrcColor - ColorGoal) + + float m_flAlphaThreshhold; + float m_flAlphaHiFreqThreshhold; + + int m_nFlags; + }; + + bool ResampleRGBA8888( const ResampleInfo_t &info ); + bool ResampleRGBA16161616( const ResampleInfo_t &info ); + bool ResampleRGB323232F( const ResampleInfo_t &info ); + + void ConvertNormalMapRGBA8888ToDUDVMapUVLX8888( const unsigned char *src, int width, int height, unsigned char *dst_ ); + void ConvertNormalMapRGBA8888ToDUDVMapUVWQ8888( const unsigned char *src, int width, int height, unsigned char *dst_ ); + void ConvertNormalMapRGBA8888ToDUDVMapUV88( const unsigned char *src, int width, int height, unsigned char *dst_ ); + void ConvertNormalMapARGB8888ToDXT5GA( const unsigned char *src, unsigned char *dst, int width, int height ); + + void ConvertIA88ImageToNormalMapRGBA8888( const unsigned char *src, int width, + int height, unsigned char *dst, + float bumpScale ); + + void NormalizeNormalMapRGBA8888( unsigned char *src, int numTexels ); + + //----------------------------------------------------------------------------- + // Gamma correction + //----------------------------------------------------------------------------- + void GammaCorrectRGBA8888( unsigned char *src, unsigned char* dst, + int width, int height, int depth, float srcGamma, float dstGamma ); + + + //----------------------------------------------------------------------------- + // Makes a gamma table + //----------------------------------------------------------------------------- + void ConstructGammaTable( unsigned char* pTable, float srcGamma, float dstGamma ); + + + //----------------------------------------------------------------------------- + // Gamma corrects using a previously constructed gamma table + //----------------------------------------------------------------------------- + void GammaCorrectRGBA8888( unsigned char* pSrc, unsigned char* pDst, + int width, int height, int depth, unsigned char* pGammaTable ); + + + //----------------------------------------------------------------------------- + // Generates a number of mipmap levels + //----------------------------------------------------------------------------- + void GenerateMipmapLevels( unsigned char* pSrc, unsigned char* pDst, int width, + int height, int depth, ImageFormat imageFormat, float srcGamma, float dstGamma, + int numLevels = 0 ); + + + //----------------------------------------------------------------------------- + // operations on square images (src and dst can be the same) + //----------------------------------------------------------------------------- + bool RotateImageLeft( const unsigned char *src, unsigned char *dst, + int widthHeight, ImageFormat imageFormat ); + bool RotateImage180( const unsigned char *src, unsigned char *dst, + int widthHeight, ImageFormat imageFormat ); + bool FlipImageVertically( void *pSrc, void *pDst, int nWidth, int nHeight, ImageFormat imageFormat, int nDstStride = 0 ); + bool FlipImageHorizontally( void *pSrc, void *pDst, int nWidth, int nHeight, ImageFormat imageFormat, int nDstStride = 0 ); + bool SwapAxes( unsigned char *src, + int widthHeight, ImageFormat imageFormat ); + + + //----------------------------------------------------------------------------- + // Returns info about each image format + //----------------------------------------------------------------------------- + ImageFormatInfo_t const& ImageFormatInfo( ImageFormat fmt ); + + + //----------------------------------------------------------------------------- + // Gets the name of the image format + //----------------------------------------------------------------------------- + inline char const* GetName( ImageFormat fmt ) + { + return ImageFormatInfo(fmt).m_pName; + } + + + //----------------------------------------------------------------------------- + // Gets the size of the image format in bytes + //----------------------------------------------------------------------------- + inline int SizeInBytes( ImageFormat fmt ) + { + return ImageFormatInfo(fmt).m_NumBytes; + } + + //----------------------------------------------------------------------------- + // Does the image format support transparency? + //----------------------------------------------------------------------------- + inline bool IsTransparent( ImageFormat fmt ) + { + return ImageFormatInfo(fmt).m_NumAlphaBits > 0; + } + + + //----------------------------------------------------------------------------- + // Is the image format compressed? + //----------------------------------------------------------------------------- + inline bool IsCompressed( ImageFormat fmt ) + { + return ImageFormatInfo(fmt).m_IsCompressed; + } + + //----------------------------------------------------------------------------- + // Is any channel > 8 bits? + //----------------------------------------------------------------------------- + inline bool HasChannelLargerThan8Bits( ImageFormat fmt ) + { + ImageFormatInfo_t info = ImageFormatInfo(fmt); + return ( info.m_NumRedBits > 8 || info.m_NumGreeBits > 8 || info.m_NumBlueBits > 8 || info.m_NumAlphaBits > 8 ); + } + + inline bool IsFloatFormat( ImageFormat fmt ) + { + return ( fmt == IMAGE_FORMAT_RGBA16161616F ) || + ( fmt == IMAGE_FORMAT_R32F ) || + ( fmt == IMAGE_FORMAT_RGB323232F ) || + ( fmt == IMAGE_FORMAT_RGBA32323232F ); + } + +} // end namespace ImageLoader + + +#endif // IMAGEFORMAT_H diff --git a/external/steamworks/glmgr/mathlite.cpp b/external/steamworks/glmgr/mathlite.cpp new file mode 100644 index 0000000..063a00a --- /dev/null +++ b/external/steamworks/glmgr/mathlite.cpp @@ -0,0 +1,1252 @@ +#include "mathlite.h" + +// ------------------------------------------------------------------------------------------- // +// Helper functions. +// ------------------------------------------------------------------------------------------- // + +const Vector vec3_origin(0,0,0); +const QAngle vec3_angle(0,0,0); +const Quaternion quat_identity(0,0,0,1); +const Vector vec3_invalid( FLT_MAX, FLT_MAX, FLT_MAX ); + +#ifndef VECTOR_NO_SLOW_OPERATIONS + +VMatrix SetupMatrixIdentity() +{ + return VMatrix( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); +} + +VMatrix SetupMatrixTranslation(const Vector &vTranslation) +{ + return VMatrix( + 1.0f, 0.0f, 0.0f, vTranslation.x, + 0.0f, 1.0f, 0.0f, vTranslation.y, + 0.0f, 0.0f, 1.0f, vTranslation.z, + 0.0f, 0.0f, 0.0f, 1.0f + ); +} + +VMatrix SetupMatrixScale(const Vector &vScale) +{ + return VMatrix( + vScale.x, 0.0f, 0.0f, 0.0f, + 0.0f, vScale.y, 0.0f, 0.0f, + 0.0f, 0.0f, vScale.z, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); +} + +VMatrix SetupMatrixReflection(const VPlane &thePlane) +{ + VMatrix mReflect, mBack, mForward; + Vector vOrigin, N; + + N = thePlane.m_Normal; + + mReflect.Init( + -2.0f*N.x*N.x + 1.0f, -2.0f*N.x*N.y, -2.0f*N.x*N.z, 0.0f, + -2.0f*N.y*N.x, -2.0f*N.y*N.y + 1.0f, -2.0f*N.y*N.z, 0.0f, + -2.0f*N.z*N.x, -2.0f*N.z*N.y, -2.0f*N.z*N.z + 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + vOrigin = thePlane.GetPointOnPlane(); + + mBack.Identity(); + mBack.SetTranslation(-vOrigin); + + mForward.Identity(); + mForward.SetTranslation(vOrigin); + + // (multiplied in reverse order, so it translates to the origin point, + // reflects, and translates back). + return mForward * mReflect * mBack; +} + +VMatrix SetupMatrixProjection(const Vector &vOrigin, const VPlane &thePlane) +{ + vec_t dot; + VMatrix mRet; + + + #define PN thePlane.m_Normal + #define PD thePlane.m_Dist; + + dot = PN[0]*vOrigin.x + PN[1]*vOrigin.y + PN[2]*vOrigin.z - PD; + + mRet.m[0][0] = dot - vOrigin.x * PN[0]; + mRet.m[0][1] = -vOrigin.x * PN[1]; + mRet.m[0][2] = -vOrigin.x * PN[2]; + mRet.m[0][3] = -vOrigin.x * -PD; + + mRet.m[1][0] = -vOrigin.y * PN[0]; + mRet.m[1][1] = dot - vOrigin.y * PN[1]; + mRet.m[1][2] = -vOrigin.y * PN[2]; + mRet.m[1][3] = -vOrigin.y * -PD; + + mRet.m[2][0] = -vOrigin.z * PN[0]; + mRet.m[2][1] = -vOrigin.z * PN[1]; + mRet.m[2][2] = dot - vOrigin.z * PN[2]; + mRet.m[2][3] = -vOrigin.z * -PD; + + mRet.m[3][0] = -PN[0]; + mRet.m[3][1] = -PN[1]; + mRet.m[3][2] = -PN[2]; + mRet.m[3][3] = dot + PD; + + #undef PN + #undef PD + + return mRet; +} + +VMatrix SetupMatrixAxisRot(const Vector &vAxis, vec_t fDegrees) +{ + vec_t s, c, t; + vec_t tx, ty, tz; + vec_t sx, sy, sz; + vec_t fRadians; + + + fRadians = fDegrees * (M_PI / 180.0f); + + s = (vec_t)sin(fRadians); + c = (vec_t)cos(fRadians); + t = 1.0f - c; + + tx = t * vAxis.x; ty = t * vAxis.y; tz = t * vAxis.z; + sx = s * vAxis.x; sy = s * vAxis.y; sz = s * vAxis.z; + + return VMatrix( + tx*vAxis.x + c, tx*vAxis.y - sz, tx*vAxis.z + sy, 0.0f, + tx*vAxis.y + sz, ty*vAxis.y + c, ty*vAxis.z - sx, 0.0f, + tx*vAxis.z - sy, ty*vAxis.z + sx, tz*vAxis.z + c, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); +} + +VMatrix SetupMatrixAngles(const QAngle &vAngles) +{ + VMatrix mRet; + MatrixFromAngles( vAngles, mRet ); + return mRet; +} + +VMatrix SetupMatrixOrgAngles(const Vector &origin, const QAngle &vAngles) +{ + VMatrix mRet; + mRet.SetupMatrixOrgAngles( origin, vAngles ); + return mRet; +} + +#endif // VECTOR_NO_SLOW_OPERATIONS + + +bool PlaneIntersection( const VPlane &vp1, const VPlane &vp2, const VPlane &vp3, Vector &vOut ) +{ + VMatrix mMat, mInverse; + + mMat.Init( + vp1.m_Normal.x, vp1.m_Normal.y, vp1.m_Normal.z, -vp1.m_Dist, + vp2.m_Normal.x, vp2.m_Normal.y, vp2.m_Normal.z, -vp2.m_Dist, + vp3.m_Normal.x, vp3.m_Normal.y, vp3.m_Normal.z, -vp3.m_Dist, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + if(mMat.InverseGeneral(mInverse)) + { + //vOut = mInverse * Vector(0.0f, 0.0f, 0.0f); + mInverse.GetTranslation( vOut ); + return true; + } + else + { + return false; + } +} + + + +// ------------------------------------------------------------------------------------------- // +// VMatrix functions. +// ------------------------------------------------------------------------------------------- // + +VMatrix& VMatrix::operator=(const VMatrix &mOther) +{ + m[0][0] = mOther.m[0][0]; + m[0][1] = mOther.m[0][1]; + m[0][2] = mOther.m[0][2]; + m[0][3] = mOther.m[0][3]; + + m[1][0] = mOther.m[1][0]; + m[1][1] = mOther.m[1][1]; + m[1][2] = mOther.m[1][2]; + m[1][3] = mOther.m[1][3]; + + m[2][0] = mOther.m[2][0]; + m[2][1] = mOther.m[2][1]; + m[2][2] = mOther.m[2][2]; + m[2][3] = mOther.m[2][3]; + + m[3][0] = mOther.m[3][0]; + m[3][1] = mOther.m[3][1]; + m[3][2] = mOther.m[3][2]; + m[3][3] = mOther.m[3][3]; + + return *this; +} + +bool VMatrix::operator==( const VMatrix& src ) const +{ + return !memcmp( src.m, m, sizeof(m) ); +} + +void VMatrix::MatrixMul( const VMatrix &vm, VMatrix &out ) const +{ + out.Init( + m[0][0]*vm.m[0][0] + m[0][1]*vm.m[1][0] + m[0][2]*vm.m[2][0] + m[0][3]*vm.m[3][0], + m[0][0]*vm.m[0][1] + m[0][1]*vm.m[1][1] + m[0][2]*vm.m[2][1] + m[0][3]*vm.m[3][1], + m[0][0]*vm.m[0][2] + m[0][1]*vm.m[1][2] + m[0][2]*vm.m[2][2] + m[0][3]*vm.m[3][2], + m[0][0]*vm.m[0][3] + m[0][1]*vm.m[1][3] + m[0][2]*vm.m[2][3] + m[0][3]*vm.m[3][3], + + m[1][0]*vm.m[0][0] + m[1][1]*vm.m[1][0] + m[1][2]*vm.m[2][0] + m[1][3]*vm.m[3][0], + m[1][0]*vm.m[0][1] + m[1][1]*vm.m[1][1] + m[1][2]*vm.m[2][1] + m[1][3]*vm.m[3][1], + m[1][0]*vm.m[0][2] + m[1][1]*vm.m[1][2] + m[1][2]*vm.m[2][2] + m[1][3]*vm.m[3][2], + m[1][0]*vm.m[0][3] + m[1][1]*vm.m[1][3] + m[1][2]*vm.m[2][3] + m[1][3]*vm.m[3][3], + + m[2][0]*vm.m[0][0] + m[2][1]*vm.m[1][0] + m[2][2]*vm.m[2][0] + m[2][3]*vm.m[3][0], + m[2][0]*vm.m[0][1] + m[2][1]*vm.m[1][1] + m[2][2]*vm.m[2][1] + m[2][3]*vm.m[3][1], + m[2][0]*vm.m[0][2] + m[2][1]*vm.m[1][2] + m[2][2]*vm.m[2][2] + m[2][3]*vm.m[3][2], + m[2][0]*vm.m[0][3] + m[2][1]*vm.m[1][3] + m[2][2]*vm.m[2][3] + m[2][3]*vm.m[3][3], + + m[3][0]*vm.m[0][0] + m[3][1]*vm.m[1][0] + m[3][2]*vm.m[2][0] + m[3][3]*vm.m[3][0], + m[3][0]*vm.m[0][1] + m[3][1]*vm.m[1][1] + m[3][2]*vm.m[2][1] + m[3][3]*vm.m[3][1], + m[3][0]*vm.m[0][2] + m[3][1]*vm.m[1][2] + m[3][2]*vm.m[2][2] + m[3][3]*vm.m[3][2], + m[3][0]*vm.m[0][3] + m[3][1]*vm.m[1][3] + m[3][2]*vm.m[2][3] + m[3][3]*vm.m[3][3] + ); +} + +#ifndef VECTOR_NO_SLOW_OPERATIONS + +VMatrix VMatrix::operator*(const VMatrix &vm) const +{ + VMatrix ret; + MatrixMul( vm, ret ); + return ret; +} + +#endif + +bool VMatrix::InverseGeneral(VMatrix &vInverse) const +{ + return MatrixInverseGeneral( *this, vInverse ); +} + + +bool MatrixInverseGeneral(const VMatrix& src, VMatrix& dst) +{ + int iRow, i, j, iTemp, iTest; + vec_t mul, fTest, fLargest; + vec_t mat[4][8]; + int rowMap[4], iLargest; + vec_t *pOut, *pRow, *pScaleRow; + + + // How it's done. + // AX = I + // A = this + // X = the matrix we're looking for + // I = identity + + // Setup AI + for(i=0; i < 4; i++) + { + const vec_t *pIn = src[i]; + pOut = mat[i]; + + for(j=0; j < 4; j++) + { + pOut[j] = pIn[j]; + } + + pOut[4] = 0.0f; + pOut[5] = 0.0f; + pOut[6] = 0.0f; + pOut[7] = 0.0f; + pOut[i+4] = 1.0f; + + rowMap[i] = i; + } + + // Use row operations to get to reduced row-echelon form using these rules: + // 1. Multiply or divide a row by a nonzero number. + // 2. Add a multiple of one row to another. + // 3. Interchange two rows. + + for(iRow=0; iRow < 4; iRow++) + { + // Find the row with the largest element in this column. + fLargest = 0.001f; + iLargest = -1; + for(iTest=iRow; iTest < 4; iTest++) + { + fTest = (vec_t)FloatMakePositive(mat[rowMap[iTest]][iRow]); + if(fTest > fLargest) + { + iLargest = iTest; + fLargest = fTest; + } + } + + // They're all too small.. sorry. + if(iLargest == -1) + { + return false; + } + + // Swap the rows. + iTemp = rowMap[iLargest]; + rowMap[iLargest] = rowMap[iRow]; + rowMap[iRow] = iTemp; + + pRow = mat[rowMap[iRow]]; + + // Divide this row by the element. + mul = 1.0f / pRow[iRow]; + for(j=0; j < 8; j++) + pRow[j] *= mul; + + pRow[iRow] = 1.0f; // Preserve accuracy... + + // Eliminate this element from the other rows using operation 2. + for(i=0; i < 4; i++) + { + if(i == iRow) + continue; + + pScaleRow = mat[rowMap[i]]; + + // Multiply this row by -(iRow*the element). + mul = -pScaleRow[iRow]; + for(j=0; j < 8; j++) + { + pScaleRow[j] += pRow[j] * mul; + } + + pScaleRow[iRow] = 0.0f; // Preserve accuracy... + } + } + + // The inverse is on the right side of AX now (the identity is on the left). + for(i=0; i < 4; i++) + { + const vec_t *pIn = mat[rowMap[i]] + 4; + pOut = dst.m[i]; + + for(j=0; j < 4; j++) + { + pOut[j] = pIn[j]; + } + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Does a fast inverse, assuming the matrix only contains translation and rotation. +//----------------------------------------------------------------------------- +void MatrixInverseTR( const VMatrix& src, VMatrix &dst ) +{ + Vector vTrans, vNewTrans; + + // Transpose the upper 3x3. + dst.m[0][0] = src.m[0][0]; dst.m[0][1] = src.m[1][0]; dst.m[0][2] = src.m[2][0]; + dst.m[1][0] = src.m[0][1]; dst.m[1][1] = src.m[1][1]; dst.m[1][2] = src.m[2][1]; + dst.m[2][0] = src.m[0][2]; dst.m[2][1] = src.m[1][2]; dst.m[2][2] = src.m[2][2]; + + // Transform the translation. + vTrans.Init( -src.m[0][3], -src.m[1][3], -src.m[2][3] ); + Vector3DMultiply( dst, vTrans, vNewTrans ); + MatrixSetColumn( dst, 3, vNewTrans ); + + // Fill in the bottom row. + dst.m[3][0] = dst.m[3][1] = dst.m[3][2] = 0.0f; + dst.m[3][3] = 1.0f; +} + + +void VMatrix::InverseTR( VMatrix &ret ) const +{ + MatrixInverseTR( *this, ret ); +} + +void MatrixInverseTranspose( const VMatrix& src, VMatrix& dst ) +{ + src.InverseGeneral( dst ); + MatrixTranspose( dst, dst ); +} + +//----------------------------------------------------------------------------- +// Computes the inverse transpose +//----------------------------------------------------------------------------- +void MatrixInverseTranspose( const matrix3x4_t& src, matrix3x4_t& dst ) +{ + VMatrix tmp, out; + tmp.CopyFrom3x4( src ); + ::MatrixInverseTranspose( tmp, out ); + out.Set3x4( dst ); +} + + +#ifndef VECTOR_NO_SLOW_OPERATIONS + +VMatrix VMatrix::InverseTR() const +{ + VMatrix ret; + MatrixInverseTR( *this, ret ); + return ret; +} + +Vector VMatrix::GetScale() const +{ + Vector vecs[3]; + + GetBasisVectors(vecs[0], vecs[1], vecs[2]); + + return Vector( + vecs[0].Length(), + vecs[1].Length(), + vecs[2].Length() + ); +} + +VMatrix VMatrix::Scale(const Vector &vScale) +{ + return VMatrix( + m[0][0]*vScale.x, m[0][1]*vScale.y, m[0][2]*vScale.z, m[0][3], + m[1][0]*vScale.x, m[1][1]*vScale.y, m[1][2]*vScale.z, m[1][3], + m[2][0]*vScale.x, m[2][1]*vScale.y, m[2][2]*vScale.z, m[2][3], + m[3][0]*vScale.x, m[3][1]*vScale.y, m[3][2]*vScale.z, 1.0f + ); +} + +#if 0 + VMatrix VMatrix::NormalizeBasisVectors() const + { + Vector vecs[3]; + VMatrix mRet; + + + GetBasisVectors(vecs[0], vecs[1], vecs[2]); + + VectorNormalize( vecs[0] ); + VectorNormalize( vecs[1] ); + VectorNormalize( vecs[2] ); + + mRet.SetBasisVectors(vecs[0], vecs[1], vecs[2]); + + // Set everything but basis vectors to identity. + mRet.m[3][0] = mRet.m[3][1] = mRet.m[3][2] = 0.0f; + mRet.m[3][3] = 1.0f; + + return mRet; + } +#endif + +VMatrix VMatrix::Transpose() const +{ + return VMatrix( + m[0][0], m[1][0], m[2][0], m[3][0], + m[0][1], m[1][1], m[2][1], m[3][1], + m[0][2], m[1][2], m[2][2], m[3][2], + m[0][3], m[1][3], m[2][3], m[3][3]); +} + +// Transpose upper-left 3x3. +VMatrix VMatrix::Transpose3x3() const +{ + return VMatrix( + m[0][0], m[1][0], m[2][0], m[0][3], + m[0][1], m[1][1], m[2][1], m[1][3], + m[0][2], m[1][2], m[2][2], m[2][3], + m[3][0], m[3][1], m[3][2], m[3][3]); +} + +#endif // VECTOR_NO_SLOW_OPERATIONS + + +bool VMatrix::IsRotationMatrix() const +{ + Vector &v1 = (Vector&)m[0][0]; + Vector &v2 = (Vector&)m[1][0]; + Vector &v3 = (Vector&)m[2][0]; + + return + FloatMakePositive( 1 - v1.Length() ) < 0.01f && + FloatMakePositive( 1 - v2.Length() ) < 0.01f && + FloatMakePositive( 1 - v3.Length() ) < 0.01f && + FloatMakePositive( v1.Dot(v2) ) < 0.01f && + FloatMakePositive( v1.Dot(v3) ) < 0.01f && + FloatMakePositive( v2.Dot(v3) ) < 0.01f; +} + +void VMatrix::SetupMatrixOrgAngles( const Vector &origin, const QAngle &vAngles ) +{ + float sr, sp, sy, cr, cp, cy; + + SinCos( DEG2RAD( vAngles[YAW] ), &sy, &cy ); + SinCos( DEG2RAD( vAngles[PITCH] ), &sp, &cp ); + SinCos( DEG2RAD( vAngles[ROLL] ), &sr, &cr ); + + // matrix = (YAW * PITCH) * ROLL + m[0][0] = cp*cy; + m[1][0] = cp*sy; + m[2][0] = -sp; + m[0][1] = sr*sp*cy+cr*-sy; + m[1][1] = sr*sp*sy+cr*cy; + m[2][1] = sr*cp; + m[0][2] = (cr*sp*cy+-sr*-sy); + m[1][2] = (cr*sp*sy+-sr*cy); + m[2][2] = cr*cp; + m[0][3] = 0.f; + m[1][3] = 0.f; + m[2][3] = 0.f; + + // Add translation + m[0][3] = origin.x; + m[1][3] = origin.y; + m[2][3] = origin.z; + m[3][0] = 0.0f; + m[3][1] = 0.0f; + m[3][2] = 0.0f; + m[3][3] = 1.0f; +} + + +//----------------------------------------------------------------------------- +// Sets matrix to identity +//----------------------------------------------------------------------------- +void MatrixSetIdentity( VMatrix &dst ) +{ + dst[0][0] = 1.0f; dst[0][1] = 0.0f; dst[0][2] = 0.0f; dst[0][3] = 0.0f; + dst[1][0] = 0.0f; dst[1][1] = 1.0f; dst[1][2] = 0.0f; dst[1][3] = 0.0f; + dst[2][0] = 0.0f; dst[2][1] = 0.0f; dst[2][2] = 1.0f; dst[2][3] = 0.0f; + dst[3][0] = 0.0f; dst[3][1] = 0.0f; dst[3][2] = 0.0f; dst[3][3] = 1.0f; +} + + +//----------------------------------------------------------------------------- +// Setup a matrix from euler angles. +//----------------------------------------------------------------------------- +void MatrixFromAngles( const QAngle& vAngles, VMatrix& dst ) +{ + dst.SetupMatrixOrgAngles( vec3_origin, vAngles ); +} + + +//----------------------------------------------------------------------------- +// Creates euler angles from a matrix +//----------------------------------------------------------------------------- +void MatrixToAngles( const VMatrix& src, QAngle& vAngles ) +{ + float forward[3]; + float left[3]; + float up[3]; + + // Extract the basis vectors from the matrix. Since we only need the Z + // component of the up vector, we don't get X and Y. + forward[0] = src[0][0]; + forward[1] = src[1][0]; + forward[2] = src[2][0]; + left[0] = src[0][1]; + left[1] = src[1][1]; + left[2] = src[2][1]; + up[2] = src[2][2]; + + float xyDist = sqrtf( forward[0] * forward[0] + forward[1] * forward[1] ); + + // enough here to get angles? + if ( xyDist > 0.001f ) + { + // (yaw) y = ATAN( forward.y, forward.x ); -- in our space, forward is the X axis + vAngles[1] = RAD2DEG( atan2f( forward[1], forward[0] ) ); + + // The engine does pitch inverted from this, but we always end up negating it in the DLL + // UNDONE: Fix the engine to make it consistent + // (pitch) x = ATAN( -forward.z, sqrt(forward.x*forward.x+forward.y*forward.y) ); + vAngles[0] = RAD2DEG( atan2f( -forward[2], xyDist ) ); + + // (roll) z = ATAN( left.z, up.z ); + vAngles[2] = RAD2DEG( atan2f( left[2], up[2] ) ); + } + else // forward is mostly Z, gimbal lock- + { + // (yaw) y = ATAN( -left.x, left.y ); -- forward is mostly z, so use right for yaw + vAngles[1] = RAD2DEG( atan2f( -left[0], left[1] ) ); + + // The engine does pitch inverted from this, but we always end up negating it in the DLL + // UNDONE: Fix the engine to make it consistent + // (pitch) x = ATAN( -forward.z, sqrt(forward.x*forward.x+forward.y*forward.y) ); + vAngles[0] = RAD2DEG( atan2f( -forward[2], xyDist ) ); + + // Assume no roll in this case as one degree of freedom has been lost (i.e. yaw == roll) + vAngles[2] = 0; + } +} + + +//----------------------------------------------------------------------------- +// Transpose +//----------------------------------------------------------------------------- +inline void Swap( float& a, float& b ) +{ + float tmp = a; + a = b; + b = tmp; +} + +void MatrixTranspose( const VMatrix& src, VMatrix& dst ) +{ + if (&src == &dst) + { + Swap( dst[0][1], dst[1][0] ); + Swap( dst[0][2], dst[2][0] ); + Swap( dst[0][3], dst[3][0] ); + Swap( dst[1][2], dst[2][1] ); + Swap( dst[1][3], dst[3][1] ); + Swap( dst[2][3], dst[3][2] ); + } + else + { + dst[0][0] = src[0][0]; dst[0][1] = src[1][0]; dst[0][2] = src[2][0]; dst[0][3] = src[3][0]; + dst[1][0] = src[0][1]; dst[1][1] = src[1][1]; dst[1][2] = src[2][1]; dst[1][3] = src[3][1]; + dst[2][0] = src[0][2]; dst[2][1] = src[1][2]; dst[2][2] = src[2][2]; dst[2][3] = src[3][2]; + dst[3][0] = src[0][3]; dst[3][1] = src[1][3]; dst[3][2] = src[2][3]; dst[3][3] = src[3][3]; + } +} + + +//----------------------------------------------------------------------------- +// Matrix copy +//----------------------------------------------------------------------------- + +void MatrixCopy( const VMatrix& src, VMatrix& dst ) +{ + if (&src != &dst) + { + memcpy( dst.m, src.m, 16 * sizeof(float) ); + } +} + +//----------------------------------------------------------------------------- +// Matrix multiply +//----------------------------------------------------------------------------- +typedef float VMatrixRaw_t[4]; + +void MatrixMultiply( const VMatrix& src1, const VMatrix& src2, VMatrix& dst ) +{ + // Make sure it works if src1 == dst or src2 == dst + VMatrix tmp1, tmp2; + const VMatrixRaw_t* s1 = (&src1 == &dst) ? tmp1.m : src1.m; + const VMatrixRaw_t* s2 = (&src2 == &dst) ? tmp2.m : src2.m; + + if (&src1 == &dst) + { + MatrixCopy( src1, tmp1 ); + } + if (&src2 == &dst) + { + MatrixCopy( src2, tmp2 ); + } + + dst[0][0] = s1[0][0] * s2[0][0] + s1[0][1] * s2[1][0] + s1[0][2] * s2[2][0] + s1[0][3] * s2[3][0]; + dst[0][1] = s1[0][0] * s2[0][1] + s1[0][1] * s2[1][1] + s1[0][2] * s2[2][1] + s1[0][3] * s2[3][1]; + dst[0][2] = s1[0][0] * s2[0][2] + s1[0][1] * s2[1][2] + s1[0][2] * s2[2][2] + s1[0][3] * s2[3][2]; + dst[0][3] = s1[0][0] * s2[0][3] + s1[0][1] * s2[1][3] + s1[0][2] * s2[2][3] + s1[0][3] * s2[3][3]; + + dst[1][0] = s1[1][0] * s2[0][0] + s1[1][1] * s2[1][0] + s1[1][2] * s2[2][0] + s1[1][3] * s2[3][0]; + dst[1][1] = s1[1][0] * s2[0][1] + s1[1][1] * s2[1][1] + s1[1][2] * s2[2][1] + s1[1][3] * s2[3][1]; + dst[1][2] = s1[1][0] * s2[0][2] + s1[1][1] * s2[1][2] + s1[1][2] * s2[2][2] + s1[1][3] * s2[3][2]; + dst[1][3] = s1[1][0] * s2[0][3] + s1[1][1] * s2[1][3] + s1[1][2] * s2[2][3] + s1[1][3] * s2[3][3]; + + dst[2][0] = s1[2][0] * s2[0][0] + s1[2][1] * s2[1][0] + s1[2][2] * s2[2][0] + s1[2][3] * s2[3][0]; + dst[2][1] = s1[2][0] * s2[0][1] + s1[2][1] * s2[1][1] + s1[2][2] * s2[2][1] + s1[2][3] * s2[3][1]; + dst[2][2] = s1[2][0] * s2[0][2] + s1[2][1] * s2[1][2] + s1[2][2] * s2[2][2] + s1[2][3] * s2[3][2]; + dst[2][3] = s1[2][0] * s2[0][3] + s1[2][1] * s2[1][3] + s1[2][2] * s2[2][3] + s1[2][3] * s2[3][3]; + + dst[3][0] = s1[3][0] * s2[0][0] + s1[3][1] * s2[1][0] + s1[3][2] * s2[2][0] + s1[3][3] * s2[3][0]; + dst[3][1] = s1[3][0] * s2[0][1] + s1[3][1] * s2[1][1] + s1[3][2] * s2[2][1] + s1[3][3] * s2[3][1]; + dst[3][2] = s1[3][0] * s2[0][2] + s1[3][1] * s2[1][2] + s1[3][2] * s2[2][2] + s1[3][3] * s2[3][2]; + dst[3][3] = s1[3][0] * s2[0][3] + s1[3][1] * s2[1][3] + s1[3][2] * s2[2][3] + s1[3][3] * s2[3][3]; +} + +//----------------------------------------------------------------------------- +// Matrix/vector multiply +//----------------------------------------------------------------------------- + +void Vector4DMultiply( const VMatrix& src1, Vector4D const& src2, Vector4D& dst ) +{ + // Make sure it works if src2 == dst + Vector4D tmp; + Vector4D const&v = (&src2 == &dst) ? tmp : src2; + + if (&src2 == &dst) + { + Vector4DCopy( src2, tmp ); + } + + dst[0] = src1[0][0] * v[0] + src1[0][1] * v[1] + src1[0][2] * v[2] + src1[0][3] * v[3]; + dst[1] = src1[1][0] * v[0] + src1[1][1] * v[1] + src1[1][2] * v[2] + src1[1][3] * v[3]; + dst[2] = src1[2][0] * v[0] + src1[2][1] * v[1] + src1[2][2] * v[2] + src1[2][3] * v[3]; + dst[3] = src1[3][0] * v[0] + src1[3][1] * v[1] + src1[3][2] * v[2] + src1[3][3] * v[3]; +} + +//----------------------------------------------------------------------------- +// Matrix/vector multiply +//----------------------------------------------------------------------------- + +void Vector4DMultiplyPosition( const VMatrix& src1, Vector const& src2, Vector4D& dst ) +{ + // Make sure it works if src2 == dst + Vector tmp; + Vector const&v = ( &src2 == &dst.AsVector3D() ) ? tmp : src2; + + if (&src2 == &dst.AsVector3D()) + { + VectorCopy( src2, tmp ); + } + + dst[0] = src1[0][0] * v[0] + src1[0][1] * v[1] + src1[0][2] * v[2] + src1[0][3]; + dst[1] = src1[1][0] * v[0] + src1[1][1] * v[1] + src1[1][2] * v[2] + src1[1][3]; + dst[2] = src1[2][0] * v[0] + src1[2][1] * v[1] + src1[2][2] * v[2] + src1[2][3]; + dst[3] = src1[3][0] * v[0] + src1[3][1] * v[1] + src1[3][2] * v[2] + src1[3][3]; +} + + + +//----------------------------------------------------------------------------- +// Matrix/vector multiply +//----------------------------------------------------------------------------- + +void Vector3DMultiply( const VMatrix &src1, const Vector &src2, Vector &dst ) +{ + // Make sure it works if src2 == dst + Vector tmp; + const Vector &v = (&src2 == &dst) ? tmp : src2; + + if( &src2 == &dst ) + { + VectorCopy( src2, tmp ); + } + + dst[0] = src1[0][0] * v[0] + src1[0][1] * v[1] + src1[0][2] * v[2]; + dst[1] = src1[1][0] * v[0] + src1[1][1] * v[1] + src1[1][2] * v[2]; + dst[2] = src1[2][0] * v[0] + src1[2][1] * v[1] + src1[2][2] * v[2]; +} + + +//----------------------------------------------------------------------------- +// Vector3DMultiplyPositionProjective treats src2 as if it's a point +// and does the perspective divide at the end +//----------------------------------------------------------------------------- +void Vector3DMultiplyPositionProjective( const VMatrix& src1, const Vector &src2, Vector& dst ) +{ + // Make sure it works if src2 == dst + Vector tmp; + const Vector &v = (&src2 == &dst) ? tmp: src2; + if( &src2 == &dst ) + { + VectorCopy( src2, tmp ); + } + + float w = src1[3][0] * v[0] + src1[3][1] * v[1] + src1[3][2] * v[2] + src1[3][3]; + if ( w != 0.0f ) + { + w = 1.0f / w; + } + + dst[0] = src1[0][0] * v[0] + src1[0][1] * v[1] + src1[0][2] * v[2] + src1[0][3]; + dst[1] = src1[1][0] * v[0] + src1[1][1] * v[1] + src1[1][2] * v[2] + src1[1][3]; + dst[2] = src1[2][0] * v[0] + src1[2][1] * v[1] + src1[2][2] * v[2] + src1[2][3]; + dst *= w; +} + + +//----------------------------------------------------------------------------- +// Vector3DMultiplyProjective treats src2 as if it's a direction +// and does the perspective divide at the end +//----------------------------------------------------------------------------- +void Vector3DMultiplyProjective( const VMatrix& src1, const Vector &src2, Vector& dst ) +{ + // Make sure it works if src2 == dst + Vector tmp; + const Vector &v = (&src2 == &dst) ? tmp : src2; + if( &src2 == &dst ) + { + VectorCopy( src2, tmp ); + } + + float w; + dst[0] = src1[0][0] * v[0] + src1[0][1] * v[1] + src1[0][2] * v[2]; + dst[1] = src1[1][0] * v[0] + src1[1][1] * v[1] + src1[1][2] * v[2]; + dst[2] = src1[2][0] * v[0] + src1[2][1] * v[1] + src1[2][2] * v[2]; + w = src1[3][0] * v[0] + src1[3][1] * v[1] + src1[3][2] * v[2]; + if (w != 0.0f) + { + dst /= w; + } + else + { + dst = vec3_origin; + } +} + + +//----------------------------------------------------------------------------- +// Multiplies the vector by the transpose of the matrix +//----------------------------------------------------------------------------- +void Vector4DMultiplyTranspose( const VMatrix& src1, Vector4D const& src2, Vector4D& dst ) +{ + // Make sure it works if src2 == dst + bool srcEqualsDst = (&src2 == &dst); + + Vector4D tmp; + Vector4D const&v = srcEqualsDst ? tmp : src2; + + if (srcEqualsDst) + { + Vector4DCopy( src2, tmp ); + } + + dst[0] = src1[0][0] * v[0] + src1[1][0] * v[1] + src1[2][0] * v[2] + src1[3][0] * v[3]; + dst[1] = src1[0][1] * v[0] + src1[1][1] * v[1] + src1[2][1] * v[2] + src1[3][1] * v[3]; + dst[2] = src1[0][2] * v[0] + src1[1][2] * v[1] + src1[2][2] * v[2] + src1[3][2] * v[3]; + dst[3] = src1[0][3] * v[0] + src1[1][3] * v[1] + src1[2][3] * v[2] + src1[3][3] * v[3]; +} + +//----------------------------------------------------------------------------- +// Multiplies the vector by the transpose of the matrix +//----------------------------------------------------------------------------- +void Vector3DMultiplyTranspose( const VMatrix& src1, const Vector& src2, Vector& dst ) +{ + // Make sure it works if src2 == dst + bool srcEqualsDst = (&src2 == &dst); + + Vector tmp; + const Vector&v = srcEqualsDst ? tmp : src2; + + if (srcEqualsDst) + { + VectorCopy( src2, tmp ); + } + + dst[0] = src1[0][0] * v[0] + src1[1][0] * v[1] + src1[2][0] * v[2]; + dst[1] = src1[0][1] * v[0] + src1[1][1] * v[1] + src1[2][1] * v[2]; + dst[2] = src1[0][2] * v[0] + src1[1][2] * v[1] + src1[2][2] * v[2]; +} + + +#if 0 +//----------------------------------------------------------------------------- +// Transform a plane +//----------------------------------------------------------------------------- +void MatrixTransformPlane( const VMatrix &src, const cplane_t &inPlane, cplane_t &outPlane ) +{ + // What we want to do is the following: + // 1) transform the normal into the new space. + // 2) Determine a point on the old plane given by plane dist * plane normal + // 3) Transform that point into the new space + // 4) Plane dist = DotProduct( new normal, new point ) + + // An optimized version, which works if the plane is orthogonal. + // 1) Transform the normal into the new space + // 2) Realize that transforming the old plane point into the new space + // is given by [ d * n'x + Tx, d * n'y + Ty, d * n'z + Tz ] + // where d = old plane dist, n' = transformed normal, Tn = translational component of transform + // 3) Compute the new plane dist using the dot product of the normal result of #2 + + // For a correct result, this should be an inverse-transpose matrix + // but that only matters if there are nonuniform scale or skew factors in this matrix. + Vector vTrans; + Vector3DMultiply( src, inPlane.normal, outPlane.normal ); + outPlane.dist = inPlane.dist * DotProduct( outPlane.normal, outPlane.normal ); + outPlane.dist += DotProduct( outPlane.normal, src.GetTranslation(vTrans) ); +} +#endif + +#ifndef VECTOR_NO_SLOW_OPERATIONS + +VPlane VMatrix::operator*(const VPlane &thePlane) const +{ + VPlane ret; + TransformPlane( thePlane, ret ); + return ret; +} + +#endif + + +//----------------------------------------------------------------------------- +// Builds a rotation matrix that rotates one direction vector into another +//----------------------------------------------------------------------------- +void MatrixBuildTranslation( VMatrix& dst, float x, float y, float z ) +{ + MatrixSetIdentity( dst ); + dst[0][3] = x; + dst[1][3] = y; + dst[2][3] = z; +} + +void MatrixBuildTranslation( VMatrix& dst, const Vector &translation ) +{ + MatrixSetIdentity( dst ); + dst[0][3] = translation[0]; + dst[1][3] = translation[1]; + dst[2][3] = translation[2]; +} + + +//----------------------------------------------------------------------------- +// Purpose: Builds the matrix for a counterclockwise rotation about an arbitrary axis. +// +// | ax2 + (1 - ax2)cosQ axay(1 - cosQ) - azsinQ azax(1 - cosQ) + aysinQ | +// Ra(Q) = | axay(1 - cosQ) + azsinQ ay2 + (1 - ay2)cosQ ayaz(1 - cosQ) - axsinQ | +// | azax(1 - cosQ) - aysinQ ayaz(1 - cosQ) + axsinQ az2 + (1 - az2)cosQ | +// +// Input : mat - +// vAxisOrRot - +// angle - +//----------------------------------------------------------------------------- +#if 0 +void MatrixBuildRotationAboutAxis( VMatrix &dst, const Vector &vAxisOfRot, float angleDegrees ) +{ + MatrixBuildRotationAboutAxis( vAxisOfRot, angleDegrees, dst.As3x4() ); + dst[3][0] = 0; + dst[3][1] = 0; + dst[3][2] = 0; + dst[3][3] = 1; +} +#endif + + +#if 0 +//----------------------------------------------------------------------------- +// Builds a rotation matrix that rotates one direction vector into another +//----------------------------------------------------------------------------- +void MatrixBuildRotation( VMatrix &dst, const Vector& initialDirection, const Vector& finalDirection ) +{ + float angle = DotProduct( initialDirection, finalDirection ); + Assert( IsFinite(angle) ); + + Vector axis; + + // No rotation required + if (angle - 1.0 > -1e-3) + { + // parallel case + MatrixSetIdentity(dst); + return; + } + else if (angle + 1.0 < 1e-3) + { + // antiparallel case, pick any axis in the plane + // perpendicular to the final direction. Choose the direction (x,y,z) + // which has the minimum component of the final direction, use that + // as an initial guess, then subtract out the component which is + // parallel to the final direction + int idx = 0; + if (FloatMakePositive(finalDirection[1]) < FloatMakePositive(finalDirection[idx])) + idx = 1; + if (FloatMakePositive(finalDirection[2]) < FloatMakePositive(finalDirection[idx])) + idx = 2; + + axis.Init( 0, 0, 0 ); + axis[idx] = 1.0f; + VectorMA( axis, -DotProduct( axis, finalDirection ), finalDirection, axis ); + VectorNormalize(axis); + angle = 180.0f; + } + else + { + CrossProduct( initialDirection, finalDirection, axis ); + VectorNormalize( axis ); + angle = acos(angle) * 180 / M_PI; + } + + MatrixBuildRotationAboutAxis( dst, axis, angle ); + +#ifdef _DEBUG + Vector test; + Vector3DMultiply( dst, initialDirection, test ); + test -= finalDirection; + Assert( test.LengthSqr() < 1e-3 ); +#endif +} +#endif + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void MatrixBuildRotateZ( VMatrix &dst, float angleDegrees ) +{ + float radians = angleDegrees * ( M_PI / 180.0f ); + + float fSin = ( float )sin( radians ); + float fCos = ( float )cos( radians ); + + dst[0][0] = fCos; dst[0][1] = -fSin; dst[0][2] = 0.0f; dst[0][3] = 0.0f; + dst[1][0] = fSin; dst[1][1] = fCos; dst[1][2] = 0.0f; dst[1][3] = 0.0f; + dst[2][0] = 0.0f; dst[2][1] = 0.0f; dst[2][2] = 1.0f; dst[2][3] = 0.0f; + dst[3][0] = 0.0f; dst[3][1] = 0.0f; dst[3][2] = 0.0f; dst[3][3] = 1.0f; +} + +// Builds a scale matrix +void MatrixBuildScale( VMatrix &dst, float x, float y, float z ) +{ + dst[0][0] = x; dst[0][1] = 0.0f; dst[0][2] = 0.0f; dst[0][3] = 0.0f; + dst[1][0] = 0.0f; dst[1][1] = y; dst[1][2] = 0.0f; dst[1][3] = 0.0f; + dst[2][0] = 0.0f; dst[2][1] = 0.0f; dst[2][2] = z; dst[2][3] = 0.0f; + dst[3][0] = 0.0f; dst[3][1] = 0.0f; dst[3][2] = 0.0f; dst[3][3] = 1.0f; +} + +void MatrixBuildScale( VMatrix &dst, const Vector& scale ) +{ + MatrixBuildScale( dst, scale.x, scale.y, scale.z ); +} + +void MatrixBuildPerspective( VMatrix &dst, float fovX, float fovY, float zNear, float zFar ) +{ + // FIXME: collapse all of this into one matrix after we figure out what all should be in here. + float width = 2 * zNear * tan( fovX * ( M_PI/180.0f ) * 0.5f ); + float height = 2 * zNear * tan( fovY * ( M_PI/180.0f ) * 0.5f ); + + memset( dst.Base(), 0, sizeof( dst ) ); + dst[0][0] = 2.0F * zNear / width; + dst[1][1] = 2.0F * zNear / height; + dst[2][2] = -zFar / ( zNear - zFar ); + dst[3][2] = 1.0f; + dst[2][3] = zNear * zFar / ( zNear - zFar ); + + // negate X and Y so that X points right, and Y points up. + VMatrix negateXY; + negateXY.Identity(); + negateXY[0][0] = -1.0f; + negateXY[1][1] = -1.0f; + MatrixMultiply( negateXY, dst, dst ); + + VMatrix addW; + addW.Identity(); + addW[0][3] = 1.0f; + addW[1][3] = 1.0f; + addW[2][3] = 0.0f; + MatrixMultiply( addW, dst, dst ); + + VMatrix scaleHalf; + scaleHalf.Identity(); + scaleHalf[0][0] = 0.5f; + scaleHalf[1][1] = 0.5f; + MatrixMultiply( scaleHalf, dst, dst ); +} +#if 0 +static inline void CalculateAABBForNormalizedFrustum_Helper( float x, float y, float z, const VMatrix &volumeToWorld, Vector &mins, Vector &maxs ) +{ + Vector volumeSpacePos( x, y, z ); + + // Make sure it's been clipped + Assert( volumeSpacePos[0] >= -1e-3f ); + Assert( volumeSpacePos[0] - 1.0f <= 1e-3f ); + Assert( volumeSpacePos[1] >= -1e-3f ); + Assert( volumeSpacePos[1] - 1.0f <= 1e-3f ); + Assert( volumeSpacePos[2] >= -1e-3f ); + Assert( volumeSpacePos[2] - 1.0f <= 1e-3f ); + + Vector worldPos; + Vector3DMultiplyPositionProjective( volumeToWorld, volumeSpacePos, worldPos ); + AddPointToBounds( worldPos, mins, maxs ); +} +//----------------------------------------------------------------------------- +// Given an inverse projection matrix, take the extremes of the space in transformed into world space and +// get a bounding box. +//----------------------------------------------------------------------------- +void CalculateAABBFromProjectionMatrixInverse( const VMatrix &volumeToWorld, Vector *pMins, Vector *pMaxs ) +{ + // FIXME: Could maybe do better than the compile with all of these multiplies by 0 and 1. + ClearBounds( *pMins, *pMaxs ); + CalculateAABBForNormalizedFrustum_Helper( 0, 0, 0, volumeToWorld, *pMins, *pMaxs ); + CalculateAABBForNormalizedFrustum_Helper( 0, 0, 1, volumeToWorld, *pMins, *pMaxs ); + CalculateAABBForNormalizedFrustum_Helper( 0, 1, 0, volumeToWorld, *pMins, *pMaxs ); + CalculateAABBForNormalizedFrustum_Helper( 0, 1, 1, volumeToWorld, *pMins, *pMaxs ); + CalculateAABBForNormalizedFrustum_Helper( 1, 0, 0, volumeToWorld, *pMins, *pMaxs ); + CalculateAABBForNormalizedFrustum_Helper( 1, 0, 1, volumeToWorld, *pMins, *pMaxs ); + CalculateAABBForNormalizedFrustum_Helper( 1, 1, 0, volumeToWorld, *pMins, *pMaxs ); + CalculateAABBForNormalizedFrustum_Helper( 1, 1, 1, volumeToWorld, *pMins, *pMaxs ); +} + +void CalculateAABBFromProjectionMatrix( const VMatrix &worldToVolume, Vector *pMins, Vector *pMaxs ) +{ + VMatrix volumeToWorld; + MatrixInverseGeneral( worldToVolume, volumeToWorld ); + CalculateAABBFromProjectionMatrixInverse( volumeToWorld, pMins, pMaxs ); +} + +#endif + +#if 0 +//----------------------------------------------------------------------------- +// Given an inverse projection matrix, take the extremes of the space in transformed into world space and +// get a bounding sphere. +//----------------------------------------------------------------------------- +void CalculateSphereFromProjectionMatrixInverse( const VMatrix &volumeToWorld, Vector *pCenter, float *pflRadius ) +{ + // FIXME: Could maybe do better than the compile with all of these multiplies by 0 and 1. + + // Need 3 points: the endpoint of the line through the center of the near + far planes, + // and one point on the far plane. From that, we can derive a point somewhere on the center line + // which would produce the smallest bounding sphere. + Vector vecCenterNear, vecCenterFar, vecNearEdge, vecFarEdge; + Vector3DMultiplyPositionProjective( volumeToWorld, Vector( 0.5f, 0.5f, 0.0f ), vecCenterNear ); + Vector3DMultiplyPositionProjective( volumeToWorld, Vector( 0.5f, 0.5f, 1.0f ), vecCenterFar ); + Vector3DMultiplyPositionProjective( volumeToWorld, Vector( 0.0f, 0.0f, 0.0f ), vecNearEdge ); + Vector3DMultiplyPositionProjective( volumeToWorld, Vector( 0.0f, 0.0f, 1.0f ), vecFarEdge ); + + // Let the distance between the near + far center points = l + // Let the distance between the near center point + near edge point = h1 + // Let the distance between the far center point + far edge point = h2 + // Let the distance along the center line from the near point to the sphere center point = x + // Then let the distance between the sphere center point + near edge point == + // the distance between the sphere center point + far edge point == r == radius of sphere + // Then h1^2 + x^2 == r^2 == (l-x)^2 + h2^2 + // h1^x + x^2 = l^2 - 2 * l * x + x^2 + h2^2 + // 2 * l * x = l^2 + h2^2 - h1^2 + // x = (l^2 + h2^2 - h1^2) / (2 * l) + // r = sqrt( hl^1 + x^2 ) + Vector vecDelta; + VectorSubtract( vecCenterFar, vecCenterNear, vecDelta ); + float l = vecDelta.Length(); + float h1Sqr = vecCenterNear.DistToSqr( vecNearEdge ); + float h2Sqr = vecCenterFar.DistToSqr( vecFarEdge ); + float x = (l*l + h2Sqr - h1Sqr) / (2.0f * l); + VectorMA( vecCenterNear, (x / l), vecDelta, *pCenter ); + *pflRadius = sqrt( h1Sqr + x*x ); +} + +//----------------------------------------------------------------------------- +// Given a projection matrix, take the extremes of the space in transformed into world space and +// get a bounding sphere. +//----------------------------------------------------------------------------- +void CalculateSphereFromProjectionMatrix( const VMatrix &worldToVolume, Vector *pCenter, float *pflRadius ) +{ + VMatrix volumeToWorld; + MatrixInverseGeneral( worldToVolume, volumeToWorld ); + CalculateSphereFromProjectionMatrixInverse( volumeToWorld, pCenter, pflRadius ); +} + +#endif + +#if 0 +static inline void FrustumPlanesFromMatrixHelper( const VMatrix &shadowToWorld, const Vector &p1, const Vector &p2, const Vector &p3, VPlane &plane ) +{ + Vector world1, world2, world3; + Vector3DMultiplyPositionProjective( shadowToWorld, p1, world1 ); + Vector3DMultiplyPositionProjective( shadowToWorld, p2, world2 ); + Vector3DMultiplyPositionProjective( shadowToWorld, p3, world3 ); + + Vector v1, v2; + VectorSubtract( world2, world1, v1 ); + VectorSubtract( world3, world1, v2 ); + + CrossProduct( v1, v2, plane.m_Normal ); + VectorNormalize( plane.m_Normal ); + plane.m_Dist = DotProduct( plane.m_Normal, world1 ); +} + +void FrustumPlanesFromMatrix( const VMatrix &clipToWorld, Frustum_t &frustum ) +{ + VPlane planes[6]; + + FrustumPlanesFromMatrixHelper( clipToWorld, + Vector( 0.0f, 0.0f, 0.0f ), Vector( 1.0f, 0.0f, 0.0f ), Vector( 0.0f, 1.0f, 0.0f ), planes[FRUSTUM_NEARZ] ); + + FrustumPlanesFromMatrixHelper( clipToWorld, + Vector( 0.0f, 0.0f, 1.0f ), Vector( 0.0f, 1.0f, 1.0f ), Vector( 1.0f, 0.0f, 1.0f ), planes[FRUSTUM_FARZ] ); + + FrustumPlanesFromMatrixHelper( clipToWorld, + Vector( 1.0f, 0.0f, 0.0f ), Vector( 1.0f, 1.0f, 1.0f ), Vector( 1.0f, 1.0f, 0.0f ), planes[FRUSTUM_RIGHT] ); + + FrustumPlanesFromMatrixHelper( clipToWorld, + Vector( 0.0f, 0.0f, 0.0f ), Vector( 0.0f, 1.0f, 1.0f ), Vector( 0.0f, 0.0f, 1.0f ), planes[FRUSTUM_LEFT] ); + + FrustumPlanesFromMatrixHelper( clipToWorld, + Vector( 1.0f, 1.0f, 0.0f ), Vector( 1.0f, 1.0f, 1.0f ), Vector( 0.0f, 1.0f, 1.0f ), planes[FRUSTUM_TOP] ); + + FrustumPlanesFromMatrixHelper( clipToWorld, + Vector( 1.0f, 0.0f, 0.0f ), Vector( 0.0f, 0.0f, 1.0f ), Vector( 1.0f, 0.0f, 1.0f ), planes[FRUSTUM_BOTTOM] ); + + frustum.SetPlanes(planes); +} +#endif + +void MatrixBuildOrtho( VMatrix& dst, double left, double top, double right, double bottom, double zNear, double zFar ) +{ + // FIXME: This is being used incorrectly! Should read: + // D3DXMatrixOrthoOffCenterRH( &matrix, left, right, bottom, top, zNear, zFar ); + // Which is certainly why we need these extra -1 scales in y. Bleah + + // NOTE: The camera can be imagined as the following diagram: + // /z + // / + // /____ x Z is going into the screen + // | + // | + // |y + // + // (0,0,z) represents the upper-left corner of the screen. + // Our projection transform needs to transform from this space to a LH coordinate + // system that looks thusly: + // + // y| /z + // | / + // |/____ x Z is going into the screen + // + // Where x,y lies between -1 and 1, and z lies from 0 to 1 + // This is because the viewport transformation from projection space to pixels + // introduces a -1 scale in the y coordinates + // D3DXMatrixOrthoOffCenterRH( &matrix, left, right, top, bottom, zNear, zFar ); + + dst.Init( 2.0f / ( right - left ), 0.0f, 0.0f, ( left + right ) / ( left - right ), + 0.0f, 2.0f / ( bottom - top ), 0.0f, ( bottom + top ) / ( top - bottom ), + 0.0f, 0.0f, 1.0f / ( zNear - zFar ), zNear / ( zNear - zFar ), + 0.0f, 0.0f, 0.0f, 1.0f ); +} + +void MatrixBuildPerspectiveX( VMatrix& dst, double flFovX, double flAspect, double flZNear, double flZFar ) +{ + float flWidth = 2.0f * flZNear * tanf( flFovX * M_PI / 360.0f ); + float flHeight = flWidth / flAspect; + dst.Init( 2.0f * flZNear / flWidth, 0.0f, 0.0f, 0.0f, + 0.0f, 2.0f * flZNear/ flHeight, 0.0f, 0.0f, + 0.0f, 0.0f, flZFar / ( flZNear - flZFar ), flZNear * flZFar / ( flZNear - flZFar ), + 0.0f, 0.0f, -1.0f, 0.0f ); +} + +void MatrixBuildPerspectiveOffCenterX( VMatrix& dst, double flFovX, double flAspect, double flZNear, double flZFar, double bottom, double top, double left, double right ) +{ + float flWidth = 2.0f * flZNear * tanf( flFovX * M_PI / 360.0f ); + float flHeight = flWidth / flAspect; + + // bottom, top, left, right are 0..1 so convert to -/2../2 + float flLeft = -(flWidth/2.0f) * (1.0f - left) + left * (flWidth/2.0f); + float flRight = -(flWidth/2.0f) * (1.0f - right) + right * (flWidth/2.0f); + float flBottom = -(flHeight/2.0f) * (1.0f - bottom) + bottom * (flHeight/2.0f); + float flTop = -(flHeight/2.0f) * (1.0f - top) + top * (flHeight/2.0f); + + dst.Init( (2.0f * flZNear) / (flRight-flLeft), 0.0f, (flLeft+flRight)/(flRight-flLeft), 0.0f, + 0.0f, 2.0f*flZNear/(flTop-flBottom), (flTop+flBottom)/(flTop-flBottom), 0.0f, + 0.0f, 0.0f, flZFar/(flZNear-flZFar), flZNear*flZFar/(flZNear-flZFar), + 0.0f, 0.0f, -1.0f, 0.0f ); +} + + diff --git a/external/steamworks/glmgr/mathlite.h b/external/steamworks/glmgr/mathlite.h new file mode 100644 index 0000000..198cd60 --- /dev/null +++ b/external/steamworks/glmgr/mathlite.h @@ -0,0 +1,4437 @@ +#ifndef MATHLITE_H +#define MATHLITE_H + +//----------------------------------------------------------------------------- +// includes + +#include +#include +#include +#include + +#if defined( OSX ) && defined( __aarch64__ ) +#include +#else +#include +#endif + +//----------------------------------------------------------------------------- +// macros + +#define FLOAT32_NAN_BITS (unsigned long)0x7FC00000 // not a number! +#define FLOAT32_NAN BitsToFloat( FLOAT32_NAN_BITS ) +#define VEC_T_NAN FLOAT32_NAN + +//#define FastSqrt(x) sqrt(x) + +#ifndef Assert +#define Assert(x) +#endif + +#ifndef RAD2DEG + #define RAD2DEG( x ) ( (float)(x) * (float)(180.f / M_PI_F) ) +#endif + +#ifndef DEG2RAD + #define DEG2RAD( x ) ( (float)(x) * (float)(M_PI_F / 180.f) ) +#endif + +#ifndef M_PI + #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h +#endif + +#define M_PI_F ((float)(M_PI)) // Shouldn't collide with anything. + + +//----------------------------------------------------------------------------- +// typedefs +typedef float vec_t; + +enum +{ + PITCH = 0, // up / down + YAW, // left / right + ROLL // fall over +}; + +//----------------------------------------------------------------------------- +// inlines + +inline float fpmin( float a, float b ) +{ + return ( a < b ) ? a : b; +} + +inline float fpmax( float a, float b ) +{ + return ( a > b ) ? a : b; +} + + +inline unsigned long& FloatBits( vec_t& f ) +{ + return *reinterpret_cast((char*)(&f)); +} + + +inline unsigned long FloatBits( const vec_t &f ) +{ + union Convertor_t + { + vec_t f; + unsigned long ul; + }tmp; + tmp.f = f; + return tmp.ul; +} + + +inline vec_t BitsToFloat( unsigned long i ) +{ + union Convertor_t + { + vec_t f; + unsigned long ul; + }tmp; + tmp.ul = i; + return tmp.f; +} + +inline bool IsFinite( const vec_t &f ) +{ +#if _X360 + return f == f && fabs(f) <= FLT_MAX; +#else + return ((FloatBits(f) & 0x7F800000) != 0x7F800000); +#endif +} + +inline unsigned long FloatAbsBits( vec_t f ) +{ + return FloatBits(f) & 0x7FFFFFFF; +} + +inline float FloatMakeNegative( vec_t f ) +{ + return BitsToFloat( FloatBits(f) | 0x80000000 ); +} + +inline float FloatMakePositive( vec_t f ) +{ + return (float)fabs( f ); +} + +inline void SinCos( float radians, float *sine, float *cosine ) +{ + *sine = sin(radians); + *cosine = cos(radians); +} + +//----------------------------------------------------------------------------- +// The following are not declared as macros because they are often used in limiting situations, +// and sometimes the compiler simply refuses to inline them for some reason +#ifndef FastSqrt +inline float FastSqrt( float x ) +{ +#if defined( OSX ) && defined( __aarch64__ ) + return simd::sqrt( x ); +#else + __m128 root = _mm_sqrt_ss( _mm_load_ss( &x ) ); + return *( reinterpret_cast( &root ) ); +#endif +} +#endif + +inline float FastRSqrtFast( float x ) +{ +#if defined( OSX ) && defined( __aarch64__ ) + return simd::fast::rsqrt( x ); +#else + // use intrinsics + __m128 rroot = _mm_rsqrt_ss( _mm_load_ss( &x ) ); + return *( reinterpret_cast( &rroot ) ); +#endif +} +// Single iteration NewtonRaphson reciprocal square root: +// 0.5 * rsqrtps * (3 - x * rsqrtps(x) * rsqrtps(x)) +// Very low error, and fine to use in place of 1.f / sqrtf(x). +inline float FastRSqrt( float x ) +{ + float rroot = FastRSqrtFast( x ); + return (0.5f * rroot) * (3.f - (x * rroot) * rroot); +} + +//----------------------------------------------------------------------------- +// classes + +// Used to make certain code easier to read. +#define X_INDEX 0 +#define Y_INDEX 1 +#define Z_INDEX 2 + + +#ifdef VECTOR_PARANOIA +#define CHECK_VALID( _v) Assert( (_v).IsValid() ) +#else +#ifdef GNUC +#define CHECK_VALID( _v) +#else +#define CHECK_VALID( _v) 0 +#endif +#endif + +#define VecToString(v) (static_cast(CFmtStr("(%f, %f, %f)", (v).x, (v).y, (v).z))) // ** Note: this generates a temporary, don't hold reference! + +class VectorByValue; + +//========================================================= +// 3D Vector +//========================================================= +class Vector +{ +public: + // Members + vec_t x, y, z; + + // Construction/destruction: + Vector(void); + Vector(vec_t X, vec_t Y, vec_t Z); + + // Initialization + void Init(vec_t ix=0.0f, vec_t iy=0.0f, vec_t iz=0.0f); + // TODO (Ilya): Should there be an init that takes a single float for consistency? + + // Got any nasty NAN's? + bool IsValid() const; + void Invalidate(); + + // array access... + vec_t operator[](int i) const; + vec_t& operator[](int i); + + // Base address... + vec_t* Base(); + vec_t const* Base() const; + + // Cast to Vector2D... + //Vector2D& AsVector2D(); + //const Vector2D& AsVector2D() const; + + // Initialization methods + void Random( vec_t minVal, vec_t maxVal ); + inline void Zero(); ///< zero out a vector + + // equality + bool operator==(const Vector& v) const; + bool operator!=(const Vector& v) const; + + // arithmetic operations + inline Vector& operator+=(const Vector &v); + inline Vector& operator-=(const Vector &v); + inline Vector& operator*=(const Vector &v); + inline Vector& operator*=(float s); + inline Vector& operator/=(const Vector &v); + inline Vector& operator/=(float s); + inline Vector& operator+=(float fl) ; ///< broadcast add + inline Vector& operator-=(float fl) ; ///< broadcast sub + +// negate the vector components + void Negate(); + + // Get the vector's magnitude. + inline vec_t Length() const; + + // Get the vector's magnitude squared. + inline vec_t LengthSqr(void) const + { + CHECK_VALID(*this); + return (x*x + y*y + z*z); + } + + // return true if this vector is (0,0,0) within tolerance + bool IsZero( float tolerance = 0.01f ) const + { + return (x > -tolerance && x < tolerance && + y > -tolerance && y < tolerance && + z > -tolerance && z < tolerance); + } + + vec_t NormalizeInPlace(); + Vector Normalized() const; + bool IsLengthGreaterThan( float val ) const; + bool IsLengthLessThan( float val ) const; + + // check if a vector is within the box defined by two other vectors + inline bool WithinAABox( Vector const &boxmin, Vector const &boxmax); + + // Get the distance from this vector to the other one. + vec_t DistTo(const Vector &vOther) const; + + // Get the distance from this vector to the other one squared. + // NJS: note, VC wasn't inlining it correctly in several deeply nested inlines due to being an 'out of line' inline. + // may be able to tidy this up after switching to VC7 + inline vec_t DistToSqr(const Vector &vOther) const + { + Vector delta; + + delta.x = x - vOther.x; + delta.y = y - vOther.y; + delta.z = z - vOther.z; + + return delta.LengthSqr(); + } + + // Copy + void CopyToArray(float* rgfl) const; + + // Multiply, add, and assign to this (ie: *this = a + b * scalar). This + // is about 12% faster than the actual vector equation (because it's done per-component + // rather than per-vector). + void MulAdd(const Vector& a, const Vector& b, float scalar); + + // Dot product. + vec_t Dot(const Vector& vOther) const; + + // assignment + Vector& operator=(const Vector &vOther); + + // returns 0, 1, 2 corresponding to the component with the largest absolute value + inline int LargestComponent() const; + + // 2d + vec_t Length2D(void) const; + vec_t Length2DSqr(void) const; + + operator VectorByValue &() { return *((VectorByValue *)(this)); } + operator const VectorByValue &() const { return *((const VectorByValue *)(this)); } + +#ifndef VECTOR_NO_SLOW_OPERATIONS + // copy constructors +// Vector(const Vector &vOther); + + // arithmetic operations + Vector operator-(void) const; + + Vector operator+(const Vector& v) const; + Vector operator-(const Vector& v) const; + Vector operator*(const Vector& v) const; + Vector operator/(const Vector& v) const; + Vector operator*(float fl) const; + Vector operator/(float fl) const; + + // Cross product between two vectors. + Vector Cross(const Vector &vOther) const; + + // Returns a vector with the min or max in X, Y, and Z. + Vector Min(const Vector &vOther) const; + Vector Max(const Vector &vOther) const; + +#else + +private: + // No copy constructors allowed if we're in optimal mode + Vector(const Vector& vOther); +#endif +}; + + + +#define USE_M64S ( ( !defined( _X360 ) ) ) + + + +//========================================================= +// 4D Short Vector (aligned on 8-byte boundary) +//========================================================= +#if 0 +class ALIGN8 ShortVector +{ +public: + + short x, y, z, w; + + // Initialization + void Init(short ix = 0, short iy = 0, short iz = 0, short iw = 0 ); + + +#if USE_M64S + __m64 &AsM64() { return *(__m64*)&x; } + const __m64 &AsM64() const { return *(const __m64*)&x; } +#endif + + // Setter + void Set( const ShortVector& vOther ); + void Set( const short ix, const short iy, const short iz, const short iw ); + + // array access... + short operator[](int i) const; + short& operator[](int i); + + // Base address... + short* Base(); + short const* Base() const; + + // equality + bool operator==(const ShortVector& v) const; + bool operator!=(const ShortVector& v) const; + + // Arithmetic operations + inline ShortVector& operator+=(const ShortVector &v); + inline ShortVector& operator-=(const ShortVector &v); + inline ShortVector& operator*=(const ShortVector &v); + inline ShortVector& operator*=(float s); + inline ShortVector& operator/=(const ShortVector &v); + inline ShortVector& operator/=(float s); + inline ShortVector operator*(float fl) const; + +private: + + // No copy constructors allowed if we're in optimal mode +// ShortVector(ShortVector const& vOther); + + // No assignment operators either... +// ShortVector& operator=( ShortVector const& src ); + +} ALIGN8_POST; +#endif + + + + +#if 0 +//========================================================= +// 4D Integer Vector +//========================================================= +class IntVector4D +{ +public: + + int x, y, z, w; + + // Initialization + void Init(int ix = 0, int iy = 0, int iz = 0, int iw = 0 ); + +#if USE_M64S + __m64 &AsM64() { return *(__m64*)&x; } + const __m64 &AsM64() const { return *(const __m64*)&x; } +#endif + + // Setter + void Set( const IntVector4D& vOther ); + void Set( const int ix, const int iy, const int iz, const int iw ); + + // array access... + int operator[](int i) const; + int& operator[](int i); + + // Base address... + int* Base(); + int const* Base() const; + + // equality + bool operator==(const IntVector4D& v) const; + bool operator!=(const IntVector4D& v) const; + + // Arithmetic operations + inline IntVector4D& operator+=(const IntVector4D &v); + inline IntVector4D& operator-=(const IntVector4D &v); + inline IntVector4D& operator*=(const IntVector4D &v); + inline IntVector4D& operator*=(float s); + inline IntVector4D& operator/=(const IntVector4D &v); + inline IntVector4D& operator/=(float s); + inline IntVector4D operator*(float fl) const; + +private: + + // No copy constructors allowed if we're in optimal mode + // IntVector4D(IntVector4D const& vOther); + + // No assignment operators either... + // IntVector4D& operator=( IntVector4D const& src ); + +}; + +#endif + +//----------------------------------------------------------------------------- +// Allows us to specifically pass the vector by value when we need to +//----------------------------------------------------------------------------- +class VectorByValue : public Vector +{ +public: + // Construction/destruction: + VectorByValue(void) : Vector() {} + VectorByValue(vec_t X, vec_t Y, vec_t Z) : Vector( X, Y, Z ) {} + VectorByValue(const VectorByValue& vOther) { *this = vOther; } +}; + + +//----------------------------------------------------------------------------- +// Utility to simplify table construction. No constructor means can use +// traditional C-style initialization +//----------------------------------------------------------------------------- +class TableVector +{ +public: + vec_t x, y, z; + + operator Vector &() { return *((Vector *)(this)); } + operator const Vector &() const { return *((const Vector *)(this)); } + + // array access... + inline vec_t& operator[](int i) + { + Assert( (i >= 0) && (i < 3) ); + return ((vec_t*)this)[i]; + } + + inline vec_t operator[](int i) const + { + Assert( (i >= 0) && (i < 3) ); + return ((vec_t*)this)[i]; + } +}; + + +//----------------------------------------------------------------------------- +// Here's where we add all those lovely SSE optimized routines +//----------------------------------------------------------------------------- + +#if 0 +class ALIGN16 VectorAligned : public Vector +{ +public: + inline VectorAligned(void) {}; + inline VectorAligned(vec_t X, vec_t Y, vec_t Z) + { + Init(X,Y,Z); + } + +#ifdef VECTOR_NO_SLOW_OPERATIONS + +private: + // No copy constructors allowed if we're in optimal mode + VectorAligned(const VectorAligned& vOther); + VectorAligned(const Vector &vOther); + +#else +public: + explicit VectorAligned(const Vector &vOther) + { + Init(vOther.x, vOther.y, vOther.z); + } + + VectorAligned& operator=(const Vector &vOther) + { + Init(vOther.x, vOther.y, vOther.z); + return *this; + } + + VectorAligned& operator=(const VectorAligned &vOther) + { + // we know we're aligned, so use simd + // we can't use the convenient abstract interface coz it gets declared later +#ifdef _X360 + XMStoreVector4A(Base(), XMLoadVector4A(vOther.Base())); +#elif _WIN32 + _mm_store_ps(Base(), _mm_load_ps( vOther.Base() )); +#else + Init(vOther.x, vOther.y, vOther.z); +#endif + return *this; + } + + +#endif + float w; // this space is used anyway + + void* operator new[] ( size_t nSize) + { + return MemAlloc_AllocAligned(nSize, 16); + } + + void* operator new[] ( size_t nSize, const char *pFileName, int nLine) + { + return MemAlloc_AllocAligned(nSize, 16); + //return MemAlloc_AllocAlignedFileLine(nSize, 16, pFileName, nLine); + } + + void* operator new[] ( size_t nSize, int /*nBlockUse*/, const char *pFileName, int nLine) + { + return MemAlloc_AllocAligned(nSize, 16); + //return MemAlloc_AllocAlignedFileLine(nSize, 16, pFileName, nLine); + } + + void operator delete[] ( void* p) + { + MemAlloc_FreeAligned(p,true); + } + + void operator delete[] ( void* p, const char *pFileName, int nLine) + { + MemAlloc_FreeAligned(p,true); + //MemAlloc_FreeAligned(p, pFileName, nLine); + } + + void operator delete[] ( void* p, int /*nBlockUse*/, const char *pFileName, int nLine) + { + MemAlloc_FreeAligned(p,true); + //MemAlloc_FreeAligned(p, pFileName, nLine); + } + + // please don't allocate a single quaternion... + void* operator new ( size_t nSize ) + { + return MemAlloc_AllocAligned(nSize, 16); + } + void* operator new ( size_t nSize, const char *pFileName, int nLine ) + { + return MemAlloc_AllocAligned(nSize, 16); + //return MemAlloc_AllocAlignedFileLine(nSize, 16, pFileName, nLine); + } + void* operator new ( size_t nSize, int /*nBlockUse*/, const char *pFileName, int nLine ) + { + return MemAlloc_AllocAligned(nSize, 16); + //return MemAlloc_AllocAlignedFileLine(nSize, 16, pFileName, nLine); + } + void operator delete ( void* p) + { + MemAlloc_FreeAligned(p,true); + } + + void operator delete ( void* p, const char *pFileName, int nLine) + { + MemAlloc_FreeAligned(p,true); + //MemAlloc_FreeAligned(p, pFileName, nLine); + } + + void operator delete ( void* p, int /*nBlockUse*/, const char *pFileName, int nLine) + { + MemAlloc_FreeAligned(p,true); + //MemAlloc_FreeAligned(p, pFileName, nLine); + } +} ALIGN16_POST; + +#endif + +//----------------------------------------------------------------------------- +// Vector related operations +//----------------------------------------------------------------------------- + +// Vector clear +inline void VectorClear( Vector& a ); + +// Copy +inline void VectorCopy( const Vector& src, Vector& dst ); + +// Vector arithmetic +inline void VectorAdd( const Vector& a, const Vector& b, Vector& result ); +inline void VectorSubtract( const Vector& a, const Vector& b, Vector& result ); +inline void VectorMultiply( const Vector& a, vec_t b, Vector& result ); +inline void VectorMultiply( const Vector& a, const Vector& b, Vector& result ); +inline void VectorDivide( const Vector& a, vec_t b, Vector& result ); +inline void VectorDivide( const Vector& a, const Vector& b, Vector& result ); + +// Vector equality with tolerance +bool VectorsAreEqual( const Vector& src1, const Vector& src2, float tolerance = 0.0f ); + +#define VectorExpand(v) (v).x, (v).y, (v).z + + +// Normalization +// FIXME: Can't use quite yet +//vec_t VectorNormalize( Vector& v ); + +// Length +inline vec_t VectorLength( const Vector& v ); + +// Dot Product +inline vec_t DotProduct(const Vector& a, const Vector& b); + +// Cross product +void CrossProduct(const Vector& a, const Vector& b, Vector& result ); + +// Store the min or max of each of x, y, and z into the result. +void VectorMin( const Vector &a, const Vector &b, Vector &result ); +void VectorMax( const Vector &a, const Vector &b, Vector &result ); + +// Linearly interpolate between two vectors +void VectorLerp(const Vector& src1, const Vector& src2, vec_t t, Vector& dest ); +Vector VectorLerp(const Vector& src1, const Vector& src2, vec_t t ); + +inline Vector ReplicateToVector( float x ) +{ + return Vector( x, x, x ); +} + +inline bool PointWithinViewAngle( Vector const &vecSrcPosition, + Vector const &vecTargetPosition, + Vector const &vecLookDirection, float flCosHalfFOV ) +{ + Vector vecDelta = vecTargetPosition - vecSrcPosition; + float cosDiff = DotProduct( vecLookDirection, vecDelta ); + + if ( flCosHalfFOV <= 0 ) // >180 + { + // signs are different, answer is implicit + if ( cosDiff > 0 ) + return true; + + // a/sqrt(b) > c == a^2 < b * c ^2 + // IFF left and right sides are <= 0 + float flLen2 = vecDelta.LengthSqr(); + return ( cosDiff * cosDiff <= flLen2 * flCosHalfFOV * flCosHalfFOV ); + } + else // flCosHalfFOV > 0 + { + // signs are different, answer is implicit + if ( cosDiff < 0 ) + return false; + + // a/sqrt(b) > c == a^2 > b * c ^2 + // IFF left and right sides are >= 0 + float flLen2 = vecDelta.LengthSqr(); + return ( cosDiff * cosDiff >= flLen2 * flCosHalfFOV * flCosHalfFOV ); + } +} + + +#ifndef VECTOR_NO_SLOW_OPERATIONS + +// Cross product +Vector CrossProduct( const Vector& a, const Vector& b ); + +// Random vector creation +Vector RandomVector( vec_t minVal, vec_t maxVal ); + +#endif + +//float RandomVectorInUnitSphere( Vector *pVector ); +//float RandomVectorInUnitCircle( Vector2D *pVector ); + + +//----------------------------------------------------------------------------- +// +// Inlined Vector methods +// +//----------------------------------------------------------------------------- + + +//----------------------------------------------------------------------------- +// constructors +//----------------------------------------------------------------------------- +inline Vector::Vector(void) +{ +#ifdef _DEBUG +#ifdef VECTOR_PARANOIA + // Initialize to NAN to catch errors + x = y = z = VEC_T_NAN; +#endif +#endif +} + +inline Vector::Vector(vec_t X, vec_t Y, vec_t Z) +{ + x = X; y = Y; z = Z; + CHECK_VALID(*this); +} + +//inline Vector::Vector(const float *pFloat) +//{ +// Assert( pFloat ); +// x = pFloat[0]; y = pFloat[1]; z = pFloat[2]; +// CHECK_VALID(*this); +//} + +#if 0 +//----------------------------------------------------------------------------- +// copy constructor +//----------------------------------------------------------------------------- + +inline Vector::Vector(const Vector &vOther) +{ + CHECK_VALID(vOther); + x = vOther.x; y = vOther.y; z = vOther.z; +} +#endif + +//----------------------------------------------------------------------------- +// initialization +//----------------------------------------------------------------------------- + +inline void Vector::Init( vec_t ix, vec_t iy, vec_t iz ) +{ + x = ix; y = iy; z = iz; + CHECK_VALID(*this); +} + +/* +inline void Vector::Random( vec_t minVal, vec_t maxVal ) +{ + x = minVal + ((float)rand() / VALVE_RAND_MAX) * (maxVal - minVal); + y = minVal + ((float)rand() / VALVE_RAND_MAX) * (maxVal - minVal); + z = minVal + ((float)rand() / VALVE_RAND_MAX) * (maxVal - minVal); + CHECK_VALID(*this); +} +*/ + +// This should really be a single opcode on the PowerPC (move r0 onto the vec reg) +inline void Vector::Zero() +{ + x = y = z = 0.0f; +} + +inline void VectorClear( Vector& a ) +{ + a.x = a.y = a.z = 0.0f; +} + +//----------------------------------------------------------------------------- +// assignment +//----------------------------------------------------------------------------- + +inline Vector& Vector::operator=(const Vector &vOther) +{ + CHECK_VALID(vOther); + x=vOther.x; y=vOther.y; z=vOther.z; + return *this; +} + + +//----------------------------------------------------------------------------- +// Array access +//----------------------------------------------------------------------------- +inline vec_t& Vector::operator[](int i) +{ + Assert( (i >= 0) && (i < 3) ); + return ((vec_t*)this)[i]; +} + +inline vec_t Vector::operator[](int i) const +{ + Assert( (i >= 0) && (i < 3) ); + return ((vec_t*)this)[i]; +} + + +//----------------------------------------------------------------------------- +// Base address... +//----------------------------------------------------------------------------- +inline vec_t* Vector::Base() +{ + return (vec_t*)this; +} + +inline vec_t const* Vector::Base() const +{ + return (vec_t const*)this; +} + +//----------------------------------------------------------------------------- +// Cast to Vector2D... +//----------------------------------------------------------------------------- + +//inline Vector2D& Vector::AsVector2D() +//{ +// return *(Vector2D*)this; +//} + +//inline const Vector2D& Vector::AsVector2D() const +//{ +// return *(const Vector2D*)this; +//} + +//----------------------------------------------------------------------------- +// IsValid? +//----------------------------------------------------------------------------- + +inline bool Vector::IsValid() const +{ + return IsFinite(x) && IsFinite(y) && IsFinite(z); +} + +//----------------------------------------------------------------------------- +// Invalidate +//----------------------------------------------------------------------------- + +inline void Vector::Invalidate() +{ +//#ifdef _DEBUG +//#ifdef VECTOR_PARANOIA + x = y = z = VEC_T_NAN; +//#endif +//#endif +} + +//----------------------------------------------------------------------------- +// comparison +//----------------------------------------------------------------------------- + +inline bool Vector::operator==( const Vector& src ) const +{ + CHECK_VALID(src); + CHECK_VALID(*this); + return (src.x == x) && (src.y == y) && (src.z == z); +} + +inline bool Vector::operator!=( const Vector& src ) const +{ + CHECK_VALID(src); + CHECK_VALID(*this); + return (src.x != x) || (src.y != y) || (src.z != z); +} + + +//----------------------------------------------------------------------------- +// Copy +//----------------------------------------------------------------------------- + +inline void VectorCopy( const Vector& src, Vector& dst ) +{ + CHECK_VALID(src); + dst.x = src.x; + dst.y = src.y; + dst.z = src.z; +} + +inline void Vector::CopyToArray(float* rgfl) const +{ + Assert( rgfl ); + CHECK_VALID(*this); + rgfl[0] = x, rgfl[1] = y, rgfl[2] = z; +} + +//----------------------------------------------------------------------------- +// standard math operations +//----------------------------------------------------------------------------- +// #pragma message("TODO: these should be SSE") + +inline void Vector::Negate() +{ + CHECK_VALID(*this); + x = -x; y = -y; z = -z; +} + +inline Vector& Vector::operator+=(const Vector& v) +{ + CHECK_VALID(*this); + CHECK_VALID(v); + x+=v.x; y+=v.y; z += v.z; + return *this; +} + +inline Vector& Vector::operator-=(const Vector& v) +{ + CHECK_VALID(*this); + CHECK_VALID(v); + x-=v.x; y-=v.y; z -= v.z; + return *this; +} + +inline Vector& Vector::operator*=(float fl) +{ + x *= fl; + y *= fl; + z *= fl; + CHECK_VALID(*this); + return *this; +} + +inline Vector& Vector::operator*=(const Vector& v) +{ + CHECK_VALID(v); + x *= v.x; + y *= v.y; + z *= v.z; + CHECK_VALID(*this); + return *this; +} + +// this ought to be an opcode. +inline Vector& Vector::operator+=(float fl) +{ + x += fl; + y += fl; + z += fl; + CHECK_VALID(*this); + return *this; +} + +inline Vector& Vector::operator-=(float fl) +{ + x -= fl; + y -= fl; + z -= fl; + CHECK_VALID(*this); + return *this; +} + + + +inline Vector& Vector::operator/=(float fl) +{ + Assert( fl != 0.0f ); + float oofl = 1.0f / fl; + x *= oofl; + y *= oofl; + z *= oofl; + CHECK_VALID(*this); + return *this; +} + +inline Vector& Vector::operator/=(const Vector& v) +{ + CHECK_VALID(v); + Assert( v.x != 0.0f && v.y != 0.0f && v.z != 0.0f ); + x /= v.x; + y /= v.y; + z /= v.z; + CHECK_VALID(*this); + return *this; +} + + +#if 0 +//----------------------------------------------------------------------------- +// +// Inlined Short Vector methods +// +//----------------------------------------------------------------------------- + + +inline void ShortVector::Init( short ix, short iy, short iz, short iw ) +{ + x = ix; y = iy; z = iz; w = iw; +} + +inline void ShortVector::Set( const ShortVector& vOther ) +{ + x = vOther.x; + y = vOther.y; + z = vOther.z; + w = vOther.w; +} + +inline void ShortVector::Set( const short ix, const short iy, const short iz, const short iw ) +{ + x = ix; + y = iy; + z = iz; + w = iw; +} + + +//----------------------------------------------------------------------------- +// Array access +//----------------------------------------------------------------------------- +inline short ShortVector::operator[](int i) const +{ + Assert( (i >= 0) && (i < 4) ); + return ((short*)this)[i]; +} + +inline short& ShortVector::operator[](int i) +{ + Assert( (i >= 0) && (i < 4) ); + return ((short*)this)[i]; +} + +//----------------------------------------------------------------------------- +// Base address... +//----------------------------------------------------------------------------- +inline short* ShortVector::Base() +{ + return (short*)this; +} + +inline short const* ShortVector::Base() const +{ + return (short const*)this; +} + + +//----------------------------------------------------------------------------- +// comparison +//----------------------------------------------------------------------------- + +inline bool ShortVector::operator==( const ShortVector& src ) const +{ + return (src.x == x) && (src.y == y) && (src.z == z) && (src.w == w); +} + +inline bool ShortVector::operator!=( const ShortVector& src ) const +{ + return (src.x != x) || (src.y != y) || (src.z != z) || (src.w != w); +} + + + +//----------------------------------------------------------------------------- +// standard math operations +//----------------------------------------------------------------------------- + +inline ShortVector& ShortVector::operator+=(const ShortVector& v) +{ + x+=v.x; y+=v.y; z += v.z; w += v.w; + return *this; +} + +inline ShortVector& ShortVector::operator-=(const ShortVector& v) +{ + x-=v.x; y-=v.y; z -= v.z; w -= v.w; + return *this; +} + +inline ShortVector& ShortVector::operator*=(float fl) +{ + x = (short)(x * fl); + y = (short)(y * fl); + z = (short)(z * fl); + w = (short)(w * fl); + return *this; +} + +inline ShortVector& ShortVector::operator*=(const ShortVector& v) +{ + x = (short)(x * v.x); + y = (short)(y * v.y); + z = (short)(z * v.z); + w = (short)(w * v.w); + return *this; +} + +inline ShortVector& ShortVector::operator/=(float fl) +{ + Assert( fl != 0.0f ); + float oofl = 1.0f / fl; + x = (short)(x * oofl); + y = (short)(y * oofl); + z = (short)(z * oofl); + w = (short)(w * oofl); + return *this; +} + +inline ShortVector& ShortVector::operator/=(const ShortVector& v) +{ + Assert( v.x != 0 && v.y != 0 && v.z != 0 && v.w != 0 ); + x = (short)(x / v.x); + y = (short)(y / v.y); + z = (short)(z / v.z); + w = (short)(w / v.w); + return *this; +} + +inline void ShortVectorMultiply( const ShortVector& src, float fl, ShortVector& res ) +{ + Assert( IsFinite(fl) ); + res.x = (short)(src.x * fl); + res.y = (short)(src.y * fl); + res.z = (short)(src.z * fl); + res.w = (short)(src.w * fl); +} + +inline ShortVector ShortVector::operator*(float fl) const +{ + ShortVector res; + ShortVectorMultiply( *this, fl, res ); + return res; +} + +#endif + + + +#if 0 +//----------------------------------------------------------------------------- +// +// Inlined Integer Vector methods +// +//----------------------------------------------------------------------------- + + +inline void IntVector4D::Init( int ix, int iy, int iz, int iw ) +{ + x = ix; y = iy; z = iz; w = iw; +} + +inline void IntVector4D::Set( const IntVector4D& vOther ) +{ + x = vOther.x; + y = vOther.y; + z = vOther.z; + w = vOther.w; +} + +inline void IntVector4D::Set( const int ix, const int iy, const int iz, const int iw ) +{ + x = ix; + y = iy; + z = iz; + w = iw; +} + + +//----------------------------------------------------------------------------- +// Array access +//----------------------------------------------------------------------------- +inline int IntVector4D::operator[](int i) const +{ + Assert( (i >= 0) && (i < 4) ); + return ((int*)this)[i]; +} + +inline int& IntVector4D::operator[](int i) +{ + Assert( (i >= 0) && (i < 4) ); + return ((int*)this)[i]; +} + +//----------------------------------------------------------------------------- +// Base address... +//----------------------------------------------------------------------------- +inline int* IntVector4D::Base() +{ + return (int*)this; +} + +inline int const* IntVector4D::Base() const +{ + return (int const*)this; +} + + +//----------------------------------------------------------------------------- +// comparison +//----------------------------------------------------------------------------- + +inline bool IntVector4D::operator==( const IntVector4D& src ) const +{ + return (src.x == x) && (src.y == y) && (src.z == z) && (src.w == w); +} + +inline bool IntVector4D::operator!=( const IntVector4D& src ) const +{ + return (src.x != x) || (src.y != y) || (src.z != z) || (src.w != w); +} + + + +//----------------------------------------------------------------------------- +// standard math operations +//----------------------------------------------------------------------------- + +inline IntVector4D& IntVector4D::operator+=(const IntVector4D& v) +{ + x+=v.x; y+=v.y; z += v.z; w += v.w; + return *this; +} + +inline IntVector4D& IntVector4D::operator-=(const IntVector4D& v) +{ + x-=v.x; y-=v.y; z -= v.z; w -= v.w; + return *this; +} + +inline IntVector4D& IntVector4D::operator*=(float fl) +{ + x = (int)(x * fl); + y = (int)(y * fl); + z = (int)(z * fl); + w = (int)(w * fl); + return *this; +} + +inline IntVector4D& IntVector4D::operator*=(const IntVector4D& v) +{ + x = (int)(x * v.x); + y = (int)(y * v.y); + z = (int)(z * v.z); + w = (int)(w * v.w); + return *this; +} + +inline IntVector4D& IntVector4D::operator/=(float fl) +{ + Assert( fl != 0.0f ); + float oofl = 1.0f / fl; + x = (int)(x * oofl); + y = (int)(y * oofl); + z = (int)(z * oofl); + w = (int)(w * oofl); + return *this; +} + +inline IntVector4D& IntVector4D::operator/=(const IntVector4D& v) +{ + Assert( v.x != 0 && v.y != 0 && v.z != 0 && v.w != 0 ); + x = (int)(x / v.x); + y = (int)(y / v.y); + z = (int)(z / v.z); + w = (int)(w / v.w); + return *this; +} + +inline void IntVector4DMultiply( const IntVector4D& src, float fl, IntVector4D& res ) +{ + Assert( IsFinite(fl) ); + res.x = (int)(src.x * fl); + res.y = (int)(src.y * fl); + res.z = (int)(src.z * fl); + res.w = (int)(src.w * fl); +} + +inline IntVector4D IntVector4D::operator*(float fl) const +{ + IntVector4D res; + IntVector4DMultiply( *this, fl, res ); + return res; +} + +#endif + +// ======================= + + +inline void VectorAdd( const Vector& a, const Vector& b, Vector& c ) +{ + CHECK_VALID(a); + CHECK_VALID(b); + c.x = a.x + b.x; + c.y = a.y + b.y; + c.z = a.z + b.z; +} + +inline void VectorSubtract( const Vector& a, const Vector& b, Vector& c ) +{ + CHECK_VALID(a); + CHECK_VALID(b); + c.x = a.x - b.x; + c.y = a.y - b.y; + c.z = a.z - b.z; +} + +inline void VectorMultiply( const Vector& a, vec_t b, Vector& c ) +{ + CHECK_VALID(a); + Assert( IsFinite(b) ); + c.x = a.x * b; + c.y = a.y * b; + c.z = a.z * b; +} + +inline void VectorMultiply( const Vector& a, const Vector& b, Vector& c ) +{ + CHECK_VALID(a); + CHECK_VALID(b); + c.x = a.x * b.x; + c.y = a.y * b.y; + c.z = a.z * b.z; +} + +inline void VectorDivide( const Vector& a, vec_t b, Vector& c ) +{ + CHECK_VALID(a); + Assert( b != 0.0f ); + vec_t oob = 1.0f / b; + c.x = a.x * oob; + c.y = a.y * oob; + c.z = a.z * oob; +} + +inline void VectorDivide( const Vector& a, const Vector& b, Vector& c ) +{ + CHECK_VALID(a); + CHECK_VALID(b); + Assert( (b.x != 0.0f) && (b.y != 0.0f) && (b.z != 0.0f) ); + c.x = a.x / b.x; + c.y = a.y / b.y; + c.z = a.z / b.z; +} + +// FIXME: Remove +// For backwards compatability +inline void Vector::MulAdd(const Vector& a, const Vector& b, float scalar) +{ + CHECK_VALID(a); + CHECK_VALID(b); + x = a.x + b.x * scalar; + y = a.y + b.y * scalar; + z = a.z + b.z * scalar; +} + +inline void VectorLerp(const Vector& src1, const Vector& src2, vec_t t, Vector& dest ) +{ + CHECK_VALID(src1); + CHECK_VALID(src2); + dest.x = src1.x + (src2.x - src1.x) * t; + dest.y = src1.y + (src2.y - src1.y) * t; + dest.z = src1.z + (src2.z - src1.z) * t; +} + +inline Vector VectorLerp(const Vector& src1, const Vector& src2, vec_t t ) +{ + Vector result; + VectorLerp( src1, src2, t, result ); + return result; +} + +#if 0 +//----------------------------------------------------------------------------- +// Temporary storage for vector results so const Vector& results can be returned +//----------------------------------------------------------------------------- +inline Vector &AllocTempVector() +{ + static Vector s_vecTemp[128]; + static CInterlockedInt s_nIndex; + + int nIndex; + for (;;) + { + int nOldIndex = s_nIndex; + nIndex = ( (nOldIndex + 0x10001) & 0x7F ); + + if ( s_nIndex.AssignIf( nOldIndex, nIndex ) ) + { + break; + } + ThreadPause(); + } + return s_vecTemp[nIndex & 0xffff]; +} +#endif + + + +//----------------------------------------------------------------------------- +// dot, cross +//----------------------------------------------------------------------------- +inline vec_t DotProduct(const Vector& a, const Vector& b) +{ + CHECK_VALID(a); + CHECK_VALID(b); + return( a.x*b.x + a.y*b.y + a.z*b.z ); +} + +// for backwards compatability +inline vec_t Vector::Dot( const Vector& vOther ) const +{ + CHECK_VALID(vOther); + return DotProduct( *this, vOther ); +} + +inline int Vector::LargestComponent() const +{ + float flAbsx = fabs(x); + float flAbsy = fabs(y); + float flAbsz = fabs(z); + if ( flAbsx > flAbsy ) + { + if ( flAbsx > flAbsz ) + return X_INDEX; + return Z_INDEX; + } + if ( flAbsy > flAbsz ) + return Y_INDEX; + return Z_INDEX; +} + +inline void CrossProduct(const Vector& a, const Vector& b, Vector& result ) +{ + CHECK_VALID(a); + CHECK_VALID(b); + Assert( &a != &result ); + Assert( &b != &result ); + result.x = a.y*b.z - a.z*b.y; + result.y = a.z*b.x - a.x*b.z; + result.z = a.x*b.y - a.y*b.x; +} + +inline vec_t DotProductAbs( const Vector &v0, const Vector &v1 ) +{ + CHECK_VALID(v0); + CHECK_VALID(v1); + return FloatMakePositive(v0.x*v1.x) + FloatMakePositive(v0.y*v1.y) + FloatMakePositive(v0.z*v1.z); +} + +inline vec_t DotProductAbs( const Vector &v0, const float *v1 ) +{ + return FloatMakePositive(v0.x * v1[0]) + FloatMakePositive(v0.y * v1[1]) + FloatMakePositive(v0.z * v1[2]); +} + +//----------------------------------------------------------------------------- +// length +//----------------------------------------------------------------------------- + +inline vec_t VectorLength( const Vector& v ) +{ + CHECK_VALID(v); + return (vec_t)FastSqrt(v.x*v.x + v.y*v.y + v.z*v.z); +} + + +inline vec_t Vector::Length(void) const +{ + CHECK_VALID(*this); + return VectorLength( *this ); +} + + +//----------------------------------------------------------------------------- +// Normalization +//----------------------------------------------------------------------------- + +/* +// FIXME: Can't use until we're un-macroed in mathlib.h +inline vec_t VectorNormalize( Vector& v ) +{ + Assert( v.IsValid() ); + vec_t l = v.Length(); + if (l != 0.0f) + { + v /= l; + } + else + { + // FIXME: + // Just copying the existing implemenation; shouldn't res.z == 0? + v.x = v.y = 0.0f; v.z = 1.0f; + } + return l; +} +*/ + + +// check a point against a box +bool Vector::WithinAABox( Vector const &boxmin, Vector const &boxmax) +{ + return ( + ( x >= boxmin.x ) && ( x <= boxmax.x) && + ( y >= boxmin.y ) && ( y <= boxmax.y) && + ( z >= boxmin.z ) && ( z <= boxmax.z) + ); +} + +//----------------------------------------------------------------------------- +// Get the distance from this vector to the other one +//----------------------------------------------------------------------------- +inline vec_t Vector::DistTo(const Vector &vOther) const +{ + Vector delta; + VectorSubtract( *this, vOther, delta ); + return delta.Length(); +} + + +//----------------------------------------------------------------------------- +// Vector equality with tolerance +//----------------------------------------------------------------------------- +inline bool VectorsAreEqual( const Vector& src1, const Vector& src2, float tolerance ) +{ + if (FloatMakePositive(src1.x - src2.x) > tolerance) + return false; + if (FloatMakePositive(src1.y - src2.y) > tolerance) + return false; + return (FloatMakePositive(src1.z - src2.z) <= tolerance); +} + + +//----------------------------------------------------------------------------- +// Computes the closest point to vecTarget no farther than flMaxDist from vecStart +//----------------------------------------------------------------------------- +inline void ComputeClosestPoint( const Vector& vecStart, float flMaxDist, const Vector& vecTarget, Vector *pResult ) +{ + Vector vecDelta; + VectorSubtract( vecTarget, vecStart, vecDelta ); + float flDistSqr = vecDelta.LengthSqr(); + if ( flDistSqr <= flMaxDist * flMaxDist ) + { + *pResult = vecTarget; + } + else + { + vecDelta /= FastSqrt( flDistSqr ); + vecDelta *= flMaxDist; + VectorAdd( vecStart, vecDelta, *pResult ); + } +} + + +//----------------------------------------------------------------------------- +// Takes the absolute value of a vector +//----------------------------------------------------------------------------- +inline void VectorAbs( const Vector& src, Vector& dst ) +{ + dst.x = FloatMakePositive(src.x); + dst.y = FloatMakePositive(src.y); + dst.z = FloatMakePositive(src.z); +} + + +//----------------------------------------------------------------------------- +// +// Slow methods +// +//----------------------------------------------------------------------------- + +#ifndef VECTOR_NO_SLOW_OPERATIONS + +//----------------------------------------------------------------------------- +// Returns a vector with the min or max in X, Y, and Z. +//----------------------------------------------------------------------------- +inline Vector Vector::Min(const Vector &vOther) const +{ + return Vector(x < vOther.x ? x : vOther.x, + y < vOther.y ? y : vOther.y, + z < vOther.z ? z : vOther.z); +} + +inline Vector Vector::Max(const Vector &vOther) const +{ + return Vector(x > vOther.x ? x : vOther.x, + y > vOther.y ? y : vOther.y, + z > vOther.z ? z : vOther.z); +} + + +//----------------------------------------------------------------------------- +// arithmetic operations +//----------------------------------------------------------------------------- + +inline Vector Vector::operator-(void) const +{ + return Vector(-x,-y,-z); +} + +inline Vector Vector::operator+(const Vector& v) const +{ + Vector res; + VectorAdd( *this, v, res ); + return res; +} + +inline Vector Vector::operator-(const Vector& v) const +{ + Vector res; + VectorSubtract( *this, v, res ); + return res; +} + +inline Vector Vector::operator*(float fl) const +{ + Vector res; + VectorMultiply( *this, fl, res ); + return res; +} + +inline Vector Vector::operator*(const Vector& v) const +{ + Vector res; + VectorMultiply( *this, v, res ); + return res; +} + +inline Vector Vector::operator/(float fl) const +{ + Vector res; + VectorDivide( *this, fl, res ); + return res; +} + +inline Vector Vector::operator/(const Vector& v) const +{ + Vector res; + VectorDivide( *this, v, res ); + return res; +} + +inline Vector operator*(float fl, const Vector& v) +{ + return v * fl; +} + +//----------------------------------------------------------------------------- +// cross product +//----------------------------------------------------------------------------- + +inline Vector Vector::Cross(const Vector& vOther) const +{ + Vector res; + CrossProduct( *this, vOther, res ); + return res; +} + +//----------------------------------------------------------------------------- +// 2D +//----------------------------------------------------------------------------- + +inline vec_t Vector::Length2D(void) const +{ + return (vec_t)FastSqrt(x*x + y*y); +} + +inline vec_t Vector::Length2DSqr(void) const +{ + return (x*x + y*y); +} + +inline Vector CrossProduct(const Vector& a, const Vector& b) +{ + return Vector( a.y*b.z - a.z*b.y, a.z*b.x - a.x*b.z, a.x*b.y - a.y*b.x ); +} + +inline void VectorMin( const Vector &a, const Vector &b, Vector &result ) +{ + result.x = fpmin(a.x, b.x); + result.y = fpmin(a.y, b.y); + result.z = fpmin(a.z, b.z); +} + +inline void VectorMax( const Vector &a, const Vector &b, Vector &result ) +{ + result.x = fpmax(a.x, b.x); + result.y = fpmax(a.y, b.y); + result.z = fpmax(a.z, b.z); +} + +inline float ComputeVolume( const Vector &vecMins, const Vector &vecMaxs ) +{ + Vector vecDelta; + VectorSubtract( vecMaxs, vecMins, vecDelta ); + return DotProduct( vecDelta, vecDelta ); +} + +// Get a random vector. +inline Vector RandomVector( float minVal, float maxVal ) +{ + Vector random; + random.Random( minVal, maxVal ); + return random; +} + +#endif //slow + +//----------------------------------------------------------------------------- +// Helper debugging stuff.... +//----------------------------------------------------------------------------- + +inline bool operator==( float const* f, const Vector& v ) +{ + // AIIIEEEE!!!! + Assert(0); + return false; +} + +inline bool operator==( const Vector& v, float const* f ) +{ + // AIIIEEEE!!!! + Assert(0); + return false; +} + +inline bool operator!=( float const* f, const Vector& v ) +{ + // AIIIEEEE!!!! + Assert(0); + return false; +} + +inline bool operator!=( const Vector& v, float const* f ) +{ + // AIIIEEEE!!!! + Assert(0); + return false; +} + + +// return a vector perpendicular to another, with smooth variation. The difference between this and +// something like VectorVectors is that there are now discontinuities. _unlike_ VectorVectors, +// you won't get an "u +void VectorPerpendicularToVector( Vector const &in, Vector *pvecOut ); + +//----------------------------------------------------------------------------- +// AngularImpulse +//----------------------------------------------------------------------------- +// AngularImpulse are exponetial maps (an axis scaled by a "twist" angle in degrees) +typedef Vector AngularImpulse; + +#ifndef VECTOR_NO_SLOW_OPERATIONS + +inline AngularImpulse RandomAngularImpulse( float minVal, float maxVal ) +{ + AngularImpulse angImp; + angImp.Random( minVal, maxVal ); + return angImp; +} + +#endif + + +//----------------------------------------------------------------------------- +// Quaternion +//----------------------------------------------------------------------------- + +class RadianEuler; + +class Quaternion // same data-layout as engine's vec4_t, +{ // which is a vec_t[4] +public: + inline Quaternion(void) { + + // Initialize to NAN to catch errors +#ifdef _DEBUG +#ifdef VECTOR_PARANOIA + x = y = z = w = VEC_T_NAN; +#endif +#endif + } + inline Quaternion(vec_t ix, vec_t iy, vec_t iz, vec_t iw) : x(ix), y(iy), z(iz), w(iw) { } + inline Quaternion(RadianEuler const &angle); // evil auto type promotion!!! + + inline void Init(vec_t ix=0.0f, vec_t iy=0.0f, vec_t iz=0.0f, vec_t iw=0.0f) { x = ix; y = iy; z = iz; w = iw; } + + bool IsValid() const; + void Invalidate(); + + bool operator==( const Quaternion &src ) const; + bool operator!=( const Quaternion &src ) const; + + vec_t* Base() { return (vec_t*)this; } + const vec_t* Base() const { return (vec_t*)this; } + + // array access... + vec_t operator[](int i) const; + vec_t& operator[](int i); + + vec_t x, y, z, w; +}; + + +//----------------------------------------------------------------------------- +// Array access +//----------------------------------------------------------------------------- +inline vec_t& Quaternion::operator[](int i) +{ + Assert( (i >= 0) && (i < 4) ); + return ((vec_t*)this)[i]; +} + +inline vec_t Quaternion::operator[](int i) const +{ + Assert( (i >= 0) && (i < 4) ); + return ((vec_t*)this)[i]; +} + + +//----------------------------------------------------------------------------- +// Equality test +//----------------------------------------------------------------------------- +inline bool Quaternion::operator==( const Quaternion &src ) const +{ + return ( x == src.x ) && ( y == src.y ) && ( z == src.z ) && ( w == src.w ); +} + +inline bool Quaternion::operator!=( const Quaternion &src ) const +{ + return !operator==( src ); +} + + +//----------------------------------------------------------------------------- +// Quaternion equality with tolerance +//----------------------------------------------------------------------------- +inline bool QuaternionsAreEqual( const Quaternion& src1, const Quaternion& src2, float tolerance ) +{ + if (FloatMakePositive(src1.x - src2.x) > tolerance) + return false; + if (FloatMakePositive(src1.y - src2.y) > tolerance) + return false; + if (FloatMakePositive(src1.z - src2.z) > tolerance) + return false; + return (FloatMakePositive(src1.w - src2.w) <= tolerance); +} + + +#if 0 +//----------------------------------------------------------------------------- +// Here's where we add all those lovely SSE optimized routines +//----------------------------------------------------------------------------- +class ALIGN16 QuaternionAligned : public Quaternion +{ +public: + inline QuaternionAligned(void) {}; + inline QuaternionAligned(vec_t X, vec_t Y, vec_t Z, vec_t W) + { + Init(X,Y,Z,W); + } + + operator Quaternion * () { return this; } + operator const Quaternion * () { return this; } + +#ifdef VECTOR_NO_SLOW_OPERATIONS + +private: + // No copy constructors allowed if we're in optimal mode + QuaternionAligned(const QuaternionAligned& vOther); + QuaternionAligned(const Quaternion &vOther); + +#else +public: + explicit QuaternionAligned(const Quaternion &vOther) + { + Init(vOther.x, vOther.y, vOther.z, vOther.w); + } + + QuaternionAligned& operator=(const Quaternion &vOther) + { + Init(vOther.x, vOther.y, vOther.z, vOther.w); + return *this; + } + + QuaternionAligned& operator=(const QuaternionAligned &vOther) + { + // we know we're aligned, so use simd + // we can't use the convenient abstract interface coz it gets declared later +#ifdef _X360 + XMStoreVector4A(Base(), XMLoadVector4A(vOther.Base())); +#elif _WIN32 + _mm_store_ps(Base(), _mm_load_ps( vOther.Base() )); +#else + Init(vOther.x, vOther.y, vOther.z, vOther.w); +#endif + return *this; + } + +#endif + + void* operator new[] ( size_t nSize) + { + return MemAlloc_AllocAligned(nSize, 16); + } + + void* operator new[] ( size_t nSize, const char *pFileName, int nLine) + { + return MemAlloc_AllocAligned(nSize, 16); + //return MemAlloc_AllocAlignedFileLine(nSize, 16, pFileName, nLine); + } + + void* operator new[] ( size_t nSize, int /*nBlockUse*/, const char *pFileName, int nLine) + { + return MemAlloc_AllocAligned(nSize, 16); + //return MemAlloc_AllocAlignedFileLine(nSize, 16, pFileName, nLine); + } + + void operator delete[] ( void* p) + { + MemAlloc_FreeAligned(p,true); + } + + void operator delete[] ( void* p, const char *pFileName, int nLine) + { + MemAlloc_FreeAligned(p,true); + //MemAlloc_FreeAligned(p, pFileName, nLine); + } + + void operator delete[] ( void* p, int /*nBlockUse*/, const char *pFileName, int nLine) + { + MemAlloc_FreeAligned(p,true); + //MemAlloc_FreeAligned(p, pFileName, nLine); + } + + // please don't allocate a single quaternion... + void* operator new ( size_t nSize ) + { + return MemAlloc_AllocAligned(nSize, 16); + } + void* operator new ( size_t nSize, const char *pFileName, int nLine ) + { + return MemAlloc_AllocAligned(nSize, 16); + //return MemAlloc_AllocAlignedFileLine(nSize, 16, pFileName, nLine); + } + void* operator new ( size_t nSize, int /*nBlockUse*/, const char *pFileName, int nLine ) + { + return MemAlloc_AllocAligned(nSize, 16); + //return MemAlloc_AllocAlignedFileLine(nSize, 16, pFileName, nLine); + } + void operator delete ( void* p) + { + MemAlloc_FreeAligned(p,true); + //MemAlloc_FreeAligned(p); + } + + void operator delete ( void* p, const char *pFileName, int nLine) + { + MemAlloc_FreeAligned(p,true); + //MemAlloc_FreeAligned(p, pFileName, nLine); + } + + void operator delete ( void* p, int /*nBlockUse*/, const char *pFileName, int nLine) + { + MemAlloc_FreeAligned(p,true); + //MemAlloc_FreeAligned(p, pFileName, nLine); + } +} ALIGN16_POST; + +#endif + +//----------------------------------------------------------------------------- +// Radian Euler angle aligned to axis (NOT ROLL/PITCH/YAW) +//----------------------------------------------------------------------------- +class QAngle; +class RadianEuler +{ +public: + inline RadianEuler(void) { } + inline RadianEuler(vec_t X, vec_t Y, vec_t Z) { x = X; y = Y; z = Z; } + inline RadianEuler(Quaternion const &q); // evil auto type promotion!!! + inline RadianEuler(QAngle const &angles); // evil auto type promotion!!! + + // Initialization + inline void Init(vec_t ix=0.0f, vec_t iy=0.0f, vec_t iz=0.0f) { x = ix; y = iy; z = iz; } + + // conversion to qangle + QAngle ToQAngle( void ) const; + bool IsValid() const; + void Invalidate(); + + // array access... + vec_t operator[](int i) const; + vec_t& operator[](int i); + + vec_t x, y, z; +}; + + +extern void AngleQuaternion( RadianEuler const &angles, Quaternion &qt ); +extern void QuaternionAngles( Quaternion const &q, RadianEuler &angles ); +inline Quaternion::Quaternion(RadianEuler const &angle) +{ + AngleQuaternion( angle, *this ); +} + +inline bool Quaternion::IsValid() const +{ + return IsFinite(x) && IsFinite(y) && IsFinite(z) && IsFinite(w); +} + +inline void Quaternion::Invalidate() +{ +//#ifdef _DEBUG +//#ifdef VECTOR_PARANOIA + x = y = z = w = VEC_T_NAN; +//#endif +//#endif +} + +inline RadianEuler::RadianEuler(Quaternion const &q) +{ + QuaternionAngles( q, *this ); +} + +inline void VectorCopy( RadianEuler const& src, RadianEuler &dst ) +{ + CHECK_VALID(src); + dst.x = src.x; + dst.y = src.y; + dst.z = src.z; +} + +inline bool RadianEuler::IsValid() const +{ + return IsFinite(x) && IsFinite(y) && IsFinite(z); +} + +inline void RadianEuler::Invalidate() +{ +//#ifdef _DEBUG +//#ifdef VECTOR_PARANOIA + x = y = z = VEC_T_NAN; +//#endif +//#endif +} + + +//----------------------------------------------------------------------------- +// Array access +//----------------------------------------------------------------------------- +inline vec_t& RadianEuler::operator[](int i) +{ + Assert( (i >= 0) && (i < 3) ); + return ((vec_t*)this)[i]; +} + +inline vec_t RadianEuler::operator[](int i) const +{ + Assert( (i >= 0) && (i < 3) ); + return ((vec_t*)this)[i]; +} + + +//----------------------------------------------------------------------------- +// Degree Euler QAngle pitch, yaw, roll +//----------------------------------------------------------------------------- +class QAngleByValue; + +class QAngle +{ +public: + // Members + vec_t x, y, z; + + // Construction/destruction + QAngle(void); + QAngle(vec_t X, vec_t Y, vec_t Z); +// QAngle(RadianEuler const &angles); // evil auto type promotion!!! + + // Allow pass-by-value + operator QAngleByValue &() { return *((QAngleByValue *)(this)); } + operator const QAngleByValue &() const { return *((const QAngleByValue *)(this)); } + + // Initialization + void Init(vec_t ix=0.0f, vec_t iy=0.0f, vec_t iz=0.0f); + void Random( vec_t minVal, vec_t maxVal ); + + // Got any nasty NAN's? + bool IsValid() const; + void Invalidate(); + + // array access... + vec_t operator[](int i) const; + vec_t& operator[](int i); + + // Base address... + vec_t* Base(); + vec_t const* Base() const; + + // equality + bool operator==(const QAngle& v) const; + bool operator!=(const QAngle& v) const; + + // arithmetic operations + QAngle& operator+=(const QAngle &v); + QAngle& operator-=(const QAngle &v); + QAngle& operator*=(float s); + QAngle& operator/=(float s); + + // Get the vector's magnitude. + vec_t Length() const; + vec_t LengthSqr() const; + + // negate the QAngle components + //void Negate(); + + // No assignment operators either... + QAngle& operator=( const QAngle& src ); + +#ifndef VECTOR_NO_SLOW_OPERATIONS + // copy constructors + + // arithmetic operations + QAngle operator-(void) const; + + QAngle operator+(const QAngle& v) const; + QAngle operator-(const QAngle& v) const; + QAngle operator*(float fl) const; + QAngle operator/(float fl) const; +#else + +private: + // No copy constructors allowed if we're in optimal mode + QAngle(const QAngle& vOther); + +#endif +}; + +//----------------------------------------------------------------------------- +// Allows us to specifically pass the vector by value when we need to +//----------------------------------------------------------------------------- +class QAngleByValue : public QAngle +{ +public: + // Construction/destruction: + QAngleByValue(void) : QAngle() {} + QAngleByValue(vec_t X, vec_t Y, vec_t Z) : QAngle( X, Y, Z ) {} + QAngleByValue(const QAngleByValue& vOther) { *this = vOther; } +}; + + +inline void VectorAdd( const QAngle& a, const QAngle& b, QAngle& result ) +{ + CHECK_VALID(a); + CHECK_VALID(b); + result.x = a.x + b.x; + result.y = a.y + b.y; + result.z = a.z + b.z; +} + +inline void VectorMA( const QAngle &start, float scale, const QAngle &direction, QAngle &dest ) +{ + CHECK_VALID(start); + CHECK_VALID(direction); + dest.x = start.x + scale * direction.x; + dest.y = start.y + scale * direction.y; + dest.z = start.z + scale * direction.z; +} + + +//----------------------------------------------------------------------------- +// constructors +//----------------------------------------------------------------------------- +inline QAngle::QAngle(void) +{ +#ifdef _DEBUG +#ifdef VECTOR_PARANOIA + // Initialize to NAN to catch errors + x = y = z = VEC_T_NAN; +#endif +#endif +} + +inline QAngle::QAngle(vec_t X, vec_t Y, vec_t Z) +{ + x = X; y = Y; z = Z; + CHECK_VALID(*this); +} + + +//----------------------------------------------------------------------------- +// initialization +//----------------------------------------------------------------------------- +inline void QAngle::Init( vec_t ix, vec_t iy, vec_t iz ) +{ + x = ix; y = iy; z = iz; + CHECK_VALID(*this); +} + +/* +inline void QAngle::Random( vec_t minVal, vec_t maxVal ) +{ + x = minVal + ((float)rand() / VALVE_RAND_MAX) * (maxVal - minVal); + y = minVal + ((float)rand() / VALVE_RAND_MAX) * (maxVal - minVal); + z = minVal + ((float)rand() / VALVE_RAND_MAX) * (maxVal - minVal); + CHECK_VALID(*this); +} +*/ + +#ifndef VECTOR_NO_SLOW_OPERATIONS + +inline QAngle RandomAngle( float minVal, float maxVal ) +{ + Vector random; + random.Random( minVal, maxVal ); + QAngle ret( random.x, random.y, random.z ); + return ret; +} + +#endif + + +inline RadianEuler::RadianEuler(QAngle const &angles) +{ + Init( + angles.z * 3.14159265358979323846f / 180.f, + angles.x * 3.14159265358979323846f / 180.f, + angles.y * 3.14159265358979323846f / 180.f ); +} + + + + +inline QAngle RadianEuler::ToQAngle( void) const +{ + return QAngle( + y * 180.f / 3.14159265358979323846f, + z * 180.f / 3.14159265358979323846f, + x * 180.f / 3.14159265358979323846f ); +} + + +//----------------------------------------------------------------------------- +// assignment +//----------------------------------------------------------------------------- +inline QAngle& QAngle::operator=(const QAngle &vOther) +{ + CHECK_VALID(vOther); + x=vOther.x; y=vOther.y; z=vOther.z; + return *this; +} + + +//----------------------------------------------------------------------------- +// Array access +//----------------------------------------------------------------------------- +inline vec_t& QAngle::operator[](int i) +{ + Assert( (i >= 0) && (i < 3) ); + return ((vec_t*)this)[i]; +} + +inline vec_t QAngle::operator[](int i) const +{ + Assert( (i >= 0) && (i < 3) ); + return ((vec_t*)this)[i]; +} + + +//----------------------------------------------------------------------------- +// Base address... +//----------------------------------------------------------------------------- +inline vec_t* QAngle::Base() +{ + return (vec_t*)this; +} + +inline vec_t const* QAngle::Base() const +{ + return (vec_t const*)this; +} + + +//----------------------------------------------------------------------------- +// IsValid? +//----------------------------------------------------------------------------- +inline bool QAngle::IsValid() const +{ + return IsFinite(x) && IsFinite(y) && IsFinite(z); +} + +//----------------------------------------------------------------------------- +// Invalidate +//----------------------------------------------------------------------------- + +inline void QAngle::Invalidate() +{ +//#ifdef _DEBUG +//#ifdef VECTOR_PARANOIA + x = y = z = VEC_T_NAN; +//#endif +//#endif +} + +//----------------------------------------------------------------------------- +// comparison +//----------------------------------------------------------------------------- +inline bool QAngle::operator==( const QAngle& src ) const +{ + CHECK_VALID(src); + CHECK_VALID(*this); + return (src.x == x) && (src.y == y) && (src.z == z); +} + +inline bool QAngle::operator!=( const QAngle& src ) const +{ + CHECK_VALID(src); + CHECK_VALID(*this); + return (src.x != x) || (src.y != y) || (src.z != z); +} + + +//----------------------------------------------------------------------------- +// Copy +//----------------------------------------------------------------------------- +inline void VectorCopy( const QAngle& src, QAngle& dst ) +{ + CHECK_VALID(src); + dst.x = src.x; + dst.y = src.y; + dst.z = src.z; +} + + +//----------------------------------------------------------------------------- +// standard math operations +//----------------------------------------------------------------------------- +inline QAngle& QAngle::operator+=(const QAngle& v) +{ + CHECK_VALID(*this); + CHECK_VALID(v); + x+=v.x; y+=v.y; z += v.z; + return *this; +} + +inline QAngle& QAngle::operator-=(const QAngle& v) +{ + CHECK_VALID(*this); + CHECK_VALID(v); + x-=v.x; y-=v.y; z -= v.z; + return *this; +} + +inline QAngle& QAngle::operator*=(float fl) +{ + x *= fl; + y *= fl; + z *= fl; + CHECK_VALID(*this); + return *this; +} + +inline QAngle& QAngle::operator/=(float fl) +{ + Assert( fl != 0.0f ); + float oofl = 1.0f / fl; + x *= oofl; + y *= oofl; + z *= oofl; + CHECK_VALID(*this); + return *this; +} + + +//----------------------------------------------------------------------------- +// length +//----------------------------------------------------------------------------- +inline vec_t QAngle::Length( ) const +{ + CHECK_VALID(*this); + return (vec_t)FastSqrt( LengthSqr( ) ); +} + + +inline vec_t QAngle::LengthSqr( ) const +{ + CHECK_VALID(*this); + return x * x + y * y + z * z; +} + + +//----------------------------------------------------------------------------- +// Vector equality with tolerance +//----------------------------------------------------------------------------- +inline bool QAnglesAreEqual( const QAngle& src1, const QAngle& src2, float tolerance = 0.0f ) +{ + if (FloatMakePositive(src1.x - src2.x) > tolerance) + return false; + if (FloatMakePositive(src1.y - src2.y) > tolerance) + return false; + return (FloatMakePositive(src1.z - src2.z) <= tolerance); +} + + +//----------------------------------------------------------------------------- +// arithmetic operations (SLOW!!) +//----------------------------------------------------------------------------- +#ifndef VECTOR_NO_SLOW_OPERATIONS + +inline QAngle QAngle::operator-(void) const +{ + QAngle ret(-x,-y,-z); + return ret; +} + +inline QAngle QAngle::operator+(const QAngle& v) const +{ + QAngle res; + res.x = x + v.x; + res.y = y + v.y; + res.z = z + v.z; + return res; +} + +inline QAngle QAngle::operator-(const QAngle& v) const +{ + QAngle res; + res.x = x - v.x; + res.y = y - v.y; + res.z = z - v.z; + return res; +} + +inline QAngle QAngle::operator*(float fl) const +{ + QAngle res; + res.x = x * fl; + res.y = y * fl; + res.z = z * fl; + return res; +} + +inline QAngle QAngle::operator/(float fl) const +{ + QAngle res; + res.x = x / fl; + res.y = y / fl; + res.z = z / fl; + return res; +} + +inline QAngle operator*(float fl, const QAngle& v) +{ + QAngle ret( v * fl ); + return ret; +} + +#endif // VECTOR_NO_SLOW_OPERATIONS + + +//----------------------------------------------------------------------------- +// NOTE: These are not completely correct. The representations are not equivalent +// unless the QAngle represents a rotational impulse along a coordinate axis (x,y,z) +inline void QAngleToAngularImpulse( const QAngle &angles, AngularImpulse &impulse ) +{ + impulse.x = angles.z; + impulse.y = angles.x; + impulse.z = angles.y; +} + +inline void AngularImpulseToQAngle( const AngularImpulse &impulse, QAngle &angles ) +{ + angles.x = impulse.y; + angles.y = impulse.z; + angles.z = impulse.x; +} + +#if !defined( _X360 ) + +inline vec_t InvRSquared( const float* v ) +{ + return 1.0 / fpmax( (float)1.0, (float)(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]) ); +} + +inline vec_t InvRSquared( const Vector &v ) +{ + return InvRSquared( v.Base() ); +} + +#else + +// call directly +inline float _VMX_InvRSquared( const Vector &v ) +{ + XMVECTOR xmV = XMVector3ReciprocalLength( XMLoadVector3( v.Base() ) ); + xmV = XMVector3Dot( xmV, xmV ); + return xmV.x; +} + +#define InvRSquared(x) _VMX_InvRSquared(x) + +#endif // _X360 + +#if !defined( _X360 ) + +// FIXME: Change this back to a #define once we get rid of the vec_t version +float VectorNormalize( Vector& v ); + +// FIXME: Obsolete version of VectorNormalize, once we remove all the friggin float*s +inline float VectorNormalize( float * v ) +{ + return VectorNormalize(*(reinterpret_cast(v))); +} + +#else + +// call directly +inline float _VMX_VectorNormalize( Vector &vec ) +{ + float mag = XMVector3Length( XMLoadVector3( vec.Base() ) ).x; + float den = 1.f / (mag + FLT_EPSILON ); + vec.x *= den; + vec.y *= den; + vec.z *= den; + return mag; +} +// FIXME: Change this back to a #define once we get rid of the vec_t version +inline float VectorNormalize( Vector& v ) +{ + return _VMX_VectorNormalize( v ); +} +// FIXME: Obsolete version of VectorNormalize, once we remove all the friggin float*s +inline float VectorNormalize( float *pV ) +{ + return _VMX_VectorNormalize(*(reinterpret_cast(pV))); +} + +#endif // _X360 + +#if !defined( _X360 ) +inline void VectorNormalizeFast (Vector& vec) +{ + float ool = FastRSqrt( FLT_EPSILON + vec.x * vec.x + vec.y * vec.y + vec.z * vec.z ); + + vec.x *= ool; + vec.y *= ool; + vec.z *= ool; +} +#else + +// call directly +inline void VectorNormalizeFast( Vector &vec ) +{ + XMVECTOR xmV = XMVector3LengthEst( XMLoadVector3( vec.Base() ) ); + float den = 1.f / (xmV.x + FLT_EPSILON); + vec.x *= den; + vec.y *= den; + vec.z *= den; +} + +#endif // _X360 + +inline vec_t Vector::NormalizeInPlace() +{ + return VectorNormalize( *this ); +} + +inline Vector Vector::Normalized() const +{ + Vector norm = *this; + VectorNormalize( norm ); + return norm; +} + +inline bool Vector::IsLengthGreaterThan( float val ) const +{ + return LengthSqr() > val*val; +} + +inline bool Vector::IsLengthLessThan( float val ) const +{ + return LengthSqr() < val*val; +} + + +//-------------------------------------------------------------------------------------------------- + +// forward declarations +class Vector; +// class Vector2D; + +//========================================================= +// 4D Vector4D +//========================================================= + +class Vector4D +{ +public: + // Members + vec_t x, y, z, w; + + // Construction/destruction + Vector4D(void); + Vector4D(vec_t X, vec_t Y, vec_t Z, vec_t W); + Vector4D(const float *pFloat); + + // Initialization + void Init(vec_t ix=0.0f, vec_t iy=0.0f, vec_t iz=0.0f, vec_t iw=0.0f); + void Init( const Vector& src, vec_t iw=0.0f ); + + // Got any nasty NAN's? + bool IsValid() const; + + // array access... + vec_t operator[](int i) const; + vec_t& operator[](int i); + + // Base address... + inline vec_t* Base(); + inline vec_t const* Base() const; + + // Cast to Vector and Vector2D... + Vector& AsVector3D(); + Vector const& AsVector3D() const; + + //Vector2D& AsVector2D(); + //Vector2D const& AsVector2D() const; + + // Initialization methods + void Random( vec_t minVal, vec_t maxVal ); + + // equality + bool operator==(const Vector4D& v) const; + bool operator!=(const Vector4D& v) const; + + // arithmetic operations + Vector4D& operator+=(const Vector4D &v); + Vector4D& operator-=(const Vector4D &v); + Vector4D& operator*=(const Vector4D &v); + Vector4D& operator*=(float s); + Vector4D& operator/=(const Vector4D &v); + Vector4D& operator/=(float s); + + Vector4D operator-( void ) const; + Vector4D operator*( float fl ) const; + Vector4D operator/( float fl ) const; + Vector4D operator*( const Vector4D& v ) const; + Vector4D operator+( const Vector4D& v ) const; + Vector4D operator-( const Vector4D& v ) const; + + // negate the Vector4D components + void Negate(); + + // Get the Vector4D's magnitude. + vec_t Length() const; + + // Get the Vector4D's magnitude squared. + vec_t LengthSqr(void) const; + + // return true if this vector is (0,0,0,0) within tolerance + bool IsZero( float tolerance = 0.01f ) const + { + return (x > -tolerance && x < tolerance && + y > -tolerance && y < tolerance && + z > -tolerance && z < tolerance && + w > -tolerance && w < tolerance); + } + + // Get the distance from this Vector4D to the other one. + vec_t DistTo(const Vector4D &vOther) const; + + // Get the distance from this Vector4D to the other one squared. + vec_t DistToSqr(const Vector4D &vOther) const; + + // Copy + void CopyToArray(float* rgfl) const; + + // Multiply, add, and assign to this (ie: *this = a + b * scalar). This + // is about 12% faster than the actual Vector4D equation (because it's done per-component + // rather than per-Vector4D). + void MulAdd(Vector4D const& a, Vector4D const& b, float scalar); + + // Dot product. + vec_t Dot(Vector4D const& vOther) const; + + // No copy constructors allowed if we're in optimal mode +#ifdef VECTOR_NO_SLOW_OPERATIONS +private: +#else +public: +#endif + Vector4D(Vector4D const& vOther); + + // No assignment operators either... + Vector4D& operator=( Vector4D const& src ); +}; + +const Vector4D vec4_origin( 0.0f, 0.0f, 0.0f, 0.0f ); +const Vector4D vec4_invalid( FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX ); + +#if 0 +//----------------------------------------------------------------------------- +// SSE optimized routines +//----------------------------------------------------------------------------- + +class ALIGN16 Vector4DAligned : public Vector4D +{ +public: + Vector4DAligned(void) {} + Vector4DAligned( vec_t X, vec_t Y, vec_t Z, vec_t W ); + + inline void Set( vec_t X, vec_t Y, vec_t Z, vec_t W ); + inline void InitZero( void ); + + inline __m128 &AsM128() { return *(__m128*)&x; } + inline const __m128 &AsM128() const { return *(const __m128*)&x; } + +private: + // No copy constructors allowed if we're in optimal mode + Vector4DAligned( Vector4DAligned const& vOther ); + + // No assignment operators either... + Vector4DAligned& operator=( Vector4DAligned const& src ); +} ALIGN16_POST; + +#endif + +//----------------------------------------------------------------------------- +// Vector4D related operations +//----------------------------------------------------------------------------- + +// Vector4D clear +void Vector4DClear( Vector4D& a ); + +// Copy +void Vector4DCopy( Vector4D const& src, Vector4D& dst ); + +// Vector4D arithmetic +void Vector4DAdd( Vector4D const& a, Vector4D const& b, Vector4D& result ); +void Vector4DSubtract( Vector4D const& a, Vector4D const& b, Vector4D& result ); +void Vector4DMultiply( Vector4D const& a, vec_t b, Vector4D& result ); +void Vector4DMultiply( Vector4D const& a, Vector4D const& b, Vector4D& result ); +void Vector4DDivide( Vector4D const& a, vec_t b, Vector4D& result ); +void Vector4DDivide( Vector4D const& a, Vector4D const& b, Vector4D& result ); +void Vector4DMA( Vector4D const& start, float s, Vector4D const& dir, Vector4D& result ); + +// Vector4DAligned arithmetic +//void Vector4DMultiplyAligned( Vector4DAligned const& a, vec_t b, Vector4DAligned& result ); + + +#define Vector4DExpand( v ) (v).x, (v).y, (v).z, (v).w + +// Normalization +vec_t Vector4DNormalize( Vector4D& v ); + +// Length +vec_t Vector4DLength( Vector4D const& v ); + +// Dot Product +vec_t DotProduct4D(Vector4D const& a, Vector4D const& b); + +// Linearly interpolate between two vectors +void Vector4DLerp(Vector4D const& src1, Vector4D const& src2, vec_t t, Vector4D& dest ); + + +//----------------------------------------------------------------------------- +// +// Inlined Vector4D methods +// +//----------------------------------------------------------------------------- + + +//----------------------------------------------------------------------------- +// constructors +//----------------------------------------------------------------------------- + +inline Vector4D::Vector4D(void) +{ +#ifdef _DEBUG + // Initialize to NAN to catch errors + x = y = z = w = VEC_T_NAN; +#endif +} + +inline Vector4D::Vector4D(vec_t X, vec_t Y, vec_t Z, vec_t W ) +{ + x = X; y = Y; z = Z; w = W; + Assert( IsValid() ); +} + +inline Vector4D::Vector4D(const float *pFloat) +{ + Assert( pFloat ); + x = pFloat[0]; y = pFloat[1]; z = pFloat[2]; w = pFloat[3]; + Assert( IsValid() ); +} + + +//----------------------------------------------------------------------------- +// copy constructor +//----------------------------------------------------------------------------- + +inline Vector4D::Vector4D(const Vector4D &vOther) +{ + Assert( vOther.IsValid() ); + x = vOther.x; y = vOther.y; z = vOther.z; w = vOther.w; +} + +//----------------------------------------------------------------------------- +// initialization +//----------------------------------------------------------------------------- +inline void Vector4D::Init( vec_t ix, vec_t iy, vec_t iz, vec_t iw ) +{ + x = ix; y = iy; z = iz; w = iw; + Assert( IsValid() ); +} + +inline void Vector4D::Init( const Vector& src, vec_t iw ) +{ + x = src.x; y = src.y; z = src.z; w = iw; + Assert( IsValid() ); +} + + +/* +inline void Vector4D::Random( vec_t minVal, vec_t maxVal ) +{ + x = minVal + ((vec_t)rand() / VALVE_RAND_MAX) * (maxVal - minVal); + y = minVal + ((vec_t)rand() / VALVE_RAND_MAX) * (maxVal - minVal); + z = minVal + ((vec_t)rand() / VALVE_RAND_MAX) * (maxVal - minVal); + w = minVal + ((vec_t)rand() / VALVE_RAND_MAX) * (maxVal - minVal); +} +*/ + +inline void Vector4DClear( Vector4D& a ) +{ + a.x = a.y = a.z = a.w = 0.0f; +} + +//----------------------------------------------------------------------------- +// assignment +//----------------------------------------------------------------------------- + +inline Vector4D& Vector4D::operator=(const Vector4D &vOther) +{ + Assert( vOther.IsValid() ); + x=vOther.x; y=vOther.y; z=vOther.z; w=vOther.w; + return *this; +} + +//----------------------------------------------------------------------------- +// Array access +//----------------------------------------------------------------------------- + +inline vec_t& Vector4D::operator[](int i) +{ + Assert( (i >= 0) && (i < 4) ); + return ((vec_t*)this)[i]; +} + +inline vec_t Vector4D::operator[](int i) const +{ + Assert( (i >= 0) && (i < 4) ); + return ((vec_t*)this)[i]; +} + +//----------------------------------------------------------------------------- +// Cast to Vector and Vector2D... +//----------------------------------------------------------------------------- + +inline Vector& Vector4D::AsVector3D() +{ + return *(Vector*)this; +} + +inline Vector const& Vector4D::AsVector3D() const +{ + return *(Vector const*)this; +} + +//inline Vector2D& Vector4D::AsVector2D() +//{ +// return *(Vector2D*)this; +//} +// +//inline Vector2D const& Vector4D::AsVector2D() const +//{ +// return *(Vector2D const*)this; +//} + +//----------------------------------------------------------------------------- +// Base address... +//----------------------------------------------------------------------------- + +inline vec_t* Vector4D::Base() +{ + return (vec_t*)this; +} + +inline vec_t const* Vector4D::Base() const +{ + return (vec_t const*)this; +} + +//----------------------------------------------------------------------------- +// IsValid? +//----------------------------------------------------------------------------- + +inline bool Vector4D::IsValid() const +{ + return IsFinite(x) && IsFinite(y) && IsFinite(z) && IsFinite(w); +} + +//----------------------------------------------------------------------------- +// comparison +//----------------------------------------------------------------------------- + +inline bool Vector4D::operator==( Vector4D const& src ) const +{ + Assert( src.IsValid() && IsValid() ); + return (src.x == x) && (src.y == y) && (src.z == z) && (src.w == w); +} + +inline bool Vector4D::operator!=( Vector4D const& src ) const +{ + Assert( src.IsValid() && IsValid() ); + return (src.x != x) || (src.y != y) || (src.z != z) || (src.w != w); +} + + +//----------------------------------------------------------------------------- +// Copy +//----------------------------------------------------------------------------- + +inline void Vector4DCopy( Vector4D const& src, Vector4D& dst ) +{ + Assert( src.IsValid() ); + dst.x = src.x; + dst.y = src.y; + dst.z = src.z; + dst.w = src.w; +} + +inline void Vector4D::CopyToArray(float* rgfl) const +{ + Assert( IsValid() ); + Assert( rgfl ); + rgfl[0] = x; rgfl[1] = y; rgfl[2] = z; rgfl[3] = w; +} + +//----------------------------------------------------------------------------- +// standard math operations +//----------------------------------------------------------------------------- + +inline void Vector4D::Negate() +{ + Assert( IsValid() ); + x = -x; y = -y; z = -z; w = -w; +} + +inline Vector4D& Vector4D::operator+=(const Vector4D& v) +{ + Assert( IsValid() && v.IsValid() ); + x+=v.x; y+=v.y; z += v.z; w += v.w; + return *this; +} + +inline Vector4D& Vector4D::operator-=(const Vector4D& v) +{ + Assert( IsValid() && v.IsValid() ); + x-=v.x; y-=v.y; z -= v.z; w -= v.w; + return *this; +} + +inline Vector4D& Vector4D::operator*=(float fl) +{ + x *= fl; + y *= fl; + z *= fl; + w *= fl; + Assert( IsValid() ); + return *this; +} + +inline Vector4D& Vector4D::operator*=(Vector4D const& v) +{ + x *= v.x; + y *= v.y; + z *= v.z; + w *= v.w; + Assert( IsValid() ); + return *this; +} + +inline Vector4D Vector4D::operator-(void) const +{ + return Vector4D(-x,-y,-z,-w); +} + +inline Vector4D Vector4D::operator+(const Vector4D& v) const +{ + Vector4D res; + Vector4DAdd( *this, v, res ); + return res; +} + +inline Vector4D Vector4D::operator-(const Vector4D& v) const +{ + Vector4D res; + Vector4DSubtract( *this, v, res ); + return res; +} + + +inline Vector4D Vector4D::operator*(float fl) const +{ + Vector4D res; + Vector4DMultiply( *this, fl, res ); + return res; +} + +inline Vector4D Vector4D::operator*(const Vector4D& v) const +{ + Vector4D res; + Vector4DMultiply( *this, v, res ); + return res; +} + +inline Vector4D Vector4D::operator/(float fl) const +{ + Vector4D res; + Vector4DDivide( *this, fl, res ); + return res; +} + +inline Vector4D operator*( float fl, const Vector4D& v ) +{ + return v * fl; +} + +inline Vector4D& Vector4D::operator/=(float fl) +{ + Assert( fl != 0.0f ); + float oofl = 1.0f / fl; + x *= oofl; + y *= oofl; + z *= oofl; + w *= oofl; + Assert( IsValid() ); + return *this; +} + +inline Vector4D& Vector4D::operator/=(Vector4D const& v) +{ + Assert( v.x != 0.0f && v.y != 0.0f && v.z != 0.0f && v.w != 0.0f ); + x /= v.x; + y /= v.y; + z /= v.z; + w /= v.w; + Assert( IsValid() ); + return *this; +} + +inline void Vector4DAdd( Vector4D const& a, Vector4D const& b, Vector4D& c ) +{ + Assert( a.IsValid() && b.IsValid() ); + c.x = a.x + b.x; + c.y = a.y + b.y; + c.z = a.z + b.z; + c.w = a.w + b.w; +} + +inline void Vector4DSubtract( Vector4D const& a, Vector4D const& b, Vector4D& c ) +{ + Assert( a.IsValid() && b.IsValid() ); + c.x = a.x - b.x; + c.y = a.y - b.y; + c.z = a.z - b.z; + c.w = a.w - b.w; +} + +inline void Vector4DMultiply( Vector4D const& a, vec_t b, Vector4D& c ) +{ + Assert( a.IsValid() && IsFinite(b) ); + c.x = a.x * b; + c.y = a.y * b; + c.z = a.z * b; + c.w = a.w * b; +} + +inline void Vector4DMultiply( Vector4D const& a, Vector4D const& b, Vector4D& c ) +{ + Assert( a.IsValid() && b.IsValid() ); + c.x = a.x * b.x; + c.y = a.y * b.y; + c.z = a.z * b.z; + c.w = a.w * b.w; +} + +inline void Vector4DDivide( Vector4D const& a, vec_t b, Vector4D& c ) +{ + Assert( a.IsValid() ); + Assert( b != 0.0f ); + vec_t oob = 1.0f / b; + c.x = a.x * oob; + c.y = a.y * oob; + c.z = a.z * oob; + c.w = a.w * oob; +} + +inline void Vector4DDivide( Vector4D const& a, Vector4D const& b, Vector4D& c ) +{ + Assert( a.IsValid() ); + Assert( (b.x != 0.0f) && (b.y != 0.0f) && (b.z != 0.0f) && (b.w != 0.0f) ); + c.x = a.x / b.x; + c.y = a.y / b.y; + c.z = a.z / b.z; + c.w = a.w / b.w; +} + +inline void Vector4DMA( Vector4D const& start, float s, Vector4D const& dir, Vector4D& result ) +{ + Assert( start.IsValid() && IsFinite(s) && dir.IsValid() ); + result.x = start.x + s*dir.x; + result.y = start.y + s*dir.y; + result.z = start.z + s*dir.z; + result.w = start.w + s*dir.w; +} + +// FIXME: Remove +// For backwards compatability +inline void Vector4D::MulAdd(Vector4D const& a, Vector4D const& b, float scalar) +{ + x = a.x + b.x * scalar; + y = a.y + b.y * scalar; + z = a.z + b.z * scalar; + w = a.w + b.w * scalar; +} + +inline void Vector4DLerp(const Vector4D& src1, const Vector4D& src2, vec_t t, Vector4D& dest ) +{ + dest[0] = src1[0] + (src2[0] - src1[0]) * t; + dest[1] = src1[1] + (src2[1] - src1[1]) * t; + dest[2] = src1[2] + (src2[2] - src1[2]) * t; + dest[3] = src1[3] + (src2[3] - src1[3]) * t; +} + +//----------------------------------------------------------------------------- +// dot, cross +//----------------------------------------------------------------------------- + +inline vec_t DotProduct4D(const Vector4D& a, const Vector4D& b) +{ + Assert( a.IsValid() && b.IsValid() ); + return( a.x*b.x + a.y*b.y + a.z*b.z + a.w*b.w ); +} + +// for backwards compatability +inline vec_t Vector4D::Dot( Vector4D const& vOther ) const +{ + return DotProduct4D( *this, vOther ); +} + + +//----------------------------------------------------------------------------- +// length +//----------------------------------------------------------------------------- + +inline vec_t Vector4DLength( Vector4D const& v ) +{ + Assert( v.IsValid() ); + return (vec_t)FastSqrt(v.x*v.x + v.y*v.y + v.z*v.z + v.w*v.w); +} + +inline vec_t Vector4D::LengthSqr(void) const +{ + Assert( IsValid() ); + return (x*x + y*y + z*z + w*w); +} + +inline vec_t Vector4D::Length(void) const +{ + return Vector4DLength( *this ); +} + + +//----------------------------------------------------------------------------- +// Normalization +//----------------------------------------------------------------------------- + +// FIXME: Can't use until we're un-macroed in mathlib.h +inline vec_t Vector4DNormalize( Vector4D& v ) +{ + Assert( v.IsValid() ); + vec_t l = v.Length(); + if (l != 0.0f) + { + v /= l; + } + else + { + v.x = v.y = v.z = v.w = 0.0f; + } + return l; +} + +//----------------------------------------------------------------------------- +// Get the distance from this Vector4D to the other one +//----------------------------------------------------------------------------- + +inline vec_t Vector4D::DistTo(const Vector4D &vOther) const +{ + Vector4D delta; + Vector4DSubtract( *this, vOther, delta ); + return delta.Length(); +} + +inline vec_t Vector4D::DistToSqr(const Vector4D &vOther) const +{ + Vector4D delta; + Vector4DSubtract( *this, vOther, delta ); + return delta.LengthSqr(); +} + + +#if 0 +//----------------------------------------------------------------------------- +// Vector4DAligned routines +//----------------------------------------------------------------------------- + +inline Vector4DAligned::Vector4DAligned( vec_t X, vec_t Y, vec_t Z, vec_t W ) +{ + x = X; y = Y; z = Z; w = W; + Assert( IsValid() ); +} + +inline void Vector4DAligned::Set( vec_t X, vec_t Y, vec_t Z, vec_t W ) +{ + x = X; y = Y; z = Z; w = W; + Assert( IsValid() ); +} + +inline void Vector4DAligned::InitZero( void ) +{ +#if !defined( _X360 ) + this->AsM128() = _mm_set1_ps( 0.0f ); +#else + this->AsM128() = __vspltisw( 0 ); +#endif + Assert( IsValid() ); +} + +inline void Vector4DMultiplyAligned( Vector4DAligned const& a, Vector4DAligned const& b, Vector4DAligned& c ) +{ + Assert( a.IsValid() && b.IsValid() ); +#if !defined( _X360 ) + c.x = a.x * b.x; + c.y = a.y * b.y; + c.z = a.z * b.z; + c.w = a.w * b.w; +#else + c.AsM128() = __vmulfp( a.AsM128(), b.AsM128() ); +#endif +} + +inline void Vector4DWeightMAD( vec_t w, Vector4DAligned const& vInA, Vector4DAligned& vOutA, Vector4DAligned const& vInB, Vector4DAligned& vOutB ) +{ + Assert( vInA.IsValid() && vInB.IsValid() && IsFinite(w) ); + +#if !defined( _X360 ) + vOutA.x += vInA.x * w; + vOutA.y += vInA.y * w; + vOutA.z += vInA.z * w; + vOutA.w += vInA.w * w; + + vOutB.x += vInB.x * w; + vOutB.y += vInB.y * w; + vOutB.z += vInB.z * w; + vOutB.w += vInB.w * w; +#else + __vector4 temp; + + temp = __lvlx( &w, 0 ); + temp = __vspltw( temp, 0 ); + + vOutA.AsM128() = __vmaddfp( vInA.AsM128(), temp, vOutA.AsM128() ); + vOutB.AsM128() = __vmaddfp( vInB.AsM128(), temp, vOutB.AsM128() ); +#endif +} + +inline void Vector4DWeightMADSSE( vec_t w, Vector4DAligned const& vInA, Vector4DAligned& vOutA, Vector4DAligned const& vInB, Vector4DAligned& vOutB ) +{ + Assert( vInA.IsValid() && vInB.IsValid() && IsFinite(w) ); + +#if !defined( _X360 ) + // Replicate scalar float out to 4 components + __m128 packed = _mm_set1_ps( w ); + + // 4D SSE Vector MAD + vOutA.AsM128() = _mm_add_ps( vOutA.AsM128(), _mm_mul_ps( vInA.AsM128(), packed ) ); + vOutB.AsM128() = _mm_add_ps( vOutB.AsM128(), _mm_mul_ps( vInB.AsM128(), packed ) ); +#else + __vector4 temp; + + temp = __lvlx( &w, 0 ); + temp = __vspltw( temp, 0 ); + + vOutA.AsM128() = __vmaddfp( vInA.AsM128(), temp, vOutA.AsM128() ); + vOutB.AsM128() = __vmaddfp( vInB.AsM128(), temp, vOutB.AsM128() ); +#endif +} + +#endif + +//-------------------------------------------------------------------------------------------------- + +typedef int SideType; + +// Used to represent sides of things like planes. +#define SIDE_FRONT 0 +#define SIDE_BACK 1 +#define SIDE_ON 2 + +#define VP_EPSILON 0.01f + + +class VPlane +{ +public: + VPlane(); + VPlane(const Vector &vNormal, vec_t dist); + + void Init(const Vector &vNormal, vec_t dist); + + // Return the distance from the point to the plane. + vec_t DistTo(const Vector &vVec) const; + + // Copy. + VPlane& operator=(const VPlane &thePlane); + + // Returns SIDE_ON, SIDE_FRONT, or SIDE_BACK. + // The epsilon for SIDE_ON can be passed in. + SideType GetPointSide(const Vector &vPoint, vec_t sideEpsilon=VP_EPSILON) const; + + // Returns SIDE_FRONT or SIDE_BACK. + SideType GetPointSideExact(const Vector &vPoint) const; + + // Classify the box with respect to the plane. + // Returns SIDE_ON, SIDE_FRONT, or SIDE_BACK + SideType BoxOnPlaneSide(const Vector &vMin, const Vector &vMax) const; + +#ifndef VECTOR_NO_SLOW_OPERATIONS + // Flip the plane. + VPlane Flip(); + + // Get a point on the plane (normal*dist). + Vector GetPointOnPlane() const; + + // Snap the specified point to the plane (along the plane's normal). + Vector SnapPointToPlane(const Vector &vPoint) const; +#endif + +public: + Vector m_Normal; + vec_t m_Dist; + +#ifdef VECTOR_NO_SLOW_OPERATIONS +private: + // No copy constructors allowed if we're in optimal mode + VPlane(const VPlane& vOther); +#endif +}; + + +//----------------------------------------------------------------------------- +// Inlines. +//----------------------------------------------------------------------------- +inline VPlane::VPlane() +{ +} + +inline VPlane::VPlane(const Vector &vNormal, vec_t dist) +{ + m_Normal = vNormal; + m_Dist = dist; +} + +inline void VPlane::Init(const Vector &vNormal, vec_t dist) +{ + m_Normal = vNormal; + m_Dist = dist; +} + +inline vec_t VPlane::DistTo(const Vector &vVec) const +{ + return vVec.Dot(m_Normal) - m_Dist; +} + +inline VPlane& VPlane::operator=(const VPlane &thePlane) +{ + m_Normal = thePlane.m_Normal; + m_Dist = thePlane.m_Dist; + return *this; +} + +#ifndef VECTOR_NO_SLOW_OPERATIONS + +inline VPlane VPlane::Flip() +{ + return VPlane(-m_Normal, -m_Dist); +} + +inline Vector VPlane::GetPointOnPlane() const +{ + return m_Normal * m_Dist; +} + +inline Vector VPlane::SnapPointToPlane(const Vector &vPoint) const +{ + return vPoint - m_Normal * DistTo(vPoint); +} + +#endif + +inline SideType VPlane::GetPointSide(const Vector &vPoint, vec_t sideEpsilon) const +{ + vec_t fDist; + + fDist = DistTo(vPoint); + if(fDist >= sideEpsilon) + return SIDE_FRONT; + else if(fDist <= -sideEpsilon) + return SIDE_BACK; + else + return SIDE_ON; +} + +inline SideType VPlane::GetPointSideExact(const Vector &vPoint) const +{ + return DistTo(vPoint) > 0.0f ? SIDE_FRONT : SIDE_BACK; +} + + +// BUGBUG: This should either simply use the implementation in mathlib or cease to exist. +// mathlib implementation is much more efficient. Check to see that VPlane isn't used in +// performance critical code. +inline SideType VPlane::BoxOnPlaneSide(const Vector &vMin, const Vector &vMax) const +{ + int i, firstSide, side; + TableVector vPoints[8] = + { + { vMin.x, vMin.y, vMin.z }, + { vMin.x, vMin.y, vMax.z }, + { vMin.x, vMax.y, vMax.z }, + { vMin.x, vMax.y, vMin.z }, + + { vMax.x, vMin.y, vMin.z }, + { vMax.x, vMin.y, vMax.z }, + { vMax.x, vMax.y, vMax.z }, + { vMax.x, vMax.y, vMin.z }, + }; + + firstSide = GetPointSideExact(vPoints[0]); + for(i=1; i < 8; i++) + { + side = GetPointSideExact(vPoints[i]); + + // Does the box cross the plane? + if(side != firstSide) + return SIDE_ON; + } + + // Ok, they're all on the same side, return that. + return firstSide; +} + +//-------------------------------------------------------------------------------------------------- + + +//struct cplane_t; + +struct matrix3x4_t +{ + matrix3x4_t() {} + matrix3x4_t( + float m00, float m01, float m02, float m03, + float m10, float m11, float m12, float m13, + float m20, float m21, float m22, float m23 ) + { + m_flMatVal[0][0] = m00; m_flMatVal[0][1] = m01; m_flMatVal[0][2] = m02; m_flMatVal[0][3] = m03; + m_flMatVal[1][0] = m10; m_flMatVal[1][1] = m11; m_flMatVal[1][2] = m12; m_flMatVal[1][3] = m13; + m_flMatVal[2][0] = m20; m_flMatVal[2][1] = m21; m_flMatVal[2][2] = m22; m_flMatVal[2][3] = m23; + } + + //----------------------------------------------------------------------------- + // Creates a matrix where the X axis = forward + // the Y axis = left, and the Z axis = up + //----------------------------------------------------------------------------- + void Init( const Vector& xAxis, const Vector& yAxis, const Vector& zAxis, const Vector &vecOrigin ) + { + m_flMatVal[0][0] = xAxis.x; m_flMatVal[0][1] = yAxis.x; m_flMatVal[0][2] = zAxis.x; m_flMatVal[0][3] = vecOrigin.x; + m_flMatVal[1][0] = xAxis.y; m_flMatVal[1][1] = yAxis.y; m_flMatVal[1][2] = zAxis.y; m_flMatVal[1][3] = vecOrigin.y; + m_flMatVal[2][0] = xAxis.z; m_flMatVal[2][1] = yAxis.z; m_flMatVal[2][2] = zAxis.z; m_flMatVal[2][3] = vecOrigin.z; + } + + //----------------------------------------------------------------------------- + // Creates a matrix where the X axis = forward + // the Y axis = left, and the Z axis = up + //----------------------------------------------------------------------------- + matrix3x4_t( const Vector& xAxis, const Vector& yAxis, const Vector& zAxis, const Vector &vecOrigin ) + { + Init( xAxis, yAxis, zAxis, vecOrigin ); + } + + inline void Invalidate( void ) + { + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 4; j++) + { + m_flMatVal[i][j] = VEC_T_NAN; + } + } + } + + float *operator[]( int i ) { Assert(( i >= 0 ) && ( i < 3 )); return m_flMatVal[i]; } + const float *operator[]( int i ) const { Assert(( i >= 0 ) && ( i < 3 )); return m_flMatVal[i]; } + float *Base() { return &m_flMatVal[0][0]; } + const float *Base() const { return &m_flMatVal[0][0]; } + + float m_flMatVal[3][4]; +}; + + + +class VMatrix +{ +public: + + VMatrix(); + VMatrix( + vec_t m00, vec_t m01, vec_t m02, vec_t m03, + vec_t m10, vec_t m11, vec_t m12, vec_t m13, + vec_t m20, vec_t m21, vec_t m22, vec_t m23, + vec_t m30, vec_t m31, vec_t m32, vec_t m33 + ); + + // Creates a matrix where the X axis = forward + // the Y axis = left, and the Z axis = up + VMatrix( const Vector& forward, const Vector& left, const Vector& up ); + + // Construct from a 3x4 matrix + VMatrix( const matrix3x4_t& matrix3x4 ); + + // Set the values in the matrix. + void Init( + vec_t m00, vec_t m01, vec_t m02, vec_t m03, + vec_t m10, vec_t m11, vec_t m12, vec_t m13, + vec_t m20, vec_t m21, vec_t m22, vec_t m23, + vec_t m30, vec_t m31, vec_t m32, vec_t m33 + ); + + + // Initialize from a 3x4 + void Init( const matrix3x4_t& matrix3x4 ); + + // array access + inline float* operator[](int i) + { + return m[i]; + } + + inline const float* operator[](int i) const + { + return m[i]; + } + + // Get a pointer to m[0][0] + inline float *Base() + { + return &m[0][0]; + } + + inline const float *Base() const + { + return &m[0][0]; + } + + void SetLeft(const Vector &vLeft); + void SetUp(const Vector &vUp); + void SetForward(const Vector &vForward); + + void GetBasisVectors(Vector &vForward, Vector &vLeft, Vector &vUp) const; + void SetBasisVectors(const Vector &vForward, const Vector &vLeft, const Vector &vUp); + + // Get/set the translation. + Vector & GetTranslation( Vector &vTrans ) const; + void SetTranslation(const Vector &vTrans); + + void PreTranslate(const Vector &vTrans); + void PostTranslate(const Vector &vTrans); + + matrix3x4_t& As3x4(); + const matrix3x4_t& As3x4() const; + void CopyFrom3x4( const matrix3x4_t &m3x4 ); + void Set3x4( matrix3x4_t& matrix3x4 ) const; + + bool operator==( const VMatrix& src ) const; + bool operator!=( const VMatrix& src ) const { return !( *this == src ); } + +#ifndef VECTOR_NO_SLOW_OPERATIONS + // Access the basis vectors. + Vector GetLeft() const; + Vector GetUp() const; + Vector GetForward() const; + Vector GetTranslation() const; +#endif + + +// Matrix->vector operations. +public: + // Multiply by a 3D vector (same as operator*). + void V3Mul(const Vector &vIn, Vector &vOut) const; + + // Multiply by a 4D vector. + void V4Mul(const Vector4D &vIn, Vector4D &vOut) const; + +#ifndef VECTOR_NO_SLOW_OPERATIONS + // Applies the rotation (ignores translation in the matrix). (This just calls VMul3x3). + Vector ApplyRotation(const Vector &vVec) const; + + // Multiply by a vector (divides by w, assumes input w is 1). + Vector operator*(const Vector &vVec) const; + + // Multiply by the upper 3x3 part of the matrix (ie: only apply rotation). + Vector VMul3x3(const Vector &vVec) const; + + // Apply the inverse (transposed) rotation (only works on pure rotation matrix) + Vector VMul3x3Transpose(const Vector &vVec) const; + + // Multiply by the upper 3 rows. + Vector VMul4x3(const Vector &vVec) const; + + // Apply the inverse (transposed) transformation (only works on pure rotation/translation) + Vector VMul4x3Transpose(const Vector &vVec) const; +#endif + + +// Matrix->plane operations. +public: + // Transform the plane. The matrix can only contain translation and rotation. + void TransformPlane( const VPlane &inPlane, VPlane &outPlane ) const; + +#ifndef VECTOR_NO_SLOW_OPERATIONS + // Just calls TransformPlane and returns the result. + VPlane operator*(const VPlane &thePlane) const; +#endif + +// Matrix->matrix operations. +public: + + VMatrix& operator=(const VMatrix &mOther); + + // Multiply two matrices (out = this * vm). + void MatrixMul( const VMatrix &vm, VMatrix &out ) const; + + // Add two matrices. + const VMatrix& operator+=(const VMatrix &other); + +#ifndef VECTOR_NO_SLOW_OPERATIONS + // Just calls MatrixMul and returns the result. + VMatrix operator*(const VMatrix &mOther) const; + + // Add/Subtract two matrices. + VMatrix operator+(const VMatrix &other) const; + VMatrix operator-(const VMatrix &other) const; + + // Negation. + VMatrix operator-() const; + + // Return inverse matrix. Be careful because the results are undefined + // if the matrix doesn't have an inverse (ie: InverseGeneral returns false). + VMatrix operator~() const; +#endif + +// Matrix operations. +public: + // Set to identity. + void Identity(); + + bool IsIdentity() const; + + // Setup a matrix for origin and angles. + void SetupMatrixOrgAngles( const Vector &origin, const QAngle &vAngles ); + + // General inverse. This may fail so check the return! + bool InverseGeneral(VMatrix &vInverse) const; + + // Does a fast inverse, assuming the matrix only contains translation and rotation. + void InverseTR( VMatrix &mRet ) const; + + // Usually used for debug checks. Returns true if the upper 3x3 contains + // unit vectors and they are all orthogonal. + bool IsRotationMatrix() const; + +#ifndef VECTOR_NO_SLOW_OPERATIONS + // This calls the other InverseTR and returns the result. + VMatrix InverseTR() const; + + // Get the scale of the matrix's basis vectors. + Vector GetScale() const; + + // (Fast) multiply by a scaling matrix setup from vScale. + VMatrix Scale(const Vector &vScale); + + // Normalize the basis vectors. + VMatrix NormalizeBasisVectors() const; + + // Transpose. + VMatrix Transpose() const; + + // Transpose upper-left 3x3. + VMatrix Transpose3x3() const; +#endif + +public: + // The matrix. + vec_t m[4][4]; +}; + + + +//----------------------------------------------------------------------------- +// Helper functions. +//----------------------------------------------------------------------------- + +#ifndef VECTOR_NO_SLOW_OPERATIONS + +// Setup an identity matrix. +VMatrix SetupMatrixIdentity(); + +// Setup as a scaling matrix. +VMatrix SetupMatrixScale(const Vector &vScale); + +// Setup a translation matrix. +VMatrix SetupMatrixTranslation(const Vector &vTranslation); + +// Setup a matrix to reflect around the plane. +VMatrix SetupMatrixReflection(const VPlane &thePlane); + +// Setup a matrix to project from vOrigin onto thePlane. +VMatrix SetupMatrixProjection(const Vector &vOrigin, const VPlane &thePlane); + +// Setup a matrix to rotate the specified amount around the specified axis. +VMatrix SetupMatrixAxisRot(const Vector &vAxis, vec_t fDegrees); + +// Setup a matrix from euler angles. Just sets identity and calls MatrixAngles. +VMatrix SetupMatrixAngles(const QAngle &vAngles); + +// Setup a matrix for origin and angles. +VMatrix SetupMatrixOrgAngles(const Vector &origin, const QAngle &vAngles); + +#endif + +#define VMatToString(mat) (static_cast(CFmtStr("[ (%f, %f, %f), (%f, %f, %f), (%f, %f, %f), (%f, %f, %f) ]", mat.m[0][0], mat.m[0][1], mat.m[0][2], mat.m[0][3], mat.m[1][0], mat.m[1][1], mat.m[1][2], mat.m[1][3], mat.m[2][0], mat.m[2][1], mat.m[2][2], mat.m[2][3], mat.m[3][0], mat.m[3][1], mat.m[3][2], mat.m[3][3] ))) // ** Note: this generates a temporary, don't hold reference! + +//----------------------------------------------------------------------------- +// Returns the point at the intersection on the 3 planes. +// Returns false if it can't be solved (2 or more planes are parallel). +//----------------------------------------------------------------------------- +bool PlaneIntersection( const VPlane &vp1, const VPlane &vp2, const VPlane &vp3, Vector &vOut ); + + +//----------------------------------------------------------------------------- +// These methods are faster. Use them if you want faster code +//----------------------------------------------------------------------------- +void MatrixSetIdentity( VMatrix &dst ); +void MatrixTranspose( const VMatrix& src, VMatrix& dst ); +void MatrixCopy( const VMatrix& src, VMatrix& dst ); +void MatrixMultiply( const VMatrix& src1, const VMatrix& src2, VMatrix& dst ); + +// Accessors +void MatrixGetColumn( const VMatrix &src, int nCol, Vector *pColumn ); +void MatrixSetColumn( VMatrix &src, int nCol, const Vector &column ); +void MatrixGetRow( const VMatrix &src, int nCol, Vector *pColumn ); +void MatrixSetRow( VMatrix &src, int nCol, const Vector &column ); + +// Vector3DMultiply treats src2 as if it's a direction vector +void Vector3DMultiply( const VMatrix& src1, const Vector& src2, Vector& dst ); + +// Vector3DMultiplyPosition treats src2 as if it's a point (adds the translation) +inline void Vector3DMultiplyPosition( const VMatrix& src1, const VectorByValue src2, Vector& dst ); + +// Vector3DMultiplyPositionProjective treats src2 as if it's a point +// and does the perspective divide at the end +void Vector3DMultiplyPositionProjective( const VMatrix& src1, const Vector &src2, Vector& dst ); + +// Vector3DMultiplyPosition treats src2 as if it's a direction +// and does the perspective divide at the end +// NOTE: src1 had better be an inverse transpose to use this correctly +void Vector3DMultiplyProjective( const VMatrix& src1, const Vector &src2, Vector& dst ); + +void Vector4DMultiply( const VMatrix& src1, const Vector4D& src2, Vector4D& dst ); + +// Same as Vector4DMultiply except that src2 has an implicit W of 1 +void Vector4DMultiplyPosition( const VMatrix& src1, const Vector &src2, Vector4D& dst ); + +// Multiplies the vector by the transpose of the matrix +void Vector3DMultiplyTranspose( const VMatrix& src1, const Vector& src2, Vector& dst ); +void Vector4DMultiplyTranspose( const VMatrix& src1, const Vector4D& src2, Vector4D& dst ); + +// Transform a plane +// void MatrixTransformPlane( const VMatrix &src, const cplane_t &inPlane, cplane_t &outPlane ); + +// Transform a plane that has an axis-aligned normal +// void MatrixTransformAxisAlignedPlane( const VMatrix &src, int nDim, float flSign, float flDist, cplane_t &outPlane ); + +void MatrixBuildTranslation( VMatrix& dst, float x, float y, float z ); +void MatrixBuildTranslation( VMatrix& dst, const Vector &translation ); + +inline void MatrixTranslate( VMatrix& dst, const Vector &translation ) +{ + VMatrix matTranslation, temp; + MatrixBuildTranslation( matTranslation, translation ); + MatrixMultiply( dst, matTranslation, temp ); + dst = temp; +} + + +void MatrixBuildRotationAboutAxis( VMatrix& dst, const Vector& vAxisOfRot, float angleDegrees ); +void MatrixBuildRotateZ( VMatrix& dst, float angleDegrees ); + +inline void MatrixRotate( VMatrix& dst, const Vector& vAxisOfRot, float angleDegrees ) +{ + VMatrix rotation, temp; + MatrixBuildRotationAboutAxis( rotation, vAxisOfRot, angleDegrees ); + MatrixMultiply( dst, rotation, temp ); + dst = temp; +} + +// Builds a rotation matrix that rotates one direction vector into another +void MatrixBuildRotation( VMatrix &dst, const Vector& initialDirection, const Vector& finalDirection ); + +// Builds a scale matrix +void MatrixBuildScale( VMatrix &dst, float x, float y, float z ); +void MatrixBuildScale( VMatrix &dst, const Vector& scale ); + +// Build a perspective matrix. +// zNear and zFar are assumed to be positive. +// You end up looking down positive Z, X is to the right, Y is up. +// X range: [0..1] +// Y range: [0..1] +// Z range: [0..1] +void MatrixBuildPerspective( VMatrix &dst, float fovX, float fovY, float zNear, float zFar ); + +//----------------------------------------------------------------------------- +// Given a projection matrix, take the extremes of the space in transformed into world space and +// get a bounding box. +//----------------------------------------------------------------------------- +void CalculateAABBFromProjectionMatrix( const VMatrix &worldToVolume, Vector *pMins, Vector *pMaxs ); + +//----------------------------------------------------------------------------- +// Given a projection matrix, take the extremes of the space in transformed into world space and +// get a bounding sphere. +//----------------------------------------------------------------------------- +void CalculateSphereFromProjectionMatrix( const VMatrix &worldToVolume, Vector *pCenter, float *pflRadius ); + +//----------------------------------------------------------------------------- +// Given an inverse projection matrix, take the extremes of the space in transformed into world space and +// get a bounding box. +//----------------------------------------------------------------------------- +void CalculateAABBFromProjectionMatrixInverse( const VMatrix &volumeToWorld, Vector *pMins, Vector *pMaxs ); + +//----------------------------------------------------------------------------- +// Given an inverse projection matrix, take the extremes of the space in transformed into world space and +// get a bounding sphere. +//----------------------------------------------------------------------------- +void CalculateSphereFromProjectionMatrixInverse( const VMatrix &volumeToWorld, Vector *pCenter, float *pflRadius ); + +//----------------------------------------------------------------------------- +// Calculate frustum planes given a clip->world space transform. +//----------------------------------------------------------------------------- +// void FrustumPlanesFromMatrix( const VMatrix &clipToWorld, Frustum_t &frustum ); + +//----------------------------------------------------------------------------- +// Setup a matrix from euler angles. +//----------------------------------------------------------------------------- +void MatrixFromAngles( const QAngle& vAngles, VMatrix& dst ); + +//----------------------------------------------------------------------------- +// Creates euler angles from a matrix +//----------------------------------------------------------------------------- +void MatrixToAngles( const VMatrix& src, QAngle& vAngles ); + +//----------------------------------------------------------------------------- +// Does a fast inverse, assuming the matrix only contains translation and rotation. +//----------------------------------------------------------------------------- +void MatrixInverseTR( const VMatrix& src, VMatrix &dst ); + +//----------------------------------------------------------------------------- +// Inverts any matrix at all +//----------------------------------------------------------------------------- +bool MatrixInverseGeneral(const VMatrix& src, VMatrix& dst); + +//----------------------------------------------------------------------------- +// Computes the inverse transpose +//----------------------------------------------------------------------------- +void MatrixInverseTranspose( const VMatrix& src, VMatrix& dst ); + + + +//----------------------------------------------------------------------------- +// VMatrix inlines. +//----------------------------------------------------------------------------- +inline VMatrix::VMatrix() +{ +} + +inline VMatrix::VMatrix( + vec_t m00, vec_t m01, vec_t m02, vec_t m03, + vec_t m10, vec_t m11, vec_t m12, vec_t m13, + vec_t m20, vec_t m21, vec_t m22, vec_t m23, + vec_t m30, vec_t m31, vec_t m32, vec_t m33) +{ + Init( + m00, m01, m02, m03, + m10, m11, m12, m13, + m20, m21, m22, m23, + m30, m31, m32, m33 + ); +} + + +inline VMatrix::VMatrix( const matrix3x4_t& matrix3x4 ) +{ + Init( matrix3x4 ); +} + + +//----------------------------------------------------------------------------- +// Creates a matrix where the X axis = forward +// the Y axis = left, and the Z axis = up +//----------------------------------------------------------------------------- +inline VMatrix::VMatrix( const Vector& xAxis, const Vector& yAxis, const Vector& zAxis ) +{ + Init( + xAxis.x, yAxis.x, zAxis.x, 0.0f, + xAxis.y, yAxis.y, zAxis.y, 0.0f, + xAxis.z, yAxis.z, zAxis.z, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); +} + + +inline void VMatrix::Init( + vec_t m00, vec_t m01, vec_t m02, vec_t m03, + vec_t m10, vec_t m11, vec_t m12, vec_t m13, + vec_t m20, vec_t m21, vec_t m22, vec_t m23, + vec_t m30, vec_t m31, vec_t m32, vec_t m33 + ) +{ + m[0][0] = m00; + m[0][1] = m01; + m[0][2] = m02; + m[0][3] = m03; + + m[1][0] = m10; + m[1][1] = m11; + m[1][2] = m12; + m[1][3] = m13; + + m[2][0] = m20; + m[2][1] = m21; + m[2][2] = m22; + m[2][3] = m23; + + m[3][0] = m30; + m[3][1] = m31; + m[3][2] = m32; + m[3][3] = m33; +} + + +//----------------------------------------------------------------------------- +// Initialize from a 3x4 +//----------------------------------------------------------------------------- +inline void VMatrix::Init( const matrix3x4_t& matrix3x4 ) +{ + memcpy(m, matrix3x4.Base(), sizeof( matrix3x4_t ) ); + + m[3][0] = 0.0f; + m[3][1] = 0.0f; + m[3][2] = 0.0f; + m[3][3] = 1.0f; +} + + +//----------------------------------------------------------------------------- +// Methods related to the basis vectors of the matrix +//----------------------------------------------------------------------------- + +#ifndef VECTOR_NO_SLOW_OPERATIONS + +inline Vector VMatrix::GetForward() const +{ + return Vector(m[0][0], m[1][0], m[2][0]); +} + +inline Vector VMatrix::GetLeft() const +{ + return Vector(m[0][1], m[1][1], m[2][1]); +} + +inline Vector VMatrix::GetUp() const +{ + return Vector(m[0][2], m[1][2], m[2][2]); +} + +#endif + +inline void VMatrix::SetForward(const Vector &vForward) +{ + m[0][0] = vForward.x; + m[1][0] = vForward.y; + m[2][0] = vForward.z; +} + +inline void VMatrix::SetLeft(const Vector &vLeft) +{ + m[0][1] = vLeft.x; + m[1][1] = vLeft.y; + m[2][1] = vLeft.z; +} + +inline void VMatrix::SetUp(const Vector &vUp) +{ + m[0][2] = vUp.x; + m[1][2] = vUp.y; + m[2][2] = vUp.z; +} + +inline void VMatrix::GetBasisVectors(Vector &vForward, Vector &vLeft, Vector &vUp) const +{ + vForward.Init( m[0][0], m[1][0], m[2][0] ); + vLeft.Init( m[0][1], m[1][1], m[2][1] ); + vUp.Init( m[0][2], m[1][2], m[2][2] ); +} + +inline void VMatrix::SetBasisVectors(const Vector &vForward, const Vector &vLeft, const Vector &vUp) +{ + SetForward(vForward); + SetLeft(vLeft); + SetUp(vUp); +} + + +//----------------------------------------------------------------------------- +// Methods related to the translation component of the matrix +//----------------------------------------------------------------------------- +#ifndef VECTOR_NO_SLOW_OPERATIONS + +inline Vector VMatrix::GetTranslation() const +{ + return Vector(m[0][3], m[1][3], m[2][3]); +} + +#endif + +inline Vector& VMatrix::GetTranslation( Vector &vTrans ) const +{ + vTrans.x = m[0][3]; + vTrans.y = m[1][3]; + vTrans.z = m[2][3]; + return vTrans; +} + +inline void VMatrix::SetTranslation(const Vector &vTrans) +{ + m[0][3] = vTrans.x; + m[1][3] = vTrans.y; + m[2][3] = vTrans.z; +} + + +//----------------------------------------------------------------------------- +// appply translation to this matrix in the input space +//----------------------------------------------------------------------------- +inline void VMatrix::PreTranslate(const Vector &vTrans) +{ + Vector tmp; + Vector3DMultiplyPosition( *this, vTrans, tmp ); + m[0][3] = tmp.x; + m[1][3] = tmp.y; + m[2][3] = tmp.z; +} + + +//----------------------------------------------------------------------------- +// appply translation to this matrix in the output space +//----------------------------------------------------------------------------- +inline void VMatrix::PostTranslate(const Vector &vTrans) +{ + m[0][3] += vTrans.x; + m[1][3] += vTrans.y; + m[2][3] += vTrans.z; +} + +inline const matrix3x4_t& VMatrix::As3x4() const +{ + return *((const matrix3x4_t*)this); +} + +inline matrix3x4_t& VMatrix::As3x4() +{ + return *((matrix3x4_t*)this); +} + +inline void VMatrix::CopyFrom3x4( const matrix3x4_t &m3x4 ) +{ + memcpy( m, m3x4.Base(), sizeof( matrix3x4_t ) ); + m[3][0] = m[3][1] = m[3][2] = 0; + m[3][3] = 1; +} + +inline void VMatrix::Set3x4( matrix3x4_t& matrix3x4 ) const +{ + memcpy(matrix3x4.Base(), m, sizeof( matrix3x4_t ) ); +} + + +//----------------------------------------------------------------------------- +// Matrix math operations +//----------------------------------------------------------------------------- +inline const VMatrix& VMatrix::operator+=(const VMatrix &other) +{ + for(int i=0; i < 4; i++) + { + for(int j=0; j < 4; j++) + { + m[i][j] += other.m[i][j]; + } + } + + return *this; +} + + +#ifndef VECTOR_NO_SLOW_OPERATIONS + +inline VMatrix VMatrix::operator+(const VMatrix &other) const +{ + VMatrix ret; + for(int i=0; i < 16; i++) + { + ((float*)ret.m)[i] = ((float*)m)[i] + ((float*)other.m)[i]; + } + return ret; +} + +inline VMatrix VMatrix::operator-(const VMatrix &other) const +{ + VMatrix ret; + + for(int i=0; i < 4; i++) + { + for(int j=0; j < 4; j++) + { + ret.m[i][j] = m[i][j] - other.m[i][j]; + } + } + + return ret; +} + +inline VMatrix VMatrix::operator-() const +{ + VMatrix ret; + for( int i=0; i < 16; i++ ) + { + ((float*)ret.m)[i] = ((float*)m)[i]; + } + return ret; +} + +#endif // VECTOR_NO_SLOW_OPERATIONS + + +//----------------------------------------------------------------------------- +// Vector transformation +//----------------------------------------------------------------------------- + +#ifndef VECTOR_NO_SLOW_OPERATIONS + +inline Vector VMatrix::operator*(const Vector &vVec) const +{ + Vector vRet; + vRet.x = m[0][0]*vVec.x + m[0][1]*vVec.y + m[0][2]*vVec.z + m[0][3]; + vRet.y = m[1][0]*vVec.x + m[1][1]*vVec.y + m[1][2]*vVec.z + m[1][3]; + vRet.z = m[2][0]*vVec.x + m[2][1]*vVec.y + m[2][2]*vVec.z + m[2][3]; + + return vRet; +} + +inline Vector VMatrix::VMul4x3(const Vector &vVec) const +{ + Vector vResult; + Vector3DMultiplyPosition( *this, vVec, vResult ); + return vResult; +} + + +inline Vector VMatrix::VMul4x3Transpose(const Vector &vVec) const +{ + Vector tmp = vVec; + tmp.x -= m[0][3]; + tmp.y -= m[1][3]; + tmp.z -= m[2][3]; + + return Vector( + m[0][0]*tmp.x + m[1][0]*tmp.y + m[2][0]*tmp.z, + m[0][1]*tmp.x + m[1][1]*tmp.y + m[2][1]*tmp.z, + m[0][2]*tmp.x + m[1][2]*tmp.y + m[2][2]*tmp.z + ); +} + +inline Vector VMatrix::VMul3x3(const Vector &vVec) const +{ + return Vector( + m[0][0]*vVec.x + m[0][1]*vVec.y + m[0][2]*vVec.z, + m[1][0]*vVec.x + m[1][1]*vVec.y + m[1][2]*vVec.z, + m[2][0]*vVec.x + m[2][1]*vVec.y + m[2][2]*vVec.z + ); +} + +inline Vector VMatrix::VMul3x3Transpose(const Vector &vVec) const +{ + return Vector( + m[0][0]*vVec.x + m[1][0]*vVec.y + m[2][0]*vVec.z, + m[0][1]*vVec.x + m[1][1]*vVec.y + m[2][1]*vVec.z, + m[0][2]*vVec.x + m[1][2]*vVec.y + m[2][2]*vVec.z + ); +} + +#endif // VECTOR_NO_SLOW_OPERATIONS + + +inline void VMatrix::V3Mul(const Vector &vIn, Vector &vOut) const +{ + vec_t rw; + + rw = 1.0f / (m[3][0]*vIn.x + m[3][1]*vIn.y + m[3][2]*vIn.z + m[3][3]); + vOut.x = (m[0][0]*vIn.x + m[0][1]*vIn.y + m[0][2]*vIn.z + m[0][3]) * rw; + vOut.y = (m[1][0]*vIn.x + m[1][1]*vIn.y + m[1][2]*vIn.z + m[1][3]) * rw; + vOut.z = (m[2][0]*vIn.x + m[2][1]*vIn.y + m[2][2]*vIn.z + m[2][3]) * rw; +} + +inline void VMatrix::V4Mul(const Vector4D &vIn, Vector4D &vOut) const +{ + vOut[0] = m[0][0]*vIn[0] + m[0][1]*vIn[1] + m[0][2]*vIn[2] + m[0][3]*vIn[3]; + vOut[1] = m[1][0]*vIn[0] + m[1][1]*vIn[1] + m[1][2]*vIn[2] + m[1][3]*vIn[3]; + vOut[2] = m[2][0]*vIn[0] + m[2][1]*vIn[1] + m[2][2]*vIn[2] + m[2][3]*vIn[3]; + vOut[3] = m[3][0]*vIn[0] + m[3][1]*vIn[1] + m[3][2]*vIn[2] + m[3][3]*vIn[3]; +} + + +//----------------------------------------------------------------------------- +// Plane transformation +//----------------------------------------------------------------------------- +inline void VMatrix::TransformPlane( const VPlane &inPlane, VPlane &outPlane ) const +{ + Vector vTrans; + Vector3DMultiply( *this, inPlane.m_Normal, outPlane.m_Normal ); + outPlane.m_Dist = inPlane.m_Dist * DotProduct( outPlane.m_Normal, outPlane.m_Normal ); + outPlane.m_Dist += DotProduct( outPlane.m_Normal, GetTranslation( vTrans ) ); +} + + +//----------------------------------------------------------------------------- +// Other random stuff +//----------------------------------------------------------------------------- +inline void VMatrix::Identity() +{ + MatrixSetIdentity( *this ); +} + + +inline bool VMatrix::IsIdentity() const +{ + return + m[0][0] == 1.0f && m[0][1] == 0.0f && m[0][2] == 0.0f && m[0][3] == 0.0f && + m[1][0] == 0.0f && m[1][1] == 1.0f && m[1][2] == 0.0f && m[1][3] == 0.0f && + m[2][0] == 0.0f && m[2][1] == 0.0f && m[2][2] == 1.0f && m[2][3] == 0.0f && + m[3][0] == 0.0f && m[3][1] == 0.0f && m[3][2] == 0.0f && m[3][3] == 1.0f; +} + +#ifndef VECTOR_NO_SLOW_OPERATIONS + +inline Vector VMatrix::ApplyRotation(const Vector &vVec) const +{ + return VMul3x3(vVec); +} + +inline VMatrix VMatrix::operator~() const +{ + VMatrix mRet; + InverseGeneral(mRet); + return mRet; +} + +#endif + + +//----------------------------------------------------------------------------- +// Accessors +//----------------------------------------------------------------------------- +inline void MatrixGetColumn( const VMatrix &src, int nCol, Vector *pColumn ) +{ + Assert( (nCol >= 0) && (nCol <= 3) ); + + pColumn->x = src[0][nCol]; + pColumn->y = src[1][nCol]; + pColumn->z = src[2][nCol]; +} + +inline void MatrixSetColumn( VMatrix &src, int nCol, const Vector &column ) +{ + Assert( (nCol >= 0) && (nCol <= 3) ); + + src.m[0][nCol] = column.x; + src.m[1][nCol] = column.y; + src.m[2][nCol] = column.z; +} + +inline void MatrixGetRow( const VMatrix &src, int nRow, Vector *pRow ) +{ + Assert( (nRow >= 0) && (nRow <= 3) ); + *pRow = *(Vector*)src[nRow]; +} + +inline void MatrixSetRow( VMatrix &dst, int nRow, const Vector &row ) +{ + Assert( (nRow >= 0) && (nRow <= 3) ); + *(Vector*)dst[nRow] = row; +} + + +//----------------------------------------------------------------------------- +// Vector3DMultiplyPosition treats src2 as if it's a point (adds the translation) +//----------------------------------------------------------------------------- +// NJS: src2 is passed in as a full vector rather than a reference to prevent the need +// for 2 branches and a potential copy in the body. (ie, handling the case when the src2 +// reference is the same as the dst reference ). +inline void Vector3DMultiplyPosition( const VMatrix& src1, const VectorByValue src2, Vector& dst ) +{ + dst[0] = src1[0][0] * src2.x + src1[0][1] * src2.y + src1[0][2] * src2.z + src1[0][3]; + dst[1] = src1[1][0] * src2.x + src1[1][1] * src2.y + src1[1][2] * src2.z + src1[1][3]; + dst[2] = src1[2][0] * src2.x + src1[2][1] * src2.y + src1[2][2] * src2.z + src1[2][3]; +} + + +#if 0 +//----------------------------------------------------------------------------- +// Transform a plane that has an axis-aligned normal +//----------------------------------------------------------------------------- +inline void MatrixTransformAxisAlignedPlane( const VMatrix &src, int nDim, float flSign, float flDist, cplane_t &outPlane ) +{ + // See MatrixTransformPlane in the .cpp file for an explanation of the algorithm. + MatrixGetColumn( src, nDim, &outPlane.normal ); + outPlane.normal *= flSign; + outPlane.dist = flDist * DotProduct( outPlane.normal, outPlane.normal ); + + // NOTE: Writing this out by hand because it doesn't inline (inline depth isn't large enough) + // This should read outPlane.dist += DotProduct( outPlane.normal, src.GetTranslation ); + outPlane.dist += outPlane.normal.x * src.m[0][3] + outPlane.normal.y * src.m[1][3] + outPlane.normal.z * src.m[2][3]; +} +#endif + + +//----------------------------------------------------------------------------- +// Matrix equality test +//----------------------------------------------------------------------------- +inline bool MatricesAreEqual( const VMatrix &src1, const VMatrix &src2, float flTolerance ) +{ + for ( int i = 0; i < 3; ++i ) + { + for ( int j = 0; j < 3; ++j ) + { + if ( fabs( src1[i][j] - src2[i][j] ) > flTolerance ) + return false; + } + } + return true; +} + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void MatrixBuildOrtho( VMatrix& dst, double left, double top, double right, double bottom, double zNear, double zFar ); +void MatrixBuildPerspectiveX( VMatrix& dst, double flFovX, double flAspect, double flZNear, double flZFar ); +void MatrixBuildPerspectiveOffCenterX( VMatrix& dst, double flFovX, double flAspect, double flZNear, double flZFar, double bottom, double top, double left, double right ); + +inline void MatrixOrtho( VMatrix& dst, double left, double top, double right, double bottom, double zNear, double zFar ) +{ + VMatrix mat; + MatrixBuildOrtho( mat, left, top, right, bottom, zNear, zFar ); + + VMatrix temp; + MatrixMultiply( dst, mat, temp ); + dst = temp; +} + +inline void MatrixPerspectiveX( VMatrix& dst, double flFovX, double flAspect, double flZNear, double flZFar ) +{ + VMatrix mat; + MatrixBuildPerspectiveX( mat, flFovX, flAspect, flZNear, flZFar ); + + VMatrix temp; + MatrixMultiply( dst, mat, temp ); + dst = temp; +} + +inline void MatrixPerspectiveOffCenterX( VMatrix& dst, double flFovX, double flAspect, double flZNear, double flZFar, double bottom, double top, double left, double right ) +{ + VMatrix mat; + MatrixBuildPerspectiveOffCenterX( mat, flFovX, flAspect, flZNear, flZFar, bottom, top, left, right ); + + VMatrix temp; + MatrixMultiply( dst, mat, temp ); + dst = temp; +} + +#endif // MATHLITE_H diff --git a/external/steamworks/glmgr/readme.txt b/external/steamworks/glmgr/readme.txt new file mode 100644 index 0000000..215f02b --- /dev/null +++ b/external/steamworks/glmgr/readme.txt @@ -0,0 +1,11 @@ +================================================================ + +Copyright © 1996-2011, Valve Corporation, All rights reserved. + +================================================================ + +OSX DirectX to OpenGL Conversion Library + +Contains all support files required to assist in converting DirectX applications to OpenGL on OSX. For reference, +this library can be enabled in the Steamworks Example by building with the compile time flag DX9MODE=1. + diff --git a/external/steamworks/public/steam/isteamapps.h b/external/steamworks/public/steam/isteamapps.h new file mode 100644 index 0000000..f0b1137 --- /dev/null +++ b/external/steamworks/public/steam/isteamapps.h @@ -0,0 +1,201 @@ +//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to app data in Steam +// +//============================================================================= + +#ifndef ISTEAMAPPS_H +#define ISTEAMAPPS_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + +const int k_cubAppProofOfPurchaseKeyMax = 240; // max supported length of a legacy cd key + + +//----------------------------------------------------------------------------- +// Purpose: interface to app data +//----------------------------------------------------------------------------- +class ISteamApps +{ +public: + virtual bool BIsSubscribed() = 0; + virtual bool BIsLowViolence() = 0; + virtual bool BIsCybercafe() = 0; + virtual bool BIsVACBanned() = 0; + virtual const char *GetCurrentGameLanguage() = 0; + virtual const char *GetAvailableGameLanguages() = 0; + + // only use this member if you need to check ownership of another game related to yours, a demo for example + virtual bool BIsSubscribedApp( AppId_t appID ) = 0; + + // Takes AppID of DLC and checks if the user owns the DLC & if the DLC is installed + virtual bool BIsDlcInstalled( AppId_t appID ) = 0; + + // returns the Unix time of the purchase of the app + virtual uint32 GetEarliestPurchaseUnixTime( AppId_t nAppID ) = 0; + + // Checks if the user is subscribed to the current app through a free weekend + // This function will return false for users who have a retail or other type of license + // Before using, please ask your Valve technical contact how to package and secure your free weekend + virtual bool BIsSubscribedFromFreeWeekend() = 0; + + // Returns the number of DLC pieces for the running app + virtual int GetDLCCount() = 0; + + // Returns metadata for DLC by index, of range [0, GetDLCCount()] + virtual bool BGetDLCDataByIndex( int iDLC, AppId_t *pAppID, bool *pbAvailable, char *pchName, int cchNameBufferSize ) = 0; + + // Install/Uninstall control for optional DLC + virtual void InstallDLC( AppId_t nAppID ) = 0; + virtual void UninstallDLC( AppId_t nAppID ) = 0; + + // Request legacy cd-key for yourself or owned DLC. If you are interested in this + // data then make sure you provide us with a list of valid keys to be distributed + // to users when they purchase the game, before the game ships. + // You'll receive an AppProofOfPurchaseKeyResponse_t callback when + // the key is available (which may be immediately). + virtual void RequestAppProofOfPurchaseKey( AppId_t nAppID ) = 0; + + virtual bool GetCurrentBetaName( char *pchName, int cchNameBufferSize ) = 0; // returns current beta branch name, 'public' is the default branch + virtual bool MarkContentCorrupt( bool bMissingFilesOnly ) = 0; // signal Steam that game files seems corrupt or missing + virtual uint32 GetInstalledDepots( AppId_t appID, DepotId_t *pvecDepots, uint32 cMaxDepots ) = 0; // return installed depots in mount order + + // returns current app install folder for AppID, returns folder name length + virtual uint32 GetAppInstallDir( AppId_t appID, char *pchFolder, uint32 cchFolderBufferSize ) = 0; + virtual bool BIsAppInstalled( AppId_t appID ) = 0; // returns true if that app is installed (not necessarily owned) + + // returns the SteamID of the original owner. If this CSteamID is different from ISteamUser::GetSteamID(), + // the user has a temporary license borrowed via Family Sharing + virtual CSteamID GetAppOwner() = 0; + + // Returns the associated launch param if the game is run via steam://run///?param1=value1¶m2=value2¶m3=value3 etc. + // Parameter names starting with the character '@' are reserved for internal use and will always return and empty string. + // Parameter names starting with an underscore '_' are reserved for steam features -- they can be queried by the game, + // but it is advised that you not param names beginning with an underscore for your own features. + // Check for new launch parameters on callback NewUrlLaunchParameters_t + virtual const char *GetLaunchQueryParam( const char *pchKey ) = 0; + + // get download progress for optional DLC + virtual bool GetDlcDownloadProgress( AppId_t nAppID, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0; + + // return the buildid of this app, may change at any time based on backend updates to the game + virtual int GetAppBuildId() = 0; + + // Request all proof of purchase keys for the calling appid and associated DLC. + // A series of AppProofOfPurchaseKeyResponse_t callbacks will be sent with + // appropriate appid values, ending with a final callback where the m_nAppId + // member is k_uAppIdInvalid (zero). + virtual void RequestAllProofOfPurchaseKeys() = 0; + + STEAM_CALL_RESULT( FileDetailsResult_t ) + virtual SteamAPICall_t GetFileDetails( const char* pszFileName ) = 0; + + // Get command line if game was launched via Steam URL, e.g. steam://run////. + // This method of passing a connect string (used when joining via rich presence, accepting an + // invite, etc) is preferable to passing the connect string on the operating system command + // line, which is a security risk. In order for rich presence joins to go through this + // path and not be placed on the OS command line, you must set a value in your app's + // configuration on Steam. Ask Valve for help with this. + // + // If game was already running and launched again, the NewUrlLaunchParameters_t will be fired. + virtual int GetLaunchCommandLine( char *pszCommandLine, int cubCommandLine ) = 0; + + // Check if user borrowed this game via Family Sharing, If true, call GetAppOwner() to get the lender SteamID + virtual bool BIsSubscribedFromFamilySharing() = 0; + + // check if game is a timed trial with limited playtime + virtual bool BIsTimedTrial( uint32* punSecondsAllowed, uint32* punSecondsPlayed ) = 0; + + // set current DLC AppID being played (or 0 if none). Allows Steam to track usage of major DLC extensions + virtual bool SetDlcContext( AppId_t nAppID ) = 0; + + // returns total number of known app branches (including default "public" branch ). nAvailable is number of available betas + virtual int GetNumBetas( int *pnAvailable, int *pnPrivate ) = 0; // + + // return beta branch details, name, description, current BuildID and state flags (EBetaBranchFlags) + virtual bool GetBetaInfo( int iBetaIndex, uint32 *punFlags, uint32 *punBuildID, char *pchBetaName, int cchBetaName, char *pchDescription, int cchDescription ) = 0; // iterate through + + // select this beta branch for this app as active, might need the game to restart so Steam can update to that branch + virtual bool SetActiveBeta( const char *pchBetaName ) = 0; +}; + +#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION008" + +// Global interface accessor +inline ISteamApps *SteamApps(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamApps *, SteamApps, STEAMAPPS_INTERFACE_VERSION ); + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif +//----------------------------------------------------------------------------- +// Purpose: posted after the user gains ownership of DLC & that DLC is installed +//----------------------------------------------------------------------------- +struct DlcInstalled_t +{ + enum { k_iCallback = k_iSteamAppsCallbacks + 5 }; + AppId_t m_nAppID; // AppID of the DLC +}; + + +//--------------------------------------------------------------------------------- +// Purpose: posted after the user gains executes a Steam URL with command line or query parameters +// such as steam://run///-commandline/?param1=value1¶m2=value2¶m3=value3 etc +// while the game is already running. The new params can be queried +// with GetLaunchQueryParam and GetLaunchCommandLine +//--------------------------------------------------------------------------------- +struct NewUrlLaunchParameters_t +{ + enum { k_iCallback = k_iSteamAppsCallbacks + 14 }; +}; + + +//----------------------------------------------------------------------------- +// Purpose: response to RequestAppProofOfPurchaseKey/RequestAllProofOfPurchaseKeys +// for supporting third-party CD keys, or other proof-of-purchase systems. +//----------------------------------------------------------------------------- +struct AppProofOfPurchaseKeyResponse_t +{ + enum { k_iCallback = k_iSteamAppsCallbacks + 21 }; + EResult m_eResult; + uint32 m_nAppID; + uint32 m_cchKeyLength; + char m_rgchKey[k_cubAppProofOfPurchaseKeyMax]; +}; + + +//----------------------------------------------------------------------------- +// Purpose: response to GetFileDetails +//----------------------------------------------------------------------------- +struct FileDetailsResult_t +{ + enum { k_iCallback = k_iSteamAppsCallbacks + 23 }; + EResult m_eResult; + uint64 m_ulFileSize; // original file size in bytes + uint8 m_FileSHA[20]; // original file SHA1 hash + uint32 m_unFlags; // +}; + + +//----------------------------------------------------------------------------- +// Purpose: called for games in Timed Trial mode +//----------------------------------------------------------------------------- +struct TimedTrialStatus_t +{ + enum { k_iCallback = k_iSteamAppsCallbacks + 30 }; + AppId_t m_unAppID; // appID + bool m_bIsOffline; // if true, time allowed / played refers to offline time, not total time + uint32 m_unSecondsAllowed; // how many seconds the app can be played in total + uint32 m_unSecondsPlayed; // how many seconds the app was already played +}; + +#pragma pack( pop ) +#endif // ISTEAMAPPS_H diff --git a/external/steamworks/public/steam/isteamappticket.h b/external/steamworks/public/steam/isteamappticket.h new file mode 100644 index 0000000..6f23906 --- /dev/null +++ b/external/steamworks/public/steam/isteamappticket.h @@ -0,0 +1,28 @@ +//====== Copyright 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: a private, but well versioned, interface to get at critical bits +// of a steam3 appticket - consumed by the simple drm wrapper to let it +// ask about ownership with greater confidence. +// +//============================================================================= + +#ifndef ISTEAMAPPTICKET_H +#define ISTEAMAPPTICKET_H +#pragma once + +//----------------------------------------------------------------------------- +// Purpose: hand out a reasonable "future proof" view of an app ownership ticket +// the raw (signed) buffer, and indices into that buffer where the appid and +// steamid are located. the sizes of the appid and steamid are implicit in +// (each version of) the interface - currently uin32 appid and uint64 steamid +//----------------------------------------------------------------------------- +class ISteamAppTicket +{ +public: + virtual uint32 GetAppOwnershipTicketData( uint32 nAppID, void *pvBuffer, uint32 cbBufferLength, uint32 *piAppId, uint32 *piSteamId, uint32 *piSignature, uint32 *pcbSignature ) = 0; +}; + +#define STEAMAPPTICKET_INTERFACE_VERSION "STEAMAPPTICKET_INTERFACE_VERSION001" + + +#endif // ISTEAMAPPTICKET_H diff --git a/external/steamworks/public/steam/isteamclient.h b/external/steamworks/public/steam/isteamclient.h new file mode 100644 index 0000000..25703c2 --- /dev/null +++ b/external/steamworks/public/steam/isteamclient.h @@ -0,0 +1,173 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Internal low-level access to Steamworks interfaces. +// +// Most users of the Steamworks SDK do not need to include this file. +// You should only include this if you are doing something special. +//============================================================================= + +#ifndef ISTEAMCLIENT_H +#define ISTEAMCLIENT_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + +//----------------------------------------------------------------------------- +// Purpose: Interface to creating a new steam instance, or to +// connect to an existing steam instance, whether it's in a +// different process or is local. +// +// For most scenarios this is all handled automatically via SteamAPI_Init(). +// You'll only need these APIs if you have a more complex versioning scheme, +// or if you want to implement a multiplexed gameserver where a single process +// is handling multiple games at once with independent gameserver SteamIDs. +//----------------------------------------------------------------------------- +class ISteamClient +{ +public: + // Creates a communication pipe to the Steam client. + // NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling + virtual HSteamPipe CreateSteamPipe() = 0; + + // Releases a previously created communications pipe + // NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling + virtual bool BReleaseSteamPipe( HSteamPipe hSteamPipe ) = 0; + + // connects to an existing global user, failing if none exists + // used by the game to coordinate with the steamUI + // NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling + virtual HSteamUser ConnectToGlobalUser( HSteamPipe hSteamPipe ) = 0; + + // used by game servers, create a steam user that won't be shared with anyone else + // NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling + virtual HSteamUser CreateLocalUser( HSteamPipe *phSteamPipe, EAccountType eAccountType ) = 0; + + // removes an allocated user + // NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling + virtual void ReleaseUser( HSteamPipe hSteamPipe, HSteamUser hUser ) = 0; + + // retrieves the ISteamUser interface associated with the handle + virtual ISteamUser *GetISteamUser( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // retrieves the ISteamGameServer interface associated with the handle + virtual ISteamGameServer *GetISteamGameServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // set the local IP and Port to bind to + // this must be set before CreateLocalUser() + virtual void SetLocalIPBinding( const SteamIPAddress_t &unIP, uint16 usPort ) = 0; + + // returns the ISteamFriends interface + virtual ISteamFriends *GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // returns the ISteamUtils interface + virtual ISteamUtils *GetISteamUtils( HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // returns the ISteamMatchmaking interface + virtual ISteamMatchmaking *GetISteamMatchmaking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // returns the ISteamMatchmakingServers interface + virtual ISteamMatchmakingServers *GetISteamMatchmakingServers( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // returns the a generic interface + virtual void *GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // returns the ISteamUserStats interface + virtual ISteamUserStats *GetISteamUserStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // returns the ISteamGameServerStats interface + virtual ISteamGameServerStats *GetISteamGameServerStats( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // returns apps interface + virtual ISteamApps *GetISteamApps( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // networking + virtual ISteamNetworking *GetISteamNetworking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // remote storage + virtual ISteamRemoteStorage *GetISteamRemoteStorage( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // user screenshots + virtual ISteamScreenshots *GetISteamScreenshots( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // game search + virtual ISteamGameSearch *GetISteamGameSearch( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Deprecated. Applications should use SteamAPI_RunCallbacks() or SteamGameServer_RunCallbacks() instead. + STEAM_PRIVATE_API( virtual void RunFrame() = 0; ) + + // returns the number of IPC calls made since the last time this function was called + // Used for perf debugging so you can understand how many IPC calls your game makes per frame + // Every IPC call is at minimum a thread context switch if not a process one so you want to rate + // control how often you do them. + virtual uint32 GetIPCCallCount() = 0; + + // API warning handling + // 'int' is the severity; 0 for msg, 1 for warning + // 'const char *' is the text of the message + // callbacks will occur directly after the API function is called that generated the warning or message. + virtual void SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction ) = 0; + + // Trigger global shutdown for the DLL + virtual bool BShutdownIfAllPipesClosed() = 0; + + // Expose HTTP interface + virtual ISteamHTTP *GetISteamHTTP( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Exposes the ISteamController interface - deprecated in favor of Steam Input + virtual ISteamController *GetISteamController( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Exposes the ISteamUGC interface + virtual ISteamUGC *GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Music Player + virtual ISteamMusic *GetISteamMusic( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Music Player Remote + virtual ISteamMusicRemote *GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion) = 0; + + // html page display + virtual ISteamHTMLSurface *GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion) = 0; + + // Helper functions for internal Steam usage + STEAM_PRIVATE_API( virtual void DEPRECATED_Set_SteamAPI_CPostAPIResultInProcess( void (*)() ) = 0; ) + STEAM_PRIVATE_API( virtual void DEPRECATED_Remove_SteamAPI_CPostAPIResultInProcess( void (*)() ) = 0; ) + STEAM_PRIVATE_API( virtual void Set_SteamAPI_CCheckCallbackRegisteredInProcess( SteamAPI_CheckCallbackRegistered_t func ) = 0; ) + + // inventory + virtual ISteamInventory *GetISteamInventory( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Video + virtual ISteamVideo *GetISteamVideo( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Parental controls + virtual ISteamParentalSettings *GetISteamParentalSettings( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Exposes the Steam Input interface for controller support + virtual ISteamInput *GetISteamInput( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Steam Parties interface + virtual ISteamParties *GetISteamParties( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Steam Remote Play interface + virtual ISteamRemotePlay *GetISteamRemotePlay( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + STEAM_PRIVATE_API( virtual void DestroyAllInterfaces() = 0; ) + +}; +#define STEAMCLIENT_INTERFACE_VERSION "SteamClient021" + +#ifndef STEAM_API_EXPORTS + +// Global ISteamClient interface accessor +inline ISteamClient *SteamClient(); +STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamClient *, SteamClient, SteamInternal_CreateInterface( STEAMCLIENT_INTERFACE_VERSION ), "global", STEAMCLIENT_INTERFACE_VERSION ); + +// The internal ISteamClient used for the gameserver interface. +// (This is actually the same thing. You really shouldn't need to access any of this stuff directly.) +inline ISteamClient *SteamGameServerClient() { return SteamClient(); } + +#endif + +#endif // ISTEAMCLIENT_H diff --git a/external/steamworks/public/steam/isteamcontroller.h b/external/steamworks/public/steam/isteamcontroller.h new file mode 100644 index 0000000..10d0f54 --- /dev/null +++ b/external/steamworks/public/steam/isteamcontroller.h @@ -0,0 +1,731 @@ +//====== Copyright 1996-2018, Valve Corporation, All rights reserved. ======= +// Note: The older ISteamController interface has been deprecated in favor of ISteamInput - this interface +// was updated in this SDK but will be removed from future SDK's. The Steam Client will retain +// compatibility with the older interfaces so your any existing integrations should be unaffected. +// +// Purpose: Steam Input is a flexible input API that supports over three hundred devices including all +// common variants of Xbox, Playstation, Nintendo Switch Pro, and Steam Controllers. +// For more info including a getting started guide for developers +// please visit: https://partner.steamgames.com/doc/features/steam_controller +// +//============================================================================= + +#ifndef ISTEAMCONTROLLER_H +#define ISTEAMCONTROLLER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" +#include "isteaminput.h" + +#define STEAM_CONTROLLER_MAX_COUNT 16 + +#define STEAM_CONTROLLER_MAX_ANALOG_ACTIONS 24 + +#define STEAM_CONTROLLER_MAX_DIGITAL_ACTIONS 256 + +#define STEAM_CONTROLLER_MAX_ORIGINS 8 + +#define STEAM_CONTROLLER_MAX_ACTIVE_LAYERS 16 + +// When sending an option to a specific controller handle, you can send to all controllers via this command +#define STEAM_CONTROLLER_HANDLE_ALL_CONTROLLERS UINT64_MAX + +#define STEAM_CONTROLLER_MIN_ANALOG_ACTION_DATA -1.0f +#define STEAM_CONTROLLER_MAX_ANALOG_ACTION_DATA 1.0f + +#ifndef ISTEAMINPUT_H +enum ESteamControllerPad +{ + k_ESteamControllerPad_Left, + k_ESteamControllerPad_Right +}; +#endif + +// Note: Please do not use action origins as a way to identify controller types. There is no +// guarantee that they will be added in a contiguous manner - use GetInputTypeForHandle instead +// Versions of Steam that add new controller types in the future will extend this enum if you're +// using a lookup table please check the bounds of any origins returned by Steam. +enum EControllerActionOrigin +{ + // Steam Controller + k_EControllerActionOrigin_None, + k_EControllerActionOrigin_A, + k_EControllerActionOrigin_B, + k_EControllerActionOrigin_X, + k_EControllerActionOrigin_Y, + k_EControllerActionOrigin_LeftBumper, + k_EControllerActionOrigin_RightBumper, + k_EControllerActionOrigin_LeftGrip, + k_EControllerActionOrigin_RightGrip, + k_EControllerActionOrigin_Start, + k_EControllerActionOrigin_Back, + k_EControllerActionOrigin_LeftPad_Touch, + k_EControllerActionOrigin_LeftPad_Swipe, + k_EControllerActionOrigin_LeftPad_Click, + k_EControllerActionOrigin_LeftPad_DPadNorth, + k_EControllerActionOrigin_LeftPad_DPadSouth, + k_EControllerActionOrigin_LeftPad_DPadWest, + k_EControllerActionOrigin_LeftPad_DPadEast, + k_EControllerActionOrigin_RightPad_Touch, + k_EControllerActionOrigin_RightPad_Swipe, + k_EControllerActionOrigin_RightPad_Click, + k_EControllerActionOrigin_RightPad_DPadNorth, + k_EControllerActionOrigin_RightPad_DPadSouth, + k_EControllerActionOrigin_RightPad_DPadWest, + k_EControllerActionOrigin_RightPad_DPadEast, + k_EControllerActionOrigin_LeftTrigger_Pull, + k_EControllerActionOrigin_LeftTrigger_Click, + k_EControllerActionOrigin_RightTrigger_Pull, + k_EControllerActionOrigin_RightTrigger_Click, + k_EControllerActionOrigin_LeftStick_Move, + k_EControllerActionOrigin_LeftStick_Click, + k_EControllerActionOrigin_LeftStick_DPadNorth, + k_EControllerActionOrigin_LeftStick_DPadSouth, + k_EControllerActionOrigin_LeftStick_DPadWest, + k_EControllerActionOrigin_LeftStick_DPadEast, + k_EControllerActionOrigin_Gyro_Move, + k_EControllerActionOrigin_Gyro_Pitch, + k_EControllerActionOrigin_Gyro_Yaw, + k_EControllerActionOrigin_Gyro_Roll, + + // PS4 Dual Shock + k_EControllerActionOrigin_PS4_X, + k_EControllerActionOrigin_PS4_Circle, + k_EControllerActionOrigin_PS4_Triangle, + k_EControllerActionOrigin_PS4_Square, + k_EControllerActionOrigin_PS4_LeftBumper, + k_EControllerActionOrigin_PS4_RightBumper, + k_EControllerActionOrigin_PS4_Options, //Start + k_EControllerActionOrigin_PS4_Share, //Back + k_EControllerActionOrigin_PS4_LeftPad_Touch, + k_EControllerActionOrigin_PS4_LeftPad_Swipe, + k_EControllerActionOrigin_PS4_LeftPad_Click, + k_EControllerActionOrigin_PS4_LeftPad_DPadNorth, + k_EControllerActionOrigin_PS4_LeftPad_DPadSouth, + k_EControllerActionOrigin_PS4_LeftPad_DPadWest, + k_EControllerActionOrigin_PS4_LeftPad_DPadEast, + k_EControllerActionOrigin_PS4_RightPad_Touch, + k_EControllerActionOrigin_PS4_RightPad_Swipe, + k_EControllerActionOrigin_PS4_RightPad_Click, + k_EControllerActionOrigin_PS4_RightPad_DPadNorth, + k_EControllerActionOrigin_PS4_RightPad_DPadSouth, + k_EControllerActionOrigin_PS4_RightPad_DPadWest, + k_EControllerActionOrigin_PS4_RightPad_DPadEast, + k_EControllerActionOrigin_PS4_CenterPad_Touch, + k_EControllerActionOrigin_PS4_CenterPad_Swipe, + k_EControllerActionOrigin_PS4_CenterPad_Click, + k_EControllerActionOrigin_PS4_CenterPad_DPadNorth, + k_EControllerActionOrigin_PS4_CenterPad_DPadSouth, + k_EControllerActionOrigin_PS4_CenterPad_DPadWest, + k_EControllerActionOrigin_PS4_CenterPad_DPadEast, + k_EControllerActionOrigin_PS4_LeftTrigger_Pull, + k_EControllerActionOrigin_PS4_LeftTrigger_Click, + k_EControllerActionOrigin_PS4_RightTrigger_Pull, + k_EControllerActionOrigin_PS4_RightTrigger_Click, + k_EControllerActionOrigin_PS4_LeftStick_Move, + k_EControllerActionOrigin_PS4_LeftStick_Click, + k_EControllerActionOrigin_PS4_LeftStick_DPadNorth, + k_EControllerActionOrigin_PS4_LeftStick_DPadSouth, + k_EControllerActionOrigin_PS4_LeftStick_DPadWest, + k_EControllerActionOrigin_PS4_LeftStick_DPadEast, + k_EControllerActionOrigin_PS4_RightStick_Move, + k_EControllerActionOrigin_PS4_RightStick_Click, + k_EControllerActionOrigin_PS4_RightStick_DPadNorth, + k_EControllerActionOrigin_PS4_RightStick_DPadSouth, + k_EControllerActionOrigin_PS4_RightStick_DPadWest, + k_EControllerActionOrigin_PS4_RightStick_DPadEast, + k_EControllerActionOrigin_PS4_DPad_North, + k_EControllerActionOrigin_PS4_DPad_South, + k_EControllerActionOrigin_PS4_DPad_West, + k_EControllerActionOrigin_PS4_DPad_East, + k_EControllerActionOrigin_PS4_Gyro_Move, + k_EControllerActionOrigin_PS4_Gyro_Pitch, + k_EControllerActionOrigin_PS4_Gyro_Yaw, + k_EControllerActionOrigin_PS4_Gyro_Roll, + + // XBox One + k_EControllerActionOrigin_XBoxOne_A, + k_EControllerActionOrigin_XBoxOne_B, + k_EControllerActionOrigin_XBoxOne_X, + k_EControllerActionOrigin_XBoxOne_Y, + k_EControllerActionOrigin_XBoxOne_LeftBumper, + k_EControllerActionOrigin_XBoxOne_RightBumper, + k_EControllerActionOrigin_XBoxOne_Menu, //Start + k_EControllerActionOrigin_XBoxOne_View, //Back + k_EControllerActionOrigin_XBoxOne_LeftTrigger_Pull, + k_EControllerActionOrigin_XBoxOne_LeftTrigger_Click, + k_EControllerActionOrigin_XBoxOne_RightTrigger_Pull, + k_EControllerActionOrigin_XBoxOne_RightTrigger_Click, + k_EControllerActionOrigin_XBoxOne_LeftStick_Move, + k_EControllerActionOrigin_XBoxOne_LeftStick_Click, + k_EControllerActionOrigin_XBoxOne_LeftStick_DPadNorth, + k_EControllerActionOrigin_XBoxOne_LeftStick_DPadSouth, + k_EControllerActionOrigin_XBoxOne_LeftStick_DPadWest, + k_EControllerActionOrigin_XBoxOne_LeftStick_DPadEast, + k_EControllerActionOrigin_XBoxOne_RightStick_Move, + k_EControllerActionOrigin_XBoxOne_RightStick_Click, + k_EControllerActionOrigin_XBoxOne_RightStick_DPadNorth, + k_EControllerActionOrigin_XBoxOne_RightStick_DPadSouth, + k_EControllerActionOrigin_XBoxOne_RightStick_DPadWest, + k_EControllerActionOrigin_XBoxOne_RightStick_DPadEast, + k_EControllerActionOrigin_XBoxOne_DPad_North, + k_EControllerActionOrigin_XBoxOne_DPad_South, + k_EControllerActionOrigin_XBoxOne_DPad_West, + k_EControllerActionOrigin_XBoxOne_DPad_East, + + // XBox 360 + k_EControllerActionOrigin_XBox360_A, + k_EControllerActionOrigin_XBox360_B, + k_EControllerActionOrigin_XBox360_X, + k_EControllerActionOrigin_XBox360_Y, + k_EControllerActionOrigin_XBox360_LeftBumper, + k_EControllerActionOrigin_XBox360_RightBumper, + k_EControllerActionOrigin_XBox360_Start, //Start + k_EControllerActionOrigin_XBox360_Back, //Back + k_EControllerActionOrigin_XBox360_LeftTrigger_Pull, + k_EControllerActionOrigin_XBox360_LeftTrigger_Click, + k_EControllerActionOrigin_XBox360_RightTrigger_Pull, + k_EControllerActionOrigin_XBox360_RightTrigger_Click, + k_EControllerActionOrigin_XBox360_LeftStick_Move, + k_EControllerActionOrigin_XBox360_LeftStick_Click, + k_EControllerActionOrigin_XBox360_LeftStick_DPadNorth, + k_EControllerActionOrigin_XBox360_LeftStick_DPadSouth, + k_EControllerActionOrigin_XBox360_LeftStick_DPadWest, + k_EControllerActionOrigin_XBox360_LeftStick_DPadEast, + k_EControllerActionOrigin_XBox360_RightStick_Move, + k_EControllerActionOrigin_XBox360_RightStick_Click, + k_EControllerActionOrigin_XBox360_RightStick_DPadNorth, + k_EControllerActionOrigin_XBox360_RightStick_DPadSouth, + k_EControllerActionOrigin_XBox360_RightStick_DPadWest, + k_EControllerActionOrigin_XBox360_RightStick_DPadEast, + k_EControllerActionOrigin_XBox360_DPad_North, + k_EControllerActionOrigin_XBox360_DPad_South, + k_EControllerActionOrigin_XBox360_DPad_West, + k_EControllerActionOrigin_XBox360_DPad_East, + + // SteamController V2 + k_EControllerActionOrigin_SteamV2_A, + k_EControllerActionOrigin_SteamV2_B, + k_EControllerActionOrigin_SteamV2_X, + k_EControllerActionOrigin_SteamV2_Y, + k_EControllerActionOrigin_SteamV2_LeftBumper, + k_EControllerActionOrigin_SteamV2_RightBumper, + k_EControllerActionOrigin_SteamV2_LeftGrip_Lower, + k_EControllerActionOrigin_SteamV2_LeftGrip_Upper, + k_EControllerActionOrigin_SteamV2_RightGrip_Lower, + k_EControllerActionOrigin_SteamV2_RightGrip_Upper, + k_EControllerActionOrigin_SteamV2_LeftBumper_Pressure, + k_EControllerActionOrigin_SteamV2_RightBumper_Pressure, + k_EControllerActionOrigin_SteamV2_LeftGrip_Pressure, + k_EControllerActionOrigin_SteamV2_RightGrip_Pressure, + k_EControllerActionOrigin_SteamV2_LeftGrip_Upper_Pressure, + k_EControllerActionOrigin_SteamV2_RightGrip_Upper_Pressure, + k_EControllerActionOrigin_SteamV2_Start, + k_EControllerActionOrigin_SteamV2_Back, + k_EControllerActionOrigin_SteamV2_LeftPad_Touch, + k_EControllerActionOrigin_SteamV2_LeftPad_Swipe, + k_EControllerActionOrigin_SteamV2_LeftPad_Click, + k_EControllerActionOrigin_SteamV2_LeftPad_Pressure, + k_EControllerActionOrigin_SteamV2_LeftPad_DPadNorth, + k_EControllerActionOrigin_SteamV2_LeftPad_DPadSouth, + k_EControllerActionOrigin_SteamV2_LeftPad_DPadWest, + k_EControllerActionOrigin_SteamV2_LeftPad_DPadEast, + k_EControllerActionOrigin_SteamV2_RightPad_Touch, + k_EControllerActionOrigin_SteamV2_RightPad_Swipe, + k_EControllerActionOrigin_SteamV2_RightPad_Click, + k_EControllerActionOrigin_SteamV2_RightPad_Pressure, + k_EControllerActionOrigin_SteamV2_RightPad_DPadNorth, + k_EControllerActionOrigin_SteamV2_RightPad_DPadSouth, + k_EControllerActionOrigin_SteamV2_RightPad_DPadWest, + k_EControllerActionOrigin_SteamV2_RightPad_DPadEast, + k_EControllerActionOrigin_SteamV2_LeftTrigger_Pull, + k_EControllerActionOrigin_SteamV2_LeftTrigger_Click, + k_EControllerActionOrigin_SteamV2_RightTrigger_Pull, + k_EControllerActionOrigin_SteamV2_RightTrigger_Click, + k_EControllerActionOrigin_SteamV2_LeftStick_Move, + k_EControllerActionOrigin_SteamV2_LeftStick_Click, + k_EControllerActionOrigin_SteamV2_LeftStick_DPadNorth, + k_EControllerActionOrigin_SteamV2_LeftStick_DPadSouth, + k_EControllerActionOrigin_SteamV2_LeftStick_DPadWest, + k_EControllerActionOrigin_SteamV2_LeftStick_DPadEast, + k_EControllerActionOrigin_SteamV2_Gyro_Move, + k_EControllerActionOrigin_SteamV2_Gyro_Pitch, + k_EControllerActionOrigin_SteamV2_Gyro_Yaw, + k_EControllerActionOrigin_SteamV2_Gyro_Roll, + + // Switch - Pro or Joycons used as a single input device. + // This does not apply to a single joycon + k_EControllerActionOrigin_Switch_A, + k_EControllerActionOrigin_Switch_B, + k_EControllerActionOrigin_Switch_X, + k_EControllerActionOrigin_Switch_Y, + k_EControllerActionOrigin_Switch_LeftBumper, + k_EControllerActionOrigin_Switch_RightBumper, + k_EControllerActionOrigin_Switch_Plus, //Start + k_EControllerActionOrigin_Switch_Minus, //Back + k_EControllerActionOrigin_Switch_Capture, + k_EControllerActionOrigin_Switch_LeftTrigger_Pull, + k_EControllerActionOrigin_Switch_LeftTrigger_Click, + k_EControllerActionOrigin_Switch_RightTrigger_Pull, + k_EControllerActionOrigin_Switch_RightTrigger_Click, + k_EControllerActionOrigin_Switch_LeftStick_Move, + k_EControllerActionOrigin_Switch_LeftStick_Click, + k_EControllerActionOrigin_Switch_LeftStick_DPadNorth, + k_EControllerActionOrigin_Switch_LeftStick_DPadSouth, + k_EControllerActionOrigin_Switch_LeftStick_DPadWest, + k_EControllerActionOrigin_Switch_LeftStick_DPadEast, + k_EControllerActionOrigin_Switch_RightStick_Move, + k_EControllerActionOrigin_Switch_RightStick_Click, + k_EControllerActionOrigin_Switch_RightStick_DPadNorth, + k_EControllerActionOrigin_Switch_RightStick_DPadSouth, + k_EControllerActionOrigin_Switch_RightStick_DPadWest, + k_EControllerActionOrigin_Switch_RightStick_DPadEast, + k_EControllerActionOrigin_Switch_DPad_North, + k_EControllerActionOrigin_Switch_DPad_South, + k_EControllerActionOrigin_Switch_DPad_West, + k_EControllerActionOrigin_Switch_DPad_East, + k_EControllerActionOrigin_Switch_ProGyro_Move, // Primary Gyro in Pro Controller, or Right JoyCon + k_EControllerActionOrigin_Switch_ProGyro_Pitch, // Primary Gyro in Pro Controller, or Right JoyCon + k_EControllerActionOrigin_Switch_ProGyro_Yaw, // Primary Gyro in Pro Controller, or Right JoyCon + k_EControllerActionOrigin_Switch_ProGyro_Roll, // Primary Gyro in Pro Controller, or Right JoyCon + // Switch JoyCon Specific + k_EControllerActionOrigin_Switch_RightGyro_Move, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EControllerActionOrigin_Switch_RightGyro_Pitch, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EControllerActionOrigin_Switch_RightGyro_Yaw, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EControllerActionOrigin_Switch_RightGyro_Roll, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EControllerActionOrigin_Switch_LeftGyro_Move, + k_EControllerActionOrigin_Switch_LeftGyro_Pitch, + k_EControllerActionOrigin_Switch_LeftGyro_Yaw, + k_EControllerActionOrigin_Switch_LeftGyro_Roll, + k_EControllerActionOrigin_Switch_LeftGrip_Lower, // Left JoyCon SR Button + k_EControllerActionOrigin_Switch_LeftGrip_Upper, // Left JoyCon SL Button + k_EControllerActionOrigin_Switch_RightGrip_Lower, // Right JoyCon SL Button + k_EControllerActionOrigin_Switch_RightGrip_Upper, // Right JoyCon SR Button + + // Added in SDK 1.45 + k_EControllerActionOrigin_PS4_DPad_Move, + k_EControllerActionOrigin_XBoxOne_DPad_Move, + k_EControllerActionOrigin_XBox360_DPad_Move, + k_EControllerActionOrigin_Switch_DPad_Move, + + // Added in SDK 1.51 + k_EControllerActionOrigin_PS5_X, + k_EControllerActionOrigin_PS5_Circle, + k_EControllerActionOrigin_PS5_Triangle, + k_EControllerActionOrigin_PS5_Square, + k_EControllerActionOrigin_PS5_LeftBumper, + k_EControllerActionOrigin_PS5_RightBumper, + k_EControllerActionOrigin_PS5_Option, //Start + k_EControllerActionOrigin_PS5_Create, //Back + k_EControllerActionOrigin_PS5_Mute, + k_EControllerActionOrigin_PS5_LeftPad_Touch, + k_EControllerActionOrigin_PS5_LeftPad_Swipe, + k_EControllerActionOrigin_PS5_LeftPad_Click, + k_EControllerActionOrigin_PS5_LeftPad_DPadNorth, + k_EControllerActionOrigin_PS5_LeftPad_DPadSouth, + k_EControllerActionOrigin_PS5_LeftPad_DPadWest, + k_EControllerActionOrigin_PS5_LeftPad_DPadEast, + k_EControllerActionOrigin_PS5_RightPad_Touch, + k_EControllerActionOrigin_PS5_RightPad_Swipe, + k_EControllerActionOrigin_PS5_RightPad_Click, + k_EControllerActionOrigin_PS5_RightPad_DPadNorth, + k_EControllerActionOrigin_PS5_RightPad_DPadSouth, + k_EControllerActionOrigin_PS5_RightPad_DPadWest, + k_EControllerActionOrigin_PS5_RightPad_DPadEast, + k_EControllerActionOrigin_PS5_CenterPad_Touch, + k_EControllerActionOrigin_PS5_CenterPad_Swipe, + k_EControllerActionOrigin_PS5_CenterPad_Click, + k_EControllerActionOrigin_PS5_CenterPad_DPadNorth, + k_EControllerActionOrigin_PS5_CenterPad_DPadSouth, + k_EControllerActionOrigin_PS5_CenterPad_DPadWest, + k_EControllerActionOrigin_PS5_CenterPad_DPadEast, + k_EControllerActionOrigin_PS5_LeftTrigger_Pull, + k_EControllerActionOrigin_PS5_LeftTrigger_Click, + k_EControllerActionOrigin_PS5_RightTrigger_Pull, + k_EControllerActionOrigin_PS5_RightTrigger_Click, + k_EControllerActionOrigin_PS5_LeftStick_Move, + k_EControllerActionOrigin_PS5_LeftStick_Click, + k_EControllerActionOrigin_PS5_LeftStick_DPadNorth, + k_EControllerActionOrigin_PS5_LeftStick_DPadSouth, + k_EControllerActionOrigin_PS5_LeftStick_DPadWest, + k_EControllerActionOrigin_PS5_LeftStick_DPadEast, + k_EControllerActionOrigin_PS5_RightStick_Move, + k_EControllerActionOrigin_PS5_RightStick_Click, + k_EControllerActionOrigin_PS5_RightStick_DPadNorth, + k_EControllerActionOrigin_PS5_RightStick_DPadSouth, + k_EControllerActionOrigin_PS5_RightStick_DPadWest, + k_EControllerActionOrigin_PS5_RightStick_DPadEast, + k_EControllerActionOrigin_PS5_DPad_Move, + k_EControllerActionOrigin_PS5_DPad_North, + k_EControllerActionOrigin_PS5_DPad_South, + k_EControllerActionOrigin_PS5_DPad_West, + k_EControllerActionOrigin_PS5_DPad_East, + k_EControllerActionOrigin_PS5_Gyro_Move, + k_EControllerActionOrigin_PS5_Gyro_Pitch, + k_EControllerActionOrigin_PS5_Gyro_Yaw, + k_EControllerActionOrigin_PS5_Gyro_Roll, + + k_EControllerActionOrigin_XBoxOne_LeftGrip_Lower, + k_EControllerActionOrigin_XBoxOne_LeftGrip_Upper, + k_EControllerActionOrigin_XBoxOne_RightGrip_Lower, + k_EControllerActionOrigin_XBoxOne_RightGrip_Upper, + k_EControllerActionOrigin_XBoxOne_Share, + + // Added in SDK 1.53 + k_EControllerActionOrigin_SteamDeck_A, + k_EControllerActionOrigin_SteamDeck_B, + k_EControllerActionOrigin_SteamDeck_X, + k_EControllerActionOrigin_SteamDeck_Y, + k_EControllerActionOrigin_SteamDeck_L1, + k_EControllerActionOrigin_SteamDeck_R1, + k_EControllerActionOrigin_SteamDeck_Menu, + k_EControllerActionOrigin_SteamDeck_View, + k_EControllerActionOrigin_SteamDeck_LeftPad_Touch, + k_EControllerActionOrigin_SteamDeck_LeftPad_Swipe, + k_EControllerActionOrigin_SteamDeck_LeftPad_Click, + k_EControllerActionOrigin_SteamDeck_LeftPad_DPadNorth, + k_EControllerActionOrigin_SteamDeck_LeftPad_DPadSouth, + k_EControllerActionOrigin_SteamDeck_LeftPad_DPadWest, + k_EControllerActionOrigin_SteamDeck_LeftPad_DPadEast, + k_EControllerActionOrigin_SteamDeck_RightPad_Touch, + k_EControllerActionOrigin_SteamDeck_RightPad_Swipe, + k_EControllerActionOrigin_SteamDeck_RightPad_Click, + k_EControllerActionOrigin_SteamDeck_RightPad_DPadNorth, + k_EControllerActionOrigin_SteamDeck_RightPad_DPadSouth, + k_EControllerActionOrigin_SteamDeck_RightPad_DPadWest, + k_EControllerActionOrigin_SteamDeck_RightPad_DPadEast, + k_EControllerActionOrigin_SteamDeck_L2_SoftPull, + k_EControllerActionOrigin_SteamDeck_L2, + k_EControllerActionOrigin_SteamDeck_R2_SoftPull, + k_EControllerActionOrigin_SteamDeck_R2, + k_EControllerActionOrigin_SteamDeck_LeftStick_Move, + k_EControllerActionOrigin_SteamDeck_L3, + k_EControllerActionOrigin_SteamDeck_LeftStick_DPadNorth, + k_EControllerActionOrigin_SteamDeck_LeftStick_DPadSouth, + k_EControllerActionOrigin_SteamDeck_LeftStick_DPadWest, + k_EControllerActionOrigin_SteamDeck_LeftStick_DPadEast, + k_EControllerActionOrigin_SteamDeck_LeftStick_Touch, + k_EControllerActionOrigin_SteamDeck_RightStick_Move, + k_EControllerActionOrigin_SteamDeck_R3, + k_EControllerActionOrigin_SteamDeck_RightStick_DPadNorth, + k_EControllerActionOrigin_SteamDeck_RightStick_DPadSouth, + k_EControllerActionOrigin_SteamDeck_RightStick_DPadWest, + k_EControllerActionOrigin_SteamDeck_RightStick_DPadEast, + k_EControllerActionOrigin_SteamDeck_RightStick_Touch, + k_EControllerActionOrigin_SteamDeck_L4, + k_EControllerActionOrigin_SteamDeck_R4, + k_EControllerActionOrigin_SteamDeck_L5, + k_EControllerActionOrigin_SteamDeck_R5, + k_EControllerActionOrigin_SteamDeck_DPad_Move, + k_EControllerActionOrigin_SteamDeck_DPad_North, + k_EControllerActionOrigin_SteamDeck_DPad_South, + k_EControllerActionOrigin_SteamDeck_DPad_West, + k_EControllerActionOrigin_SteamDeck_DPad_East, + k_EControllerActionOrigin_SteamDeck_Gyro_Move, + k_EControllerActionOrigin_SteamDeck_Gyro_Pitch, + k_EControllerActionOrigin_SteamDeck_Gyro_Yaw, + k_EControllerActionOrigin_SteamDeck_Gyro_Roll, + k_EControllerActionOrigin_SteamDeck_Reserved1, + k_EControllerActionOrigin_SteamDeck_Reserved2, + k_EControllerActionOrigin_SteamDeck_Reserved3, + k_EControllerActionOrigin_SteamDeck_Reserved4, + k_EControllerActionOrigin_SteamDeck_Reserved5, + k_EControllerActionOrigin_SteamDeck_Reserved6, + k_EControllerActionOrigin_SteamDeck_Reserved7, + k_EControllerActionOrigin_SteamDeck_Reserved8, + k_EControllerActionOrigin_SteamDeck_Reserved9, + k_EControllerActionOrigin_SteamDeck_Reserved10, + k_EControllerActionOrigin_SteamDeck_Reserved11, + k_EControllerActionOrigin_SteamDeck_Reserved12, + k_EControllerActionOrigin_SteamDeck_Reserved13, + k_EControllerActionOrigin_SteamDeck_Reserved14, + k_EControllerActionOrigin_SteamDeck_Reserved15, + k_EControllerActionOrigin_SteamDeck_Reserved16, + k_EControllerActionOrigin_SteamDeck_Reserved17, + k_EControllerActionOrigin_SteamDeck_Reserved18, + k_EControllerActionOrigin_SteamDeck_Reserved19, + k_EControllerActionOrigin_SteamDeck_Reserved20, + + k_EControllerActionOrigin_Switch_JoyConButton_N, // With a Horizontal JoyCon this will be Y or what would be Dpad Right when vertical + k_EControllerActionOrigin_Switch_JoyConButton_E, // X + k_EControllerActionOrigin_Switch_JoyConButton_S, // A + k_EControllerActionOrigin_Switch_JoyConButton_W, // B + + k_EControllerActionOrigin_PS5_LeftGrip, + k_EControllerActionOrigin_PS5_RightGrip, + k_EControllerActionOrigin_PS5_LeftFn, + k_EControllerActionOrigin_PS5_RightFn, + + k_EControllerActionOrigin_Horipad_M1, + k_EControllerActionOrigin_Horipad_M2, + k_EControllerActionOrigin_Horipad_L4, + k_EControllerActionOrigin_Horipad_R4, + + k_EControllerActionOrigin_Count, // If Steam has added support for new controllers origins will go here. + k_EControllerActionOrigin_MaximumPossibleValue = 32767, // Origins are currently a maximum of 16 bits. +}; + +#ifndef ISTEAMINPUT_H +enum EXboxOrigin +{ + k_EXboxOrigin_A, + k_EXboxOrigin_B, + k_EXboxOrigin_X, + k_EXboxOrigin_Y, + k_EXboxOrigin_LeftBumper, + k_EXboxOrigin_RightBumper, + k_EXboxOrigin_Menu, //Start + k_EXboxOrigin_View, //Back + k_EXboxOrigin_LeftTrigger_Pull, + k_EXboxOrigin_LeftTrigger_Click, + k_EXboxOrigin_RightTrigger_Pull, + k_EXboxOrigin_RightTrigger_Click, + k_EXboxOrigin_LeftStick_Move, + k_EXboxOrigin_LeftStick_Click, + k_EXboxOrigin_LeftStick_DPadNorth, + k_EXboxOrigin_LeftStick_DPadSouth, + k_EXboxOrigin_LeftStick_DPadWest, + k_EXboxOrigin_LeftStick_DPadEast, + k_EXboxOrigin_RightStick_Move, + k_EXboxOrigin_RightStick_Click, + k_EXboxOrigin_RightStick_DPadNorth, + k_EXboxOrigin_RightStick_DPadSouth, + k_EXboxOrigin_RightStick_DPadWest, + k_EXboxOrigin_RightStick_DPadEast, + k_EXboxOrigin_DPad_North, + k_EXboxOrigin_DPad_South, + k_EXboxOrigin_DPad_West, + k_EXboxOrigin_DPad_East, +}; + +enum ESteamInputType +{ + k_ESteamInputType_Unknown, + k_ESteamInputType_SteamController, + k_ESteamInputType_XBox360Controller, + k_ESteamInputType_XBoxOneController, + k_ESteamInputType_GenericGamepad, // DirectInput controllers + k_ESteamInputType_PS4Controller, + k_ESteamInputType_AppleMFiController, // Unused + k_ESteamInputType_AndroidController, // Unused + k_ESteamInputType_SwitchJoyConPair, // Unused + k_ESteamInputType_SwitchJoyConSingle, // Unused + k_ESteamInputType_SwitchProController, + k_ESteamInputType_MobileTouch, // Steam Link App On-screen Virtual Controller + k_ESteamInputType_PS3Controller, // Currently uses PS4 Origins + k_ESteamInputType_PS5Controller, // Added in SDK 151 + k_ESteamInputType_Count, + k_ESteamInputType_MaximumPossibleValue = 255, +}; +#endif + +enum ESteamControllerLEDFlag +{ + k_ESteamControllerLEDFlag_SetColor, + k_ESteamControllerLEDFlag_RestoreUserDefault +}; + +// ControllerHandle_t is used to refer to a specific controller. +// This handle will consistently identify a controller, even if it is disconnected and re-connected +typedef uint64 ControllerHandle_t; + + +// These handles are used to refer to a specific in-game action or action set +// All action handles should be queried during initialization for performance reasons +typedef uint64 ControllerActionSetHandle_t; +typedef uint64 ControllerDigitalActionHandle_t; +typedef uint64 ControllerAnalogActionHandle_t; + +#pragma pack( push, 1 ) + +#ifdef ISTEAMINPUT_H +#define ControllerAnalogActionData_t InputAnalogActionData_t +#define ControllerDigitalActionData_t InputDigitalActionData_t +#define ControllerMotionData_t InputMotionData_t +#else +struct ControllerAnalogActionData_t +{ + // Type of data coming from this action, this will match what got specified in the action set + EControllerSourceMode eMode; + + // The current state of this action; will be delta updates for mouse actions + float x, y; + + // Whether or not this action is currently available to be bound in the active action set + bool bActive; +}; + +struct ControllerDigitalActionData_t +{ + // The current state of this action; will be true if currently pressed + bool bState; + + // Whether or not this action is currently available to be bound in the active action set + bool bActive; +}; + +struct ControllerMotionData_t +{ + // Sensor-fused absolute rotation; will drift in heading + float rotQuatX; + float rotQuatY; + float rotQuatZ; + float rotQuatW; + + // Positional acceleration + float posAccelX; + float posAccelY; + float posAccelZ; + + // Angular velocity + float rotVelX; + float rotVelY; + float rotVelZ; +}; +#endif +#pragma pack( pop ) + + +//----------------------------------------------------------------------------- +// Purpose: Steam Input API +//----------------------------------------------------------------------------- +class ISteamController +{ +public: + + // Init and Shutdown must be called when starting/ending use of this interface + virtual bool Init() = 0; + virtual bool Shutdown() = 0; + + // Synchronize API state with the latest Steam Controller inputs available. This + // is performed automatically by SteamAPI_RunCallbacks, but for the absolute lowest + // possible latency, you call this directly before reading controller state. This must + // be called from somewhere before GetConnectedControllers will return any handles + virtual void RunFrame() = 0; + + // Enumerate currently connected controllers + // handlesOut should point to a STEAM_CONTROLLER_MAX_COUNT sized array of ControllerHandle_t handles + // Returns the number of handles written to handlesOut + virtual int GetConnectedControllers( STEAM_OUT_ARRAY_COUNT( STEAM_CONTROLLER_MAX_COUNT, Receives list of connected controllers ) ControllerHandle_t *handlesOut ) = 0; + + //----------------------------------------------------------------------------- + // ACTION SETS + //----------------------------------------------------------------------------- + + // Lookup the handle for an Action Set. Best to do this once on startup, and store the handles for all future API calls. + virtual ControllerActionSetHandle_t GetActionSetHandle( const char *pszActionSetName ) = 0; + + // Reconfigure the controller to use the specified action set (ie 'Menu', 'Walk' or 'Drive') + // This is cheap, and can be safely called repeatedly. It's often easier to repeatedly call it in + // your state loops, instead of trying to place it in all of your state transitions. + virtual void ActivateActionSet( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle ) = 0; + virtual ControllerActionSetHandle_t GetCurrentActionSet( ControllerHandle_t controllerHandle ) = 0; + + // ACTION SET LAYERS + virtual void ActivateActionSetLayer( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle ) = 0; + virtual void DeactivateActionSetLayer( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle ) = 0; + virtual void DeactivateAllActionSetLayers( ControllerHandle_t controllerHandle ) = 0; + // Enumerate currently active layers + // handlesOut should point to a STEAM_CONTROLLER_MAX_ACTIVE_LAYERS sized array of ControllerActionSetHandle_t handles. + // Returns the number of handles written to handlesOut + virtual int GetActiveActionSetLayers( ControllerHandle_t controllerHandle, STEAM_OUT_ARRAY_COUNT( STEAM_CONTROLLER_MAX_ACTIVE_LAYERS, Receives list of active layers ) ControllerActionSetHandle_t *handlesOut ) = 0; + + //----------------------------------------------------------------------------- + // ACTIONS + //----------------------------------------------------------------------------- + + // Lookup the handle for a digital action. Best to do this once on startup, and store the handles for all future API calls. + virtual ControllerDigitalActionHandle_t GetDigitalActionHandle( const char *pszActionName ) = 0; + + // Returns the current state of the supplied digital game action + virtual ControllerDigitalActionData_t GetDigitalActionData( ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle ) = 0; + + // Get the origin(s) for a digital action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action. + // originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles. The EControllerActionOrigin enum will get extended as support for new controller controllers gets added to + // the Steam client and will exceed the values from this header, please check bounds if you are using a look up table. + virtual int GetDigitalActionOrigins( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, STEAM_OUT_ARRAY_COUNT( STEAM_CONTROLLER_MAX_ORIGINS, Receives list of aciton origins ) EControllerActionOrigin *originsOut ) = 0; + + // Lookup the handle for an analog action. Best to do this once on startup, and store the handles for all future API calls. + virtual ControllerAnalogActionHandle_t GetAnalogActionHandle( const char *pszActionName ) = 0; + + // Returns the current state of these supplied analog game action + virtual ControllerAnalogActionData_t GetAnalogActionData( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle ) = 0; + + // Get the origin(s) for an analog action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action. + // originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles. The EControllerActionOrigin enum will get extended as support for new controller controllers gets added to + // the Steam client and will exceed the values from this header, please check bounds if you are using a look up table. + virtual int GetAnalogActionOrigins( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, STEAM_OUT_ARRAY_COUNT( STEAM_CONTROLLER_MAX_ORIGINS, Receives list of action origins ) EControllerActionOrigin *originsOut ) = 0; + + // Get a local path to art for on-screen glyph for a particular origin - this call is cheap + virtual const char *GetGlyphForActionOrigin( EControllerActionOrigin eOrigin ) = 0; + + // Returns a localized string (from Steam's language setting) for the specified origin - this call is serialized + virtual const char *GetStringForActionOrigin( EControllerActionOrigin eOrigin ) = 0; + + virtual void StopAnalogActionMomentum( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction ) = 0; + + // Returns raw motion data from the specified controller + virtual ControllerMotionData_t GetMotionData( ControllerHandle_t controllerHandle ) = 0; + + //----------------------------------------------------------------------------- + // OUTPUTS + //----------------------------------------------------------------------------- + + // Trigger a haptic pulse on a controller + virtual void TriggerHapticPulse( ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec ) = 0; + + // Trigger a pulse with a duty cycle of usDurationMicroSec / usOffMicroSec, unRepeat times. + // nFlags is currently unused and reserved for future use. + virtual void TriggerRepeatedHapticPulse( ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags ) = 0; + + // Trigger a vibration event on supported controllers. + virtual void TriggerVibration( ControllerHandle_t controllerHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed ) = 0; + + // Set the controller LED color on supported controllers. + virtual void SetLEDColor( ControllerHandle_t controllerHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ) = 0; + + //----------------------------------------------------------------------------- + // Utility functions available without using the rest of Steam Input API + //----------------------------------------------------------------------------- + + // Invokes the Steam overlay and brings up the binding screen if the user is using Big Picture Mode + // If the user is not in Big Picture Mode it will open up the binding in a new window + virtual bool ShowBindingPanel( ControllerHandle_t controllerHandle ) = 0; + + // Returns the input type for a particular handle - unlike EControllerActionOrigin which update with Steam and may return unrecognized values + // ESteamInputType will remain static and only return valid values from your SDK version + virtual ESteamInputType GetInputTypeForHandle( ControllerHandle_t controllerHandle ) = 0; + + // Returns the associated controller handle for the specified emulated gamepad - can be used with the above 2 functions + // to identify controllers presented to your game over Xinput. Returns 0 if the Xinput index isn't associated with Steam Input + virtual ControllerHandle_t GetControllerForGamepadIndex( int nIndex ) = 0; + + // Returns the associated gamepad index for the specified controller, if emulating a gamepad or -1 if not associated with an Xinput index + virtual int GetGamepadIndexForController( ControllerHandle_t ulControllerHandle ) = 0; + + // Returns a localized string (from Steam's language setting) for the specified Xbox controller origin. + virtual const char *GetStringForXboxOrigin( EXboxOrigin eOrigin ) = 0; + + // Get a local path to art for on-screen glyph for a particular Xbox controller origin. + virtual const char *GetGlyphForXboxOrigin( EXboxOrigin eOrigin ) = 0; + + // Get the equivalent ActionOrigin for a given Xbox controller origin this can be chained with GetGlyphForActionOrigin to provide future proof glyphs for + // non-Steam Input API action games. Note - this only translates the buttons directly and doesn't take into account any remapping a user has made in their configuration + virtual EControllerActionOrigin GetActionOriginFromXboxOrigin( ControllerHandle_t controllerHandle, EXboxOrigin eOrigin ) = 0; + + // Convert an origin to another controller type - for inputs not present on the other controller type this will return k_EControllerActionOrigin_None + virtual EControllerActionOrigin TranslateActionOrigin( ESteamInputType eDestinationInputType, EControllerActionOrigin eSourceOrigin ) = 0; + + // Get the binding revision for a given device. Returns false if the handle was not valid or if a mapping is not yet loaded for the device + virtual bool GetControllerBindingRevision( ControllerHandle_t controllerHandle, int *pMajor, int *pMinor ) = 0; +}; + +#define STEAMCONTROLLER_INTERFACE_VERSION "SteamController008" + +// Global interface accessor +inline ISteamController *SteamController(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamController *, SteamController, STEAMCONTROLLER_INTERFACE_VERSION ); + +#endif // ISTEAMCONTROLLER_H diff --git a/external/steamworks/public/steam/isteamdualsense.h b/external/steamworks/public/steam/isteamdualsense.h new file mode 100644 index 0000000..08e4370 --- /dev/null +++ b/external/steamworks/public/steam/isteamdualsense.h @@ -0,0 +1,169 @@ +/* SIE CONFIDENTIAL + * $PSLibId$ + * Copyright (C) 2019 Sony Interactive Entertainment Inc. + * All Rights Reserved. + */ + + +#ifndef _SCE_PAD_TRIGGER_EFFECT_H +#define _SCE_PAD_TRIGGER_EFFECT_H + + +#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_L2 0x01 +#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2 0x02 + +#define SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_L2 0 +#define SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 1 + +#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_NUM 2 + +/* Definition of control point num */ +#define SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM 10 + +typedef enum ScePadTriggerEffectMode{ + SCE_PAD_TRIGGER_EFFECT_MODE_OFF, + SCE_PAD_TRIGGER_EFFECT_MODE_FEEDBACK, + SCE_PAD_TRIGGER_EFFECT_MODE_WEAPON, + SCE_PAD_TRIGGER_EFFECT_MODE_VIBRATION, + SCE_PAD_TRIGGER_EFFECT_MODE_MULTIPLE_POSITION_FEEDBACK, + SCE_PAD_TRIGGER_EFFECT_MODE_SLOPE_FEEDBACK, + SCE_PAD_TRIGGER_EFFECT_MODE_MULTIPLE_POSITION_VIBRATION, +} ScePadTriggerEffectMode; + +/** + *E + * @brief parameter for setting the trigger effect to off mode. + * Off Mode: Stop trigger effect. + **/ +typedef struct ScePadTriggerEffectOffParam{ + uint8_t padding[48]; +} ScePadTriggerEffectOffParam; + +/** + *E + * @brief parameter for setting the trigger effect to Feedback mode. + * Feedback Mode: The motor arm pushes back trigger. + * Trigger obtains stiffness at specified position. + **/ +typedef struct ScePadTriggerEffectFeedbackParam{ + uint8_t position; /*E position where the strength of target trigger start changing(0~9). */ + uint8_t strength; /*E strength that the motor arm pushes back target trigger(0~8 (0: Same as Off mode)). */ + uint8_t padding[46]; +} ScePadTriggerEffectFeedbackParam; + +/** + *E + * @brief parameter for setting the trigger effect to Weapon mode. + * Weapon Mode: Emulate weapon like gun trigger. + **/ +typedef struct ScePadTriggerEffectWeaponParam{ + uint8_t startPosition; /*E position where the stiffness of trigger start changing(2~7). */ + uint8_t endPosition; /*E position where the stiffness of trigger finish changing(startPosition+1~8). */ + uint8_t strength; /*E strength of gun trigger(0~8 (0: Same as Off mode)). */ + uint8_t padding[45]; +} ScePadTriggerEffectWeaponParam; + +/** + *E + * @brief parameter for setting the trigger effect to Vibration mode. + * Vibration Mode: Vibrates motor arm around specified position. + **/ +typedef struct ScePadTriggerEffectVibrationParam{ + uint8_t position; /*E position where the motor arm start vibrating(0~9). */ + uint8_t amplitude; /*E vibration amplitude(0~8 (0: Same as Off mode)). */ + uint8_t frequency; /*E vibration frequency(0~255[Hz] (0: Same as Off mode)). */ + uint8_t padding[45]; +} ScePadTriggerEffectVibrationParam; + +/** + *E + * @brief parameter for setting the trigger effect to ScePadTriggerEffectMultiplePositionFeedbackParam mode. + * Multi Position Feedback Mode: The motor arm pushes back trigger. + * Trigger obtains specified stiffness at each control point. + **/ +typedef struct ScePadTriggerEffectMultiplePositionFeedbackParam{ + uint8_t strength[SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM]; /*E strength that the motor arm pushes back target trigger at position(0~8 (0: Same as Off mode)). + * strength[0] means strength of motor arm at position0. + * strength[1] means strength of motor arm at position1. + * ... + * */ + uint8_t padding[38]; +} ScePadTriggerEffectMultiplePositionFeedbackParam; + +/** + *E + * @brief parameter for setting the trigger effect to Feedback3 mode. + * Slope Feedback Mode: The motor arm pushes back trigger between two spedified control points. + * Stiffness of the trigger is changing depending on the set place. + **/ +typedef struct ScePadTriggerEffectSlopeFeedbackParam{ + + uint8_t startPosition; /*E position where the strength of target trigger start changing(0~endPosition). */ + uint8_t endPosition; /*E position where the strength of target trigger finish changing(startPosition+1~9). */ + uint8_t startStrength; /*E strength when trigger's position is startPosition(1~8) */ + uint8_t endStrength; /*E strength when trigger's position is endPosition(1~8) */ + uint8_t padding[44]; +} ScePadTriggerEffectSlopeFeedbackParam; + +/** + *E + * @brief parameter for setting the trigger effect to Vibration2 mode. + * Multi Position Vibration Mode: Vibrates motor arm around specified control point. + * Trigger vibrates specified amplitude at each control point. + **/ +typedef struct ScePadTriggerEffectMultiplePositionVibrationParam{ + uint8_t frequency; /*E vibration frequency(0~255 (0: Same as Off mode)) */ + uint8_t amplitude[SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM]; /*E vibration amplitude at position(0~8 (0: Same as Off mode)). + * amplitude[0] means amplitude of vibration at position0. + * amplitude[1] means amplitude of vibration at position1. + * ... + * */ + uint8_t padding[37]; +} ScePadTriggerEffectMultiplePositionVibrationParam; + +/** + *E + * @brief parameter for setting the trigger effect mode. + **/ +typedef union ScePadTriggerEffectCommandData{ + ScePadTriggerEffectOffParam offParam; + ScePadTriggerEffectFeedbackParam feedbackParam; + ScePadTriggerEffectWeaponParam weaponParam; + ScePadTriggerEffectVibrationParam vibrationParam; + ScePadTriggerEffectMultiplePositionFeedbackParam multiplePositionFeedbackParam; + ScePadTriggerEffectSlopeFeedbackParam slopeFeedbackParam; + ScePadTriggerEffectMultiplePositionVibrationParam multiplePositionVibrationParam; +} ScePadTriggerEffectCommandData; + +/** + *E + * @brief parameter for setting the trigger effect. + **/ +typedef struct ScePadTriggerEffectCommand{ + ScePadTriggerEffectMode mode; + uint8_t padding[4]; + ScePadTriggerEffectCommandData commandData; +} ScePadTriggerEffectCommand; + +/** + *E + * @brief parameter for the scePadSetTriggerEffect function. + **/ +typedef struct ScePadTriggerEffectParam{ + + uint8_t triggerMask; /*E Set trigger mask to activate trigger effect commands. + * SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_L2 : 0x01 + * SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2 : 0x02 + * */ + uint8_t padding[7]; + + ScePadTriggerEffectCommand command[SCE_PAD_TRIGGER_EFFECT_TRIGGER_NUM]; /*E command[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_L2] is for L2 trigger setting + * and param[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2] is for R2 trgger setting. + * */ +} ScePadTriggerEffectParam; + +#if defined(__cplusplus) && __cplusplus >= 201103L +static_assert( sizeof( ScePadTriggerEffectParam ) == 120, "ScePadTriggerEffectParam has incorrect size" ); +#endif + +#endif /* _SCE_PAD_TRIGGER_EFFECT_H */ diff --git a/external/steamworks/public/steam/isteamfriends.h b/external/steamworks/public/steam/isteamfriends.h new file mode 100644 index 0000000..0616c13 --- /dev/null +++ b/external/steamworks/public/steam/isteamfriends.h @@ -0,0 +1,714 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Purpose: interface to both friends list data and general information about users +// +//============================================================================= + +#ifndef ISTEAMFRIENDS_H +#define ISTEAMFRIENDS_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + +//----------------------------------------------------------------------------- +// Purpose: set of relationships to other users +//----------------------------------------------------------------------------- +enum EFriendRelationship +{ + k_EFriendRelationshipNone = 0, + k_EFriendRelationshipBlocked = 1, // this doesn't get stored; the user has just done an Ignore on an friendship invite + k_EFriendRelationshipRequestRecipient = 2, + k_EFriendRelationshipFriend = 3, + k_EFriendRelationshipRequestInitiator = 4, + k_EFriendRelationshipIgnored = 5, // this is stored; the user has explicit blocked this other user from comments/chat/etc + k_EFriendRelationshipIgnoredFriend = 6, + k_EFriendRelationshipSuggested_DEPRECATED = 7, // was used by the original implementation of the facebook linking feature, but now unused. + + // keep this updated + k_EFriendRelationshipMax = 8, +}; + +// maximum length of friend group name (not including terminating nul!) +const int k_cchMaxFriendsGroupName = 64; + +// maximum number of groups a single user is allowed +const int k_cFriendsGroupLimit = 100; + +// friends group identifier type +typedef int16 FriendsGroupID_t; + +// invalid friends group identifier constant +const FriendsGroupID_t k_FriendsGroupID_Invalid = -1; + +const int k_cEnumerateFollowersMax = 50; + + +//----------------------------------------------------------------------------- +// Purpose: list of states a friend can be in +//----------------------------------------------------------------------------- +enum EPersonaState +{ + k_EPersonaStateOffline = 0, // friend is not currently logged on + k_EPersonaStateOnline = 1, // friend is logged on + k_EPersonaStateBusy = 2, // user is on, but busy + k_EPersonaStateAway = 3, // auto-away feature + k_EPersonaStateSnooze = 4, // auto-away for a long time + k_EPersonaStateLookingToTrade = 5, // Online, trading + k_EPersonaStateLookingToPlay = 6, // Online, wanting to play + k_EPersonaStateInvisible = 7, // Online, but appears offline to friends. This status is never published to clients. + k_EPersonaStateMax, +}; + + +//----------------------------------------------------------------------------- +// Purpose: flags for enumerating friends list, or quickly checking a the relationship between users +//----------------------------------------------------------------------------- +enum EFriendFlags +{ + k_EFriendFlagNone = 0x00, + k_EFriendFlagBlocked = 0x01, + k_EFriendFlagFriendshipRequested = 0x02, + k_EFriendFlagImmediate = 0x04, // "regular" friend + k_EFriendFlagClanMember = 0x08, + k_EFriendFlagOnGameServer = 0x10, + // k_EFriendFlagHasPlayedWith = 0x20, // not currently used + // k_EFriendFlagFriendOfFriend = 0x40, // not currently used + k_EFriendFlagRequestingFriendship = 0x80, + k_EFriendFlagRequestingInfo = 0x100, + k_EFriendFlagIgnored = 0x200, + k_EFriendFlagIgnoredFriend = 0x400, + // k_EFriendFlagSuggested = 0x800, // not used + k_EFriendFlagChatMember = 0x1000, + k_EFriendFlagAll = 0xFFFF, +}; + + +// friend game played information +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif +struct FriendGameInfo_t +{ + CGameID m_gameID; + uint32 m_unGameIP; + uint16 m_usGamePort; + uint16 m_usQueryPort; + CSteamID m_steamIDLobby; +}; +#pragma pack( pop ) + +// special values for FriendGameInfo_t::m_usQueryPort +const uint16 k_usFriendGameInfoQueryPort_NotInitialized = 0xFFFF; // We haven't asked the GS for this query port's actual value yet. Was #define QUERY_PORT_NOT_INITIALIZED in older versions of Steamworks SDK. +const uint16 k_usFriendGameInfoQueryPort_Error = 0xFFFE; // We were unable to get the query port for this server. Was #define QUERY_PORT_ERROR in older versions of Steamworks SDK. + +// maximum number of characters in a user's name. Two flavors; one for UTF-8 and one for UTF-16. +// The UTF-8 version has to be very generous to accomodate characters that get large when encoded +// in UTF-8. +enum +{ + k_cchPersonaNameMax = 128, + k_cwchPersonaNameMax = 32, +}; + +// size limit on chat room or member metadata +const uint32 k_cubChatMetadataMax = 8192; + +// size limits on Rich Presence data +enum { k_cchMaxRichPresenceKeys = 30 }; +enum { k_cchMaxRichPresenceKeyLength = 64 }; +enum { k_cchMaxRichPresenceValueLength = 256 }; + +// These values are passed as parameters to the store +enum EOverlayToStoreFlag +{ + k_EOverlayToStoreFlag_None = 0, + k_EOverlayToStoreFlag_AddToCart = 1, + k_EOverlayToStoreFlag_AddToCartAndShow = 2, +}; + + +//----------------------------------------------------------------------------- +// Purpose: Tells Steam where to place the browser window inside the overlay +//----------------------------------------------------------------------------- +enum EActivateGameOverlayToWebPageMode +{ + k_EActivateGameOverlayToWebPageMode_Default = 0, // Browser will open next to all other windows that the user has open in the overlay. + // The window will remain open, even if the user closes then re-opens the overlay. + + k_EActivateGameOverlayToWebPageMode_Modal = 1 // Browser will be opened in a special overlay configuration which hides all other windows + // that the user has open in the overlay. When the user closes the overlay, the browser window + // will also close. When the user closes the browser window, the overlay will automatically close. +}; + +//----------------------------------------------------------------------------- +// Purpose: See GetProfileItemPropertyString and GetProfileItemPropertyUint +//----------------------------------------------------------------------------- +enum ECommunityProfileItemType +{ + k_ECommunityProfileItemType_AnimatedAvatar = 0, + k_ECommunityProfileItemType_AvatarFrame = 1, + k_ECommunityProfileItemType_ProfileModifier = 2, + k_ECommunityProfileItemType_ProfileBackground = 3, + k_ECommunityProfileItemType_MiniProfileBackground = 4, +}; +enum ECommunityProfileItemProperty +{ + k_ECommunityProfileItemProperty_ImageSmall = 0, // string + k_ECommunityProfileItemProperty_ImageLarge = 1, // string + k_ECommunityProfileItemProperty_InternalName = 2, // string + k_ECommunityProfileItemProperty_Title = 3, // string + k_ECommunityProfileItemProperty_Description = 4, // string + k_ECommunityProfileItemProperty_AppID = 5, // uint32 + k_ECommunityProfileItemProperty_TypeID = 6, // uint32 + k_ECommunityProfileItemProperty_Class = 7, // uint32 + k_ECommunityProfileItemProperty_MovieWebM = 8, // string + k_ECommunityProfileItemProperty_MovieMP4 = 9, // string + k_ECommunityProfileItemProperty_MovieWebMSmall = 10, // string + k_ECommunityProfileItemProperty_MovieMP4Small = 11, // string +}; + +//----------------------------------------------------------------------------- +// Purpose: interface to accessing information about individual users, +// that can be a friend, in a group, on a game server or in a lobby with the local user +//----------------------------------------------------------------------------- +class ISteamFriends +{ +public: + // returns the local players name - guaranteed to not be NULL. + // this is the same name as on the users community profile page + // this is stored in UTF-8 format + // like all the other interface functions that return a char *, it's important that this pointer is not saved + // off; it will eventually be free'd or re-allocated + virtual const char *GetPersonaName() = 0; + + // gets the status of the current user + virtual EPersonaState GetPersonaState() = 0; + + // friend iteration + // takes a set of k_EFriendFlags, and returns the number of users the client knows about who meet that criteria + // then GetFriendByIndex() can then be used to return the id's of each of those users + virtual int GetFriendCount( int iFriendFlags ) = 0; + + // returns the steamID of a user + // iFriend is a index of range [0, GetFriendCount()) + // iFriendsFlags must be the same value as used in GetFriendCount() + // the returned CSteamID can then be used by all the functions below to access details about the user + virtual CSteamID GetFriendByIndex( int iFriend, int iFriendFlags ) = 0; + + // returns a relationship to a user + virtual EFriendRelationship GetFriendRelationship( CSteamID steamIDFriend ) = 0; + + // returns the current status of the specified user + // this will only be known by the local user if steamIDFriend is in their friends list; on the same game server; in a chat room or lobby; or in a small group with the local user + virtual EPersonaState GetFriendPersonaState( CSteamID steamIDFriend ) = 0; + + // returns the name another user - guaranteed to not be NULL. + // same rules as GetFriendPersonaState() apply as to whether or not the user knowns the name of the other user + // note that on first joining a lobby, chat room or game server the local user will not known the name of the other users automatically; that information will arrive asyncronously + // + virtual const char *GetFriendPersonaName( CSteamID steamIDFriend ) = 0; + + // returns true if the friend is actually in a game, and fills in pFriendGameInfo with an extra details + virtual bool GetFriendGamePlayed( CSteamID steamIDFriend, STEAM_OUT_STRUCT() FriendGameInfo_t *pFriendGameInfo ) = 0; + // accesses old friends names - returns an empty string when their are no more items in the history + virtual const char *GetFriendPersonaNameHistory( CSteamID steamIDFriend, int iPersonaName ) = 0; + // friends steam level + virtual int GetFriendSteamLevel( CSteamID steamIDFriend ) = 0; + + // Returns nickname the current user has set for the specified player. Returns NULL if the no nickname has been set for that player. + // DEPRECATED: GetPersonaName follows the Steam nickname preferences, so apps shouldn't need to care about nicknames explicitly. + virtual const char *GetPlayerNickname( CSteamID steamIDPlayer ) = 0; + + // friend grouping (tag) apis + // returns the number of friends groups + virtual int GetFriendsGroupCount() = 0; + // returns the friends group ID for the given index (invalid indices return k_FriendsGroupID_Invalid) + virtual FriendsGroupID_t GetFriendsGroupIDByIndex( int iFG ) = 0; + // returns the name for the given friends group (NULL in the case of invalid friends group IDs) + virtual const char *GetFriendsGroupName( FriendsGroupID_t friendsGroupID ) = 0; + // returns the number of members in a given friends group + virtual int GetFriendsGroupMembersCount( FriendsGroupID_t friendsGroupID ) = 0; + // gets up to nMembersCount members of the given friends group, if fewer exist than requested those positions' SteamIDs will be invalid + virtual void GetFriendsGroupMembersList( FriendsGroupID_t friendsGroupID, STEAM_OUT_ARRAY_CALL(nMembersCount, GetFriendsGroupMembersCount, friendsGroupID ) CSteamID *pOutSteamIDMembers, int nMembersCount ) = 0; + + // returns true if the specified user meets any of the criteria specified in iFriendFlags + // iFriendFlags can be the union (binary or, |) of one or more k_EFriendFlags values + virtual bool HasFriend( CSteamID steamIDFriend, int iFriendFlags ) = 0; + + // clan (group) iteration and access functions + virtual int GetClanCount() = 0; + virtual CSteamID GetClanByIndex( int iClan ) = 0; + virtual const char *GetClanName( CSteamID steamIDClan ) = 0; + virtual const char *GetClanTag( CSteamID steamIDClan ) = 0; + // returns the most recent information we have about what's happening in a clan + virtual bool GetClanActivityCounts( CSteamID steamIDClan, int *pnOnline, int *pnInGame, int *pnChatting ) = 0; + + // for clans a user is a member of, they will have reasonably up-to-date information, but for others you'll have to download the info to have the latest + STEAM_CALL_RESULT( DownloadClanActivityCountsResult_t ) + virtual SteamAPICall_t DownloadClanActivityCounts( STEAM_ARRAY_COUNT(cClansToRequest) CSteamID *psteamIDClans, int cClansToRequest ) = 0; + + // iterators for getting users in a chat room, lobby, game server or clan + // note that large clans that cannot be iterated by the local user + // note that the current user must be in a lobby to retrieve CSteamIDs of other users in that lobby + // steamIDSource can be the steamID of a group, game server, lobby or chat room + virtual int GetFriendCountFromSource( CSteamID steamIDSource ) = 0; + virtual CSteamID GetFriendFromSourceByIndex( CSteamID steamIDSource, int iFriend ) = 0; + + // returns true if the local user can see that steamIDUser is a member or in steamIDSource + virtual bool IsUserInSource( CSteamID steamIDUser, CSteamID steamIDSource ) = 0; + + // User is in a game pressing the talk button (will suppress the microphone for all voice comms from the Steam friends UI) + virtual void SetInGameVoiceSpeaking( CSteamID steamIDUser, bool bSpeaking ) = 0; + + // activates the game overlay, with an optional dialog to open + // valid options include "Friends", "Community", "Players", "Settings", "OfficialGameGroup", "Stats", "Achievements", + // "chatroomgroup/nnnn" + virtual void ActivateGameOverlay( const char *pchDialog ) = 0; + + // activates game overlay to a specific place + // valid options are + // "steamid" - opens the overlay web browser to the specified user or groups profile + // "chat" - opens a chat window to the specified user, or joins the group chat + // "jointrade" - opens a window to a Steam Trading session that was started with the ISteamEconomy/StartTrade Web API + // "stats" - opens the overlay web browser to the specified user's stats + // "achievements" - opens the overlay web browser to the specified user's achievements + // "friendadd" - opens the overlay in minimal mode prompting the user to add the target user as a friend + // "friendremove" - opens the overlay in minimal mode prompting the user to remove the target friend + // "friendrequestaccept" - opens the overlay in minimal mode prompting the user to accept an incoming friend invite + // "friendrequestignore" - opens the overlay in minimal mode prompting the user to ignore an incoming friend invite + virtual void ActivateGameOverlayToUser( const char *pchDialog, CSteamID steamID ) = 0; + + // activates game overlay web browser directly to the specified URL + // full address with protocol type is required, e.g. http://www.steamgames.com/ + virtual void ActivateGameOverlayToWebPage( const char *pchURL, EActivateGameOverlayToWebPageMode eMode = k_EActivateGameOverlayToWebPageMode_Default ) = 0; + + // activates game overlay to store page for app + virtual void ActivateGameOverlayToStore( AppId_t nAppID, EOverlayToStoreFlag eFlag ) = 0; + + // Mark a target user as 'played with'. This is a client-side only feature that requires that the calling user is + // in game + virtual void SetPlayedWith( CSteamID steamIDUserPlayedWith ) = 0; + + // activates game overlay to open the invite dialog. Invitations will be sent for the provided lobby. + virtual void ActivateGameOverlayInviteDialog( CSteamID steamIDLobby ) = 0; + + // gets the small (32x32) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set + virtual int GetSmallFriendAvatar( CSteamID steamIDFriend ) = 0; + + // gets the medium (64x64) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set + virtual int GetMediumFriendAvatar( CSteamID steamIDFriend ) = 0; + + // gets the large (184x184) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set + // returns -1 if this image has yet to be loaded, in this case wait for a AvatarImageLoaded_t callback and then call this again + virtual int GetLargeFriendAvatar( CSteamID steamIDFriend ) = 0; + + // requests information about a user - persona name & avatar + // if bRequireNameOnly is set, then the avatar of a user isn't downloaded + // - it's a lot slower to download avatars and churns the local cache, so if you don't need avatars, don't request them + // if returns true, it means that data is being requested, and a PersonaStateChanged_t callback will be posted when it's retrieved + // if returns false, it means that we already have all the details about that user, and functions can be called immediately + virtual bool RequestUserInformation( CSteamID steamIDUser, bool bRequireNameOnly ) = 0; + + // requests information about a clan officer list + // when complete, data is returned in ClanOfficerListResponse_t call result + // this makes available the calls below + // you can only ask about clans that a user is a member of + // note that this won't download avatars automatically; if you get an officer, + // and no avatar image is available, call RequestUserInformation( steamID, false ) to download the avatar + STEAM_CALL_RESULT( ClanOfficerListResponse_t ) + virtual SteamAPICall_t RequestClanOfficerList( CSteamID steamIDClan ) = 0; + + // iteration of clan officers - can only be done when a RequestClanOfficerList() call has completed + + // returns the steamID of the clan owner + virtual CSteamID GetClanOwner( CSteamID steamIDClan ) = 0; + // returns the number of officers in a clan (including the owner) + virtual int GetClanOfficerCount( CSteamID steamIDClan ) = 0; + // returns the steamID of a clan officer, by index, of range [0,GetClanOfficerCount) + virtual CSteamID GetClanOfficerByIndex( CSteamID steamIDClan, int iOfficer ) = 0; + + // Rich Presence data is automatically shared between friends who are in the same game + // Each user has a set of Key/Value pairs + // Note the following limits: k_cchMaxRichPresenceKeys, k_cchMaxRichPresenceKeyLength, k_cchMaxRichPresenceValueLength + // There are five magic keys: + // "status" - a UTF-8 string that will show up in the 'view game info' dialog in the Steam friends list + // "connect" - a UTF-8 string that contains the command-line for how a friend can connect to a game + // "steam_display" - Names a rich presence localization token that will be displayed in the viewing user's selected language + // in the Steam client UI. For more info: https://partner.steamgames.com/doc/api/ISteamFriends#richpresencelocalization + // "steam_player_group" - When set, indicates to the Steam client that the player is a member of a particular group. Players in the same group + // may be organized together in various places in the Steam UI. + // "steam_player_group_size" - When set, indicates the total number of players in the steam_player_group. The Steam client may use this number to + // display additional information about a group when all of the members are not part of a user's friends list. + // GetFriendRichPresence() returns an empty string "" if no value is set + // SetRichPresence() to a NULL or an empty string deletes the key + // You can iterate the current set of keys for a friend with GetFriendRichPresenceKeyCount() + // and GetFriendRichPresenceKeyByIndex() (typically only used for debugging) + virtual bool SetRichPresence( const char *pchKey, const char *pchValue ) = 0; + virtual void ClearRichPresence() = 0; + virtual const char *GetFriendRichPresence( CSteamID steamIDFriend, const char *pchKey ) = 0; + virtual int GetFriendRichPresenceKeyCount( CSteamID steamIDFriend ) = 0; + virtual const char *GetFriendRichPresenceKeyByIndex( CSteamID steamIDFriend, int iKey ) = 0; + // Requests rich presence for a specific user. + virtual void RequestFriendRichPresence( CSteamID steamIDFriend ) = 0; + + // Rich invite support. + // If the target accepts the invite, a GameRichPresenceJoinRequested_t callback is posted containing the connect string. + // (Or you can configure your game so that it is passed on the command line instead. This is a deprecated path; ask us if you really need this.) + virtual bool InviteUserToGame( CSteamID steamIDFriend, const char *pchConnectString ) = 0; + + // recently-played-with friends iteration + // this iterates the entire list of users recently played with, across games + // GetFriendCoplayTime() returns as a unix time + virtual int GetCoplayFriendCount() = 0; + virtual CSteamID GetCoplayFriend( int iCoplayFriend ) = 0; + virtual int GetFriendCoplayTime( CSteamID steamIDFriend ) = 0; + virtual AppId_t GetFriendCoplayGame( CSteamID steamIDFriend ) = 0; + + // chat interface for games + // this allows in-game access to group (clan) chats from in the game + // the behavior is somewhat sophisticated, because the user may or may not be already in the group chat from outside the game or in the overlay + // use ActivateGameOverlayToUser( "chat", steamIDClan ) to open the in-game overlay version of the chat + STEAM_CALL_RESULT( JoinClanChatRoomCompletionResult_t ) + virtual SteamAPICall_t JoinClanChatRoom( CSteamID steamIDClan ) = 0; + virtual bool LeaveClanChatRoom( CSteamID steamIDClan ) = 0; + virtual int GetClanChatMemberCount( CSteamID steamIDClan ) = 0; + virtual CSteamID GetChatMemberByIndex( CSteamID steamIDClan, int iUser ) = 0; + virtual bool SendClanChatMessage( CSteamID steamIDClanChat, const char *pchText ) = 0; + virtual int GetClanChatMessage( CSteamID steamIDClanChat, int iMessage, void *prgchText, int cchTextMax, EChatEntryType *peChatEntryType, STEAM_OUT_STRUCT() CSteamID *psteamidChatter ) = 0; + virtual bool IsClanChatAdmin( CSteamID steamIDClanChat, CSteamID steamIDUser ) = 0; + + // interact with the Steam (game overlay / desktop) + virtual bool IsClanChatWindowOpenInSteam( CSteamID steamIDClanChat ) = 0; + virtual bool OpenClanChatWindowInSteam( CSteamID steamIDClanChat ) = 0; + virtual bool CloseClanChatWindowInSteam( CSteamID steamIDClanChat ) = 0; + + // peer-to-peer chat interception + // this is so you can show P2P chats inline in the game + virtual bool SetListenForFriendsMessages( bool bInterceptEnabled ) = 0; + virtual bool ReplyToFriendMessage( CSteamID steamIDFriend, const char *pchMsgToSend ) = 0; + virtual int GetFriendMessage( CSteamID steamIDFriend, int iMessageID, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0; + + // following apis + STEAM_CALL_RESULT( FriendsGetFollowerCount_t ) + virtual SteamAPICall_t GetFollowerCount( CSteamID steamID ) = 0; + STEAM_CALL_RESULT( FriendsIsFollowing_t ) + virtual SteamAPICall_t IsFollowing( CSteamID steamID ) = 0; + STEAM_CALL_RESULT( FriendsEnumerateFollowingList_t ) + virtual SteamAPICall_t EnumerateFollowingList( uint32 unStartIndex ) = 0; + + virtual bool IsClanPublic( CSteamID steamIDClan ) = 0; + virtual bool IsClanOfficialGameGroup( CSteamID steamIDClan ) = 0; + + /// Return the number of chats (friends or chat rooms) with unread messages. + /// A "priority" message is one that would generate some sort of toast or + /// notification, and depends on user settings. + /// + /// You can register for UnreadChatMessagesChanged_t callbacks to know when this + /// has potentially changed. + virtual int GetNumChatsWithUnreadPriorityMessages() = 0; + + // activates game overlay to open the remote play together invite dialog. Invitations will be sent for remote play together + virtual void ActivateGameOverlayRemotePlayTogetherInviteDialog( CSteamID steamIDLobby ) = 0; + + // Call this before calling ActivateGameOverlayToWebPage() to have the Steam Overlay Browser block navigations + // to your specified protocol (scheme) uris and instead dispatch a OverlayBrowserProtocolNavigation_t callback to your game. + // ActivateGameOverlayToWebPage() must have been called with k_EActivateGameOverlayToWebPageMode_Modal + virtual bool RegisterProtocolInOverlayBrowser( const char *pchProtocol ) = 0; + + // Activates the game overlay to open an invite dialog that will send the provided Rich Presence connect string to selected friends + virtual void ActivateGameOverlayInviteDialogConnectString( const char *pchConnectString ) = 0; + + // Steam Community items equipped by a user on their profile + // You can register for EquippedProfileItemsChanged_t to know when a friend has changed their equipped profile items + STEAM_CALL_RESULT( EquippedProfileItems_t ) + virtual SteamAPICall_t RequestEquippedProfileItems( CSteamID steamID ) = 0; + virtual bool BHasEquippedProfileItem( CSteamID steamID, ECommunityProfileItemType itemType ) = 0; + virtual const char *GetProfileItemPropertyString( CSteamID steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop ) = 0; + virtual uint32 GetProfileItemPropertyUint( CSteamID steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop ) = 0; +}; + +#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends018" + +// Global interface accessor +inline ISteamFriends *SteamFriends(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamFriends *, SteamFriends, STEAMFRIENDS_INTERFACE_VERSION ); + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + +//----------------------------------------------------------------------------- +// Purpose: called when a friends' status changes +//----------------------------------------------------------------------------- +struct PersonaStateChange_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 4 }; + + uint64 m_ulSteamID; // steamID of the friend who changed + int m_nChangeFlags; // what's changed +}; + + +// used in PersonaStateChange_t::m_nChangeFlags to describe what's changed about a user +// these flags describe what the client has learned has changed recently, so on startup you'll see a name, avatar & relationship change for every friend +enum EPersonaChange +{ + k_EPersonaChangeName = 0x0001, + k_EPersonaChangeStatus = 0x0002, + k_EPersonaChangeComeOnline = 0x0004, + k_EPersonaChangeGoneOffline = 0x0008, + k_EPersonaChangeGamePlayed = 0x0010, + k_EPersonaChangeGameServer = 0x0020, + k_EPersonaChangeAvatar = 0x0040, + k_EPersonaChangeJoinedSource= 0x0080, + k_EPersonaChangeLeftSource = 0x0100, + k_EPersonaChangeRelationshipChanged = 0x0200, + k_EPersonaChangeNameFirstSet = 0x0400, + k_EPersonaChangeBroadcast = 0x0800, + k_EPersonaChangeNickname = 0x1000, + k_EPersonaChangeSteamLevel = 0x2000, + k_EPersonaChangeRichPresence = 0x4000, +}; + + +//----------------------------------------------------------------------------- +// Purpose: posted when game overlay activates or deactivates +// the game can use this to be pause or resume single player games +//----------------------------------------------------------------------------- +struct GameOverlayActivated_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 31 }; + uint8 m_bActive; // true if it's just been activated, false otherwise + bool m_bUserInitiated; // true if the user asked for the overlay to be activated/deactivated + AppId_t m_nAppID; // the appID of the game (should always be the current game) + uint32 m_dwOverlayPID; // used internally +}; + + +//----------------------------------------------------------------------------- +// Purpose: called when the user tries to join a different game server from their friends list +// game client should attempt to connect to specified server when this is received +//----------------------------------------------------------------------------- +struct GameServerChangeRequested_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 32 }; + char m_rgchServer[64]; // server address ("127.0.0.1:27015", "tf2.valvesoftware.com") + char m_rgchPassword[64]; // server password, if any +}; + + +//----------------------------------------------------------------------------- +// Purpose: called when the user tries to join a lobby from their friends list +// game client should attempt to connect to specified lobby when this is received +//----------------------------------------------------------------------------- +struct GameLobbyJoinRequested_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 33 }; + CSteamID m_steamIDLobby; + + // The friend they did the join via (will be invalid if not directly via a friend) + CSteamID m_steamIDFriend; +}; + + +//----------------------------------------------------------------------------- +// Purpose: called when an avatar is loaded in from a previous GetLargeFriendAvatar() call +// if the image wasn't already available +//----------------------------------------------------------------------------- +struct AvatarImageLoaded_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 34 }; + CSteamID m_steamID; // steamid the avatar has been loaded for + int m_iImage; // the image index of the now loaded image + int m_iWide; // width of the loaded image + int m_iTall; // height of the loaded image +}; + + +//----------------------------------------------------------------------------- +// Purpose: marks the return of a request officer list call +//----------------------------------------------------------------------------- +struct ClanOfficerListResponse_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 35 }; + CSteamID m_steamIDClan; + int m_cOfficers; + uint8 m_bSuccess; +}; + + +//----------------------------------------------------------------------------- +// Purpose: callback indicating updated data about friends rich presence information +//----------------------------------------------------------------------------- +struct FriendRichPresenceUpdate_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 36 }; + CSteamID m_steamIDFriend; // friend who's rich presence has changed + AppId_t m_nAppID; // the appID of the game (should always be the current game) +}; + + +//----------------------------------------------------------------------------- +// Purpose: called when the user tries to join a game from their friends list +// rich presence will have been set with the "connect" key which is set here +//----------------------------------------------------------------------------- +struct GameRichPresenceJoinRequested_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 37 }; + CSteamID m_steamIDFriend; // the friend they did the join via (will be invalid if not directly via a friend) + char m_rgchConnect[k_cchMaxRichPresenceValueLength]; +}; + + +//----------------------------------------------------------------------------- +// Purpose: a chat message has been received for a clan chat the game has joined +//----------------------------------------------------------------------------- +struct GameConnectedClanChatMsg_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 38 }; + CSteamID m_steamIDClanChat; + CSteamID m_steamIDUser; + int m_iMessageID; +}; + + +//----------------------------------------------------------------------------- +// Purpose: a user has joined a clan chat +//----------------------------------------------------------------------------- +struct GameConnectedChatJoin_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 39 }; + CSteamID m_steamIDClanChat; + CSteamID m_steamIDUser; +}; + + +//----------------------------------------------------------------------------- +// Purpose: a user has left the chat we're in +//----------------------------------------------------------------------------- +struct GameConnectedChatLeave_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 40 }; + CSteamID m_steamIDClanChat; + CSteamID m_steamIDUser; + bool m_bKicked; // true if admin kicked + bool m_bDropped; // true if Steam connection dropped +}; + + +//----------------------------------------------------------------------------- +// Purpose: a DownloadClanActivityCounts() call has finished +//----------------------------------------------------------------------------- +struct DownloadClanActivityCountsResult_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 41 }; + bool m_bSuccess; +}; + + +//----------------------------------------------------------------------------- +// Purpose: a JoinClanChatRoom() call has finished +//----------------------------------------------------------------------------- +struct JoinClanChatRoomCompletionResult_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 42 }; + CSteamID m_steamIDClanChat; + EChatRoomEnterResponse m_eChatRoomEnterResponse; +}; + +//----------------------------------------------------------------------------- +// Purpose: a chat message has been received from a user +//----------------------------------------------------------------------------- +struct GameConnectedFriendChatMsg_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 43 }; + CSteamID m_steamIDUser; + int m_iMessageID; +}; + + +struct FriendsGetFollowerCount_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 44 }; + EResult m_eResult; + CSteamID m_steamID; + int m_nCount; +}; + + +struct FriendsIsFollowing_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 45 }; + EResult m_eResult; + CSteamID m_steamID; + bool m_bIsFollowing; +}; + + +struct FriendsEnumerateFollowingList_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 46 }; + EResult m_eResult; + CSteamID m_rgSteamID[ k_cEnumerateFollowersMax ]; + int32 m_nResultsReturned; + int32 m_nTotalResultCount; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Invoked when the status of unread messages changes +//----------------------------------------------------------------------------- +struct UnreadChatMessagesChanged_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 48 }; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Dispatched when an overlay browser instance is navigated to a protocol/scheme registered by RegisterProtocolInOverlayBrowser() +//----------------------------------------------------------------------------- +struct OverlayBrowserProtocolNavigation_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 49 }; + char rgchURI[ 1024 ]; +}; + +//----------------------------------------------------------------------------- +// Purpose: A user's equipped profile items have changed +//----------------------------------------------------------------------------- +struct EquippedProfileItemsChanged_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 50 }; + CSteamID m_steamID; +}; + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +struct EquippedProfileItems_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 51 }; + EResult m_eResult; + CSteamID m_steamID; + bool m_bHasAnimatedAvatar; + bool m_bHasAvatarFrame; + bool m_bHasProfileModifier; + bool m_bHasProfileBackground; + bool m_bHasMiniProfileBackground; + bool m_bFromCache; +}; + +#pragma pack( pop ) + +#endif // ISTEAMFRIENDS_H diff --git a/external/steamworks/public/steam/isteamgamecoordinator.h b/external/steamworks/public/steam/isteamgamecoordinator.h new file mode 100644 index 0000000..9e3d76d --- /dev/null +++ b/external/steamworks/public/steam/isteamgamecoordinator.h @@ -0,0 +1,74 @@ +//====== Copyright ©, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to the game coordinator for this application +// +//============================================================================= + +#ifndef ISTEAMGAMECOORDINATOR +#define ISTEAMGAMECOORDINATOR +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + + +// list of possible return values from the ISteamGameCoordinator API +enum EGCResults +{ + k_EGCResultOK = 0, + k_EGCResultNoMessage = 1, // There is no message in the queue + k_EGCResultBufferTooSmall = 2, // The buffer is too small for the requested message + k_EGCResultNotLoggedOn = 3, // The client is not logged onto Steam + k_EGCResultInvalidMessage = 4, // Something was wrong with the message being sent with SendMessage +}; + + +//----------------------------------------------------------------------------- +// Purpose: Functions for sending and receiving messages from the Game Coordinator +// for this application +//----------------------------------------------------------------------------- +class ISteamGameCoordinator +{ +public: + + // sends a message to the Game Coordinator + virtual EGCResults SendMessage( uint32 unMsgType, const void *pubData, uint32 cubData ) = 0; + + // returns true if there is a message waiting from the game coordinator + virtual bool IsMessageAvailable( uint32 *pcubMsgSize ) = 0; + + // fills the provided buffer with the first message in the queue and returns k_EGCResultOK or + // returns k_EGCResultNoMessage if there is no message waiting. pcubMsgSize is filled with the message size. + // If the provided buffer is not large enough to fit the entire message, k_EGCResultBufferTooSmall is returned + // and the message remains at the head of the queue. + virtual EGCResults RetrieveMessage( uint32 *punMsgType, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0; + +}; +#define STEAMGAMECOORDINATOR_INTERFACE_VERSION "SteamGameCoordinator001" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + +// callback notification - A new message is available for reading from the message queue +struct GCMessageAvailable_t +{ + enum { k_iCallback = k_iSteamGameCoordinatorCallbacks + 1 }; + uint32 m_nMessageSize; +}; + +// callback notification - A message failed to make it to the GC. It may be down temporarily +struct GCMessageFailed_t +{ + enum { k_iCallback = k_iSteamGameCoordinatorCallbacks + 2 }; +}; + +#pragma pack( pop ) + +#endif // ISTEAMGAMECOORDINATOR diff --git a/external/steamworks/public/steam/isteamgameserver.h b/external/steamworks/public/steam/isteamgameserver.h new file mode 100644 index 0000000..73d3c4e --- /dev/null +++ b/external/steamworks/public/steam/isteamgameserver.h @@ -0,0 +1,394 @@ +//====== Copyright (c) 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to steam for game servers +// +//============================================================================= + +#ifndef ISTEAMGAMESERVER_H +#define ISTEAMGAMESERVER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + +//----------------------------------------------------------------------------- +// Purpose: Functions for authenticating users via Steam to play on a game server +//----------------------------------------------------------------------------- +class ISteamGameServer +{ +public: + +// +// Basic server data. These properties, if set, must be set before before calling LogOn. They +// may not be changed after logged in. +// + + /// This is called by SteamGameServer_Init, and you will usually not need to call it directly + STEAM_PRIVATE_API( virtual bool InitGameServer( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, uint32 unFlags, AppId_t nGameAppId, const char *pchVersionString ) = 0; ) + + /// Game product identifier. This is currently used by the master server for version checking purposes. + /// It's a required field, but will eventually will go away, and the AppID will be used for this purpose. + virtual void SetProduct( const char *pszProduct ) = 0; + + /// Description of the game. This is a required field and is displayed in the steam server browser....for now. + /// This is a required field, but it will go away eventually, as the data should be determined from the AppID. + virtual void SetGameDescription( const char *pszGameDescription ) = 0; + + /// If your game is a "mod," pass the string that identifies it. The default is an empty string, meaning + /// this application is the original game, not a mod. + /// + /// @see k_cbMaxGameServerGameDir + virtual void SetModDir( const char *pszModDir ) = 0; + + /// Is this is a dedicated server? The default value is false. + virtual void SetDedicatedServer( bool bDedicated ) = 0; + +// +// Login +// + + /// Begin process to login to a persistent game server account + /// + /// You need to register for callbacks to determine the result of this operation. + /// @see SteamServersConnected_t + /// @see SteamServerConnectFailure_t + /// @see SteamServersDisconnected_t + virtual void LogOn( const char *pszToken ) = 0; + + /// Login to a generic, anonymous account. + /// + /// Note: in previous versions of the SDK, this was automatically called within SteamGameServer_Init, + /// but this is no longer the case. + virtual void LogOnAnonymous() = 0; + + /// Begin process of logging game server out of steam + virtual void LogOff() = 0; + + // status functions + virtual bool BLoggedOn() = 0; + virtual bool BSecure() = 0; + virtual CSteamID GetSteamID() = 0; + + /// Returns true if the master server has requested a restart. + /// Only returns true once per request. + virtual bool WasRestartRequested() = 0; + +// +// Server state. These properties may be changed at any time. +// + + /// Max player count that will be reported to server browser and client queries + virtual void SetMaxPlayerCount( int cPlayersMax ) = 0; + + /// Number of bots. Default value is zero + virtual void SetBotPlayerCount( int cBotplayers ) = 0; + + /// Set the name of server as it will appear in the server browser + /// + /// @see k_cbMaxGameServerName + virtual void SetServerName( const char *pszServerName ) = 0; + + /// Set name of map to report in the server browser + /// + /// @see k_cbMaxGameServerMapName + virtual void SetMapName( const char *pszMapName ) = 0; + + /// Let people know if your server will require a password + virtual void SetPasswordProtected( bool bPasswordProtected ) = 0; + + /// Spectator server port to advertise. The default value is zero, meaning the + /// service is not used. If your server receives any info requests on the LAN, + /// this is the value that will be placed into the reply for such local queries. + /// + /// This is also the value that will be advertised by the master server. + /// The only exception is if your server is using a FakeIP. Then then the second + /// fake port number (index 1) assigned to your server will be listed on the master + /// server as the spectator port, if you set this value to any nonzero value. + /// + /// This function merely controls the values that are advertised -- it's up to you to + /// configure the server to actually listen on this port and handle any spectator traffic + virtual void SetSpectatorPort( uint16 unSpectatorPort ) = 0; + + /// Name of the spectator server. (Only used if spectator port is nonzero.) + /// + /// @see k_cbMaxGameServerMapName + virtual void SetSpectatorServerName( const char *pszSpectatorServerName ) = 0; + + /// Call this to clear the whole list of key/values that are sent in rules queries. + virtual void ClearAllKeyValues() = 0; + + /// Call this to add/update a key/value pair. + virtual void SetKeyValue( const char *pKey, const char *pValue ) = 0; + + /// Sets a string defining the "gametags" for this server, this is optional, but if it is set + /// it allows users to filter in the matchmaking/server-browser interfaces based on the value + /// + /// @see k_cbMaxGameServerTags + virtual void SetGameTags( const char *pchGameTags ) = 0; + + /// Sets a string defining the "gamedata" for this server, this is optional, but if it is set + /// it allows users to filter in the matchmaking/server-browser interfaces based on the value + /// + /// @see k_cbMaxGameServerGameData + virtual void SetGameData( const char *pchGameData ) = 0; + + /// Region identifier. This is an optional field, the default value is empty, meaning the "world" region + virtual void SetRegion( const char *pszRegion ) = 0; + + /// Indicate whether you wish to be listed on the master server list + /// and/or respond to server browser / LAN discovery packets. + /// The server starts with this value set to false. You should set all + /// relevant server parameters before enabling advertisement on the server. + /// + /// (This function used to be named EnableHeartbeats, so if you are wondering + /// where that function went, it's right here. It does the same thing as before, + /// the old name was just confusing.) + virtual void SetAdvertiseServerActive( bool bActive ) = 0; + +// +// Player list management / authentication. +// + + // Retrieve ticket to be sent to the entity who wishes to authenticate you ( using BeginAuthSession API ). + // pcbTicket retrieves the length of the actual ticket. + // SteamNetworkingIdentity is an optional parameter to hold the public IP address of the entity you are connecting to + // if an IP address is passed Steam will only allow the ticket to be used by an entity with that IP address + virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSnid ) = 0; + + // Authenticate ticket ( from GetAuthSessionTicket ) from entity steamID to be sure it is valid and isnt reused + // Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse ) + virtual EBeginAuthSessionResult BeginAuthSession( const void *pAuthTicket, int cbAuthTicket, CSteamID steamID ) = 0; + + // Stop tracking started by BeginAuthSession - called when no longer playing game with this entity + virtual void EndAuthSession( CSteamID steamID ) = 0; + + // Cancel auth ticket from GetAuthSessionTicket, called when no longer playing game with the entity you gave the ticket to + virtual void CancelAuthTicket( HAuthTicket hAuthTicket ) = 0; + + // After receiving a user's authentication data, and passing it to SendUserConnectAndAuthenticate, use this function + // to determine if the user owns downloadable content specified by the provided AppID. + virtual EUserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID, AppId_t appID ) = 0; + + // Ask if a user in in the specified group, results returns async by GSUserGroupStatus_t + // returns false if we're not connected to the steam servers and thus cannot ask + virtual bool RequestUserGroupStatus( CSteamID steamIDUser, CSteamID steamIDGroup ) = 0; + + + // these two functions s are deprecated, and will not return results + // they will be removed in a future version of the SDK + virtual void GetGameplayStats( ) = 0; + STEAM_CALL_RESULT( GSReputation_t ) + virtual SteamAPICall_t GetServerReputation() = 0; + + // Returns the public IP of the server according to Steam, useful when the server is + // behind NAT and you want to advertise its IP in a lobby for other clients to directly + // connect to + virtual SteamIPAddress_t GetPublicIP() = 0; + +// Server browser related query packet processing for shared socket mode. These are used +// when you pass STEAMGAMESERVER_QUERY_PORT_SHARED as the query port to SteamGameServer_Init. +// IP address and port are in host order, i.e 127.0.0.1 == 0x7f000001 + + // These are used when you've elected to multiplex the game server's UDP socket + // rather than having the master server updater use its own sockets. + // + // Source games use this to simplify the job of the server admins, so they + // don't have to open up more ports on their firewalls. + + // Call this when a packet that starts with 0xFFFFFFFF comes in. That means + // it's for us. + virtual bool HandleIncomingPacket( const void *pData, int cbData, uint32 srcIP, uint16 srcPort ) = 0; + + // AFTER calling HandleIncomingPacket for any packets that came in that frame, call this. + // This gets a packet that the master server updater needs to send out on UDP. + // It returns the length of the packet it wants to send, or 0 if there are no more packets to send. + // Call this each frame until it returns 0. + virtual int GetNextOutgoingPacket( void *pOut, int cbMaxOut, uint32 *pNetAdr, uint16 *pPort ) = 0; + +// +// Server clan association +// + + // associate this game server with this clan for the purposes of computing player compat + STEAM_CALL_RESULT( AssociateWithClanResult_t ) + virtual SteamAPICall_t AssociateWithClan( CSteamID steamIDClan ) = 0; + + // ask if any of the current players dont want to play with this new player - or vice versa + STEAM_CALL_RESULT( ComputeNewPlayerCompatibilityResult_t ) + virtual SteamAPICall_t ComputeNewPlayerCompatibility( CSteamID steamIDNewPlayer ) = 0; + + + + + // Handles receiving a new connection from a Steam user. This call will ask the Steam + // servers to validate the users identity, app ownership, and VAC status. If the Steam servers + // are off-line, then it will validate the cached ticket itself which will validate app ownership + // and identity. The AuthBlob here should be acquired on the game client using SteamUser()->InitiateGameConnection() + // and must then be sent up to the game server for authentication. + // + // Return Value: returns true if the users ticket passes basic checks. pSteamIDUser will contain the Steam ID of this user. pSteamIDUser must NOT be NULL + // If the call succeeds then you should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication + // for the user has succeeded or failed (the steamid in the callback will match the one returned by this call) + // + // DEPRECATED! This function will be removed from the SDK in an upcoming version. + // Please migrate to BeginAuthSession and related functions. + virtual bool SendUserConnectAndAuthenticate_DEPRECATED( uint32 unIPClient, const void *pvAuthBlob, uint32 cubAuthBlobSize, CSteamID *pSteamIDUser ) = 0; + + // Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation. + // + // Return Value: Returns a SteamID for the user to be tracked with, you should call EndAuthSession() + // when this user leaves the server just like you would for a real user. + virtual CSteamID CreateUnauthenticatedUserConnection() = 0; + + // Should be called whenever a user leaves our game server, this lets Steam internally + // track which users are currently on which servers for the purposes of preventing a single + // account being logged into multiple servers, showing who is currently on a server, etc. + // + // DEPRECATED! This function will be removed from the SDK in an upcoming version. + // Please migrate to BeginAuthSession and related functions. + virtual void SendUserDisconnect_DEPRECATED( CSteamID steamIDUser ) = 0; + + // Update the data to be displayed in the server browser and matchmaking interfaces for a user + // currently connected to the server. For regular users you must call this after you receive a + // GSUserValidationSuccess callback. + // + // Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player) + virtual bool BUpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore ) = 0; + +// Deprecated functions. These will be removed in a future version of the SDK. +// If you really need these, please contact us and help us understand what you are +// using them for. + + STEAM_PRIVATE_API( + virtual void SetMasterServerHeartbeatInterval_DEPRECATED( int iHeartbeatInterval ) = 0; + virtual void ForceMasterServerHeartbeat_DEPRECATED() = 0; + ) +}; + +#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer015" + +// Global accessor +inline ISteamGameServer *SteamGameServer(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamGameServer *, SteamGameServer, STEAMGAMESERVER_INTERFACE_VERSION ); + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + + +// client has been approved to connect to this game server +struct GSClientApprove_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 1 }; + CSteamID m_SteamID; // SteamID of approved player + CSteamID m_OwnerSteamID; // SteamID of original owner for game license +}; + + +// client has been denied to connection to this game server +struct GSClientDeny_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 2 }; + CSteamID m_SteamID; + EDenyReason m_eDenyReason; + char m_rgchOptionalText[128]; +}; + + +// request the game server should kick the user +struct GSClientKick_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 3 }; + CSteamID m_SteamID; + EDenyReason m_eDenyReason; +}; + +// NOTE: callback values 4 and 5 are skipped because they are used for old deprecated callbacks, +// do not reuse them here. + + +// client achievement info +struct GSClientAchievementStatus_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 6 }; + uint64 m_SteamID; + char m_pchAchievement[128]; + bool m_bUnlocked; +}; + +// received when the game server requests to be displayed as secure (VAC protected) +// m_bSecure is true if the game server should display itself as secure to users, false otherwise +struct GSPolicyResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 15 }; + uint8 m_bSecure; +}; + +// GS gameplay stats info +struct GSGameplayStats_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 7 }; + EResult m_eResult; // Result of the call + int32 m_nRank; // Overall rank of the server (0-based) + uint32 m_unTotalConnects; // Total number of clients who have ever connected to the server + uint32 m_unTotalMinutesPlayed; // Total number of minutes ever played on the server +}; + +// send as a reply to RequestUserGroupStatus() +struct GSClientGroupStatus_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 8 }; + CSteamID m_SteamIDUser; + CSteamID m_SteamIDGroup; + bool m_bMember; + bool m_bOfficer; +}; + +// Sent as a reply to GetServerReputation() +struct GSReputation_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 9 }; + EResult m_eResult; // Result of the call; + uint32 m_unReputationScore; // The reputation score for the game server + bool m_bBanned; // True if the server is banned from the Steam + // master servers + + // The following members are only filled out if m_bBanned is true. They will all + // be set to zero otherwise. Master server bans are by IP so it is possible to be + // banned even when the score is good high if there is a bad server on another port. + // This information can be used to determine which server is bad. + + uint32 m_unBannedIP; // The IP of the banned server + uint16 m_usBannedPort; // The port of the banned server + uint64 m_ulBannedGameID; // The game ID the banned server is serving + uint32 m_unBanExpires; // Time the ban expires, expressed in the Unix epoch (seconds since 1/1/1970) +}; + +// Sent as a reply to AssociateWithClan() +struct AssociateWithClanResult_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 10 }; + EResult m_eResult; // Result of the call; +}; + +// Sent as a reply to ComputeNewPlayerCompatibility() +struct ComputeNewPlayerCompatibilityResult_t +{ + enum { k_iCallback = k_iSteamGameServerCallbacks + 11 }; + EResult m_eResult; // Result of the call; + int m_cPlayersThatDontLikeCandidate; + int m_cPlayersThatCandidateDoesntLike; + int m_cClanPlayersThatDontLikeCandidate; + CSteamID m_SteamIDCandidate; +}; + + +#pragma pack( pop ) + +#endif // ISTEAMGAMESERVER_H diff --git a/external/steamworks/public/steam/isteamgameserverstats.h b/external/steamworks/public/steam/isteamgameserverstats.h new file mode 100644 index 0000000..f20d101 --- /dev/null +++ b/external/steamworks/public/steam/isteamgameserverstats.h @@ -0,0 +1,114 @@ +//====== Copyright © Valve Corporation, All rights reserved. ======= +// +// Purpose: interface for game servers to steam stats and achievements +// +//============================================================================= + +#ifndef ISTEAMGAMESERVERSTATS_H +#define ISTEAMGAMESERVERSTATS_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + +//----------------------------------------------------------------------------- +// Purpose: Functions for authenticating users via Steam to play on a game server +//----------------------------------------------------------------------------- +class ISteamGameServerStats +{ +public: + // downloads stats for the user + // returns a GSStatsReceived_t callback when completed + // if the user has no stats, GSStatsReceived_t.m_eResult will be set to k_EResultFail + // these stats will only be auto-updated for clients playing on the server. For other + // users you'll need to call RequestUserStats() again to refresh any data + STEAM_CALL_RESULT( GSStatsReceived_t ) + virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0; + + // requests stat information for a user, usable after a successful call to RequestUserStats() + STEAM_FLAT_NAME( GetUserStatInt32 ) + virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, int32 *pData ) = 0; + + STEAM_FLAT_NAME( GetUserStatFloat ) + virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0; + + virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0; + + // Set / update stats and achievements. + // Note: These updates will work only on stats game servers are allowed to edit and only for + // game servers that have been declared as officially controlled by the game creators. + // Set the IP range of your official servers on the Steamworks page + + STEAM_FLAT_NAME( SetUserStatInt32 ) + virtual bool SetUserStat( CSteamID steamIDUser, const char *pchName, int32 nData ) = 0; + + STEAM_FLAT_NAME( SetUserStatFloat ) + virtual bool SetUserStat( CSteamID steamIDUser, const char *pchName, float fData ) = 0; + + virtual bool UpdateUserAvgRateStat( CSteamID steamIDUser, const char *pchName, float flCountThisSession, double dSessionLength ) = 0; + + virtual bool SetUserAchievement( CSteamID steamIDUser, const char *pchName ) = 0; + virtual bool ClearUserAchievement( CSteamID steamIDUser, const char *pchName ) = 0; + + // Store the current data on the server, will get a GSStatsStored_t callback when set. + // + // If the callback has a result of k_EResultInvalidParam, one or more stats + // uploaded has been rejected, either because they broke constraints + // or were out of date. In this case the server sends back updated values. + // The stats should be re-iterated to keep in sync. + STEAM_CALL_RESULT( GSStatsStored_t ) + virtual SteamAPICall_t StoreUserStats( CSteamID steamIDUser ) = 0; +}; +#define STEAMGAMESERVERSTATS_INTERFACE_VERSION "SteamGameServerStats001" + +// Global accessor +inline ISteamGameServerStats *SteamGameServerStats(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamGameServerStats *, SteamGameServerStats, STEAMGAMESERVERSTATS_INTERFACE_VERSION ); + + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + +//----------------------------------------------------------------------------- +// Purpose: called when the latests stats and achievements have been received +// from the server +//----------------------------------------------------------------------------- +struct GSStatsReceived_t +{ + enum { k_iCallback = k_iSteamGameServerStatsCallbacks }; + EResult m_eResult; // Success / error fetching the stats + CSteamID m_steamIDUser; // The user for whom the stats are retrieved for +}; + + +//----------------------------------------------------------------------------- +// Purpose: result of a request to store the user stats for a game +//----------------------------------------------------------------------------- +struct GSStatsStored_t +{ + enum { k_iCallback = k_iSteamGameServerStatsCallbacks + 1 }; + EResult m_eResult; // success / error + CSteamID m_steamIDUser; // The user for whom the stats were stored +}; + +//----------------------------------------------------------------------------- +// Purpose: Callback indicating that a user's stats have been unloaded. +// Call RequestUserStats again to access stats for this user +//----------------------------------------------------------------------------- +struct GSStatsUnloaded_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 8 }; + CSteamID m_steamIDUser; // User whose stats have been unloaded +}; + +#pragma pack( pop ) + + +#endif // ISTEAMGAMESERVERSTATS_H diff --git a/external/steamworks/public/steam/isteamhtmlsurface.h b/external/steamworks/public/steam/isteamhtmlsurface.h new file mode 100644 index 0000000..dd33072 --- /dev/null +++ b/external/steamworks/public/steam/isteamhtmlsurface.h @@ -0,0 +1,481 @@ +//====== Copyright 1996-2013, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to display html pages in a texture +// +//============================================================================= + +#ifndef ISTEAMHTMLSURFACE_H +#define ISTEAMHTMLSURFACE_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + +typedef uint32 HHTMLBrowser; +const uint32 INVALID_HTMLBROWSER = 0; + +//----------------------------------------------------------------------------- +// Purpose: Functions for displaying HTML pages and interacting with them +//----------------------------------------------------------------------------- +class ISteamHTMLSurface +{ +public: + virtual ~ISteamHTMLSurface() {} + + // Must call init and shutdown when starting/ending use of the interface + virtual bool Init() = 0; + virtual bool Shutdown() = 0; + + // Create a browser object for display of a html page, when creation is complete the call handle + // will return a HTML_BrowserReady_t callback for the HHTMLBrowser of your new browser. + // The user agent string is a substring to be added to the general user agent string so you can + // identify your client on web servers. + // The userCSS string lets you apply a CSS style sheet to every displayed page, leave null if + // you do not require this functionality. + // + // YOU MUST HAVE IMPLEMENTED HANDLERS FOR HTML_BrowserReady_t, HTML_StartRequest_t, + // HTML_JSAlert_t, HTML_JSConfirm_t, and HTML_FileOpenDialog_t! See the CALLBACKS + // section of this interface (AllowStartRequest, etc) for more details. If you do + // not implement these callback handlers, the browser may appear to hang instead of + // navigating to new pages or triggering javascript popups. + // + STEAM_CALL_RESULT( HTML_BrowserReady_t ) + virtual SteamAPICall_t CreateBrowser( const char *pchUserAgent, const char *pchUserCSS ) = 0; + + // Call this when you are done with a html surface, this lets us free the resources being used by it + virtual void RemoveBrowser( HHTMLBrowser unBrowserHandle ) = 0; + + // Navigate to this URL, results in a HTML_StartRequest_t as the request commences + virtual void LoadURL( HHTMLBrowser unBrowserHandle, const char *pchURL, const char *pchPostData ) = 0; + + // Tells the surface the size in pixels to display the surface + virtual void SetSize( HHTMLBrowser unBrowserHandle, uint32 unWidth, uint32 unHeight ) = 0; + + // Stop the load of the current html page + virtual void StopLoad( HHTMLBrowser unBrowserHandle ) = 0; + // Reload (most likely from local cache) the current page + virtual void Reload( HHTMLBrowser unBrowserHandle ) = 0; + // navigate back in the page history + virtual void GoBack( HHTMLBrowser unBrowserHandle ) = 0; + // navigate forward in the page history + virtual void GoForward( HHTMLBrowser unBrowserHandle ) = 0; + + // add this header to any url requests from this browser + virtual void AddHeader( HHTMLBrowser unBrowserHandle, const char *pchKey, const char *pchValue ) = 0; + // run this javascript script in the currently loaded page + virtual void ExecuteJavascript( HHTMLBrowser unBrowserHandle, const char *pchScript ) = 0; + + enum EHTMLMouseButton + { + eHTMLMouseButton_Left = 0, + eHTMLMouseButton_Right = 1, + eHTMLMouseButton_Middle = 2, + }; + + // Mouse click and mouse movement commands + virtual void MouseUp( HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton ) = 0; + virtual void MouseDown( HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton ) = 0; + virtual void MouseDoubleClick( HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton ) = 0; + // x and y are relative to the HTML bounds + virtual void MouseMove( HHTMLBrowser unBrowserHandle, int x, int y ) = 0; + // nDelta is pixels of scroll + virtual void MouseWheel( HHTMLBrowser unBrowserHandle, int32 nDelta ) = 0; + + enum EHTMLMouseCursor + { + k_EHTMLMouseCursor_User = 0, + k_EHTMLMouseCursor_None, + k_EHTMLMouseCursor_Arrow, + k_EHTMLMouseCursor_IBeam, + k_EHTMLMouseCursor_Hourglass, + k_EHTMLMouseCursor_WaitArrow, + k_EHTMLMouseCursor_Crosshair, + k_EHTMLMouseCursor_Up, + k_EHTMLMouseCursor_SizeNW, + k_EHTMLMouseCursor_SizeSE, + k_EHTMLMouseCursor_SizeNE, + k_EHTMLMouseCursor_SizeSW, + k_EHTMLMouseCursor_SizeW, + k_EHTMLMouseCursor_SizeE, + k_EHTMLMouseCursor_SizeN, + k_EHTMLMouseCursor_SizeS, + k_EHTMLMouseCursor_SizeWE, + k_EHTMLMouseCursor_SizeNS, + k_EHTMLMouseCursor_SizeAll, + k_EHTMLMouseCursor_No, + k_EHTMLMouseCursor_Hand, + k_EHTMLMouseCursor_Blank, // don't show any custom cursor, just use your default + k_EHTMLMouseCursor_MiddlePan, + k_EHTMLMouseCursor_NorthPan, + k_EHTMLMouseCursor_NorthEastPan, + k_EHTMLMouseCursor_EastPan, + k_EHTMLMouseCursor_SouthEastPan, + k_EHTMLMouseCursor_SouthPan, + k_EHTMLMouseCursor_SouthWestPan, + k_EHTMLMouseCursor_WestPan, + k_EHTMLMouseCursor_NorthWestPan, + k_EHTMLMouseCursor_Alias, + k_EHTMLMouseCursor_Cell, + k_EHTMLMouseCursor_ColResize, + k_EHTMLMouseCursor_CopyCur, + k_EHTMLMouseCursor_VerticalText, + k_EHTMLMouseCursor_RowResize, + k_EHTMLMouseCursor_ZoomIn, + k_EHTMLMouseCursor_ZoomOut, + k_EHTMLMouseCursor_Help, + k_EHTMLMouseCursor_Custom, + k_EHTMLMouseCursor_SizeNWSE, + k_EHTMLMouseCursor_SizeNESW, + + k_EHTMLMouseCursor_last, // custom cursors start from this value and up + }; + + enum EHTMLKeyModifiers + { + k_eHTMLKeyModifier_None = 0, + k_eHTMLKeyModifier_AltDown = 1 << 0, + k_eHTMLKeyModifier_CtrlDown = 1 << 1, + k_eHTMLKeyModifier_ShiftDown = 1 << 2, + }; + + // keyboard interactions, native keycode is the virtual key code value from your OS, system key flags the key to not + // be sent as a typed character as well as a key down + virtual void KeyDown( HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers, bool bIsSystemKey = false ) = 0; + virtual void KeyUp( HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers ) = 0; + // cUnicodeChar is the unicode character point for this keypress (and potentially multiple chars per press) + virtual void KeyChar( HHTMLBrowser unBrowserHandle, uint32 cUnicodeChar, EHTMLKeyModifiers eHTMLKeyModifiers ) = 0; + + // programmatically scroll this many pixels on the page + virtual void SetHorizontalScroll( HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll ) = 0; + virtual void SetVerticalScroll( HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll ) = 0; + + // tell the html control if it has key focus currently, controls showing the I-beam cursor in text controls amongst other things + virtual void SetKeyFocus( HHTMLBrowser unBrowserHandle, bool bHasKeyFocus ) = 0; + + // open the current pages html code in the local editor of choice, used for debugging + virtual void ViewSource( HHTMLBrowser unBrowserHandle ) = 0; + // copy the currently selected text on the html page to the local clipboard + virtual void CopyToClipboard( HHTMLBrowser unBrowserHandle ) = 0; + // paste from the local clipboard to the current html page + virtual void PasteFromClipboard( HHTMLBrowser unBrowserHandle ) = 0; + + // find this string in the browser, if bCurrentlyInFind is true then instead cycle to the next matching element + virtual void Find( HHTMLBrowser unBrowserHandle, const char *pchSearchStr, bool bCurrentlyInFind, bool bReverse ) = 0; + // cancel a currently running find + virtual void StopFind( HHTMLBrowser unBrowserHandle ) = 0; + + // return details about the link at position x,y on the current page + virtual void GetLinkAtPosition( HHTMLBrowser unBrowserHandle, int x, int y ) = 0; + + // set a webcookie for the hostname in question + virtual void SetCookie( const char *pchHostname, const char *pchKey, const char *pchValue, const char *pchPath = "/", RTime32 nExpires = 0, bool bSecure = false, bool bHTTPOnly = false ) = 0; + + // Zoom the current page by flZoom ( from 0.0 to 2.0, so to zoom to 120% use 1.2 ), zooming around point X,Y in the page (use 0,0 if you don't care) + virtual void SetPageScaleFactor( HHTMLBrowser unBrowserHandle, float flZoom, int nPointX, int nPointY ) = 0; + + // Enable/disable low-resource background mode, where javascript and repaint timers are throttled, resources are + // more aggressively purged from memory, and audio/video elements are paused. When background mode is enabled, + // all HTML5 video and audio objects will execute ".pause()" and gain the property "._steam_background_paused = 1". + // When background mode is disabled, any video or audio objects with that property will resume with ".play()". + virtual void SetBackgroundMode( HHTMLBrowser unBrowserHandle, bool bBackgroundMode ) = 0; + + // Scale the output display space by this factor, this is useful when displaying content on high dpi devices. + // Specifies the ratio between physical and logical pixels. + virtual void SetDPIScalingFactor( HHTMLBrowser unBrowserHandle, float flDPIScaling ) = 0; + + // Open HTML/JS developer tools + virtual void OpenDeveloperTools( HHTMLBrowser unBrowserHandle ) = 0; + + // CALLBACKS + // + // These set of functions are used as responses to callback requests + // + + // You MUST call this in response to a HTML_StartRequest_t callback + // Set bAllowed to true to allow this navigation, false to cancel it and stay + // on the current page. You can use this feature to limit the valid pages + // allowed in your HTML surface. + virtual void AllowStartRequest( HHTMLBrowser unBrowserHandle, bool bAllowed ) = 0; + + // You MUST call this in response to a HTML_JSAlert_t or HTML_JSConfirm_t callback + // Set bResult to true for the OK option of a confirm, use false otherwise + virtual void JSDialogResponse( HHTMLBrowser unBrowserHandle, bool bResult ) = 0; + + // You MUST call this in response to a HTML_FileOpenDialog_t callback + virtual void FileLoadDialogResponse( HHTMLBrowser unBrowserHandle, const char **pchSelectedFiles ) = 0; +}; + +#define STEAMHTMLSURFACE_INTERFACE_VERSION "STEAMHTMLSURFACE_INTERFACE_VERSION_005" + +// Global interface accessor +inline ISteamHTMLSurface *SteamHTMLSurface(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamHTMLSurface *, SteamHTMLSurface, STEAMHTMLSURFACE_INTERFACE_VERSION ); + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + + +//----------------------------------------------------------------------------- +// Purpose: The browser is ready for use +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_BrowserReady_t, k_iSteamHTMLSurfaceCallbacks + 1 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // this browser is now fully created and ready to navigate to pages +STEAM_CALLBACK_END(1) + + +//----------------------------------------------------------------------------- +// Purpose: the browser has a pending paint +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN(HTML_NeedsPaint_t, k_iSteamHTMLSurfaceCallbacks + 2) +STEAM_CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the browser that needs the paint +STEAM_CALLBACK_MEMBER(1, const char *, pBGRA ) // a pointer to the B8G8R8A8 data for this surface, valid until SteamAPI_RunCallbacks is next called +STEAM_CALLBACK_MEMBER(2, uint32, unWide) // the total width of the pBGRA texture +STEAM_CALLBACK_MEMBER(3, uint32, unTall) // the total height of the pBGRA texture +STEAM_CALLBACK_MEMBER(4, uint32, unUpdateX) // the offset in X for the damage rect for this update +STEAM_CALLBACK_MEMBER(5, uint32, unUpdateY) // the offset in Y for the damage rect for this update +STEAM_CALLBACK_MEMBER(6, uint32, unUpdateWide) // the width of the damage rect for this update +STEAM_CALLBACK_MEMBER(7, uint32, unUpdateTall) // the height of the damage rect for this update +STEAM_CALLBACK_MEMBER(8, uint32, unScrollX) // the page scroll the browser was at when this texture was rendered +STEAM_CALLBACK_MEMBER(9, uint32, unScrollY) // the page scroll the browser was at when this texture was rendered +STEAM_CALLBACK_MEMBER(10, float, flPageScale) // the page scale factor on this page when rendered +STEAM_CALLBACK_MEMBER(11, uint32, unPageSerial) // incremented on each new page load, you can use this to reject draws while navigating to new pages +STEAM_CALLBACK_END(12) + + +//----------------------------------------------------------------------------- +// Purpose: The browser wanted to navigate to a new page +// NOTE - you MUST call AllowStartRequest in response to this callback +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN(HTML_StartRequest_t, k_iSteamHTMLSurfaceCallbacks + 3) +STEAM_CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface navigating +STEAM_CALLBACK_MEMBER(1, const char *, pchURL) // the url they wish to navigate to +STEAM_CALLBACK_MEMBER(2, const char *, pchTarget) // the html link target type (i.e _blank, _self, _parent, _top ) +STEAM_CALLBACK_MEMBER(3, const char *, pchPostData ) // any posted data for the request +STEAM_CALLBACK_MEMBER(4, bool, bIsRedirect) // true if this was a http/html redirect from the last load request +STEAM_CALLBACK_END(5) + + +//----------------------------------------------------------------------------- +// Purpose: The browser has been requested to close due to user interaction (usually from a javascript window.close() call) +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN(HTML_CloseBrowser_t, k_iSteamHTMLSurfaceCallbacks + 4) +STEAM_CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface +STEAM_CALLBACK_END(1) + + +//----------------------------------------------------------------------------- +// Purpose: the browser is navigating to a new url +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_URLChanged_t, k_iSteamHTMLSurfaceCallbacks + 5 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface navigating +STEAM_CALLBACK_MEMBER( 1, const char *, pchURL ) // the url they wish to navigate to +STEAM_CALLBACK_MEMBER( 2, const char *, pchPostData ) // any posted data for the request +STEAM_CALLBACK_MEMBER( 3, bool, bIsRedirect ) // true if this was a http/html redirect from the last load request +STEAM_CALLBACK_MEMBER( 4, const char *, pchPageTitle ) // the title of the page +STEAM_CALLBACK_MEMBER( 5, bool, bNewNavigation ) // true if this was from a fresh tab and not a click on an existing page +STEAM_CALLBACK_END(6) + + +//----------------------------------------------------------------------------- +// Purpose: A page is finished loading +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_FinishedRequest_t, k_iSteamHTMLSurfaceCallbacks + 6 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchURL ) // +STEAM_CALLBACK_MEMBER( 2, const char *, pchPageTitle ) // +STEAM_CALLBACK_END(3) + + +//----------------------------------------------------------------------------- +// Purpose: a request to load this url in a new tab +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_OpenLinkInNewTab_t, k_iSteamHTMLSurfaceCallbacks + 7 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchURL ) // +STEAM_CALLBACK_END(2) + + +//----------------------------------------------------------------------------- +// Purpose: the page has a new title now +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_ChangedTitle_t, k_iSteamHTMLSurfaceCallbacks + 8 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchTitle ) // +STEAM_CALLBACK_END(2) + + +//----------------------------------------------------------------------------- +// Purpose: results from a search +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_SearchResults_t, k_iSteamHTMLSurfaceCallbacks + 9 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, uint32, unResults ) // +STEAM_CALLBACK_MEMBER( 2, uint32, unCurrentMatch ) // +STEAM_CALLBACK_END(3) + + +//----------------------------------------------------------------------------- +// Purpose: page history status changed on the ability to go backwards and forward +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_CanGoBackAndForward_t, k_iSteamHTMLSurfaceCallbacks + 10 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, bool, bCanGoBack ) // +STEAM_CALLBACK_MEMBER( 2, bool, bCanGoForward ) // +STEAM_CALLBACK_END(3) + + +//----------------------------------------------------------------------------- +// Purpose: details on the visibility and size of the horizontal scrollbar +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_HorizontalScroll_t, k_iSteamHTMLSurfaceCallbacks + 11 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, uint32, unScrollMax ) // +STEAM_CALLBACK_MEMBER( 2, uint32, unScrollCurrent ) // +STEAM_CALLBACK_MEMBER( 3, float, flPageScale ) // +STEAM_CALLBACK_MEMBER( 4, bool , bVisible ) // +STEAM_CALLBACK_MEMBER( 5, uint32, unPageSize ) // +STEAM_CALLBACK_END(6) + + +//----------------------------------------------------------------------------- +// Purpose: details on the visibility and size of the vertical scrollbar +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_VerticalScroll_t, k_iSteamHTMLSurfaceCallbacks + 12 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, uint32, unScrollMax ) // +STEAM_CALLBACK_MEMBER( 2, uint32, unScrollCurrent ) // +STEAM_CALLBACK_MEMBER( 3, float, flPageScale ) // +STEAM_CALLBACK_MEMBER( 4, bool, bVisible ) // +STEAM_CALLBACK_MEMBER( 5, uint32, unPageSize ) // +STEAM_CALLBACK_END(6) + + +//----------------------------------------------------------------------------- +// Purpose: response to GetLinkAtPosition call +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_LinkAtPosition_t, k_iSteamHTMLSurfaceCallbacks + 13 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, uint32, x ) // NOTE - Not currently set +STEAM_CALLBACK_MEMBER( 2, uint32, y ) // NOTE - Not currently set +STEAM_CALLBACK_MEMBER( 3, const char *, pchURL ) // +STEAM_CALLBACK_MEMBER( 4, bool, bInput ) // +STEAM_CALLBACK_MEMBER( 5, bool, bLiveLink ) // +STEAM_CALLBACK_END(6) + + + +//----------------------------------------------------------------------------- +// Purpose: show a Javascript alert dialog, call JSDialogResponse +// when the user dismisses this dialog (or right away to ignore it) +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_JSAlert_t, k_iSteamHTMLSurfaceCallbacks + 14 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchMessage ) // +STEAM_CALLBACK_END(2) + + +//----------------------------------------------------------------------------- +// Purpose: show a Javascript confirmation dialog, call JSDialogResponse +// when the user dismisses this dialog (or right away to ignore it) +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_JSConfirm_t, k_iSteamHTMLSurfaceCallbacks + 15 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchMessage ) // +STEAM_CALLBACK_END(2) + + +//----------------------------------------------------------------------------- +// Purpose: when received show a file open dialog +// then call FileLoadDialogResponse with the file(s) the user selected. +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_FileOpenDialog_t, k_iSteamHTMLSurfaceCallbacks + 16 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchTitle ) // +STEAM_CALLBACK_MEMBER( 2, const char *, pchInitialFile ) // +STEAM_CALLBACK_END(3) + + +//----------------------------------------------------------------------------- +// Purpose: a new html window is being created. +// +// IMPORTANT NOTE: at this time, the API does not allow you to acknowledge or +// render the contents of this new window, so the new window is always destroyed +// immediately. The URL and other parameters of the new window are passed here +// to give your application the opportunity to call CreateBrowser and set up +// a new browser in response to the attempted popup, if you wish to do so. +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_NewWindow_t, k_iSteamHTMLSurfaceCallbacks + 21 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the current surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchURL ) // the page to load +STEAM_CALLBACK_MEMBER( 2, uint32, unX ) // the x pos into the page to display the popup +STEAM_CALLBACK_MEMBER( 3, uint32, unY ) // the y pos into the page to display the popup +STEAM_CALLBACK_MEMBER( 4, uint32, unWide ) // the total width of the pBGRA texture +STEAM_CALLBACK_MEMBER( 5, uint32, unTall ) // the total height of the pBGRA texture +STEAM_CALLBACK_MEMBER( 6, HHTMLBrowser, unNewWindow_BrowserHandle_IGNORE ) +STEAM_CALLBACK_END(7) + + +//----------------------------------------------------------------------------- +// Purpose: change the cursor to display +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_SetCursor_t, k_iSteamHTMLSurfaceCallbacks + 22 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, uint32, eMouseCursor ) // the EHTMLMouseCursor to display +STEAM_CALLBACK_END(2) + + +//----------------------------------------------------------------------------- +// Purpose: informational message from the browser +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_StatusText_t, k_iSteamHTMLSurfaceCallbacks + 23 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchMsg ) // the message text +STEAM_CALLBACK_END(2) + + +//----------------------------------------------------------------------------- +// Purpose: show a tooltip +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_ShowToolTip_t, k_iSteamHTMLSurfaceCallbacks + 24 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchMsg ) // the tooltip text +STEAM_CALLBACK_END(2) + + +//----------------------------------------------------------------------------- +// Purpose: update the text of an existing tooltip +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_UpdateToolTip_t, k_iSteamHTMLSurfaceCallbacks + 25 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchMsg ) // the new tooltip text +STEAM_CALLBACK_END(2) + + +//----------------------------------------------------------------------------- +// Purpose: hide the tooltip you are showing +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_HideToolTip_t, k_iSteamHTMLSurfaceCallbacks + 26 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_END(1) + + +//----------------------------------------------------------------------------- +// Purpose: The browser has restarted due to an internal failure, use this new handle value +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( HTML_BrowserRestarted_t, k_iSteamHTMLSurfaceCallbacks + 27 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // this is the new browser handle after the restart +STEAM_CALLBACK_MEMBER( 1, HHTMLBrowser, unOldBrowserHandle ) // the handle for the browser before the restart, if your handle was this then switch to using unBrowserHandle for API calls +STEAM_CALLBACK_END(2) + + +#pragma pack( pop ) + + +#endif // ISTEAMHTMLSURFACE_H diff --git a/external/steamworks/public/steam/isteamhttp.h b/external/steamworks/public/steam/isteamhttp.h new file mode 100644 index 0000000..5f69a3f --- /dev/null +++ b/external/steamworks/public/steam/isteamhttp.h @@ -0,0 +1,219 @@ +//====== Copyright © 1996-2009, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to http client +// +//============================================================================= + +#ifndef ISTEAMHTTP_H +#define ISTEAMHTTP_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" +#include "steamhttpenums.h" + +// Handle to a HTTP Request handle +typedef uint32 HTTPRequestHandle; +#define INVALID_HTTPREQUEST_HANDLE 0 + +typedef uint32 HTTPCookieContainerHandle; +#define INVALID_HTTPCOOKIE_HANDLE 0 + +//----------------------------------------------------------------------------- +// Purpose: interface to http client +//----------------------------------------------------------------------------- +class ISteamHTTP +{ +public: + + // Initializes a new HTTP request, returning a handle to use in further operations on it. Requires + // the method (GET or POST) and the absolute URL for the request. Both http and https are supported, + // so this string must start with http:// or https:// and should look like http://store.steampowered.com/app/250/ + // or such. + virtual HTTPRequestHandle CreateHTTPRequest( EHTTPMethod eHTTPRequestMethod, const char *pchAbsoluteURL ) = 0; + + // Set a context value for the request, which will be returned in the HTTPRequestCompleted_t callback after + // sending the request. This is just so the caller can easily keep track of which callbacks go with which request data. + virtual bool SetHTTPRequestContextValue( HTTPRequestHandle hRequest, uint64 ulContextValue ) = 0; + + // Set a timeout in seconds for the HTTP request, must be called prior to sending the request. Default + // timeout is 60 seconds if you don't call this. Returns false if the handle is invalid, or the request + // has already been sent. + virtual bool SetHTTPRequestNetworkActivityTimeout( HTTPRequestHandle hRequest, uint32 unTimeoutSeconds ) = 0; + + // Set a request header value for the request, must be called prior to sending the request. Will + // return false if the handle is invalid or the request is already sent. + virtual bool SetHTTPRequestHeaderValue( HTTPRequestHandle hRequest, const char *pchHeaderName, const char *pchHeaderValue ) = 0; + + // Set a GET or POST parameter value on the request, which is set will depend on the EHTTPMethod specified + // when creating the request. Must be called prior to sending the request. Will return false if the + // handle is invalid or the request is already sent. + virtual bool SetHTTPRequestGetOrPostParameter( HTTPRequestHandle hRequest, const char *pchParamName, const char *pchParamValue ) = 0; + + // Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on + // asynchronous response via callback. + // + // Note: If the user is in offline mode in Steam, then this will add a only-if-cached cache-control + // header and only do a local cache lookup rather than sending any actual remote request. + virtual bool SendHTTPRequest( HTTPRequestHandle hRequest, SteamAPICall_t *pCallHandle ) = 0; + + // Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on + // asynchronous response via callback for completion, and listen for HTTPRequestHeadersReceived_t and + // HTTPRequestDataReceived_t callbacks while streaming. + virtual bool SendHTTPRequestAndStreamResponse( HTTPRequestHandle hRequest, SteamAPICall_t *pCallHandle ) = 0; + + // Defers a request you have sent, the actual HTTP client code may have many requests queued, and this will move + // the specified request to the tail of the queue. Returns false on invalid handle, or if the request is not yet sent. + virtual bool DeferHTTPRequest( HTTPRequestHandle hRequest ) = 0; + + // Prioritizes a request you have sent, the actual HTTP client code may have many requests queued, and this will move + // the specified request to the head of the queue. Returns false on invalid handle, or if the request is not yet sent. + virtual bool PrioritizeHTTPRequest( HTTPRequestHandle hRequest ) = 0; + + // Checks if a response header is present in a HTTP response given a handle from HTTPRequestCompleted_t, also + // returns the size of the header value if present so the caller and allocate a correctly sized buffer for + // GetHTTPResponseHeaderValue. + virtual bool GetHTTPResponseHeaderSize( HTTPRequestHandle hRequest, const char *pchHeaderName, uint32 *unResponseHeaderSize ) = 0; + + // Gets header values from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the + // header is not present or if your buffer is too small to contain it's value. You should first call + // BGetHTTPResponseHeaderSize to check for the presence of the header and to find out the size buffer needed. + virtual bool GetHTTPResponseHeaderValue( HTTPRequestHandle hRequest, const char *pchHeaderName, uint8 *pHeaderValueBuffer, uint32 unBufferSize ) = 0; + + // Gets the size of the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the + // handle is invalid. + virtual bool GetHTTPResponseBodySize( HTTPRequestHandle hRequest, uint32 *unBodySize ) = 0; + + // Gets the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the + // handle is invalid or is to a streaming response, or if the provided buffer is not the correct size. Use BGetHTTPResponseBodySize first to find out + // the correct buffer size to use. + virtual bool GetHTTPResponseBodyData( HTTPRequestHandle hRequest, uint8 *pBodyDataBuffer, uint32 unBufferSize ) = 0; + + // Gets the body data from a streaming HTTP response given a handle from HTTPRequestDataReceived_t. Will return false if the + // handle is invalid or is to a non-streaming response (meaning it wasn't sent with SendHTTPRequestAndStreamResponse), or if the buffer size and offset + // do not match the size and offset sent in HTTPRequestDataReceived_t. + virtual bool GetHTTPStreamingResponseBodyData( HTTPRequestHandle hRequest, uint32 cOffset, uint8 *pBodyDataBuffer, uint32 unBufferSize ) = 0; + + // Releases an HTTP response handle, should always be called to free resources after receiving a HTTPRequestCompleted_t + // callback and finishing using the response. + virtual bool ReleaseHTTPRequest( HTTPRequestHandle hRequest ) = 0; + + // Gets progress on downloading the body for the request. This will be zero unless a response header has already been + // received which included a content-length field. For responses that contain no content-length it will report + // zero for the duration of the request as the size is unknown until the connection closes. + virtual bool GetHTTPDownloadProgressPct( HTTPRequestHandle hRequest, float *pflPercentOut ) = 0; + + // Sets the body for an HTTP Post request. Will fail and return false on a GET request, and will fail if POST params + // have already been set for the request. Setting this raw body makes it the only contents for the post, the pchContentType + // parameter will set the content-type header for the request so the server may know how to interpret the body. + virtual bool SetHTTPRequestRawPostBody( HTTPRequestHandle hRequest, const char *pchContentType, uint8 *pubBody, uint32 unBodyLen ) = 0; + + // Creates a cookie container handle which you must later free with ReleaseCookieContainer(). If bAllowResponsesToModify=true + // than any response to your requests using this cookie container may add new cookies which may be transmitted with + // future requests. If bAllowResponsesToModify=false than only cookies you explicitly set will be sent. This API is just for + // during process lifetime, after steam restarts no cookies are persisted and you have no way to access the cookie container across + // repeat executions of your process. + virtual HTTPCookieContainerHandle CreateCookieContainer( bool bAllowResponsesToModify ) = 0; + + // Release a cookie container you are finished using, freeing it's memory + virtual bool ReleaseCookieContainer( HTTPCookieContainerHandle hCookieContainer ) = 0; + + // Adds a cookie to the specified cookie container that will be used with future requests. + virtual bool SetCookie( HTTPCookieContainerHandle hCookieContainer, const char *pchHost, const char *pchUrl, const char *pchCookie ) = 0; + + // Set the cookie container to use for a HTTP request + virtual bool SetHTTPRequestCookieContainer( HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer ) = 0; + + // Set the extra user agent info for a request, this doesn't clobber the normal user agent, it just adds the extra info on the end + virtual bool SetHTTPRequestUserAgentInfo( HTTPRequestHandle hRequest, const char *pchUserAgentInfo ) = 0; + + // Disable or re-enable verification of SSL/TLS certificates. + // By default, certificates are checked for all HTTPS requests. + virtual bool SetHTTPRequestRequiresVerifiedCertificate( HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate ) = 0; + + // Set an absolute timeout on the HTTP request, this is just a total time timeout different than the network activity timeout + // which can bump everytime we get more data + virtual bool SetHTTPRequestAbsoluteTimeoutMS( HTTPRequestHandle hRequest, uint32 unMilliseconds ) = 0; + + // Check if the reason the request failed was because we timed it out (rather than some harder failure) + virtual bool GetHTTPRequestWasTimedOut( HTTPRequestHandle hRequest, bool *pbWasTimedOut ) = 0; +}; + +#define STEAMHTTP_INTERFACE_VERSION "STEAMHTTP_INTERFACE_VERSION003" + +// Global interface accessor +inline ISteamHTTP *SteamHTTP(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamHTTP *, SteamHTTP, STEAMHTTP_INTERFACE_VERSION ); + +// Global accessor for the gameserver client +inline ISteamHTTP *SteamGameServerHTTP(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamHTTP *, SteamGameServerHTTP, STEAMHTTP_INTERFACE_VERSION ); + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + +struct HTTPRequestCompleted_t +{ + enum { k_iCallback = k_iSteamHTTPCallbacks + 1 }; + + // Handle value for the request that has completed. + HTTPRequestHandle m_hRequest; + + // Context value that the user defined on the request that this callback is associated with, 0 if + // no context value was set. + uint64 m_ulContextValue; + + // This will be true if we actually got any sort of response from the server (even an error). + // It will be false if we failed due to an internal error or client side network failure. + bool m_bRequestSuccessful; + + // Will be the HTTP status code value returned by the server, k_EHTTPStatusCode200OK is the normal + // OK response, if you get something else you probably need to treat it as a failure. + EHTTPStatusCode m_eStatusCode; + + uint32 m_unBodySize; // Same as GetHTTPResponseBodySize() +}; + + +struct HTTPRequestHeadersReceived_t +{ + enum { k_iCallback = k_iSteamHTTPCallbacks + 2 }; + + // Handle value for the request that has received headers. + HTTPRequestHandle m_hRequest; + + // Context value that the user defined on the request that this callback is associated with, 0 if + // no context value was set. + uint64 m_ulContextValue; +}; + +struct HTTPRequestDataReceived_t +{ + enum { k_iCallback = k_iSteamHTTPCallbacks + 3 }; + + // Handle value for the request that has received data. + HTTPRequestHandle m_hRequest; + + // Context value that the user defined on the request that this callback is associated with, 0 if + // no context value was set. + uint64 m_ulContextValue; + + + // Offset to provide to GetHTTPStreamingResponseBodyData to get this chunk of data + uint32 m_cOffset; + + // Size to provide to GetHTTPStreamingResponseBodyData to get this chunk of data + uint32 m_cBytesReceived; +}; + + +#pragma pack( pop ) + +#endif // ISTEAMHTTP_H \ No newline at end of file diff --git a/external/steamworks/public/steam/isteaminput.h b/external/steamworks/public/steam/isteaminput.h new file mode 100644 index 0000000..992f84c --- /dev/null +++ b/external/steamworks/public/steam/isteaminput.h @@ -0,0 +1,1004 @@ +//====== Copyright 1996-2018, Valve Corporation, All rights reserved. ======= +// +// Purpose: Steam Input is a flexible input API that supports over three hundred devices including all +// common variants of Xbox, Playstation, Nintendo Switch Pro, and Steam Controllers. +// For more info including a getting started guide for developers +// please visit: https://partner.steamgames.com/doc/features/steam_controller +// +//============================================================================= + +#ifndef ISTEAMINPUT_H +#define ISTEAMINPUT_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + +#define STEAM_INPUT_MAX_COUNT 16 + +#define STEAM_INPUT_MAX_ANALOG_ACTIONS 24 + +#define STEAM_INPUT_MAX_DIGITAL_ACTIONS 256 + +#define STEAM_INPUT_MAX_ORIGINS 8 + +#define STEAM_INPUT_MAX_ACTIVE_LAYERS 16 + +// When sending an option to a specific controller handle, you can send to all devices via this command +#define STEAM_INPUT_HANDLE_ALL_CONTROLLERS UINT64_MAX + +#define STEAM_INPUT_MIN_ANALOG_ACTION_DATA -1.0f +#define STEAM_INPUT_MAX_ANALOG_ACTION_DATA 1.0f + +enum EInputSourceMode +{ + k_EInputSourceMode_None, + k_EInputSourceMode_Dpad, + k_EInputSourceMode_Buttons, + k_EInputSourceMode_FourButtons, + k_EInputSourceMode_AbsoluteMouse, + k_EInputSourceMode_RelativeMouse, + k_EInputSourceMode_JoystickMove, + k_EInputSourceMode_JoystickMouse, + k_EInputSourceMode_JoystickCamera, + k_EInputSourceMode_ScrollWheel, + k_EInputSourceMode_Trigger, + k_EInputSourceMode_TouchMenu, + k_EInputSourceMode_MouseJoystick, + k_EInputSourceMode_MouseRegion, + k_EInputSourceMode_RadialMenu, + k_EInputSourceMode_SingleButton, + k_EInputSourceMode_Switches +}; + +// Note: Please do not use action origins as a way to identify controller types. There is no +// guarantee that they will be added in a contiguous manner - use GetInputTypeForHandle instead. +// Versions of Steam that add new controller types in the future will extend this enum so if you're +// using a lookup table please check the bounds of any origins returned by Steam. +enum EInputActionOrigin +{ + // Steam Controller + k_EInputActionOrigin_None, + k_EInputActionOrigin_SteamController_A, + k_EInputActionOrigin_SteamController_B, + k_EInputActionOrigin_SteamController_X, + k_EInputActionOrigin_SteamController_Y, + k_EInputActionOrigin_SteamController_LeftBumper, + k_EInputActionOrigin_SteamController_RightBumper, + k_EInputActionOrigin_SteamController_LeftGrip, + k_EInputActionOrigin_SteamController_RightGrip, + k_EInputActionOrigin_SteamController_Start, + k_EInputActionOrigin_SteamController_Back, + k_EInputActionOrigin_SteamController_LeftPad_Touch, + k_EInputActionOrigin_SteamController_LeftPad_Swipe, + k_EInputActionOrigin_SteamController_LeftPad_Click, + k_EInputActionOrigin_SteamController_LeftPad_DPadNorth, + k_EInputActionOrigin_SteamController_LeftPad_DPadSouth, + k_EInputActionOrigin_SteamController_LeftPad_DPadWest, + k_EInputActionOrigin_SteamController_LeftPad_DPadEast, + k_EInputActionOrigin_SteamController_RightPad_Touch, + k_EInputActionOrigin_SteamController_RightPad_Swipe, + k_EInputActionOrigin_SteamController_RightPad_Click, + k_EInputActionOrigin_SteamController_RightPad_DPadNorth, + k_EInputActionOrigin_SteamController_RightPad_DPadSouth, + k_EInputActionOrigin_SteamController_RightPad_DPadWest, + k_EInputActionOrigin_SteamController_RightPad_DPadEast, + k_EInputActionOrigin_SteamController_LeftTrigger_Pull, + k_EInputActionOrigin_SteamController_LeftTrigger_Click, + k_EInputActionOrigin_SteamController_RightTrigger_Pull, + k_EInputActionOrigin_SteamController_RightTrigger_Click, + k_EInputActionOrigin_SteamController_LeftStick_Move, + k_EInputActionOrigin_SteamController_LeftStick_Click, + k_EInputActionOrigin_SteamController_LeftStick_DPadNorth, + k_EInputActionOrigin_SteamController_LeftStick_DPadSouth, + k_EInputActionOrigin_SteamController_LeftStick_DPadWest, + k_EInputActionOrigin_SteamController_LeftStick_DPadEast, + k_EInputActionOrigin_SteamController_Gyro_Move, + k_EInputActionOrigin_SteamController_Gyro_Pitch, + k_EInputActionOrigin_SteamController_Gyro_Yaw, + k_EInputActionOrigin_SteamController_Gyro_Roll, + k_EInputActionOrigin_SteamController_Reserved0, + k_EInputActionOrigin_SteamController_Reserved1, + k_EInputActionOrigin_SteamController_Reserved2, + k_EInputActionOrigin_SteamController_Reserved3, + k_EInputActionOrigin_SteamController_Reserved4, + k_EInputActionOrigin_SteamController_Reserved5, + k_EInputActionOrigin_SteamController_Reserved6, + k_EInputActionOrigin_SteamController_Reserved7, + k_EInputActionOrigin_SteamController_Reserved8, + k_EInputActionOrigin_SteamController_Reserved9, + k_EInputActionOrigin_SteamController_Reserved10, + + // PS4 Dual Shock + k_EInputActionOrigin_PS4_X, + k_EInputActionOrigin_PS4_Circle, + k_EInputActionOrigin_PS4_Triangle, + k_EInputActionOrigin_PS4_Square, + k_EInputActionOrigin_PS4_LeftBumper, + k_EInputActionOrigin_PS4_RightBumper, + k_EInputActionOrigin_PS4_Options, //Start + k_EInputActionOrigin_PS4_Share, //Back + k_EInputActionOrigin_PS4_LeftPad_Touch, + k_EInputActionOrigin_PS4_LeftPad_Swipe, + k_EInputActionOrigin_PS4_LeftPad_Click, + k_EInputActionOrigin_PS4_LeftPad_DPadNorth, + k_EInputActionOrigin_PS4_LeftPad_DPadSouth, + k_EInputActionOrigin_PS4_LeftPad_DPadWest, + k_EInputActionOrigin_PS4_LeftPad_DPadEast, + k_EInputActionOrigin_PS4_RightPad_Touch, + k_EInputActionOrigin_PS4_RightPad_Swipe, + k_EInputActionOrigin_PS4_RightPad_Click, + k_EInputActionOrigin_PS4_RightPad_DPadNorth, + k_EInputActionOrigin_PS4_RightPad_DPadSouth, + k_EInputActionOrigin_PS4_RightPad_DPadWest, + k_EInputActionOrigin_PS4_RightPad_DPadEast, + k_EInputActionOrigin_PS4_CenterPad_Touch, + k_EInputActionOrigin_PS4_CenterPad_Swipe, + k_EInputActionOrigin_PS4_CenterPad_Click, + k_EInputActionOrigin_PS4_CenterPad_DPadNorth, + k_EInputActionOrigin_PS4_CenterPad_DPadSouth, + k_EInputActionOrigin_PS4_CenterPad_DPadWest, + k_EInputActionOrigin_PS4_CenterPad_DPadEast, + k_EInputActionOrigin_PS4_LeftTrigger_Pull, + k_EInputActionOrigin_PS4_LeftTrigger_Click, + k_EInputActionOrigin_PS4_RightTrigger_Pull, + k_EInputActionOrigin_PS4_RightTrigger_Click, + k_EInputActionOrigin_PS4_LeftStick_Move, + k_EInputActionOrigin_PS4_LeftStick_Click, + k_EInputActionOrigin_PS4_LeftStick_DPadNorth, + k_EInputActionOrigin_PS4_LeftStick_DPadSouth, + k_EInputActionOrigin_PS4_LeftStick_DPadWest, + k_EInputActionOrigin_PS4_LeftStick_DPadEast, + k_EInputActionOrigin_PS4_RightStick_Move, + k_EInputActionOrigin_PS4_RightStick_Click, + k_EInputActionOrigin_PS4_RightStick_DPadNorth, + k_EInputActionOrigin_PS4_RightStick_DPadSouth, + k_EInputActionOrigin_PS4_RightStick_DPadWest, + k_EInputActionOrigin_PS4_RightStick_DPadEast, + k_EInputActionOrigin_PS4_DPad_North, + k_EInputActionOrigin_PS4_DPad_South, + k_EInputActionOrigin_PS4_DPad_West, + k_EInputActionOrigin_PS4_DPad_East, + k_EInputActionOrigin_PS4_Gyro_Move, + k_EInputActionOrigin_PS4_Gyro_Pitch, + k_EInputActionOrigin_PS4_Gyro_Yaw, + k_EInputActionOrigin_PS4_Gyro_Roll, + k_EInputActionOrigin_PS4_DPad_Move, + k_EInputActionOrigin_PS4_Reserved1, + k_EInputActionOrigin_PS4_Reserved2, + k_EInputActionOrigin_PS4_Reserved3, + k_EInputActionOrigin_PS4_Reserved4, + k_EInputActionOrigin_PS4_Reserved5, + k_EInputActionOrigin_PS4_Reserved6, + k_EInputActionOrigin_PS4_Reserved7, + k_EInputActionOrigin_PS4_Reserved8, + k_EInputActionOrigin_PS4_Reserved9, + k_EInputActionOrigin_PS4_Reserved10, + + // XBox One + k_EInputActionOrigin_XBoxOne_A, + k_EInputActionOrigin_XBoxOne_B, + k_EInputActionOrigin_XBoxOne_X, + k_EInputActionOrigin_XBoxOne_Y, + k_EInputActionOrigin_XBoxOne_LeftBumper, + k_EInputActionOrigin_XBoxOne_RightBumper, + k_EInputActionOrigin_XBoxOne_Menu, //Start + k_EInputActionOrigin_XBoxOne_View, //Back + k_EInputActionOrigin_XBoxOne_LeftTrigger_Pull, + k_EInputActionOrigin_XBoxOne_LeftTrigger_Click, + k_EInputActionOrigin_XBoxOne_RightTrigger_Pull, + k_EInputActionOrigin_XBoxOne_RightTrigger_Click, + k_EInputActionOrigin_XBoxOne_LeftStick_Move, + k_EInputActionOrigin_XBoxOne_LeftStick_Click, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadNorth, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadSouth, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadWest, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadEast, + k_EInputActionOrigin_XBoxOne_RightStick_Move, + k_EInputActionOrigin_XBoxOne_RightStick_Click, + k_EInputActionOrigin_XBoxOne_RightStick_DPadNorth, + k_EInputActionOrigin_XBoxOne_RightStick_DPadSouth, + k_EInputActionOrigin_XBoxOne_RightStick_DPadWest, + k_EInputActionOrigin_XBoxOne_RightStick_DPadEast, + k_EInputActionOrigin_XBoxOne_DPad_North, + k_EInputActionOrigin_XBoxOne_DPad_South, + k_EInputActionOrigin_XBoxOne_DPad_West, + k_EInputActionOrigin_XBoxOne_DPad_East, + k_EInputActionOrigin_XBoxOne_DPad_Move, + k_EInputActionOrigin_XBoxOne_LeftGrip_Lower, + k_EInputActionOrigin_XBoxOne_LeftGrip_Upper, + k_EInputActionOrigin_XBoxOne_RightGrip_Lower, + k_EInputActionOrigin_XBoxOne_RightGrip_Upper, + k_EInputActionOrigin_XBoxOne_Share, // Xbox Series X controllers only + k_EInputActionOrigin_XBoxOne_Reserved6, + k_EInputActionOrigin_XBoxOne_Reserved7, + k_EInputActionOrigin_XBoxOne_Reserved8, + k_EInputActionOrigin_XBoxOne_Reserved9, + k_EInputActionOrigin_XBoxOne_Reserved10, + + // XBox 360 + k_EInputActionOrigin_XBox360_A, + k_EInputActionOrigin_XBox360_B, + k_EInputActionOrigin_XBox360_X, + k_EInputActionOrigin_XBox360_Y, + k_EInputActionOrigin_XBox360_LeftBumper, + k_EInputActionOrigin_XBox360_RightBumper, + k_EInputActionOrigin_XBox360_Start, //Start + k_EInputActionOrigin_XBox360_Back, //Back + k_EInputActionOrigin_XBox360_LeftTrigger_Pull, + k_EInputActionOrigin_XBox360_LeftTrigger_Click, + k_EInputActionOrigin_XBox360_RightTrigger_Pull, + k_EInputActionOrigin_XBox360_RightTrigger_Click, + k_EInputActionOrigin_XBox360_LeftStick_Move, + k_EInputActionOrigin_XBox360_LeftStick_Click, + k_EInputActionOrigin_XBox360_LeftStick_DPadNorth, + k_EInputActionOrigin_XBox360_LeftStick_DPadSouth, + k_EInputActionOrigin_XBox360_LeftStick_DPadWest, + k_EInputActionOrigin_XBox360_LeftStick_DPadEast, + k_EInputActionOrigin_XBox360_RightStick_Move, + k_EInputActionOrigin_XBox360_RightStick_Click, + k_EInputActionOrigin_XBox360_RightStick_DPadNorth, + k_EInputActionOrigin_XBox360_RightStick_DPadSouth, + k_EInputActionOrigin_XBox360_RightStick_DPadWest, + k_EInputActionOrigin_XBox360_RightStick_DPadEast, + k_EInputActionOrigin_XBox360_DPad_North, + k_EInputActionOrigin_XBox360_DPad_South, + k_EInputActionOrigin_XBox360_DPad_West, + k_EInputActionOrigin_XBox360_DPad_East, + k_EInputActionOrigin_XBox360_DPad_Move, + k_EInputActionOrigin_XBox360_Reserved1, + k_EInputActionOrigin_XBox360_Reserved2, + k_EInputActionOrigin_XBox360_Reserved3, + k_EInputActionOrigin_XBox360_Reserved4, + k_EInputActionOrigin_XBox360_Reserved5, + k_EInputActionOrigin_XBox360_Reserved6, + k_EInputActionOrigin_XBox360_Reserved7, + k_EInputActionOrigin_XBox360_Reserved8, + k_EInputActionOrigin_XBox360_Reserved9, + k_EInputActionOrigin_XBox360_Reserved10, + + + // Switch - Pro or Joycons used as a single input device. + // This does not apply to a single joycon + k_EInputActionOrigin_Switch_A, + k_EInputActionOrigin_Switch_B, + k_EInputActionOrigin_Switch_X, + k_EInputActionOrigin_Switch_Y, + k_EInputActionOrigin_Switch_LeftBumper, + k_EInputActionOrigin_Switch_RightBumper, + k_EInputActionOrigin_Switch_Plus, //Start + k_EInputActionOrigin_Switch_Minus, //Back + k_EInputActionOrigin_Switch_Capture, + k_EInputActionOrigin_Switch_LeftTrigger_Pull, + k_EInputActionOrigin_Switch_LeftTrigger_Click, + k_EInputActionOrigin_Switch_RightTrigger_Pull, + k_EInputActionOrigin_Switch_RightTrigger_Click, + k_EInputActionOrigin_Switch_LeftStick_Move, + k_EInputActionOrigin_Switch_LeftStick_Click, + k_EInputActionOrigin_Switch_LeftStick_DPadNorth, + k_EInputActionOrigin_Switch_LeftStick_DPadSouth, + k_EInputActionOrigin_Switch_LeftStick_DPadWest, + k_EInputActionOrigin_Switch_LeftStick_DPadEast, + k_EInputActionOrigin_Switch_RightStick_Move, + k_EInputActionOrigin_Switch_RightStick_Click, + k_EInputActionOrigin_Switch_RightStick_DPadNorth, + k_EInputActionOrigin_Switch_RightStick_DPadSouth, + k_EInputActionOrigin_Switch_RightStick_DPadWest, + k_EInputActionOrigin_Switch_RightStick_DPadEast, + k_EInputActionOrigin_Switch_DPad_North, + k_EInputActionOrigin_Switch_DPad_South, + k_EInputActionOrigin_Switch_DPad_West, + k_EInputActionOrigin_Switch_DPad_East, + k_EInputActionOrigin_Switch_ProGyro_Move, // Primary Gyro in Pro Controller, or Right JoyCon + k_EInputActionOrigin_Switch_ProGyro_Pitch, // Primary Gyro in Pro Controller, or Right JoyCon + k_EInputActionOrigin_Switch_ProGyro_Yaw, // Primary Gyro in Pro Controller, or Right JoyCon + k_EInputActionOrigin_Switch_ProGyro_Roll, // Primary Gyro in Pro Controller, or Right JoyCon + k_EInputActionOrigin_Switch_DPad_Move, + k_EInputActionOrigin_Switch_Reserved1, + k_EInputActionOrigin_Switch_Reserved2, + k_EInputActionOrigin_Switch_Reserved3, + k_EInputActionOrigin_Switch_Reserved4, + k_EInputActionOrigin_Switch_Reserved5, + k_EInputActionOrigin_Switch_Reserved6, + k_EInputActionOrigin_Switch_Reserved7, + k_EInputActionOrigin_Switch_Reserved8, + k_EInputActionOrigin_Switch_Reserved9, + k_EInputActionOrigin_Switch_Reserved10, + + // Switch JoyCon Specific + k_EInputActionOrigin_Switch_RightGyro_Move, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EInputActionOrigin_Switch_RightGyro_Pitch, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EInputActionOrigin_Switch_RightGyro_Yaw, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EInputActionOrigin_Switch_RightGyro_Roll, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EInputActionOrigin_Switch_LeftGyro_Move, + k_EInputActionOrigin_Switch_LeftGyro_Pitch, + k_EInputActionOrigin_Switch_LeftGyro_Yaw, + k_EInputActionOrigin_Switch_LeftGyro_Roll, + k_EInputActionOrigin_Switch_LeftGrip_Lower, // Left JoyCon SR Button + k_EInputActionOrigin_Switch_LeftGrip_Upper, // Left JoyCon SL Button + k_EInputActionOrigin_Switch_RightGrip_Lower, // Right JoyCon SL Button + k_EInputActionOrigin_Switch_RightGrip_Upper, // Right JoyCon SR Button + k_EInputActionOrigin_Switch_JoyConButton_N, // With a Horizontal JoyCon this will be Y or what would be Dpad Right when vertical + k_EInputActionOrigin_Switch_JoyConButton_E, // X + k_EInputActionOrigin_Switch_JoyConButton_S, // A + k_EInputActionOrigin_Switch_JoyConButton_W, // B + k_EInputActionOrigin_Switch_Reserved15, + k_EInputActionOrigin_Switch_Reserved16, + k_EInputActionOrigin_Switch_Reserved17, + k_EInputActionOrigin_Switch_Reserved18, + k_EInputActionOrigin_Switch_Reserved19, + k_EInputActionOrigin_Switch_Reserved20, + + // Added in SDK 1.51 + k_EInputActionOrigin_PS5_X, + k_EInputActionOrigin_PS5_Circle, + k_EInputActionOrigin_PS5_Triangle, + k_EInputActionOrigin_PS5_Square, + k_EInputActionOrigin_PS5_LeftBumper, + k_EInputActionOrigin_PS5_RightBumper, + k_EInputActionOrigin_PS5_Option, //Start + k_EInputActionOrigin_PS5_Create, //Back + k_EInputActionOrigin_PS5_Mute, + k_EInputActionOrigin_PS5_LeftPad_Touch, + k_EInputActionOrigin_PS5_LeftPad_Swipe, + k_EInputActionOrigin_PS5_LeftPad_Click, + k_EInputActionOrigin_PS5_LeftPad_DPadNorth, + k_EInputActionOrigin_PS5_LeftPad_DPadSouth, + k_EInputActionOrigin_PS5_LeftPad_DPadWest, + k_EInputActionOrigin_PS5_LeftPad_DPadEast, + k_EInputActionOrigin_PS5_RightPad_Touch, + k_EInputActionOrigin_PS5_RightPad_Swipe, + k_EInputActionOrigin_PS5_RightPad_Click, + k_EInputActionOrigin_PS5_RightPad_DPadNorth, + k_EInputActionOrigin_PS5_RightPad_DPadSouth, + k_EInputActionOrigin_PS5_RightPad_DPadWest, + k_EInputActionOrigin_PS5_RightPad_DPadEast, + k_EInputActionOrigin_PS5_CenterPad_Touch, + k_EInputActionOrigin_PS5_CenterPad_Swipe, + k_EInputActionOrigin_PS5_CenterPad_Click, + k_EInputActionOrigin_PS5_CenterPad_DPadNorth, + k_EInputActionOrigin_PS5_CenterPad_DPadSouth, + k_EInputActionOrigin_PS5_CenterPad_DPadWest, + k_EInputActionOrigin_PS5_CenterPad_DPadEast, + k_EInputActionOrigin_PS5_LeftTrigger_Pull, + k_EInputActionOrigin_PS5_LeftTrigger_Click, + k_EInputActionOrigin_PS5_RightTrigger_Pull, + k_EInputActionOrigin_PS5_RightTrigger_Click, + k_EInputActionOrigin_PS5_LeftStick_Move, + k_EInputActionOrigin_PS5_LeftStick_Click, + k_EInputActionOrigin_PS5_LeftStick_DPadNorth, + k_EInputActionOrigin_PS5_LeftStick_DPadSouth, + k_EInputActionOrigin_PS5_LeftStick_DPadWest, + k_EInputActionOrigin_PS5_LeftStick_DPadEast, + k_EInputActionOrigin_PS5_RightStick_Move, + k_EInputActionOrigin_PS5_RightStick_Click, + k_EInputActionOrigin_PS5_RightStick_DPadNorth, + k_EInputActionOrigin_PS5_RightStick_DPadSouth, + k_EInputActionOrigin_PS5_RightStick_DPadWest, + k_EInputActionOrigin_PS5_RightStick_DPadEast, + k_EInputActionOrigin_PS5_DPad_North, + k_EInputActionOrigin_PS5_DPad_South, + k_EInputActionOrigin_PS5_DPad_West, + k_EInputActionOrigin_PS5_DPad_East, + k_EInputActionOrigin_PS5_Gyro_Move, + k_EInputActionOrigin_PS5_Gyro_Pitch, + k_EInputActionOrigin_PS5_Gyro_Yaw, + k_EInputActionOrigin_PS5_Gyro_Roll, + k_EInputActionOrigin_PS5_DPad_Move, + k_EInputActionOrigin_PS5_LeftGrip, + k_EInputActionOrigin_PS5_RightGrip, + k_EInputActionOrigin_PS5_LeftFn, + k_EInputActionOrigin_PS5_RightFn, + k_EInputActionOrigin_PS5_Reserved5, + k_EInputActionOrigin_PS5_Reserved6, + k_EInputActionOrigin_PS5_Reserved7, + k_EInputActionOrigin_PS5_Reserved8, + k_EInputActionOrigin_PS5_Reserved9, + k_EInputActionOrigin_PS5_Reserved10, + k_EInputActionOrigin_PS5_Reserved11, + k_EInputActionOrigin_PS5_Reserved12, + k_EInputActionOrigin_PS5_Reserved13, + k_EInputActionOrigin_PS5_Reserved14, + k_EInputActionOrigin_PS5_Reserved15, + k_EInputActionOrigin_PS5_Reserved16, + k_EInputActionOrigin_PS5_Reserved17, + k_EInputActionOrigin_PS5_Reserved18, + k_EInputActionOrigin_PS5_Reserved19, + k_EInputActionOrigin_PS5_Reserved20, + + // Added in SDK 1.53 + k_EInputActionOrigin_SteamDeck_A, + k_EInputActionOrigin_SteamDeck_B, + k_EInputActionOrigin_SteamDeck_X, + k_EInputActionOrigin_SteamDeck_Y, + k_EInputActionOrigin_SteamDeck_L1, + k_EInputActionOrigin_SteamDeck_R1, + k_EInputActionOrigin_SteamDeck_Menu, + k_EInputActionOrigin_SteamDeck_View, + k_EInputActionOrigin_SteamDeck_LeftPad_Touch, + k_EInputActionOrigin_SteamDeck_LeftPad_Swipe, + k_EInputActionOrigin_SteamDeck_LeftPad_Click, + k_EInputActionOrigin_SteamDeck_LeftPad_DPadNorth, + k_EInputActionOrigin_SteamDeck_LeftPad_DPadSouth, + k_EInputActionOrigin_SteamDeck_LeftPad_DPadWest, + k_EInputActionOrigin_SteamDeck_LeftPad_DPadEast, + k_EInputActionOrigin_SteamDeck_RightPad_Touch, + k_EInputActionOrigin_SteamDeck_RightPad_Swipe, + k_EInputActionOrigin_SteamDeck_RightPad_Click, + k_EInputActionOrigin_SteamDeck_RightPad_DPadNorth, + k_EInputActionOrigin_SteamDeck_RightPad_DPadSouth, + k_EInputActionOrigin_SteamDeck_RightPad_DPadWest, + k_EInputActionOrigin_SteamDeck_RightPad_DPadEast, + k_EInputActionOrigin_SteamDeck_L2_SoftPull, + k_EInputActionOrigin_SteamDeck_L2, + k_EInputActionOrigin_SteamDeck_R2_SoftPull, + k_EInputActionOrigin_SteamDeck_R2, + k_EInputActionOrigin_SteamDeck_LeftStick_Move, + k_EInputActionOrigin_SteamDeck_L3, + k_EInputActionOrigin_SteamDeck_LeftStick_DPadNorth, + k_EInputActionOrigin_SteamDeck_LeftStick_DPadSouth, + k_EInputActionOrigin_SteamDeck_LeftStick_DPadWest, + k_EInputActionOrigin_SteamDeck_LeftStick_DPadEast, + k_EInputActionOrigin_SteamDeck_LeftStick_Touch, + k_EInputActionOrigin_SteamDeck_RightStick_Move, + k_EInputActionOrigin_SteamDeck_R3, + k_EInputActionOrigin_SteamDeck_RightStick_DPadNorth, + k_EInputActionOrigin_SteamDeck_RightStick_DPadSouth, + k_EInputActionOrigin_SteamDeck_RightStick_DPadWest, + k_EInputActionOrigin_SteamDeck_RightStick_DPadEast, + k_EInputActionOrigin_SteamDeck_RightStick_Touch, + k_EInputActionOrigin_SteamDeck_L4, + k_EInputActionOrigin_SteamDeck_R4, + k_EInputActionOrigin_SteamDeck_L5, + k_EInputActionOrigin_SteamDeck_R5, + k_EInputActionOrigin_SteamDeck_DPad_Move, + k_EInputActionOrigin_SteamDeck_DPad_North, + k_EInputActionOrigin_SteamDeck_DPad_South, + k_EInputActionOrigin_SteamDeck_DPad_West, + k_EInputActionOrigin_SteamDeck_DPad_East, + k_EInputActionOrigin_SteamDeck_Gyro_Move, + k_EInputActionOrigin_SteamDeck_Gyro_Pitch, + k_EInputActionOrigin_SteamDeck_Gyro_Yaw, + k_EInputActionOrigin_SteamDeck_Gyro_Roll, + k_EInputActionOrigin_SteamDeck_Reserved1, + k_EInputActionOrigin_SteamDeck_Reserved2, + k_EInputActionOrigin_SteamDeck_Reserved3, + k_EInputActionOrigin_SteamDeck_Reserved4, + k_EInputActionOrigin_SteamDeck_Reserved5, + k_EInputActionOrigin_SteamDeck_Reserved6, + k_EInputActionOrigin_SteamDeck_Reserved7, + k_EInputActionOrigin_SteamDeck_Reserved8, + k_EInputActionOrigin_SteamDeck_Reserved9, + k_EInputActionOrigin_SteamDeck_Reserved10, + k_EInputActionOrigin_SteamDeck_Reserved11, + k_EInputActionOrigin_SteamDeck_Reserved12, + k_EInputActionOrigin_SteamDeck_Reserved13, + k_EInputActionOrigin_SteamDeck_Reserved14, + k_EInputActionOrigin_SteamDeck_Reserved15, + k_EInputActionOrigin_SteamDeck_Reserved16, + k_EInputActionOrigin_SteamDeck_Reserved17, + k_EInputActionOrigin_SteamDeck_Reserved18, + k_EInputActionOrigin_SteamDeck_Reserved19, + k_EInputActionOrigin_SteamDeck_Reserved20, + + k_EInputActionOrigin_Horipad_M1, + k_EInputActionOrigin_Horipad_M2, + k_EInputActionOrigin_Horipad_L4, + k_EInputActionOrigin_Horipad_R4, + + k_EInputActionOrigin_Count, // If Steam has added support for new controllers origins will go here. + k_EInputActionOrigin_MaximumPossibleValue = 32767, // Origins are currently a maximum of 16 bits. +}; + +enum EXboxOrigin +{ + k_EXboxOrigin_A, + k_EXboxOrigin_B, + k_EXboxOrigin_X, + k_EXboxOrigin_Y, + k_EXboxOrigin_LeftBumper, + k_EXboxOrigin_RightBumper, + k_EXboxOrigin_Menu, //Start + k_EXboxOrigin_View, //Back + k_EXboxOrigin_LeftTrigger_Pull, + k_EXboxOrigin_LeftTrigger_Click, + k_EXboxOrigin_RightTrigger_Pull, + k_EXboxOrigin_RightTrigger_Click, + k_EXboxOrigin_LeftStick_Move, + k_EXboxOrigin_LeftStick_Click, + k_EXboxOrigin_LeftStick_DPadNorth, + k_EXboxOrigin_LeftStick_DPadSouth, + k_EXboxOrigin_LeftStick_DPadWest, + k_EXboxOrigin_LeftStick_DPadEast, + k_EXboxOrigin_RightStick_Move, + k_EXboxOrigin_RightStick_Click, + k_EXboxOrigin_RightStick_DPadNorth, + k_EXboxOrigin_RightStick_DPadSouth, + k_EXboxOrigin_RightStick_DPadWest, + k_EXboxOrigin_RightStick_DPadEast, + k_EXboxOrigin_DPad_North, + k_EXboxOrigin_DPad_South, + k_EXboxOrigin_DPad_West, + k_EXboxOrigin_DPad_East, + k_EXboxOrigin_Count, +}; + +enum ESteamControllerPad +{ + k_ESteamControllerPad_Left, + k_ESteamControllerPad_Right +}; + +enum EControllerHapticLocation +{ + k_EControllerHapticLocation_Left = ( 1 << k_ESteamControllerPad_Left ), + k_EControllerHapticLocation_Right = ( 1 << k_ESteamControllerPad_Right ), + k_EControllerHapticLocation_Both = ( 1 << k_ESteamControllerPad_Left | 1 << k_ESteamControllerPad_Right ), +}; + +enum EControllerHapticType +{ + k_EControllerHapticType_Off, + k_EControllerHapticType_Tick, + k_EControllerHapticType_Click, +}; + +enum ESteamInputType +{ + k_ESteamInputType_Unknown, + k_ESteamInputType_SteamController, + k_ESteamInputType_XBox360Controller, + k_ESteamInputType_XBoxOneController, + k_ESteamInputType_GenericGamepad, // DirectInput controllers + k_ESteamInputType_PS4Controller, + k_ESteamInputType_AppleMFiController, // Unused + k_ESteamInputType_AndroidController, // Unused + k_ESteamInputType_SwitchJoyConPair, // Unused + k_ESteamInputType_SwitchJoyConSingle, // Unused + k_ESteamInputType_SwitchProController, + k_ESteamInputType_MobileTouch, // Steam Link App On-screen Virtual Controller + k_ESteamInputType_PS3Controller, // Currently uses PS4 Origins + k_ESteamInputType_PS5Controller, // Added in SDK 151 + k_ESteamInputType_SteamDeckController, // Added in SDK 153 + k_ESteamInputType_Count, + k_ESteamInputType_MaximumPossibleValue = 255, +}; + +// Individual values are used by the GetSessionInputConfigurationSettings bitmask +enum ESteamInputConfigurationEnableType +{ + k_ESteamInputConfigurationEnableType_None = 0x0000, + k_ESteamInputConfigurationEnableType_Playstation = 0x0001, + k_ESteamInputConfigurationEnableType_Xbox = 0x0002, + k_ESteamInputConfigurationEnableType_Generic = 0x0004, + k_ESteamInputConfigurationEnableType_Switch = 0x0008, +}; + +// These values are passed into SetLEDColor +enum ESteamInputLEDFlag +{ + k_ESteamInputLEDFlag_SetColor, + // Restore the LED color to the user's preference setting as set in the controller personalization menu. + // This also happens automatically on exit of your game. + k_ESteamInputLEDFlag_RestoreUserDefault +}; + +// These values are passed into GetGlyphPNGForActionOrigin +enum ESteamInputGlyphSize +{ + k_ESteamInputGlyphSize_Small, // 32x32 pixels + k_ESteamInputGlyphSize_Medium, // 128x128 pixels + k_ESteamInputGlyphSize_Large, // 256x256 pixels + k_ESteamInputGlyphSize_Count, +}; + +enum ESteamInputGlyphStyle +{ + // Base-styles - cannot mix + ESteamInputGlyphStyle_Knockout = 0x0, // Face buttons will have colored labels/outlines on a knocked out background + // Rest of inputs will have white detail/borders on a knocked out background + ESteamInputGlyphStyle_Light = 0x1, // Black detail/borders on a white background + ESteamInputGlyphStyle_Dark = 0x2, // White detail/borders on a black background + + // Modifiers + // Default ABXY/PS equivalent glyphs have a solid fill w/ color matching the physical buttons on the device + ESteamInputGlyphStyle_NeutralColorABXY = 0x10, // ABXY Buttons will match the base style color instead of their normal associated color + ESteamInputGlyphStyle_SolidABXY = 0x20, // ABXY Buttons will have a solid fill +}; + +enum ESteamInputActionEventType +{ + ESteamInputActionEventType_DigitalAction, + ESteamInputActionEventType_AnalogAction, +}; + +// InputHandle_t is used to refer to a specific controller. +// This handle will consistently identify a controller, even if it is disconnected and re-connected +typedef uint64 InputHandle_t; + +// These handles are used to refer to a specific in-game action or action set +// All action handles should be queried during initialization for performance reasons +typedef uint64 InputActionSetHandle_t; +typedef uint64 InputDigitalActionHandle_t; +typedef uint64 InputAnalogActionHandle_t; + +#pragma pack( push, 1 ) + +struct InputAnalogActionData_t +{ + // Type of data coming from this action, this will match what got specified in the action set + EInputSourceMode eMode; + + // The current state of this action; will be delta updates for mouse actions + float x, y; + + // Whether or not this action is currently available to be bound in the active action set + bool bActive; +}; + +struct InputDigitalActionData_t +{ + // The current state of this action; will be true if currently pressed + bool bState; + + // Whether or not this action is currently available to be bound in the active action set + bool bActive; +}; + +struct InputMotionData_t +{ + // Gyro Quaternion: + // Absolute rotation of the controller since wakeup, using the Accelerometer reading at startup to determine the first value. + // This means real world "up" is know, but heading is not known. + // Every rotation packet is integrated using sensor time delta, and that change is used to update this quaternion. + // A Quaternion Identity ( x:0, y:0, z:0, w:1 ) will be sent in the first few packets while the controller's IMU is still waking up; + // some controllers have a short "warmup" period before these values should be used. + + // After the first time GetMotionData is called per controller handle, the IMU will be active until your app is closed. + // The exception is the Sony Dualshock, which will stay on until the controller has been turned off. + + // Filtering: When rotating the controller at low speeds, low level noise is filtered out without noticeable latency. High speed movement is always unfiltered. + // Drift: Gyroscopic "Drift" can be fixed using the Steam Input "Gyro Calibration" button. Users will have to be informed of this feature. + float rotQuatX; + float rotQuatY; + float rotQuatZ; + float rotQuatW; + + // Positional acceleration + // This represents only the latest hardware packet's state. + // Values range from -SHRT_MAX..SHRT_MAX + // This represents -2G..+2G along each axis + float posAccelX; // +tive when controller's Right hand side is pointed toward the sky. + float posAccelY; // +tive when controller's charging port (forward side of controller) is pointed toward the sky. + float posAccelZ; // +tive when controller's sticks point toward the sky. + + // Angular velocity + // Values range from -SHRT_MAX..SHRT_MAX + // These values map to a real world range of -2000..+2000 degrees per second on each axis (SDL standard) + // This represents only the latest hardware packet's state. + float rotVelX; // Local Pitch + float rotVelY; // Local Roll + float rotVelZ; // Local Yaw +}; + +//----------------------------------------------------------------------------- +// Purpose: when callbacks are enabled this fires each time a controller action +// state changes +//----------------------------------------------------------------------------- +struct SteamInputActionEvent_t +{ + InputHandle_t controllerHandle; + ESteamInputActionEventType eEventType; + struct AnalogAction_t { + InputAnalogActionHandle_t actionHandle; + InputAnalogActionData_t analogActionData; + }; + struct DigitalAction_t { + InputDigitalActionHandle_t actionHandle; + InputDigitalActionData_t digitalActionData; + }; + union { + AnalogAction_t analogAction; + DigitalAction_t digitalAction; + }; +}; + +//----------------------------------------------------------------------------- +// Forward declaration for ScePadTriggerEffectParam, defined in isteamdualsense.h +//----------------------------------------------------------------------------- +struct ScePadTriggerEffectParam; + +#pragma pack( pop ) + +typedef void ( *SteamInputActionEventCallbackPointer )( SteamInputActionEvent_t * ); + +//----------------------------------------------------------------------------- +// Purpose: Steam Input API +//----------------------------------------------------------------------------- +class ISteamInput +{ +public: + + // Init and Shutdown must be called when starting/ending use of this interface. + // if bExplicitlyCallRunFrame is called then you will need to manually call RunFrame + // each frame, otherwise Steam Input will updated when SteamAPI_RunCallbacks() is called + virtual bool Init( bool bExplicitlyCallRunFrame ) = 0; + virtual bool Shutdown() = 0; + + // Set the absolute path to the Input Action Manifest file containing the in-game actions + // and file paths to the official configurations. Used in games that bundle Steam Input + // configurations inside of the game depot instead of using the Steam Workshop + virtual bool SetInputActionManifestFilePath( const char *pchInputActionManifestAbsolutePath ) = 0; + + // Synchronize API state with the latest Steam Input action data available. This + // is performed automatically by SteamAPI_RunCallbacks, but for the absolute lowest + // possible latency, you call this directly before reading controller state. + // Note: This must be called from somewhere before GetConnectedControllers will + // return any handles + virtual void RunFrame( bool bReservedValue = true ) = 0; + + // Waits on an IPC event from Steam sent when there is new data to be fetched from + // the data drop. Returns true when data was recievied before the timeout expires. + // Useful for games with a dedicated input thread + virtual bool BWaitForData( bool bWaitForever, uint32 unTimeout ) = 0; + + // Returns true if new data has been received since the last time action data was accessed + // via GetDigitalActionData or GetAnalogActionData. The game will still need to call + // SteamInput()->RunFrame() or SteamAPI_RunCallbacks() before this to update the data stream + virtual bool BNewDataAvailable() = 0; + + // Enumerate currently connected Steam Input enabled devices - developers can opt in controller by type (ex: Xbox/Playstation/etc) via + // the Steam Input settings in the Steamworks site or users can opt-in in their controller settings in Steam. + // handlesOut should point to a STEAM_INPUT_MAX_COUNT sized array of InputHandle_t handles + // Returns the number of handles written to handlesOut + virtual int GetConnectedControllers( STEAM_OUT_ARRAY_COUNT( STEAM_INPUT_MAX_COUNT, Receives list of connected controllers ) InputHandle_t *handlesOut ) = 0; + + //----------------------------------------------------------------------------- + // CALLBACKS + //----------------------------------------------------------------------------- + + // Controller configuration loaded - these callbacks will always fire if you have + // a handler. Note: this is called within either SteamInput()->RunFrame or by SteamAPI_RunCallbacks + STEAM_CALL_BACK( SteamInputConfigurationLoaded_t ) + + // Enable SteamInputDeviceConnected_t and SteamInputDeviceDisconnected_t callbacks. + // Each controller that is already connected will generate a device connected + // callback when you enable them + virtual void EnableDeviceCallbacks() = 0; + + // Controller Connected - provides info about a single newly connected controller + // Note: this is called within either SteamInput()->RunFrame or by SteamAPI_RunCallbacks + STEAM_CALL_BACK( SteamInputDeviceConnected_t ) + + // Controller Disconnected - provides info about a single disconnected controller + // Note: this is called within either SteamInput()->RunFrame or by SteamAPI_RunCallbacks + STEAM_CALL_BACK( SteamInputDeviceDisconnected_t ) + + // Controllers using Gamepad emulation (XInput, DirectInput, etc) will be seated in the order that + // input is sent by the device. This callback will fire on first input for each device and when the + // a user has manually changed the order via the Steam overlay. This also has the device type info + // so that you can change out glyph sets without making additional API calls + STEAM_CALL_BACK( SteamInputGamepadSlotChange_t ) + + // Enable SteamInputActionEvent_t callbacks. Directly calls your callback function + // for lower latency than standard Steam callbacks. Supports one callback at a time. + // Note: this is called within either SteamInput()->RunFrame or by SteamAPI_RunCallbacks + virtual void EnableActionEventCallbacks( SteamInputActionEventCallbackPointer pCallback ) = 0; + + //----------------------------------------------------------------------------- + // ACTION SETS + //----------------------------------------------------------------------------- + + // Lookup the handle for an Action Set. Best to do this once on startup, and store the handles for all future API calls. + virtual InputActionSetHandle_t GetActionSetHandle( const char *pszActionSetName ) = 0; + + // Reconfigure the controller to use the specified action set (ie 'Menu', 'Walk' or 'Drive') + // This is cheap, and can be safely called repeatedly. It's often easier to repeatedly call it in + // your state loops, instead of trying to place it in all of your state transitions. + virtual void ActivateActionSet( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle ) = 0; + virtual InputActionSetHandle_t GetCurrentActionSet( InputHandle_t inputHandle ) = 0; + + // ACTION SET LAYERS + virtual void ActivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) = 0; + virtual void DeactivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) = 0; + virtual void DeactivateAllActionSetLayers( InputHandle_t inputHandle ) = 0; + + // Enumerate currently active layers. + // handlesOut should point to a STEAM_INPUT_MAX_ACTIVE_LAYERS sized array of InputActionSetHandle_t handles + // Returns the number of handles written to handlesOut + virtual int GetActiveActionSetLayers( InputHandle_t inputHandle, STEAM_OUT_ARRAY_COUNT( STEAM_INPUT_MAX_ACTIVE_LAYERS, Receives list of active layers ) InputActionSetHandle_t *handlesOut ) = 0; + + //----------------------------------------------------------------------------- + // ACTIONS + //----------------------------------------------------------------------------- + + // Lookup the handle for a digital action. Best to do this once on startup, and store the handles for all future API calls. + virtual InputDigitalActionHandle_t GetDigitalActionHandle( const char *pszActionName ) = 0; + + // Returns the current state of the supplied digital game action + virtual InputDigitalActionData_t GetDigitalActionData( InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ) = 0; + + // Get the origin(s) for a digital action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action. + // originsOut should point to a STEAM_INPUT_MAX_ORIGINS sized array of EInputActionOrigin handles. The EInputActionOrigin enum will get extended as support for new controller controllers gets added to + // the Steam client and will exceed the values from this header, please check bounds if you are using a look up table. + virtual int GetDigitalActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, STEAM_OUT_ARRAY_COUNT( STEAM_INPUT_MAX_ORIGINS, Receives list of action origins ) EInputActionOrigin *originsOut ) = 0; + + // Returns a localized string (from Steam's language setting) for the user-facing action name corresponding to the specified handle + virtual const char *GetStringForDigitalActionName( InputDigitalActionHandle_t eActionHandle ) = 0; + + // Lookup the handle for an analog action. Best to do this once on startup, and store the handles for all future API calls. + virtual InputAnalogActionHandle_t GetAnalogActionHandle( const char *pszActionName ) = 0; + + // Returns the current state of these supplied analog game action + virtual InputAnalogActionData_t GetAnalogActionData( InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ) = 0; + + // Get the origin(s) for an analog action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action. + // originsOut should point to a STEAM_INPUT_MAX_ORIGINS sized array of EInputActionOrigin handles. The EInputActionOrigin enum will get extended as support for new controller controllers gets added to + // the Steam client and will exceed the values from this header, please check bounds if you are using a look up table. + virtual int GetAnalogActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, STEAM_OUT_ARRAY_COUNT( STEAM_INPUT_MAX_ORIGINS, Receives list of action origins ) EInputActionOrigin *originsOut ) = 0; + + // Get a local path to a PNG file for the provided origin's glyph. + virtual const char *GetGlyphPNGForActionOrigin( EInputActionOrigin eOrigin, ESteamInputGlyphSize eSize, uint32 unFlags ) = 0; + + // Get a local path to a SVG file for the provided origin's glyph. + virtual const char *GetGlyphSVGForActionOrigin( EInputActionOrigin eOrigin, uint32 unFlags ) = 0; + + // Get a local path to an older, Big Picture Mode-style PNG file for a particular origin + virtual const char *GetGlyphForActionOrigin_Legacy( EInputActionOrigin eOrigin ) = 0; + + // Returns a localized string (from Steam's language setting) for the specified origin. + virtual const char *GetStringForActionOrigin( EInputActionOrigin eOrigin ) = 0; + + // Returns a localized string (from Steam's language setting) for the user-facing action name corresponding to the specified handle + virtual const char *GetStringForAnalogActionName( InputAnalogActionHandle_t eActionHandle ) = 0; + + // Stop analog momentum for the action if it is a mouse action in trackball mode + virtual void StopAnalogActionMomentum( InputHandle_t inputHandle, InputAnalogActionHandle_t eAction ) = 0; + + // Returns raw motion data from the specified device + virtual InputMotionData_t GetMotionData( InputHandle_t inputHandle ) = 0; + + //----------------------------------------------------------------------------- + // OUTPUTS + //----------------------------------------------------------------------------- + + // Trigger a vibration event on supported controllers - Steam will translate these commands into haptic pulses for Steam Controllers + virtual void TriggerVibration( InputHandle_t inputHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed ) = 0; + + // Trigger a vibration event on supported controllers including Xbox trigger impulse rumble - Steam will translate these commands into haptic pulses for Steam Controllers + virtual void TriggerVibrationExtended( InputHandle_t inputHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed, unsigned short usLeftTriggerSpeed, unsigned short usRightTriggerSpeed ) = 0; + + // Send a haptic pulse, works on Steam Deck and Steam Controller devices + virtual void TriggerSimpleHapticEvent( InputHandle_t inputHandle, EControllerHapticLocation eHapticLocation, uint8 nIntensity, char nGainDB, uint8 nOtherIntensity, char nOtherGainDB ) = 0; + + // Set the controller LED color on supported controllers. nFlags is a bitmask of values from ESteamInputLEDFlag - 0 will default to setting a color. Steam will handle + // the behavior on exit of your program so you don't need to try restore the default as you are shutting down + virtual void SetLEDColor( InputHandle_t inputHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ) = 0; + + // Trigger a haptic pulse on a Steam Controller - if you are approximating rumble you may want to use TriggerVibration instead. + // Good uses for Haptic pulses include chimes, noises, or directional gameplay feedback (taking damage, footstep locations, etc). + virtual void Legacy_TriggerHapticPulse( InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec ) = 0; + + // Trigger a haptic pulse with a duty cycle of usDurationMicroSec / usOffMicroSec, unRepeat times. If you are approximating rumble you may want to use TriggerVibration instead. + // nFlags is currently unused and reserved for future use. + virtual void Legacy_TriggerRepeatedHapticPulse( InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags ) = 0; + + //----------------------------------------------------------------------------- + // Utility functions available without using the rest of Steam Input API + //----------------------------------------------------------------------------- + + // Invokes the Steam overlay and brings up the binding screen if the user is using Big Picture Mode + // If the user is not in Big Picture Mode it will open up the binding in a new window + virtual bool ShowBindingPanel( InputHandle_t inputHandle ) = 0; + + // Returns the input type for a particular handle - unlike EInputActionOrigin which update with Steam and may return unrecognized values + // ESteamInputType will remain static and only return valid values from your SDK version + virtual ESteamInputType GetInputTypeForHandle( InputHandle_t inputHandle ) = 0; + + // Returns the associated controller handle for the specified emulated gamepad - can be used with the above 2 functions + // to identify controllers presented to your game over Xinput. Returns 0 if the Xinput index isn't associated with Steam Input + virtual InputHandle_t GetControllerForGamepadIndex( int nIndex ) = 0; + + // Returns the associated gamepad index for the specified controller, if emulating a gamepad or -1 if not associated with an Xinput index + virtual int GetGamepadIndexForController( InputHandle_t ulinputHandle ) = 0; + + // Returns a localized string (from Steam's language setting) for the specified Xbox controller origin. + virtual const char *GetStringForXboxOrigin( EXboxOrigin eOrigin ) = 0; + + // Get a local path to art for on-screen glyph for a particular Xbox controller origin + virtual const char *GetGlyphForXboxOrigin( EXboxOrigin eOrigin ) = 0; + + // Get the equivalent ActionOrigin for a given Xbox controller origin this can be chained with GetGlyphForActionOrigin to provide future proof glyphs for + // non-Steam Input API action games. Note - this only translates the buttons directly and doesn't take into account any remapping a user has made in their configuration + virtual EInputActionOrigin GetActionOriginFromXboxOrigin( InputHandle_t inputHandle, EXboxOrigin eOrigin ) = 0; + + // Convert an origin to another controller type - for inputs not present on the other controller type this will return k_EInputActionOrigin_None + // When a new input type is added you will be able to pass in k_ESteamInputType_Unknown and the closest origin that your version of the SDK recognized will be returned + // ex: if a Playstation 5 controller was released this function would return Playstation 4 origins. + virtual EInputActionOrigin TranslateActionOrigin( ESteamInputType eDestinationInputType, EInputActionOrigin eSourceOrigin ) = 0; + + // Get the binding revision for a given device. Returns false if the handle was not valid or if a mapping is not yet loaded for the device + virtual bool GetDeviceBindingRevision( InputHandle_t inputHandle, int *pMajor, int *pMinor ) = 0; + + // Get the Steam Remote Play session ID associated with a device, or 0 if there is no session associated with it + // See isteamremoteplay.h for more information on Steam Remote Play sessions + virtual uint32 GetRemotePlaySessionID( InputHandle_t inputHandle ) = 0; + + // Get a bitmask of the Steam Input Configuration types opted in for the current session. Returns ESteamInputConfigurationEnableType values. + // Note: user can override the settings from the Steamworks Partner site so the returned values may not exactly match your default configuration + virtual uint16 GetSessionInputConfigurationSettings() = 0; + + // Set the trigger effect for a DualSense controller + virtual void SetDualSenseTriggerEffect( InputHandle_t inputHandle, const ScePadTriggerEffectParam *pParam ) = 0; +}; + +#define STEAMINPUT_INTERFACE_VERSION "SteamInput006" + +// Global interface accessor +inline ISteamInput *SteamInput(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamInput *, SteamInput, STEAMINPUT_INTERFACE_VERSION ); + +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + +//----------------------------------------------------------------------------- +// Purpose: called when a new controller has been connected, will fire once +// per controller if multiple new controllers connect in the same frame +//----------------------------------------------------------------------------- +struct SteamInputDeviceConnected_t +{ + enum { k_iCallback = k_iSteamControllerCallbacks + 1 }; + InputHandle_t m_ulConnectedDeviceHandle; // Handle for device +}; + +//----------------------------------------------------------------------------- +// Purpose: called when a new controller has been connected, will fire once +// per controller if multiple new controllers connect in the same frame +//----------------------------------------------------------------------------- +struct SteamInputDeviceDisconnected_t +{ + enum { k_iCallback = k_iSteamControllerCallbacks + 2 }; + InputHandle_t m_ulDisconnectedDeviceHandle; // Handle for device +}; + +//----------------------------------------------------------------------------- +// Purpose: called when a controller configuration has been loaded, will fire once +// per controller per focus change for Steam Input enabled controllers +//----------------------------------------------------------------------------- +struct SteamInputConfigurationLoaded_t +{ + enum { k_iCallback = k_iSteamControllerCallbacks + 3 }; + AppId_t m_unAppID; + InputHandle_t m_ulDeviceHandle; // Handle for device + CSteamID m_ulMappingCreator; // May differ from local user when using + // an unmodified community or official config + uint32 m_unMajorRevision; // Binding revision from In-game Action File. + // Same value as queried by GetDeviceBindingRevision + uint32 m_unMinorRevision; + bool m_bUsesSteamInputAPI; // Does the configuration contain any Analog/Digital actions? + bool m_bUsesGamepadAPI; // Does the configuration contain any Xinput bindings? +}; + +//----------------------------------------------------------------------------- +// Purpose: called when controller gamepad slots change - on Linux/macOS these +// slots are shared for all running apps. +//----------------------------------------------------------------------------- +struct SteamInputGamepadSlotChange_t +{ + enum { k_iCallback = k_iSteamControllerCallbacks + 4 }; + AppId_t m_unAppID; + InputHandle_t m_ulDeviceHandle; // Handle for device + ESteamInputType m_eDeviceType; // Type of device + int m_nOldGamepadSlot; // Previous GamepadSlot - can be -1 controller doesn't uses gamepad bindings + int m_nNewGamepadSlot; // New Gamepad Slot - can be -1 controller doesn't uses gamepad bindings +}; + +#pragma pack( pop ) + +#endif // ISTEAMINPUT_H diff --git a/external/steamworks/public/steam/isteaminventory.h b/external/steamworks/public/steam/isteaminventory.h new file mode 100644 index 0000000..2b388ed --- /dev/null +++ b/external/steamworks/public/steam/isteaminventory.h @@ -0,0 +1,435 @@ +//====== Copyright © 1996-2014 Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to Steam Inventory +// +//============================================================================= + +#ifndef ISTEAMINVENTORY_H +#define ISTEAMINVENTORY_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + + +// Every individual instance of an item has a globally-unique ItemInstanceID. +// This ID is unique to the combination of (player, specific item instance) +// and will not be transferred to another player or re-used for another item. +typedef uint64 SteamItemInstanceID_t; + +static const SteamItemInstanceID_t k_SteamItemInstanceIDInvalid = (SteamItemInstanceID_t)~0; + +// Types of items in your game are identified by a 32-bit "item definition number". +// Valid definition numbers are between 1 and 999999999; numbers less than or equal to +// zero are invalid, and numbers greater than or equal to one billion (1x10^9) are +// reserved for internal Steam use. +typedef int32 SteamItemDef_t; + + +enum ESteamItemFlags +{ + // Item status flags - these flags are permanently attached to specific item instances + k_ESteamItemNoTrade = 1 << 0, // This item is account-locked and cannot be traded or given away. + + // Action confirmation flags - these flags are set one time only, as part of a result set + k_ESteamItemRemoved = 1 << 8, // The item has been destroyed, traded away, expired, or otherwise invalidated + k_ESteamItemConsumed = 1 << 9, // The item quantity has been decreased by 1 via ConsumeItem API. + + // All other flag bits are currently reserved for internal Steam use at this time. + // Do not assume anything about the state of other flags which are not defined here. +}; + +struct SteamItemDetails_t +{ + SteamItemInstanceID_t m_itemId; + SteamItemDef_t m_iDefinition; + uint16 m_unQuantity; + uint16 m_unFlags; // see ESteamItemFlags +}; + +typedef int32 SteamInventoryResult_t; + +static const SteamInventoryResult_t k_SteamInventoryResultInvalid = -1; + +typedef uint64 SteamInventoryUpdateHandle_t; +const SteamInventoryUpdateHandle_t k_SteamInventoryUpdateHandleInvalid = 0xffffffffffffffffull; + +//----------------------------------------------------------------------------- +// Purpose: Steam Inventory query and manipulation API +//----------------------------------------------------------------------------- +class ISteamInventory +{ +public: + + // INVENTORY ASYNC RESULT MANAGEMENT + // + // Asynchronous inventory queries always output a result handle which can be used with + // GetResultStatus, GetResultItems, etc. A SteamInventoryResultReady_t callback will + // be triggered when the asynchronous result becomes ready (or fails). + // + + // Find out the status of an asynchronous inventory result handle. Possible values: + // k_EResultPending - still in progress + // k_EResultOK - done, result ready + // k_EResultExpired - done, result ready, maybe out of date (see DeserializeResult) + // k_EResultInvalidParam - ERROR: invalid API call parameters + // k_EResultServiceUnavailable - ERROR: service temporarily down, you may retry later + // k_EResultLimitExceeded - ERROR: operation would exceed per-user inventory limits + // k_EResultFail - ERROR: unknown / generic error + virtual EResult GetResultStatus( SteamInventoryResult_t resultHandle ) = 0; + + // Copies the contents of a result set into a flat array. The specific + // contents of the result set depend on which query which was used. + virtual bool GetResultItems( SteamInventoryResult_t resultHandle, + STEAM_OUT_ARRAY_COUNT( punOutItemsArraySize,Output array) SteamItemDetails_t *pOutItemsArray, + uint32 *punOutItemsArraySize ) = 0; + + // In combination with GetResultItems, you can use GetResultItemProperty to retrieve + // dynamic string properties for a given item returned in the result set. + // + // Property names are always composed of ASCII letters, numbers, and/or underscores. + // + // Pass a NULL pointer for pchPropertyName to get a comma - separated list of available + // property names. + // + // If pchValueBuffer is NULL, *punValueBufferSize will contain the + // suggested buffer size. Otherwise it will be the number of bytes actually copied + // to pchValueBuffer. If the results do not fit in the given buffer, partial + // results may be copied. + virtual bool GetResultItemProperty( SteamInventoryResult_t resultHandle, + uint32 unItemIndex, + const char *pchPropertyName, + STEAM_OUT_STRING_COUNT( punValueBufferSizeOut ) char *pchValueBuffer, uint32 *punValueBufferSizeOut ) = 0; + + // Returns the server time at which the result was generated. Compare against + // the value of IClientUtils::GetServerRealTime() to determine age. + virtual uint32 GetResultTimestamp( SteamInventoryResult_t resultHandle ) = 0; + + // Returns true if the result belongs to the target steam ID, false if the + // result does not. This is important when using DeserializeResult, to verify + // that a remote player is not pretending to have a different user's inventory. + virtual bool CheckResultSteamID( SteamInventoryResult_t resultHandle, CSteamID steamIDExpected ) = 0; + + // Destroys a result handle and frees all associated memory. + virtual void DestroyResult( SteamInventoryResult_t resultHandle ) = 0; + + + // INVENTORY ASYNC QUERY + // + + // Captures the entire state of the current user's Steam inventory. + // You must call DestroyResult on this handle when you are done with it. + // Returns false and sets *pResultHandle to zero if inventory is unavailable. + // Note: calls to this function are subject to rate limits and may return + // cached results if called too frequently. It is suggested that you call + // this function only when you are about to display the user's full inventory, + // or if you expect that the inventory may have changed. + virtual bool GetAllItems( SteamInventoryResult_t *pResultHandle ) = 0; + + + // Captures the state of a subset of the current user's Steam inventory, + // identified by an array of item instance IDs. The results from this call + // can be serialized and passed to other players to "prove" that the current + // user owns specific items, without exposing the user's entire inventory. + // For example, you could call GetItemsByID with the IDs of the user's + // currently equipped cosmetic items and serialize this to a buffer, and + // then transmit this buffer to other players upon joining a game. + virtual bool GetItemsByID( SteamInventoryResult_t *pResultHandle, STEAM_ARRAY_COUNT( unCountInstanceIDs ) const SteamItemInstanceID_t *pInstanceIDs, uint32 unCountInstanceIDs ) = 0; + + + // RESULT SERIALIZATION AND AUTHENTICATION + // + // Serialized result sets contain a short signature which can't be forged + // or replayed across different game sessions. A result set can be serialized + // on the local client, transmitted to other players via your game networking, + // and deserialized by the remote players. This is a secure way of preventing + // hackers from lying about posessing rare/high-value items. + + // Serializes a result set with signature bytes to an output buffer. Pass + // NULL as an output buffer to get the required size via punOutBufferSize. + // The size of a serialized result depends on the number items which are being + // serialized. When securely transmitting items to other players, it is + // recommended to use "GetItemsByID" first to create a minimal result set. + // Results have a built-in timestamp which will be considered "expired" after + // an hour has elapsed. See DeserializeResult for expiration handling. + virtual bool SerializeResult( SteamInventoryResult_t resultHandle, STEAM_OUT_BUFFER_COUNT(punOutBufferSize) void *pOutBuffer, uint32 *punOutBufferSize ) = 0; + + // Deserializes a result set and verifies the signature bytes. Returns false + // if bRequireFullOnlineVerify is set but Steam is running in Offline mode. + // Otherwise returns true and then delivers error codes via GetResultStatus. + // + // The bRESERVED_MUST_BE_FALSE flag is reserved for future use and should not + // be set to true by your game at this time. + // + // DeserializeResult has a potential soft-failure mode where the handle status + // is set to k_EResultExpired. GetResultItems() still succeeds in this mode. + // The "expired" result could indicate that the data may be out of date - not + // just due to timed expiration (one hour), but also because one of the items + // in the result set may have been traded or consumed since the result set was + // generated. You could compare the timestamp from GetResultTimestamp() to + // ISteamUtils::GetServerRealTime() to determine how old the data is. You could + // simply ignore the "expired" result code and continue as normal, or you + // could challenge the player with expired data to send an updated result set. + virtual bool DeserializeResult( SteamInventoryResult_t *pOutResultHandle, STEAM_BUFFER_COUNT(punOutBufferSize) const void *pBuffer, uint32 unBufferSize, bool bRESERVED_MUST_BE_FALSE = false ) = 0; + + + // INVENTORY ASYNC MODIFICATION + // + + // GenerateItems() creates one or more items and then generates a SteamInventoryCallback_t + // notification with a matching nCallbackContext parameter. This API is only intended + // for prototyping - it is only usable by Steam accounts that belong to the publisher group + // for your game. + // If punArrayQuantity is not NULL, it should be the same length as pArrayItems and should + // describe the quantity of each item to generate. + virtual bool GenerateItems( SteamInventoryResult_t *pResultHandle, STEAM_ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, STEAM_ARRAY_COUNT(unArrayLength) const uint32 *punArrayQuantity, uint32 unArrayLength ) = 0; + + // GrantPromoItems() checks the list of promotional items for which the user may be eligible + // and grants the items (one time only). On success, the result set will include items which + // were granted, if any. If no items were granted because the user isn't eligible for any + // promotions, this is still considered a success. + virtual bool GrantPromoItems( SteamInventoryResult_t *pResultHandle ) = 0; + + // AddPromoItem() / AddPromoItems() are restricted versions of GrantPromoItems(). Instead of + // scanning for all eligible promotional items, the check is restricted to a single item + // definition or set of item definitions. This can be useful if your game has custom UI for + // showing a specific promo item to the user. + virtual bool AddPromoItem( SteamInventoryResult_t *pResultHandle, SteamItemDef_t itemDef ) = 0; + virtual bool AddPromoItems( SteamInventoryResult_t *pResultHandle, STEAM_ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, uint32 unArrayLength ) = 0; + + // ConsumeItem() removes items from the inventory, permanently. They cannot be recovered. + // Not for the faint of heart - if your game implements item removal at all, a high-friction + // UI confirmation process is highly recommended. + virtual bool ConsumeItem( SteamInventoryResult_t *pResultHandle, SteamItemInstanceID_t itemConsume, uint32 unQuantity ) = 0; + + // ExchangeItems() is an atomic combination of item generation and consumption. + // It can be used to implement crafting recipes or transmutations, or items which unpack + // themselves into other items (e.g., a chest). + // Exchange recipes are defined in the ItemDef, and explicitly list the required item + // types and resulting generated type. + // Exchange recipes are evaluated atomically by the Inventory Service; if the supplied + // components do not match the recipe, or do not contain sufficient quantity, the + // exchange will fail. + virtual bool ExchangeItems( SteamInventoryResult_t *pResultHandle, + STEAM_ARRAY_COUNT(unArrayGenerateLength) const SteamItemDef_t *pArrayGenerate, STEAM_ARRAY_COUNT(unArrayGenerateLength) const uint32 *punArrayGenerateQuantity, uint32 unArrayGenerateLength, + STEAM_ARRAY_COUNT(unArrayDestroyLength) const SteamItemInstanceID_t *pArrayDestroy, STEAM_ARRAY_COUNT(unArrayDestroyLength) const uint32 *punArrayDestroyQuantity, uint32 unArrayDestroyLength ) = 0; + + + // TransferItemQuantity() is intended for use with items which are "stackable" (can have + // quantity greater than one). It can be used to split a stack into two, or to transfer + // quantity from one stack into another stack of identical items. To split one stack into + // two, pass k_SteamItemInstanceIDInvalid for itemIdDest and a new item will be generated. + virtual bool TransferItemQuantity( SteamInventoryResult_t *pResultHandle, SteamItemInstanceID_t itemIdSource, uint32 unQuantity, SteamItemInstanceID_t itemIdDest ) = 0; + + + // TIMED DROPS AND PLAYTIME CREDIT + // + + // Deprecated. Calling this method is not required for proper playtime accounting. + virtual void SendItemDropHeartbeat() = 0; + + // Playtime credit must be consumed and turned into item drops by your game. Only item + // definitions which are marked as "playtime item generators" can be spawned. The call + // will return an empty result set if there is not enough playtime credit for a drop. + // Your game should call TriggerItemDrop at an appropriate time for the user to receive + // new items, such as between rounds or while the player is dead. Note that players who + // hack their clients could modify the value of "dropListDefinition", so do not use it + // to directly control rarity. + // See your Steamworks configuration to set playtime drop rates for individual itemdefs. + // The client library will suppress too-frequent calls to this method. + virtual bool TriggerItemDrop( SteamInventoryResult_t *pResultHandle, SteamItemDef_t dropListDefinition ) = 0; + + + // Deprecated. This method is not supported. + virtual bool TradeItems( SteamInventoryResult_t *pResultHandle, CSteamID steamIDTradePartner, + STEAM_ARRAY_COUNT(nArrayGiveLength) const SteamItemInstanceID_t *pArrayGive, STEAM_ARRAY_COUNT(nArrayGiveLength) const uint32 *pArrayGiveQuantity, uint32 nArrayGiveLength, + STEAM_ARRAY_COUNT(nArrayGetLength) const SteamItemInstanceID_t *pArrayGet, STEAM_ARRAY_COUNT(nArrayGetLength) const uint32 *pArrayGetQuantity, uint32 nArrayGetLength ) = 0; + + + // ITEM DEFINITIONS + // + // Item definitions are a mapping of "definition IDs" (integers between 1 and 1000000) + // to a set of string properties. Some of these properties are required to display items + // on the Steam community web site. Other properties can be defined by applications. + // Use of these functions is optional; there is no reason to call LoadItemDefinitions + // if your game hardcodes the numeric definition IDs (eg, purple face mask = 20, blue + // weapon mod = 55) and does not allow for adding new item types without a client patch. + // + + // LoadItemDefinitions triggers the automatic load and refresh of item definitions. + // Every time new item definitions are available (eg, from the dynamic addition of new + // item types while players are still in-game), a SteamInventoryDefinitionUpdate_t + // callback will be fired. + virtual bool LoadItemDefinitions() = 0; + + // GetItemDefinitionIDs returns the set of all defined item definition IDs (which are + // defined via Steamworks configuration, and not necessarily contiguous integers). + // If pItemDefIDs is null, the call will return true and *punItemDefIDsArraySize will + // contain the total size necessary for a subsequent call. Otherwise, the call will + // return false if and only if there is not enough space in the output array. + virtual bool GetItemDefinitionIDs( + STEAM_OUT_ARRAY_COUNT(punItemDefIDsArraySize,List of item definition IDs) SteamItemDef_t *pItemDefIDs, + STEAM_DESC(Size of array is passed in and actual size used is returned in this param) uint32 *punItemDefIDsArraySize ) = 0; + + // GetItemDefinitionProperty returns a string property from a given item definition. + // Note that some properties (for example, "name") may be localized and will depend + // on the current Steam language settings (see ISteamApps::GetCurrentGameLanguage). + // Property names are always composed of ASCII letters, numbers, and/or underscores. + // Pass a NULL pointer for pchPropertyName to get a comma - separated list of available + // property names. If pchValueBuffer is NULL, *punValueBufferSize will contain the + // suggested buffer size. Otherwise it will be the number of bytes actually copied + // to pchValueBuffer. If the results do not fit in the given buffer, partial + // results may be copied. + virtual bool GetItemDefinitionProperty( SteamItemDef_t iDefinition, const char *pchPropertyName, + STEAM_OUT_STRING_COUNT(punValueBufferSizeOut) char *pchValueBuffer, uint32 *punValueBufferSizeOut ) = 0; + + // Request the list of "eligible" promo items that can be manually granted to the given + // user. These are promo items of type "manual" that won't be granted automatically. + // An example usage of this is an item that becomes available every week. + STEAM_CALL_RESULT( SteamInventoryEligiblePromoItemDefIDs_t ) + virtual SteamAPICall_t RequestEligiblePromoItemDefinitionsIDs( CSteamID steamID ) = 0; + + // After handling a SteamInventoryEligiblePromoItemDefIDs_t call result, use this + // function to pull out the list of item definition ids that the user can be + // manually granted via the AddPromoItems() call. + virtual bool GetEligiblePromoItemDefinitionIDs( + CSteamID steamID, + STEAM_OUT_ARRAY_COUNT(punItemDefIDsArraySize,List of item definition IDs) SteamItemDef_t *pItemDefIDs, + STEAM_DESC(Size of array is passed in and actual size used is returned in this param) uint32 *punItemDefIDsArraySize ) = 0; + + // Starts the purchase process for the given item definitions. The callback SteamInventoryStartPurchaseResult_t + // will be posted if Steam was able to initialize the transaction. + // + // Once the purchase has been authorized and completed by the user, the callback SteamInventoryResultReady_t + // will be posted. + STEAM_CALL_RESULT( SteamInventoryStartPurchaseResult_t ) + virtual SteamAPICall_t StartPurchase( STEAM_ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, STEAM_ARRAY_COUNT(unArrayLength) const uint32 *punArrayQuantity, uint32 unArrayLength ) = 0; + + // Request current prices for all applicable item definitions + STEAM_CALL_RESULT( SteamInventoryRequestPricesResult_t ) + virtual SteamAPICall_t RequestPrices() = 0; + + // Returns the number of items with prices. Need to call RequestPrices() first. + virtual uint32 GetNumItemsWithPrices() = 0; + + // Returns item definition ids and their prices in the user's local currency. + // Need to call RequestPrices() first. + virtual bool GetItemsWithPrices( STEAM_ARRAY_COUNT(unArrayLength) STEAM_OUT_ARRAY_COUNT(pArrayItemDefs, Items with prices) SteamItemDef_t *pArrayItemDefs, + STEAM_ARRAY_COUNT(unArrayLength) STEAM_OUT_ARRAY_COUNT(pPrices, List of prices for the given item defs) uint64 *pCurrentPrices, + STEAM_ARRAY_COUNT(unArrayLength) STEAM_OUT_ARRAY_COUNT(pPrices, List of prices for the given item defs) uint64 *pBasePrices, + uint32 unArrayLength ) = 0; + + // Retrieves the price for the item definition id + // Returns false if there is no price stored for the item definition. + virtual bool GetItemPrice( SteamItemDef_t iDefinition, uint64 *pCurrentPrice, uint64 *pBasePrice ) = 0; + + // Create a request to update properties on items + virtual SteamInventoryUpdateHandle_t StartUpdateProperties() = 0; + // Remove the property on the item + virtual bool RemoveProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName ) = 0; + // Accessor methods to set properties on items + + STEAM_FLAT_NAME( SetPropertyString ) + virtual bool SetProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName, const char *pchPropertyValue ) = 0; + + STEAM_FLAT_NAME( SetPropertyBool ) + virtual bool SetProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName, bool bValue ) = 0; + + STEAM_FLAT_NAME( SetPropertyInt64 ) + virtual bool SetProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName, int64 nValue ) = 0; + + STEAM_FLAT_NAME( SetPropertyFloat ) + virtual bool SetProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName, float flValue ) = 0; + + // Submit the update request by handle + virtual bool SubmitUpdateProperties( SteamInventoryUpdateHandle_t handle, SteamInventoryResult_t * pResultHandle ) = 0; + + virtual bool InspectItem( SteamInventoryResult_t *pResultHandle, const char *pchItemToken ) = 0; +}; + +#define STEAMINVENTORY_INTERFACE_VERSION "STEAMINVENTORY_INTERFACE_V003" + +// Global interface accessor +inline ISteamInventory *SteamInventory(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamInventory *, SteamInventory, STEAMINVENTORY_INTERFACE_VERSION ); + +// Global accessor for the gameserver client +inline ISteamInventory *SteamGameServerInventory(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamInventory *, SteamGameServerInventory, STEAMINVENTORY_INTERFACE_VERSION ); + +// SteamInventoryResultReady_t callbacks are fired whenever asynchronous +// results transition from "Pending" to "OK" or an error state. There will +// always be exactly one callback per handle. +struct SteamInventoryResultReady_t +{ + enum { k_iCallback = k_iSteamInventoryCallbacks + 0 }; + SteamInventoryResult_t m_handle; + EResult m_result; +}; + + +// SteamInventoryFullUpdate_t callbacks are triggered when GetAllItems +// successfully returns a result which is newer / fresher than the last +// known result. (It will not trigger if the inventory hasn't changed, +// or if results from two overlapping calls are reversed in flight and +// the earlier result is already known to be stale/out-of-date.) +// The normal ResultReady callback will still be triggered immediately +// afterwards; this is an additional notification for your convenience. +struct SteamInventoryFullUpdate_t +{ + enum { k_iCallback = k_iSteamInventoryCallbacks + 1 }; + SteamInventoryResult_t m_handle; +}; + + +// A SteamInventoryDefinitionUpdate_t callback is triggered whenever +// item definitions have been updated, which could be in response to +// LoadItemDefinitions() or any other async request which required +// a definition update in order to process results from the server. +struct SteamInventoryDefinitionUpdate_t +{ + enum { k_iCallback = k_iSteamInventoryCallbacks + 2 }; +}; + +// Returned +struct SteamInventoryEligiblePromoItemDefIDs_t +{ + enum { k_iCallback = k_iSteamInventoryCallbacks + 3 }; + EResult m_result; + CSteamID m_steamID; + int m_numEligiblePromoItemDefs; + bool m_bCachedData; // indicates that the data was retrieved from the cache and not the server +}; + +// Triggered from StartPurchase call +struct SteamInventoryStartPurchaseResult_t +{ + enum { k_iCallback = k_iSteamInventoryCallbacks + 4 }; + EResult m_result; + uint64 m_ulOrderID; + uint64 m_ulTransID; +}; + + +// Triggered from RequestPrices +struct SteamInventoryRequestPricesResult_t +{ + enum { k_iCallback = k_iSteamInventoryCallbacks + 5 }; + EResult m_result; + char m_rgchCurrency[4]; +}; + +#pragma pack( pop ) + + +#endif // ISTEAMCONTROLLER_H diff --git a/external/steamworks/public/steam/isteammatchmaking.h b/external/steamworks/public/steam/isteammatchmaking.h new file mode 100644 index 0000000..6bcba11 --- /dev/null +++ b/external/steamworks/public/steam/isteammatchmaking.h @@ -0,0 +1,1067 @@ +//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to steam managing game server/client match making +// +//============================================================================= + +#ifndef ISTEAMMATCHMAKING +#define ISTEAMMATCHMAKING +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" +#include "matchmakingtypes.h" +#include "isteamfriends.h" + +// lobby type description +enum ELobbyType +{ + k_ELobbyTypePrivate = 0, // only way to join the lobby is to invite to someone else + k_ELobbyTypeFriendsOnly = 1, // shows for friends or invitees, but not in lobby list + k_ELobbyTypePublic = 2, // visible for friends and in lobby list + k_ELobbyTypeInvisible = 3, // returned by search, but not visible to other friends + // useful if you want a user in two lobbies, for example matching groups together + // a user can be in only one regular lobby, and up to two invisible lobbies + k_ELobbyTypePrivateUnique = 4, // private, unique and does not delete when empty - only one of these may exist per unique keypair set + // can only create from webapi +}; + +// lobby search filter tools +enum ELobbyComparison +{ + k_ELobbyComparisonEqualToOrLessThan = -2, + k_ELobbyComparisonLessThan = -1, + k_ELobbyComparisonEqual = 0, + k_ELobbyComparisonGreaterThan = 1, + k_ELobbyComparisonEqualToOrGreaterThan = 2, + k_ELobbyComparisonNotEqual = 3, +}; + +// lobby search distance. Lobby results are sorted from closest to farthest. +enum ELobbyDistanceFilter +{ + k_ELobbyDistanceFilterClose, // only lobbies in the same immediate region will be returned + k_ELobbyDistanceFilterDefault, // only lobbies in the same region or near by regions + k_ELobbyDistanceFilterFar, // for games that don't have many latency requirements, will return lobbies about half-way around the globe + k_ELobbyDistanceFilterWorldwide, // no filtering, will match lobbies as far as India to NY (not recommended, expect multiple seconds of latency between the clients) +}; + +// maximum number of characters a lobby metadata key can be +#define k_nMaxLobbyKeyLength 255 + +//----------------------------------------------------------------------------- +// Purpose: Functions for match making services for clients to get to favorites +// and to operate on game lobbies. +//----------------------------------------------------------------------------- +class ISteamMatchmaking +{ +public: + // game server favorites storage + // saves basic details about a multiplayer game server locally + + // returns the number of favorites servers the user has stored + virtual int GetFavoriteGameCount() = 0; + + // returns the details of the game server + // iGame is of range [0,GetFavoriteGameCount()) + // *pnIP, *pnConnPort are filled in the with IP:port of the game server + // *punFlags specify whether the game server was stored as an explicit favorite or in the history of connections + // *pRTime32LastPlayedOnServer is filled in the with the Unix time the favorite was added + virtual bool GetFavoriteGame( int iGame, AppId_t *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer ) = 0; + + // adds the game server to the local list; updates the time played of the server if it already exists in the list + virtual int AddFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) = 0; + + // removes the game server from the local storage; returns true if one was removed + virtual bool RemoveFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ) = 0; + + /////// + // Game lobby functions + + // Get a list of relevant lobbies + // this is an asynchronous request + // results will be returned by LobbyMatchList_t callback & call result, with the number of lobbies found + // this will never return lobbies that are full + // to add more filter, the filter calls below need to be call before each and every RequestLobbyList() call + // use the CCallResult<> object in steam_api.h to match the SteamAPICall_t call result to a function in an object, e.g. + /* + class CMyLobbyListManager + { + CCallResult m_CallResultLobbyMatchList; + void FindLobbies() + { + // SteamMatchmaking()->AddRequestLobbyListFilter*() functions would be called here, before RequestLobbyList() + SteamAPICall_t hSteamAPICall = SteamMatchmaking()->RequestLobbyList(); + m_CallResultLobbyMatchList.Set( hSteamAPICall, this, &CMyLobbyListManager::OnLobbyMatchList ); + } + + void OnLobbyMatchList( LobbyMatchList_t *pLobbyMatchList, bool bIOFailure ) + { + // lobby list has be retrieved from Steam back-end, use results + } + } + */ + // + STEAM_CALL_RESULT( LobbyMatchList_t ) + virtual SteamAPICall_t RequestLobbyList() = 0; + // filters for lobbies + // this needs to be called before RequestLobbyList() to take effect + // these are cleared on each call to RequestLobbyList() + virtual void AddRequestLobbyListStringFilter( const char *pchKeyToMatch, const char *pchValueToMatch, ELobbyComparison eComparisonType ) = 0; + // numerical comparison + virtual void AddRequestLobbyListNumericalFilter( const char *pchKeyToMatch, int nValueToMatch, ELobbyComparison eComparisonType ) = 0; + // returns results closest to the specified value. Multiple near filters can be added, with early filters taking precedence + virtual void AddRequestLobbyListNearValueFilter( const char *pchKeyToMatch, int nValueToBeCloseTo ) = 0; + // returns only lobbies with the specified number of slots available + virtual void AddRequestLobbyListFilterSlotsAvailable( int nSlotsAvailable ) = 0; + // sets the distance for which we should search for lobbies (based on users IP address to location map on the Steam backed) + virtual void AddRequestLobbyListDistanceFilter( ELobbyDistanceFilter eLobbyDistanceFilter ) = 0; + // sets how many results to return, the lower the count the faster it is to download the lobby results & details to the client + virtual void AddRequestLobbyListResultCountFilter( int cMaxResults ) = 0; + + virtual void AddRequestLobbyListCompatibleMembersFilter( CSteamID steamIDLobby ) = 0; + + // returns the CSteamID of a lobby, as retrieved by a RequestLobbyList call + // should only be called after a LobbyMatchList_t callback is received + // iLobby is of the range [0, LobbyMatchList_t::m_nLobbiesMatching) + // the returned CSteamID::IsValid() will be false if iLobby is out of range + virtual CSteamID GetLobbyByIndex( int iLobby ) = 0; + + // Create a lobby on the Steam servers. + // If private, then the lobby will not be returned by any RequestLobbyList() call; the CSteamID + // of the lobby will need to be communicated via game channels or via InviteUserToLobby() + // this is an asynchronous request + // results will be returned by LobbyCreated_t callback and call result; lobby is joined & ready to use at this point + // a LobbyEnter_t callback will also be received (since the local user is joining their own lobby) + STEAM_CALL_RESULT( LobbyCreated_t ) + virtual SteamAPICall_t CreateLobby( ELobbyType eLobbyType, int cMaxMembers ) = 0; + + // Joins an existing lobby + // this is an asynchronous request + // results will be returned by LobbyEnter_t callback & call result, check m_EChatRoomEnterResponse to see if was successful + // lobby metadata is available to use immediately on this call completing + STEAM_CALL_RESULT( LobbyEnter_t ) + virtual SteamAPICall_t JoinLobby( CSteamID steamIDLobby ) = 0; + + // Leave a lobby; this will take effect immediately on the client side + // other users in the lobby will be notified by a LobbyChatUpdate_t callback + virtual void LeaveLobby( CSteamID steamIDLobby ) = 0; + + // Invite another user to the lobby + // the target user will receive a LobbyInvite_t callback + // will return true if the invite is successfully sent, whether or not the target responds + // returns false if the local user is not connected to the Steam servers + // if the other user clicks the join link, a GameLobbyJoinRequested_t will be posted if the user is in-game, + // or if the game isn't running yet the game will be launched with the parameter +connect_lobby <64-bit lobby id> + virtual bool InviteUserToLobby( CSteamID steamIDLobby, CSteamID steamIDInvitee ) = 0; + + // Lobby iteration, for viewing details of users in a lobby + // only accessible if the lobby user is a member of the specified lobby + // persona information for other lobby members (name, avatar, etc.) will be asynchronously received + // and accessible via ISteamFriends interface + + // returns the number of users in the specified lobby + virtual int GetNumLobbyMembers( CSteamID steamIDLobby ) = 0; + // returns the CSteamID of a user in the lobby + // iMember is of range [0,GetNumLobbyMembers()) + // note that the current user must be in a lobby to retrieve CSteamIDs of other users in that lobby + virtual CSteamID GetLobbyMemberByIndex( CSteamID steamIDLobby, int iMember ) = 0; + + // Get data associated with this lobby + // takes a simple key, and returns the string associated with it + // "" will be returned if no value is set, or if steamIDLobby is invalid + virtual const char *GetLobbyData( CSteamID steamIDLobby, const char *pchKey ) = 0; + // Sets a key/value pair in the lobby metadata + // each user in the lobby will be broadcast this new value, and any new users joining will receive any existing data + // this can be used to set lobby names, map, etc. + // to reset a key, just set it to "" + // other users in the lobby will receive notification of the lobby data change via a LobbyDataUpdate_t callback + virtual bool SetLobbyData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0; + + // returns the number of metadata keys set on the specified lobby + virtual int GetLobbyDataCount( CSteamID steamIDLobby ) = 0; + + // returns a lobby metadata key/values pair by index, of range [0, GetLobbyDataCount()) + virtual bool GetLobbyDataByIndex( CSteamID steamIDLobby, int iLobbyData, char *pchKey, int cchKeyBufferSize, char *pchValue, int cchValueBufferSize ) = 0; + + // removes a metadata key from the lobby + virtual bool DeleteLobbyData( CSteamID steamIDLobby, const char *pchKey ) = 0; + + // Gets per-user metadata for someone in this lobby + virtual const char *GetLobbyMemberData( CSteamID steamIDLobby, CSteamID steamIDUser, const char *pchKey ) = 0; + // Sets per-user metadata (for the local user implicitly) + virtual void SetLobbyMemberData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0; + + // Broadcasts a chat message to the all the users in the lobby + // users in the lobby (including the local user) will receive a LobbyChatMsg_t callback + // returns true if the message is successfully sent + // pvMsgBody can be binary or text data, up to 4k + // if pvMsgBody is text, cubMsgBody should be strlen( text ) + 1, to include the null terminator + virtual bool SendLobbyChatMsg( CSteamID steamIDLobby, const void *pvMsgBody, int cubMsgBody ) = 0; + // Get a chat message as specified in a LobbyChatMsg_t callback + // iChatID is the LobbyChatMsg_t::m_iChatID value in the callback + // *pSteamIDUser is filled in with the CSteamID of the member + // *pvData is filled in with the message itself + // return value is the number of bytes written into the buffer + virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, STEAM_OUT_STRUCT() CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0; + + // Refreshes metadata for a lobby you're not necessarily in right now + // you never do this for lobbies you're a member of, only if your + // this will send down all the metadata associated with a lobby + // this is an asynchronous call + // returns false if the local user is not connected to the Steam servers + // results will be returned by a LobbyDataUpdate_t callback + // if the specified lobby doesn't exist, LobbyDataUpdate_t::m_bSuccess will be set to false + virtual bool RequestLobbyData( CSteamID steamIDLobby ) = 0; + + // sets the game server associated with the lobby + // usually at this point, the users will join the specified game server + // either the IP/Port or the steamID of the game server has to be valid, depending on how you want the clients to be able to connect + virtual void SetLobbyGameServer( CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, CSteamID steamIDGameServer ) = 0; + // returns the details of a game server set in a lobby - returns false if there is no game server set, or that lobby doesn't exist + virtual bool GetLobbyGameServer( CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, STEAM_OUT_STRUCT() CSteamID *psteamIDGameServer ) = 0; + + // set the limit on the # of users who can join the lobby + virtual bool SetLobbyMemberLimit( CSteamID steamIDLobby, int cMaxMembers ) = 0; + // returns the current limit on the # of users who can join the lobby; returns 0 if no limit is defined + virtual int GetLobbyMemberLimit( CSteamID steamIDLobby ) = 0; + + // updates which type of lobby it is + // only lobbies that are k_ELobbyTypePublic or k_ELobbyTypeInvisible, and are set to joinable, will be returned by RequestLobbyList() calls + virtual bool SetLobbyType( CSteamID steamIDLobby, ELobbyType eLobbyType ) = 0; + + // sets whether or not a lobby is joinable - defaults to true for a new lobby + // if set to false, no user can join, even if they are a friend or have been invited + virtual bool SetLobbyJoinable( CSteamID steamIDLobby, bool bLobbyJoinable ) = 0; + + // returns the current lobby owner + // you must be a member of the lobby to access this + // there always one lobby owner - if the current owner leaves, another user will become the owner + // it is possible (bur rare) to join a lobby just as the owner is leaving, thus entering a lobby with self as the owner + virtual CSteamID GetLobbyOwner( CSteamID steamIDLobby ) = 0; + + // changes who the lobby owner is + // you must be the lobby owner for this to succeed, and steamIDNewOwner must be in the lobby + // after completion, the local user will no longer be the owner + virtual bool SetLobbyOwner( CSteamID steamIDLobby, CSteamID steamIDNewOwner ) = 0; + + // link two lobbies for the purposes of checking player compatibility + // you must be the lobby owner of both lobbies + virtual bool SetLinkedLobby( CSteamID steamIDLobby, CSteamID steamIDLobbyDependent ) = 0; +}; +#define STEAMMATCHMAKING_INTERFACE_VERSION "SteamMatchMaking009" + +// Global interface accessor +inline ISteamMatchmaking *SteamMatchmaking(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamMatchmaking *, SteamMatchmaking, STEAMMATCHMAKING_INTERFACE_VERSION ); + +//----------------------------------------------------------------------------- +// Callback interfaces for server list functions (see ISteamMatchmakingServers below) +// +// The idea here is that your game code implements objects that implement these +// interfaces to receive callback notifications after calling asynchronous functions +// inside the ISteamMatchmakingServers() interface below. +// +// This is different than normal Steam callback handling due to the potentially +// large size of server lists. +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Typedef for handle type you will receive when requesting server list. +//----------------------------------------------------------------------------- +typedef void* HServerListRequest; + +//----------------------------------------------------------------------------- +// Purpose: Callback interface for receiving responses after a server list refresh +// or an individual server update. +// +// Since you get these callbacks after requesting full list refreshes you will +// usually implement this interface inside an object like CServerBrowser. If that +// object is getting destructed you should use ISteamMatchMakingServers()->CancelQuery() +// to cancel any in-progress queries so you don't get a callback into the destructed +// object and crash. +//----------------------------------------------------------------------------- +class ISteamMatchmakingServerListResponse +{ +public: + // Server has responded ok with updated data + virtual void ServerResponded( HServerListRequest hRequest, int iServer ) = 0; + + // Server has failed to respond + virtual void ServerFailedToRespond( HServerListRequest hRequest, int iServer ) = 0; + + // A list refresh you had initiated is now 100% completed + virtual void RefreshComplete( HServerListRequest hRequest, EMatchMakingServerResponse response ) = 0; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Callback interface for receiving responses after pinging an individual server +// +// These callbacks all occur in response to querying an individual server +// via the ISteamMatchmakingServers()->PingServer() call below. If you are +// destructing an object that implements this interface then you should call +// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query +// which is in progress. Failure to cancel in progress queries when destructing +// a callback handler may result in a crash when a callback later occurs. +//----------------------------------------------------------------------------- +class ISteamMatchmakingPingResponse +{ +public: + // Server has responded successfully and has updated data + virtual void ServerResponded( gameserveritem_t &server ) = 0; + + // Server failed to respond to the ping request + virtual void ServerFailedToRespond() = 0; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Callback interface for receiving responses after requesting details on +// who is playing on a particular server. +// +// These callbacks all occur in response to querying an individual server +// via the ISteamMatchmakingServers()->PlayerDetails() call below. If you are +// destructing an object that implements this interface then you should call +// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query +// which is in progress. Failure to cancel in progress queries when destructing +// a callback handler may result in a crash when a callback later occurs. +//----------------------------------------------------------------------------- +class ISteamMatchmakingPlayersResponse +{ +public: + // Got data on a new player on the server -- you'll get this callback once per player + // on the server which you have requested player data on. + virtual void AddPlayerToList( const char *pchName, int nScore, float flTimePlayed ) = 0; + + // The server failed to respond to the request for player details + virtual void PlayersFailedToRespond() = 0; + + // The server has finished responding to the player details request + // (ie, you won't get anymore AddPlayerToList callbacks) + virtual void PlayersRefreshComplete() = 0; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Callback interface for receiving responses after requesting rules +// details on a particular server. +// +// These callbacks all occur in response to querying an individual server +// via the ISteamMatchmakingServers()->ServerRules() call below. If you are +// destructing an object that implements this interface then you should call +// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query +// which is in progress. Failure to cancel in progress queries when destructing +// a callback handler may result in a crash when a callback later occurs. +//----------------------------------------------------------------------------- +class ISteamMatchmakingRulesResponse +{ +public: + // Got data on a rule on the server -- you'll get one of these per rule defined on + // the server you are querying + virtual void RulesResponded( const char *pchRule, const char *pchValue ) = 0; + + // The server failed to respond to the request for rule details + virtual void RulesFailedToRespond() = 0; + + // The server has finished responding to the rule details request + // (ie, you won't get anymore RulesResponded callbacks) + virtual void RulesRefreshComplete() = 0; +}; + + +//----------------------------------------------------------------------------- +// Typedef for handle type you will receive when querying details on an individual server. +//----------------------------------------------------------------------------- +typedef int HServerQuery; +const int HSERVERQUERY_INVALID = 0xffffffff; + +//----------------------------------------------------------------------------- +// Purpose: Functions for match making services for clients to get to game lists and details +//----------------------------------------------------------------------------- +class ISteamMatchmakingServers +{ +public: + // Request a new list of servers of a particular type. These calls each correspond to one of the EMatchMakingType values. + // Each call allocates a new asynchronous request object. + // Request object must be released by calling ReleaseRequest( hServerListRequest ) + virtual HServerListRequest RequestInternetServerList( AppId_t iApp, STEAM_ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestLANServerList( AppId_t iApp, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestFriendsServerList( AppId_t iApp, STEAM_ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestFavoritesServerList( AppId_t iApp, STEAM_ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestHistoryServerList( AppId_t iApp, STEAM_ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestSpectatorServerList( AppId_t iApp, STEAM_ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + + // Releases the asynchronous request object and cancels any pending query on it if there's a pending query in progress. + // RefreshComplete callback is not posted when request is released. + virtual void ReleaseRequest( HServerListRequest hServerListRequest ) = 0; + + /* the filter operation codes that go in the key part of MatchMakingKeyValuePair_t should be one of these: + + "map" + - Server passes the filter if the server is playing the specified map. + "gamedataand" + - Server passes the filter if the server's game data (ISteamGameServer::SetGameData) contains all of the + specified strings. The value field is a comma-delimited list of strings to match. + "gamedataor" + - Server passes the filter if the server's game data (ISteamGameServer::SetGameData) contains at least one of the + specified strings. The value field is a comma-delimited list of strings to match. + "gamedatanor" + - Server passes the filter if the server's game data (ISteamGameServer::SetGameData) does not contain any + of the specified strings. The value field is a comma-delimited list of strings to check. + "gametagsand" + - Server passes the filter if the server's game tags (ISteamGameServer::SetGameTags) contains all + of the specified strings. The value field is a comma-delimited list of strings to check. + "gametagsnor" + - Server passes the filter if the server's game tags (ISteamGameServer::SetGameTags) does not contain any + of the specified strings. The value field is a comma-delimited list of strings to check. + "and" (x1 && x2 && ... && xn) + "or" (x1 || x2 || ... || xn) + "nand" !(x1 && x2 && ... && xn) + "nor" !(x1 || x2 || ... || xn) + - Performs Boolean operation on the following filters. The operand to this filter specifies + the "size" of the Boolean inputs to the operation, in Key/value pairs. (The keyvalue + pairs must immediately follow, i.e. this is a prefix logical operator notation.) + In the simplest case where Boolean expressions are not nested, this is simply + the number of operands. + + For example, to match servers on a particular map or with a particular tag, would would + use these filters. + + ( server.map == "cp_dustbowl" || server.gametags.contains("payload") ) + "or", "2" + "map", "cp_dustbowl" + "gametagsand", "payload" + + If logical inputs are nested, then the operand specifies the size of the entire + "length" of its operands, not the number of immediate children. + + ( server.map == "cp_dustbowl" || ( server.gametags.contains("payload") && !server.gametags.contains("payloadrace") ) ) + "or", "4" + "map", "cp_dustbowl" + "and", "2" + "gametagsand", "payload" + "gametagsnor", "payloadrace" + + Unary NOT can be achieved using either "nand" or "nor" with a single operand. + + "addr" + - Server passes the filter if the server's query address matches the specified IP or IP:port. + "gameaddr" + - Server passes the filter if the server's game address matches the specified IP or IP:port. + + The following filter operations ignore the "value" part of MatchMakingKeyValuePair_t + + "dedicated" + - Server passes the filter if it passed true to SetDedicatedServer. + "secure" + - Server passes the filter if the server is VAC-enabled. + "notfull" + - Server passes the filter if the player count is less than the reported max player count. + "hasplayers" + - Server passes the filter if the player count is greater than zero. + "noplayers" + - Server passes the filter if it doesn't have any players. + "linux" + - Server passes the filter if it's a linux server + */ + + // Get details on a given server in the list, you can get the valid range of index + // values by calling GetServerCount(). You will also receive index values in + // ISteamMatchmakingServerListResponse::ServerResponded() callbacks + virtual gameserveritem_t *GetServerDetails( HServerListRequest hRequest, int iServer ) = 0; + + // Cancel an request which is operation on the given list type. You should call this to cancel + // any in-progress requests before destructing a callback object that may have been passed + // to one of the above list request calls. Not doing so may result in a crash when a callback + // occurs on the destructed object. + // Canceling a query does not release the allocated request handle. + // The request handle must be released using ReleaseRequest( hRequest ) + virtual void CancelQuery( HServerListRequest hRequest ) = 0; + + // Ping every server in your list again but don't update the list of servers + // Query callback installed when the server list was requested will be used + // again to post notifications and RefreshComplete, so the callback must remain + // valid until another RefreshComplete is called on it or the request + // is released with ReleaseRequest( hRequest ) + virtual void RefreshQuery( HServerListRequest hRequest ) = 0; + + // Returns true if the list is currently refreshing its server list + virtual bool IsRefreshing( HServerListRequest hRequest ) = 0; + + // How many servers in the given list, GetServerDetails above takes 0... GetServerCount() - 1 + virtual int GetServerCount( HServerListRequest hRequest ) = 0; + + // Refresh a single server inside of a query (rather than all the servers ) + virtual void RefreshServer( HServerListRequest hRequest, int iServer ) = 0; + + + //----------------------------------------------------------------------------- + // Queries to individual servers directly via IP/Port + //----------------------------------------------------------------------------- + + // Request updated ping time and other details from a single server + virtual HServerQuery PingServer( uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse *pRequestServersResponse ) = 0; + + // Request the list of players currently playing on a server + virtual HServerQuery PlayerDetails( uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse *pRequestServersResponse ) = 0; + + // Request the list of rules that the server is running (See ISteamGameServer::SetKeyValue() to set the rules server side) + virtual HServerQuery ServerRules( uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse *pRequestServersResponse ) = 0; + + // Cancel an outstanding Ping/Players/Rules query from above. You should call this to cancel + // any in-progress requests before destructing a callback object that may have been passed + // to one of the above calls to avoid crashing when callbacks occur. + virtual void CancelServerQuery( HServerQuery hServerQuery ) = 0; +}; +#define STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION "SteamMatchMakingServers002" + +// Global interface accessor +inline ISteamMatchmakingServers *SteamMatchmakingServers(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamMatchmakingServers *, SteamMatchmakingServers, STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION ); + +// game server flags +const uint32 k_unFavoriteFlagNone = 0x00; +const uint32 k_unFavoriteFlagFavorite = 0x01; // this game favorite entry is for the favorites list +const uint32 k_unFavoriteFlagHistory = 0x02; // this game favorite entry is for the history list + + +//----------------------------------------------------------------------------- +// Purpose: Used in ChatInfo messages - fields specific to a chat member - must fit in a uint32 +//----------------------------------------------------------------------------- +enum EChatMemberStateChange +{ + // Specific to joining / leaving the chatroom + k_EChatMemberStateChangeEntered = 0x0001, // This user has joined or is joining the chat room + k_EChatMemberStateChangeLeft = 0x0002, // This user has left or is leaving the chat room + k_EChatMemberStateChangeDisconnected = 0x0004, // User disconnected without leaving the chat first + k_EChatMemberStateChangeKicked = 0x0008, // User kicked + k_EChatMemberStateChangeBanned = 0x0010, // User kicked and banned +}; + +// returns true of the flags indicate that a user has been removed from the chat +#define BChatMemberStateChangeRemoved( rgfChatMemberStateChangeFlags ) ( rgfChatMemberStateChangeFlags & ( k_EChatMemberStateChangeDisconnected | k_EChatMemberStateChangeLeft | k_EChatMemberStateChangeKicked | k_EChatMemberStateChangeBanned ) ) + + + +//----------------------------------------------------------------------------- +// Purpose: Functions for match making services for clients to get to favorites +// and to operate on game lobbies. +//----------------------------------------------------------------------------- +class ISteamGameSearch +{ +public: + // ============================================================================================= + // Game Player APIs + + // a keyname and a list of comma separated values: one of which is must be found in order for the match to qualify + // fails if a search is currently in progress + virtual EGameSearchErrorCode_t AddGameSearchParams( const char *pchKeyToFind, const char *pchValuesToFind ) = 0; + + // all players in lobby enter the queue and await a SearchForGameNotificationCallback_t callback. fails if another search is currently in progress + // if not the owner of the lobby or search already in progress this call fails + // periodic callbacks will be sent as queue time estimates change + virtual EGameSearchErrorCode_t SearchForGameWithLobby( CSteamID steamIDLobby, int nPlayerMin, int nPlayerMax ) = 0; + + // user enter the queue and await a SearchForGameNotificationCallback_t callback. fails if another search is currently in progress + // periodic callbacks will be sent as queue time estimates change + virtual EGameSearchErrorCode_t SearchForGameSolo( int nPlayerMin, int nPlayerMax ) = 0; + + // after receiving SearchForGameResultCallback_t, accept or decline the game + // multiple SearchForGameResultCallback_t will follow as players accept game until the host starts or cancels the game + virtual EGameSearchErrorCode_t AcceptGame() = 0; + virtual EGameSearchErrorCode_t DeclineGame() = 0; + + // after receiving GameStartedByHostCallback_t get connection details to server + virtual EGameSearchErrorCode_t RetrieveConnectionDetails( CSteamID steamIDHost, char *pchConnectionDetails, int cubConnectionDetails ) = 0; + + // leaves queue if still waiting + virtual EGameSearchErrorCode_t EndGameSearch() = 0; + + // ============================================================================================= + // Game Host APIs + + // a keyname and a list of comma separated values: all the values you allow + virtual EGameSearchErrorCode_t SetGameHostParams( const char *pchKey, const char *pchValue ) = 0; + + // set connection details for players once game is found so they can connect to this server + virtual EGameSearchErrorCode_t SetConnectionDetails( const char *pchConnectionDetails, int cubConnectionDetails ) = 0; + + // mark server as available for more players with nPlayerMin,nPlayerMax desired + // accept no lobbies with playercount greater than nMaxTeamSize + // the set of lobbies returned must be partitionable into teams of no more than nMaxTeamSize + // RequestPlayersForGameNotificationCallback_t callback will be sent when the search has started + // multple RequestPlayersForGameResultCallback_t callbacks will follow when players are found + virtual EGameSearchErrorCode_t RequestPlayersForGame( int nPlayerMin, int nPlayerMax, int nMaxTeamSize ) = 0; + + // accept the player list and release connection details to players + // players will only be given connection details and host steamid when this is called + // ( allows host to accept after all players confirm, some confirm, or none confirm. decision is entirely up to the host ) + virtual EGameSearchErrorCode_t HostConfirmGameStart( uint64 ullUniqueGameID ) = 0; + + // cancel request and leave the pool of game hosts looking for players + // if a set of players has already been sent to host, all players will receive SearchForGameHostFailedToConfirm_t + virtual EGameSearchErrorCode_t CancelRequestPlayersForGame() = 0; + + // submit a result for one player. does not end the game. ullUniqueGameID continues to describe this game + virtual EGameSearchErrorCode_t SubmitPlayerResult( uint64 ullUniqueGameID, CSteamID steamIDPlayer, EPlayerResult_t EPlayerResult ) = 0; + + // ends the game. no further SubmitPlayerResults for ullUniqueGameID will be accepted + // any future requests will provide a new ullUniqueGameID + virtual EGameSearchErrorCode_t EndGame( uint64 ullUniqueGameID ) = 0; + +}; +#define STEAMGAMESEARCH_INTERFACE_VERSION "SteamMatchGameSearch001" + +// Global interface accessor +inline ISteamGameSearch *SteamGameSearch(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamGameSearch *, SteamGameSearch, STEAMGAMESEARCH_INTERFACE_VERSION ); + + +//----------------------------------------------------------------------------- +// Purpose: Functions for quickly creating a Party with friends or acquaintances, +// EG from chat rooms. +//----------------------------------------------------------------------------- +enum ESteamPartyBeaconLocationType +{ + k_ESteamPartyBeaconLocationType_Invalid = 0, + k_ESteamPartyBeaconLocationType_ChatGroup = 1, + + k_ESteamPartyBeaconLocationType_Max, +}; + + +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + + +struct SteamPartyBeaconLocation_t +{ + ESteamPartyBeaconLocationType m_eType; + uint64 m_ulLocationID; +}; + +enum ESteamPartyBeaconLocationData +{ + k_ESteamPartyBeaconLocationDataInvalid = 0, + k_ESteamPartyBeaconLocationDataName = 1, + k_ESteamPartyBeaconLocationDataIconURLSmall = 2, + k_ESteamPartyBeaconLocationDataIconURLMedium = 3, + k_ESteamPartyBeaconLocationDataIconURLLarge = 4, +}; + +class ISteamParties +{ +public: + + // ============================================================================================= + // Party Client APIs + + // Enumerate any active beacons for parties you may wish to join + virtual uint32 GetNumActiveBeacons() = 0; + virtual PartyBeaconID_t GetBeaconByIndex( uint32 unIndex ) = 0; + virtual bool GetBeaconDetails( PartyBeaconID_t ulBeaconID, CSteamID *pSteamIDBeaconOwner, STEAM_OUT_STRUCT() SteamPartyBeaconLocation_t *pLocation, STEAM_OUT_STRING_COUNT(cchMetadata) char *pchMetadata, int cchMetadata ) = 0; + + // Join an open party. Steam will reserve one beacon slot for your SteamID, + // and return the necessary JoinGame string for you to use to connect + STEAM_CALL_RESULT( JoinPartyCallback_t ) + virtual SteamAPICall_t JoinParty( PartyBeaconID_t ulBeaconID ) = 0; + + // ============================================================================================= + // Party Host APIs + + // Get a list of possible beacon locations + virtual bool GetNumAvailableBeaconLocations( uint32 *puNumLocations ) = 0; + virtual bool GetAvailableBeaconLocations( SteamPartyBeaconLocation_t *pLocationList, uint32 uMaxNumLocations ) = 0; + + // Create a new party beacon and activate it in the selected location. + // unOpenSlots is the maximum number of users that Steam will send to you. + // When people begin responding to your beacon, Steam will send you + // PartyReservationCallback_t callbacks to let you know who is on the way. + STEAM_CALL_RESULT( CreateBeaconCallback_t ) + virtual SteamAPICall_t CreateBeacon( uint32 unOpenSlots, SteamPartyBeaconLocation_t *pBeaconLocation, const char *pchConnectString, const char *pchMetadata ) = 0; + + // Call this function when a user that had a reservation (see callback below) + // has successfully joined your party. + // Steam will manage the remaining open slots automatically. + virtual void OnReservationCompleted( PartyBeaconID_t ulBeacon, CSteamID steamIDUser ) = 0; + + // To cancel a reservation (due to timeout or user input), call this. + // Steam will open a new reservation slot. + // Note: The user may already be in-flight to your game, so it's possible they will still connect and try to join your party. + virtual void CancelReservation( PartyBeaconID_t ulBeacon, CSteamID steamIDUser ) = 0; + + // Change the number of open beacon reservation slots. + // Call this if, for example, someone without a reservation joins your party (eg a friend, or via your own matchmaking system). + STEAM_CALL_RESULT( ChangeNumOpenSlotsCallback_t ) + virtual SteamAPICall_t ChangeNumOpenSlots( PartyBeaconID_t ulBeacon, uint32 unOpenSlots ) = 0; + + // Turn off the beacon. + virtual bool DestroyBeacon( PartyBeaconID_t ulBeacon ) = 0; + + // Utils + virtual bool GetBeaconLocationData( SteamPartyBeaconLocation_t BeaconLocation, ESteamPartyBeaconLocationData eData, STEAM_OUT_STRING_COUNT(cchDataStringOut) char *pchDataStringOut, int cchDataStringOut ) = 0; + +}; +#define STEAMPARTIES_INTERFACE_VERSION "SteamParties002" + +// Global interface accessor +inline ISteamParties *SteamParties(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamParties *, SteamParties, STEAMPARTIES_INTERFACE_VERSION ); + + +//----------------------------------------------------------------------------- +// Callbacks for ISteamMatchmaking (which go through the regular Steam callback registration system) + +//----------------------------------------------------------------------------- +// Purpose: a server was added/removed from the favorites list, you should refresh now +//----------------------------------------------------------------------------- +struct FavoritesListChanged_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 2 }; + uint32 m_nIP; // an IP of 0 means reload the whole list, any other value means just one server + uint32 m_nQueryPort; + uint32 m_nConnPort; + uint32 m_nAppID; + uint32 m_nFlags; + bool m_bAdd; // true if this is adding the entry, otherwise it is a remove + AccountID_t m_unAccountId; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Someone has invited you to join a Lobby +// normally you don't need to do anything with this, since +// the Steam UI will also display a ' has invited you to the lobby, join?' dialog +// +// if the user outside a game chooses to join, your game will be launched with the parameter "+connect_lobby <64-bit lobby id>", +// or with the callback GameLobbyJoinRequested_t if they're already in-game +//----------------------------------------------------------------------------- +struct LobbyInvite_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 3 }; + + uint64 m_ulSteamIDUser; // Steam ID of the person making the invite + uint64 m_ulSteamIDLobby; // Steam ID of the Lobby + uint64 m_ulGameID; // GameID of the Lobby +}; + + +//----------------------------------------------------------------------------- +// Purpose: Sent on entering a lobby, or on failing to enter +// m_EChatRoomEnterResponse will be set to k_EChatRoomEnterResponseSuccess on success, +// or a higher value on failure (see enum EChatRoomEnterResponse) +//----------------------------------------------------------------------------- +struct LobbyEnter_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 4 }; + + uint64 m_ulSteamIDLobby; // SteamID of the Lobby you have entered + uint32 m_rgfChatPermissions; // Permissions of the current user + bool m_bLocked; // If true, then only invited users may join + uint32 m_EChatRoomEnterResponse; // EChatRoomEnterResponse +}; + + +//----------------------------------------------------------------------------- +// Purpose: The lobby metadata has changed +// if m_ulSteamIDMember is the steamID of a lobby member, use GetLobbyMemberData() to access per-user details +// if m_ulSteamIDMember == m_ulSteamIDLobby, use GetLobbyData() to access lobby metadata +//----------------------------------------------------------------------------- +struct LobbyDataUpdate_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 5 }; + + uint64 m_ulSteamIDLobby; // steamID of the Lobby + uint64 m_ulSteamIDMember; // steamID of the member whose data changed, or the room itself + uint8 m_bSuccess; // true if we lobby data was successfully changed; + // will only be false if RequestLobbyData() was called on a lobby that no longer exists +}; + + +//----------------------------------------------------------------------------- +// Purpose: The lobby chat room state has changed +// this is usually sent when a user has joined or left the lobby +//----------------------------------------------------------------------------- +struct LobbyChatUpdate_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 6 }; + + uint64 m_ulSteamIDLobby; // Lobby ID + uint64 m_ulSteamIDUserChanged; // user who's status in the lobby just changed - can be recipient + uint64 m_ulSteamIDMakingChange; // Chat member who made the change (different from SteamIDUserChange if kicking, muting, etc.) + // for example, if one user kicks another from the lobby, this will be set to the id of the user who initiated the kick + uint32 m_rgfChatMemberStateChange; // bitfield of EChatMemberStateChange values +}; + + +//----------------------------------------------------------------------------- +// Purpose: A chat message for this lobby has been sent +// use GetLobbyChatEntry( m_iChatID ) to retrieve the contents of this message +//----------------------------------------------------------------------------- +struct LobbyChatMsg_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 7 }; + + uint64 m_ulSteamIDLobby; // the lobby id this is in + uint64 m_ulSteamIDUser; // steamID of the user who has sent this message + uint8 m_eChatEntryType; // type of message + uint32 m_iChatID; // index of the chat entry to lookup +}; + + +//----------------------------------------------------------------------------- +// Purpose: A game created a game for all the members of the lobby to join, +// as triggered by a SetLobbyGameServer() +// it's up to the individual clients to take action on this; the usual +// game behavior is to leave the lobby and connect to the specified game server +//----------------------------------------------------------------------------- +struct LobbyGameCreated_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 9 }; + + uint64 m_ulSteamIDLobby; // the lobby we were in + uint64 m_ulSteamIDGameServer; // the new game server that has been created or found for the lobby members + uint32 m_unIP; // IP & Port of the game server (if any) + uint16 m_usPort; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Number of matching lobbies found +// iterate the returned lobbies with GetLobbyByIndex(), from values 0 to m_nLobbiesMatching-1 +//----------------------------------------------------------------------------- +struct LobbyMatchList_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 10 }; + uint32 m_nLobbiesMatching; // Number of lobbies that matched search criteria and we have SteamIDs for +}; + + +//----------------------------------------------------------------------------- +// Purpose: posted if a user is forcefully removed from a lobby +// can occur if a user loses connection to Steam +//----------------------------------------------------------------------------- +struct LobbyKicked_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 12 }; + uint64 m_ulSteamIDLobby; // Lobby + uint64 m_ulSteamIDAdmin; // User who kicked you - possibly the ID of the lobby itself + uint8 m_bKickedDueToDisconnect; // true if you were kicked from the lobby due to the user losing connection to Steam (currently always true) +}; + + +//----------------------------------------------------------------------------- +// Purpose: Result of our request to create a Lobby +// m_eResult == k_EResultOK on success +// at this point, the lobby has been joined and is ready for use +// a LobbyEnter_t callback will also be received (since the local user is joining their own lobby) +//----------------------------------------------------------------------------- +struct LobbyCreated_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 13 }; + + EResult m_eResult; // k_EResultOK - the lobby was successfully created + // k_EResultNoConnection - your Steam client doesn't have a connection to the back-end + // k_EResultTimeout - you the message to the Steam servers, but it didn't respond + // k_EResultFail - the server responded, but with an unknown internal error + // k_EResultAccessDenied - your game isn't set to allow lobbies, or your client does haven't rights to play the game + // k_EResultLimitExceeded - your game client has created too many lobbies + + uint64 m_ulSteamIDLobby; // chat room, zero if failed +}; + +// used by now obsolete RequestFriendsLobbiesResponse_t +// enum { k_iCallback = k_iSteamMatchmakingCallbacks + 14 }; + +// used by now obsolete PSNGameBootInviteResult_t +// enum { k_iCallback = k_iSteamMatchmakingCallbacks + 15 }; + +//----------------------------------------------------------------------------- +// Purpose: Result of our request to create a Lobby +// m_eResult == k_EResultOK on success +// at this point, the lobby has been joined and is ready for use +// a LobbyEnter_t callback will also be received (since the local user is joining their own lobby) +//----------------------------------------------------------------------------- +struct FavoritesListAccountsUpdated_t +{ + enum { k_iCallback = k_iSteamMatchmakingCallbacks + 16 }; + + EResult m_eResult; +}; + + + +//----------------------------------------------------------------------------- +// Callbacks for ISteamGameSearch (which go through the regular Steam callback registration system) + +struct SearchForGameProgressCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 1 }; + + uint64 m_ullSearchID; // all future callbacks referencing this search will include this Search ID + + EResult m_eResult; // if search has started this result will be k_EResultOK, any other value indicates search has failed to start or has terminated + CSteamID m_lobbyID; // lobby ID if lobby search, invalid steamID otherwise + CSteamID m_steamIDEndedSearch; // if search was terminated, steamID that terminated search + + int32 m_nSecondsRemainingEstimate; + int32 m_cPlayersSearching; +}; + +// notification to all players searching that a game has been found +struct SearchForGameResultCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 2 }; + + uint64 m_ullSearchID; + + EResult m_eResult; // if game/host was lost this will be an error value + + // if m_bGameFound is true the following are non-zero + int32 m_nCountPlayersInGame; + int32 m_nCountAcceptedGame; + // if m_steamIDHost is valid the host has started the game + CSteamID m_steamIDHost; + bool m_bFinalCallback; +}; + + +//----------------------------------------------------------------------------- +// ISteamGameSearch : Game Host API callbacks + +// callback from RequestPlayersForGame when the matchmaking service has started or ended search +// callback will also follow a call from CancelRequestPlayersForGame - m_bSearchInProgress will be false +struct RequestPlayersForGameProgressCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 11 }; + + EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK + uint64 m_ullSearchID; // all future callbacks referencing this search will include this Search ID +}; + +// callback from RequestPlayersForGame +// one of these will be sent per player +// followed by additional callbacks when players accept or decline the game +struct RequestPlayersForGameResultCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 12 }; + + EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK + uint64 m_ullSearchID; + + CSteamID m_SteamIDPlayerFound; // player steamID + CSteamID m_SteamIDLobby; // if the player is in a lobby, the lobby ID + enum PlayerAcceptState_t + { + k_EStateUnknown = 0, + k_EStatePlayerAccepted = 1, + k_EStatePlayerDeclined = 2, + }; + PlayerAcceptState_t m_ePlayerAcceptState; + int32 m_nPlayerIndex; + int32 m_nTotalPlayersFound; // expect this many callbacks at minimum + int32 m_nTotalPlayersAcceptedGame; + int32 m_nSuggestedTeamIndex; + uint64 m_ullUniqueGameID; +}; + + +struct RequestPlayersForGameFinalResultCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 13 }; + + EResult m_eResult; + uint64 m_ullSearchID; + uint64 m_ullUniqueGameID; +}; + + + +// this callback confirms that results were received by the matchmaking service for this player +struct SubmitPlayerResultResultCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 14 }; + + EResult m_eResult; + uint64 ullUniqueGameID; + CSteamID steamIDPlayer; +}; + + +// this callback confirms that the game is recorded as complete on the matchmaking service +// the next call to RequestPlayersForGame will generate a new unique game ID +struct EndGameResultCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 15 }; + + EResult m_eResult; + uint64 ullUniqueGameID; +}; + + +// Steam has responded to the user request to join a party via the given Beacon ID. +// If successful, the connect string contains game-specific instructions to connect +// to the game with that party. +struct JoinPartyCallback_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 1 }; + + EResult m_eResult; + PartyBeaconID_t m_ulBeaconID; + CSteamID m_SteamIDBeaconOwner; + char m_rgchConnectString[256]; +}; + +// Response to CreateBeacon request. If successful, the beacon ID is provided. +struct CreateBeaconCallback_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 2 }; + + EResult m_eResult; + PartyBeaconID_t m_ulBeaconID; +}; + +// Someone has used the beacon to join your party - they are in-flight now +// and we've reserved one of the open slots for them. +// You should confirm when they join your party by calling OnReservationCompleted(). +// Otherwise, Steam may timeout their reservation eventually. +struct ReservationNotificationCallback_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 3 }; + + PartyBeaconID_t m_ulBeaconID; + CSteamID m_steamIDJoiner; +}; + +// Response to ChangeNumOpenSlots call +struct ChangeNumOpenSlotsCallback_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 4 }; + + EResult m_eResult; +}; + +// The list of possible Party beacon locations has changed +struct AvailableBeaconLocationsUpdated_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 5 }; +}; + +// The list of active beacons may have changed +struct ActiveBeaconsUpdated_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 6 }; +}; + + +#pragma pack( pop ) + + +#endif // ISTEAMMATCHMAKING diff --git a/external/steamworks/public/steam/isteammusic.h b/external/steamworks/public/steam/isteammusic.h new file mode 100644 index 0000000..2100cae --- /dev/null +++ b/external/steamworks/public/steam/isteammusic.h @@ -0,0 +1,71 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ + +#ifndef ISTEAMMUSIC_H +#define ISTEAMMUSIC_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +enum AudioPlayback_Status +{ + AudioPlayback_Undefined = 0, + AudioPlayback_Playing = 1, + AudioPlayback_Paused = 2, + AudioPlayback_Idle = 3 +}; + + +//----------------------------------------------------------------------------- +// Purpose: Functions to control music playback in the steam client +//----------------------------------------------------------------------------- +class ISteamMusic +{ +public: + virtual bool BIsEnabled() = 0; + virtual bool BIsPlaying() = 0; + + virtual AudioPlayback_Status GetPlaybackStatus() = 0; + + virtual void Play() = 0; + virtual void Pause() = 0; + virtual void PlayPrevious() = 0; + virtual void PlayNext() = 0; + + // volume is between 0.0 and 1.0 + virtual void SetVolume( float flVolume ) = 0; + virtual float GetVolume() = 0; + +}; + +#define STEAMMUSIC_INTERFACE_VERSION "STEAMMUSIC_INTERFACE_VERSION001" + +// Global interface accessor +inline ISteamMusic *SteamMusic(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamMusic *, SteamMusic, STEAMMUSIC_INTERFACE_VERSION ); + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + + +STEAM_CALLBACK_BEGIN( PlaybackStatusHasChanged_t, k_iSteamMusicCallbacks + 1 ) +STEAM_CALLBACK_END(0) + +STEAM_CALLBACK_BEGIN( VolumeHasChanged_t, k_iSteamMusicCallbacks + 2 ) + STEAM_CALLBACK_MEMBER( 0, float, m_flNewVolume ) +STEAM_CALLBACK_END(1) + +#pragma pack( pop ) + + +#endif // #define ISTEAMMUSIC_H diff --git a/external/steamworks/public/steam/isteammusicremote.h b/external/steamworks/public/steam/isteammusicremote.h new file mode 100644 index 0000000..39fd4a0 --- /dev/null +++ b/external/steamworks/public/steam/isteammusicremote.h @@ -0,0 +1,133 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ + +#ifndef ISTEAMMUSICREMOTE_H +#define ISTEAMMUSICREMOTE_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" +#include "isteammusic.h" + +#define k_SteamMusicNameMaxLength 255 +#define k_SteamMusicPNGMaxLength 65535 + + +class ISteamMusicRemote +{ +public: + // Service Definition + virtual bool RegisterSteamMusicRemote( const char *pchName ) = 0; + virtual bool DeregisterSteamMusicRemote() = 0; + virtual bool BIsCurrentMusicRemote() = 0; + virtual bool BActivationSuccess( bool bValue ) = 0; + + virtual bool SetDisplayName( const char *pchDisplayName ) = 0; + virtual bool SetPNGIcon_64x64( void *pvBuffer, uint32 cbBufferLength ) = 0; + + // Abilities for the user interface + virtual bool EnablePlayPrevious(bool bValue) = 0; + virtual bool EnablePlayNext( bool bValue ) = 0; + virtual bool EnableShuffled( bool bValue ) = 0; + virtual bool EnableLooped( bool bValue ) = 0; + virtual bool EnableQueue( bool bValue ) = 0; + virtual bool EnablePlaylists( bool bValue ) = 0; + + // Status + virtual bool UpdatePlaybackStatus( AudioPlayback_Status nStatus ) = 0; + virtual bool UpdateShuffled( bool bValue ) = 0; + virtual bool UpdateLooped( bool bValue ) = 0; + virtual bool UpdateVolume( float flValue ) = 0; // volume is between 0.0 and 1.0 + + // Current Entry + virtual bool CurrentEntryWillChange() = 0; + virtual bool CurrentEntryIsAvailable( bool bAvailable ) = 0; + virtual bool UpdateCurrentEntryText( const char *pchText ) = 0; + virtual bool UpdateCurrentEntryElapsedSeconds( int nValue ) = 0; + virtual bool UpdateCurrentEntryCoverArt( void *pvBuffer, uint32 cbBufferLength ) = 0; + virtual bool CurrentEntryDidChange() = 0; + + // Queue + virtual bool QueueWillChange() = 0; + virtual bool ResetQueueEntries() = 0; + virtual bool SetQueueEntry( int nID, int nPosition, const char *pchEntryText ) = 0; + virtual bool SetCurrentQueueEntry( int nID ) = 0; + virtual bool QueueDidChange() = 0; + + // Playlist + virtual bool PlaylistWillChange() = 0; + virtual bool ResetPlaylistEntries() = 0; + virtual bool SetPlaylistEntry( int nID, int nPosition, const char *pchEntryText ) = 0; + virtual bool SetCurrentPlaylistEntry( int nID ) = 0; + virtual bool PlaylistDidChange() = 0; +}; + +#define STEAMMUSICREMOTE_INTERFACE_VERSION "STEAMMUSICREMOTE_INTERFACE_VERSION001" + +// Global interface accessor +inline ISteamMusicRemote *SteamMusicRemote(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamMusicRemote *, SteamMusicRemote, STEAMMUSICREMOTE_INTERFACE_VERSION ); + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + + +STEAM_CALLBACK_BEGIN( MusicPlayerRemoteWillActivate_t, k_iSteamMusicRemoteCallbacks + 1) +STEAM_CALLBACK_END(0) + +STEAM_CALLBACK_BEGIN( MusicPlayerRemoteWillDeactivate_t, k_iSteamMusicRemoteCallbacks + 2 ) +STEAM_CALLBACK_END(0) + +STEAM_CALLBACK_BEGIN( MusicPlayerRemoteToFront_t, k_iSteamMusicRemoteCallbacks + 3 ) +STEAM_CALLBACK_END(0) + +STEAM_CALLBACK_BEGIN( MusicPlayerWillQuit_t, k_iSteamMusicRemoteCallbacks + 4 ) +STEAM_CALLBACK_END(0) + +STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlay_t, k_iSteamMusicRemoteCallbacks + 5 ) +STEAM_CALLBACK_END(0) + +STEAM_CALLBACK_BEGIN( MusicPlayerWantsPause_t, k_iSteamMusicRemoteCallbacks + 6 ) +STEAM_CALLBACK_END(0) + +STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlayPrevious_t, k_iSteamMusicRemoteCallbacks + 7 ) +STEAM_CALLBACK_END(0) + +STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlayNext_t, k_iSteamMusicRemoteCallbacks + 8 ) +STEAM_CALLBACK_END(0) + +STEAM_CALLBACK_BEGIN( MusicPlayerWantsShuffled_t, k_iSteamMusicRemoteCallbacks + 9 ) + STEAM_CALLBACK_MEMBER( 0, bool, m_bShuffled ) +STEAM_CALLBACK_END(1) + +STEAM_CALLBACK_BEGIN( MusicPlayerWantsLooped_t, k_iSteamMusicRemoteCallbacks + 10 ) + STEAM_CALLBACK_MEMBER(0, bool, m_bLooped ) +STEAM_CALLBACK_END(1) + +STEAM_CALLBACK_BEGIN( MusicPlayerWantsVolume_t, k_iSteamMusicCallbacks + 11 ) + STEAM_CALLBACK_MEMBER(0, float, m_flNewVolume) +STEAM_CALLBACK_END(1) + +STEAM_CALLBACK_BEGIN( MusicPlayerSelectsQueueEntry_t, k_iSteamMusicCallbacks + 12 ) + STEAM_CALLBACK_MEMBER(0, int, nID ) +STEAM_CALLBACK_END(1) + +STEAM_CALLBACK_BEGIN( MusicPlayerSelectsPlaylistEntry_t, k_iSteamMusicCallbacks + 13 ) + STEAM_CALLBACK_MEMBER(0, int, nID ) +STEAM_CALLBACK_END(1) + +STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlayingRepeatStatus_t, k_iSteamMusicRemoteCallbacks + 14 ) + STEAM_CALLBACK_MEMBER(0, int, m_nPlayingRepeatStatus ) +STEAM_CALLBACK_END(1) + +#pragma pack( pop ) + + + +#endif // #define ISTEAMMUSICREMOTE_H diff --git a/external/steamworks/public/steam/isteamnetworking.h b/external/steamworks/public/steam/isteamnetworking.h new file mode 100644 index 0000000..b214a5e --- /dev/null +++ b/external/steamworks/public/steam/isteamnetworking.h @@ -0,0 +1,343 @@ +//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to steam managing network connections between game clients & servers +// +//============================================================================= + +#ifndef ISTEAMNETWORKING +#define ISTEAMNETWORKING +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + +// list of possible errors returned by SendP2PPacket() API +// these will be posted in the P2PSessionConnectFail_t callback +enum EP2PSessionError +{ + k_EP2PSessionErrorNone = 0, + k_EP2PSessionErrorNoRightsToApp = 2, // local user doesn't own the app that is running + k_EP2PSessionErrorTimeout = 4, // target isn't responding, perhaps not calling AcceptP2PSessionWithUser() + // corporate firewalls can also block this (NAT traversal is not firewall traversal) + // make sure that UDP ports 3478, 4379, and 4380 are open in an outbound direction + + // The following error codes were removed and will never be sent. + // For privacy reasons, there is no reply if the user is offline or playing another game. + k_EP2PSessionErrorNotRunningApp_DELETED = 1, + k_EP2PSessionErrorDestinationNotLoggedIn_DELETED = 3, + + k_EP2PSessionErrorMax = 5 +}; + +// SendP2PPacket() send types +// Typically k_EP2PSendUnreliable is what you want for UDP-like packets, k_EP2PSendReliable for TCP-like packets +enum EP2PSend +{ + // Basic UDP send. Packets can't be bigger than 1200 bytes (your typical MTU size). Can be lost, or arrive out of order (rare). + // The sending API does have some knowledge of the underlying connection, so if there is no NAT-traversal accomplished or + // there is a recognized adjustment happening on the connection, the packet will be batched until the connection is open again. + k_EP2PSendUnreliable = 0, + + // As above, but if the underlying p2p connection isn't yet established the packet will just be thrown away. Using this on the first + // packet sent to a remote host almost guarantees the packet will be dropped. + // This is only really useful for kinds of data that should never buffer up, i.e. voice payload packets + k_EP2PSendUnreliableNoDelay = 1, + + // Reliable message send. Can send up to 1MB of data in a single message. + // Does fragmentation/re-assembly of messages under the hood, as well as a sliding window for efficient sends of large chunks of data. + k_EP2PSendReliable = 2, + + // As above, but applies the Nagle algorithm to the send - sends will accumulate + // until the current MTU size (typically ~1200 bytes, but can change) or ~200ms has passed (Nagle algorithm). + // Useful if you want to send a set of smaller messages but have the coalesced into a single packet + // Since the reliable stream is all ordered, you can do several small message sends with k_EP2PSendReliableWithBuffering and then + // do a normal k_EP2PSendReliable to force all the buffered data to be sent. + k_EP2PSendReliableWithBuffering = 3, + +}; + + +// connection state to a specified user, returned by GetP2PSessionState() +// this is under-the-hood info about what's going on with a SendP2PPacket(), shouldn't be needed except for debuggin +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif +struct P2PSessionState_t +{ + uint8 m_bConnectionActive; // true if we've got an active open connection + uint8 m_bConnecting; // true if we're currently trying to establish a connection + uint8 m_eP2PSessionError; // last error recorded (see enum above) + uint8 m_bUsingRelay; // true if it's going through a relay server (TURN) + int32 m_nBytesQueuedForSend; + int32 m_nPacketsQueuedForSend; + uint32 m_nRemoteIP; // potential IP:Port of remote host. Could be TURN server. + uint16 m_nRemotePort; // Only exists for compatibility with older authentication api's +}; +#pragma pack( pop ) + + +// handle to a socket +typedef uint32 SNetSocket_t; // CreateP2PConnectionSocket() +typedef uint32 SNetListenSocket_t; // CreateListenSocket() + +// connection progress indicators, used by CreateP2PConnectionSocket() +enum ESNetSocketState +{ + k_ESNetSocketStateInvalid = 0, + + // communication is valid + k_ESNetSocketStateConnected = 1, + + // states while establishing a connection + k_ESNetSocketStateInitiated = 10, // the connection state machine has started + + // p2p connections + k_ESNetSocketStateLocalCandidatesFound = 11, // we've found our local IP info + k_ESNetSocketStateReceivedRemoteCandidates = 12,// we've received information from the remote machine, via the Steam back-end, about their IP info + + // direct connections + k_ESNetSocketStateChallengeHandshake = 15, // we've received a challenge packet from the server + + // failure states + k_ESNetSocketStateDisconnecting = 21, // the API shut it down, and we're in the process of telling the other end + k_ESNetSocketStateLocalDisconnect = 22, // the API shut it down, and we've completed shutdown + k_ESNetSocketStateTimeoutDuringConnect = 23, // we timed out while trying to creating the connection + k_ESNetSocketStateRemoteEndDisconnected = 24, // the remote end has disconnected from us + k_ESNetSocketStateConnectionBroken = 25, // connection has been broken; either the other end has disappeared or our local network connection has broke + +}; + +// describes how the socket is currently connected +enum ESNetSocketConnectionType +{ + k_ESNetSocketConnectionTypeNotConnected = 0, + k_ESNetSocketConnectionTypeUDP = 1, + k_ESNetSocketConnectionTypeUDPRelay = 2, +}; + + +//----------------------------------------------------------------------------- +// Purpose: Functions for making connections and sending data between clients, +// traversing NAT's where possible +// +// NOTE: This interface is deprecated and may be removed in a future release of +/// the Steamworks SDK. Please see ISteamNetworkingSockets and +/// ISteamNetworkingMessages +//----------------------------------------------------------------------------- +class ISteamNetworking +{ +public: + //////////////////////////////////////////////////////////////////////////////////////////// + // + // UDP-style (connectionless) networking interface. These functions send messages using + // an API organized around the destination. Reliable and unreliable messages are supported. + // + // For a more TCP-style interface (meaning you have a connection handle), see the functions below. + // Both interface styles can send both reliable and unreliable messages. + // + // Automatically establishes NAT-traversing or Relay server connections + // + // These APIs are deprecated, and may be removed in a future version of the Steamworks + // SDK. See ISteamNetworkingMessages. + + // Sends a P2P packet to the specified user + // UDP-like, unreliable and a max packet size of 1200 bytes + // the first packet send may be delayed as the NAT-traversal code runs + // if we can't get through to the user, an error will be posted via the callback P2PSessionConnectFail_t + // see EP2PSend enum above for the descriptions of the different ways of sending packets + // + // nChannel is a routing number you can use to help route message to different systems - you'll have to call ReadP2PPacket() + // with the same channel number in order to retrieve the data on the other end + // using different channels to talk to the same user will still use the same underlying p2p connection, saving on resources + virtual bool SendP2PPacket( CSteamID steamIDRemote, const void *pubData, uint32 cubData, EP2PSend eP2PSendType, int nChannel = 0 ) = 0; + + // returns true if any data is available for read, and the amount of data that will need to be read + virtual bool IsP2PPacketAvailable( uint32 *pcubMsgSize, int nChannel = 0 ) = 0; + + // reads in a packet that has been sent from another user via SendP2PPacket() + // returns the size of the message and the steamID of the user who sent it in the last two parameters + // if the buffer passed in is too small, the message will be truncated + // this call is not blocking, and will return false if no data is available + virtual bool ReadP2PPacket( void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, CSteamID *psteamIDRemote, int nChannel = 0 ) = 0; + + // AcceptP2PSessionWithUser() should only be called in response to a P2PSessionRequest_t callback + // P2PSessionRequest_t will be posted if another user tries to send you a packet that you haven't talked to yet + // if you don't want to talk to the user, just ignore the request + // if the user continues to send you packets, another P2PSessionRequest_t will be posted periodically + // this may be called multiple times for a single user + // (if you've called SendP2PPacket() on the other user, this implicitly accepts the session request) + virtual bool AcceptP2PSessionWithUser( CSteamID steamIDRemote ) = 0; + + // call CloseP2PSessionWithUser() when you're done talking to a user, will free up resources under-the-hood + // if the remote user tries to send data to you again, another P2PSessionRequest_t callback will be posted + virtual bool CloseP2PSessionWithUser( CSteamID steamIDRemote ) = 0; + + // call CloseP2PChannelWithUser() when you're done talking to a user on a specific channel. Once all channels + // open channels to a user have been closed, the open session to the user will be closed and new data from this + // user will trigger a P2PSessionRequest_t callback + virtual bool CloseP2PChannelWithUser( CSteamID steamIDRemote, int nChannel ) = 0; + + // fills out P2PSessionState_t structure with details about the underlying connection to the user + // should only needed for debugging purposes + // returns false if no connection exists to the specified user + virtual bool GetP2PSessionState( CSteamID steamIDRemote, P2PSessionState_t *pConnectionState ) = 0; + + // Allow P2P connections to fall back to being relayed through the Steam servers if a direct connection + // or NAT-traversal cannot be established. Only applies to connections created after setting this value, + // or to existing connections that need to automatically reconnect after this value is set. + // + // P2P packet relay is allowed by default + // + // NOTE: This function is deprecated and may be removed in a future version of the SDK. For + // security purposes, we may decide to relay the traffic to certain peers, even if you pass false + // to this function, to prevent revealing the client's IP address top another peer. + virtual bool AllowP2PPacketRelay( bool bAllow ) = 0; + + + //////////////////////////////////////////////////////////////////////////////////////////// + // + // LISTEN / CONNECT connection-oriented interface functions + // + // These functions are more like a client-server TCP API. One side is the "server" + // and "listens" for incoming connections, which then must be "accepted." The "client" + // initiates a connection by "connecting." Sending and receiving is done through a + // connection handle. + // + // For a more UDP-style interface, where you do not track connection handles but + // simply send messages to a SteamID, use the UDP-style functions above. + // + // Both methods can send both reliable and unreliable methods. + // + // These APIs are deprecated, and may be removed in a future version of the Steamworks + // SDK. See ISteamNetworkingSockets. + // + //////////////////////////////////////////////////////////////////////////////////////////// + + + // creates a socket and listens others to connect + // will trigger a SocketStatusCallback_t callback on another client connecting + // nVirtualP2PPort is the unique ID that the client will connect to, in case you have multiple ports + // this can usually just be 0 unless you want multiple sets of connections + // unIP is the local IP address to bind to + // pass in 0 if you just want the default local IP + // unPort is the port to use + // pass in 0 if you don't want users to be able to connect via IP/Port, but expect to be always peer-to-peer connections only + virtual SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, SteamIPAddress_t nIP, uint16 nPort, bool bAllowUseOfPacketRelay ) = 0; + + // creates a socket and begin connection to a remote destination + // can connect via a known steamID (client or game server), or directly to an IP + // on success will trigger a SocketStatusCallback_t callback + // on failure or timeout will trigger a SocketStatusCallback_t callback with a failure code in m_eSNetSocketState + virtual SNetSocket_t CreateP2PConnectionSocket( CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay ) = 0; + virtual SNetSocket_t CreateConnectionSocket( SteamIPAddress_t nIP, uint16 nPort, int nTimeoutSec ) = 0; + + // disconnects the connection to the socket, if any, and invalidates the handle + // any unread data on the socket will be thrown away + // if bNotifyRemoteEnd is set, socket will not be completely destroyed until the remote end acknowledges the disconnect + virtual bool DestroySocket( SNetSocket_t hSocket, bool bNotifyRemoteEnd ) = 0; + // destroying a listen socket will automatically kill all the regular sockets generated from it + virtual bool DestroyListenSocket( SNetListenSocket_t hSocket, bool bNotifyRemoteEnd ) = 0; + + // sending data + // must be a handle to a connected socket + // data is all sent via UDP, and thus send sizes are limited to 1200 bytes; after this, many routers will start dropping packets + // use the reliable flag with caution; although the resend rate is pretty aggressive, + // it can still cause stalls in receiving data (like TCP) + virtual bool SendDataOnSocket( SNetSocket_t hSocket, void *pubData, uint32 cubData, bool bReliable ) = 0; + + // receiving data + // returns false if there is no data remaining + // fills out *pcubMsgSize with the size of the next message, in bytes + virtual bool IsDataAvailableOnSocket( SNetSocket_t hSocket, uint32 *pcubMsgSize ) = 0; + + // fills in pubDest with the contents of the message + // messages are always complete, of the same size as was sent (i.e. packetized, not streaming) + // if *pcubMsgSize < cubDest, only partial data is written + // returns false if no data is available + virtual bool RetrieveDataFromSocket( SNetSocket_t hSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0; + + // checks for data from any socket that has been connected off this listen socket + // returns false if there is no data remaining + // fills out *pcubMsgSize with the size of the next message, in bytes + // fills out *phSocket with the socket that data is available on + virtual bool IsDataAvailable( SNetListenSocket_t hListenSocket, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0; + + // retrieves data from any socket that has been connected off this listen socket + // fills in pubDest with the contents of the message + // messages are always complete, of the same size as was sent (i.e. packetized, not streaming) + // if *pcubMsgSize < cubDest, only partial data is written + // returns false if no data is available + // fills out *phSocket with the socket that data is available on + virtual bool RetrieveData( SNetListenSocket_t hListenSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0; + + // returns information about the specified socket, filling out the contents of the pointers + virtual bool GetSocketInfo( SNetSocket_t hSocket, CSteamID *pSteamIDRemote, int *peSocketStatus, SteamIPAddress_t *punIPRemote, uint16 *punPortRemote ) = 0; + + // returns which local port the listen socket is bound to + // *pnIP and *pnPort will be 0 if the socket is set to listen for P2P connections only + virtual bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, SteamIPAddress_t *pnIP, uint16 *pnPort ) = 0; + + // returns true to describe how the socket ended up connecting + virtual ESNetSocketConnectionType GetSocketConnectionType( SNetSocket_t hSocket ) = 0; + + // max packet size, in bytes + virtual int GetMaxPacketSize( SNetSocket_t hSocket ) = 0; +}; +#define STEAMNETWORKING_INTERFACE_VERSION "SteamNetworking006" + +// Global interface accessor +inline ISteamNetworking *SteamNetworking(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamNetworking *, SteamNetworking, STEAMNETWORKING_INTERFACE_VERSION ); + +// Global accessor for the gameserver client +inline ISteamNetworking *SteamGameServerNetworking(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamNetworking *, SteamGameServerNetworking, STEAMNETWORKING_INTERFACE_VERSION ); + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + +// callback notification - a user wants to talk to us over the P2P channel via the SendP2PPacket() API +// in response, a call to AcceptP2PPacketsFromUser() needs to be made, if you want to talk with them +struct P2PSessionRequest_t +{ + enum { k_iCallback = k_iSteamNetworkingCallbacks + 2 }; + CSteamID m_steamIDRemote; // user who wants to talk to us +}; + + +// callback notification - packets can't get through to the specified user via the SendP2PPacket() API +// all packets queued packets unsent at this point will be dropped +// further attempts to send will retry making the connection (but will be dropped if we fail again) +struct P2PSessionConnectFail_t +{ + enum { k_iCallback = k_iSteamNetworkingCallbacks + 3 }; + CSteamID m_steamIDRemote; // user we were sending packets to + uint8 m_eP2PSessionError; // EP2PSessionError indicating why we're having trouble +}; + + +// callback notification - status of a socket has changed +// used as part of the CreateListenSocket() / CreateP2PConnectionSocket() +struct SocketStatusCallback_t +{ + enum { k_iCallback = k_iSteamNetworkingCallbacks + 1 }; + SNetSocket_t m_hSocket; // the socket used to send/receive data to the remote host + SNetListenSocket_t m_hListenSocket; // this is the server socket that we were listening on; NULL if this was an outgoing connection + CSteamID m_steamIDRemote; // remote steamID we have connected to, if it has one + int m_eSNetSocketState; // socket state, ESNetSocketState +}; + +#pragma pack( pop ) + +#endif // ISTEAMNETWORKING diff --git a/external/steamworks/public/steam/isteamnetworkingmessages.h b/external/steamworks/public/steam/isteamnetworkingmessages.h new file mode 100644 index 0000000..b14a0a3 --- /dev/null +++ b/external/steamworks/public/steam/isteamnetworkingmessages.h @@ -0,0 +1,198 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== + +#ifndef ISTEAMNETWORKINGMESSAGES +#define ISTEAMNETWORKINGMESSAGES +#pragma once + +#include "steamnetworkingtypes.h" +#include "steam_api_common.h" + +//----------------------------------------------------------------------------- +/// The non-connection-oriented interface to send and receive messages +/// (whether they be "clients" or "servers"). +/// +/// ISteamNetworkingSockets is connection-oriented (like TCP), meaning you +/// need to listen and connect, and then you send messages using a connection +/// handle. ISteamNetworkingMessages is more like UDP, in that you can just send +/// messages to arbitrary peers at any time. The underlying connections are +/// established implicitly. +/// +/// Under the hood ISteamNetworkingMessages works on top of the ISteamNetworkingSockets +/// code, so you get the same routing and messaging efficiency. The difference is +/// mainly in your responsibility to explicitly establish a connection and +/// the type of feedback you get about the state of the connection. Both +/// interfaces can do "P2P" communications, and both support both unreliable +/// and reliable messages, fragmentation and reassembly. +/// +/// The primary purpose of this interface is to be "like UDP", so that UDP-based code +/// can be ported easily to take advantage of relayed connections. If you find +/// yourself needing more low level information or control, or to be able to better +/// handle failure, then you probably need to use ISteamNetworkingSockets directly. +/// Also, note that if your main goal is to obtain a connection between two peers +/// without concerning yourself with assigning roles of "client" and "server", +/// you may find the symmetric connection mode of ISteamNetworkingSockets useful. +/// (See k_ESteamNetworkingConfig_SymmetricConnect.) +/// +class ISteamNetworkingMessages +{ +public: + /// Sends a message to the specified host. If we don't already have a session with that user, + /// a session is implicitly created. There might be some handshaking that needs to happen + /// before we can actually begin sending message data. If this handshaking fails and we can't + /// get through, an error will be posted via the callback SteamNetworkingMessagesSessionFailed_t. + /// There is no notification when the operation succeeds. (You should have the peer send a reply + /// for this purpose.) + /// + /// Sending a message to a host will also implicitly accept any incoming connection from that host. + /// + /// nSendFlags is a bitmask of k_nSteamNetworkingSend_xxx options + /// + /// nRemoteChannel is a routing number you can use to help route message to different systems. + /// You'll have to call ReceiveMessagesOnChannel() with the same channel number in order to retrieve + /// the data on the other end. + /// + /// Using different channels to talk to the same user will still use the same underlying + /// connection, saving on resources. If you don't need this feature, use 0. + /// Otherwise, small integers are the most efficient. + /// + /// It is guaranteed that reliable messages to the same host on the same channel + /// will be be received by the remote host (if they are received at all) exactly once, + /// and in the same order that they were sent. + /// + /// NO other order guarantees exist! In particular, unreliable messages may be dropped, + /// received out of order with respect to each other and with respect to reliable data, + /// or may be received multiple times. Messages on different channels are *not* guaranteed + /// to be received in the order they were sent. + /// + /// A note for those familiar with TCP/IP ports, or converting an existing codebase that + /// opened multiple sockets: You might notice that there is only one channel, and with + /// TCP/IP each endpoint has a port number. You can think of the channel number as the + /// *destination* port. If you need each message to also include a "source port" (so the + /// recipient can route the reply), then just put that in your message. That is essentially + /// how UDP works! + /// + /// Returns: + /// - k_EREsultOK on success. + /// - k_EResultNoConnection, if the session has failed or was closed by the peer and + /// k_nSteamNetworkingSend_AutoRestartBrokenSession was not specified. (You can + /// use GetSessionConnectionInfo to get the details.) In order to acknowledge the + /// broken session and start a new one, you must call CloseSessionWithUser, or you may + /// repeat the call with k_nSteamNetworkingSend_AutoRestartBrokenSession. See + /// k_nSteamNetworkingSend_AutoRestartBrokenSession for more details. + /// - See ISteamNetworkingSockets::SendMessageToConnection for more possible return values + virtual EResult SendMessageToUser( const SteamNetworkingIdentity &identityRemote, const void *pubData, uint32 cubData, int nSendFlags, int nRemoteChannel ) = 0; + + /// Reads the next message that has been sent from another user via SendMessageToUser() on the given channel. + /// Returns number of messages returned into your list. (0 if no message are available on that channel.) + /// + /// When you're done with the message object(s), make sure and call SteamNetworkingMessage_t::Release()! + virtual int ReceiveMessagesOnChannel( int nLocalChannel, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0; + + /// Call this in response to a SteamNetworkingMessagesSessionRequest_t callback. + /// SteamNetworkingMessagesSessionRequest_t are posted when a user tries to send you a message, + /// and you haven't tried to talk to them first. If you don't want to talk to them, just ignore + /// the request. If the user continues to send you messages, SteamNetworkingMessagesSessionRequest_t + /// callbacks will continue to be posted periodically. + /// + /// Returns false if there is no session with the user pending or otherwise. If there is an + /// existing active session, this function will return true, even if it is not pending. + /// + /// Calling SendMessageToUser() will implicitly accepts any pending session request to that user. + virtual bool AcceptSessionWithUser( const SteamNetworkingIdentity &identityRemote ) = 0; + + /// Call this when you're done talking to a user to immediately free up resources under-the-hood. + /// If the remote user tries to send data to you again, another SteamNetworkingMessagesSessionRequest_t + /// callback will be posted. + /// + /// Note that sessions that go unused for a few minutes are automatically timed out. + virtual bool CloseSessionWithUser( const SteamNetworkingIdentity &identityRemote ) = 0; + + /// Call this when you're done talking to a user on a specific channel. Once all + /// open channels to a user have been closed, the open session to the user will be + /// closed, and any new data from this user will trigger a + /// SteamSteamNetworkingMessagesSessionRequest_t callback + virtual bool CloseChannelWithUser( const SteamNetworkingIdentity &identityRemote, int nLocalChannel ) = 0; + + /// Returns information about the latest state of a connection, if any, with the given peer. + /// Primarily intended for debugging purposes, but can also be used to get more detailed + /// failure information. (See SendMessageToUser and k_nSteamNetworkingSend_AutoRestartBrokenSession.) + /// + /// Returns the value of SteamNetConnectionInfo_t::m_eState, or k_ESteamNetworkingConnectionState_None + /// if no connection exists with specified peer. You may pass nullptr for either parameter if + /// you do not need the corresponding details. Note that sessions time out after a while, + /// so if a connection fails, or SendMessageToUser returns k_EResultNoConnection, you cannot wait + /// indefinitely to obtain the reason for failure. + virtual ESteamNetworkingConnectionState GetSessionConnectionInfo( const SteamNetworkingIdentity &identityRemote, SteamNetConnectionInfo_t *pConnectionInfo, SteamNetConnectionRealTimeStatus_t *pQuickStatus ) = 0; +}; +#define STEAMNETWORKINGMESSAGES_INTERFACE_VERSION "SteamNetworkingMessages002" + +// +// Callbacks +// + +#pragma pack( push, 1 ) + +/// Posted when a remote host is sending us a message, and we do not already have a session with them +struct SteamNetworkingMessagesSessionRequest_t +{ + enum { k_iCallback = k_iSteamNetworkingMessagesCallbacks + 1 }; + SteamNetworkingIdentity m_identityRemote; // user who wants to talk to us +}; + +/// Posted when we fail to establish a connection, or we detect that communications +/// have been disrupted it an unusual way. There is no notification when a peer proactively +/// closes the session. ("Closed by peer" is not a concept of UDP-style communications, and +/// SteamNetworkingMessages is primarily intended to make porting UDP code easy.) +/// +/// Remember: callbacks are asynchronous. See notes on SendMessageToUser, +/// and k_nSteamNetworkingSend_AutoRestartBrokenSession in particular. +/// +/// Also, if a session times out due to inactivity, no callbacks will be posted. The only +/// way to detect that this is happening is that querying the session state may return +/// none, connecting, and findingroute again. +struct SteamNetworkingMessagesSessionFailed_t +{ + enum { k_iCallback = k_iSteamNetworkingMessagesCallbacks + 2 }; + + /// Detailed info about the session that failed. + /// SteamNetConnectionInfo_t::m_identityRemote indicates who this session + /// was with. + SteamNetConnectionInfo_t m_info; +}; + +#pragma pack(pop) + +// Global accessors + +// Using standalone lib +#ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB + + static_assert( STEAMNETWORKINGMESSAGES_INTERFACE_VERSION[25] == '2', "Version mismatch" ); + + STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingMessages *SteamNetworkingMessages_LibV2(); + inline ISteamNetworkingMessages *SteamNetworkingMessages_Lib() { return SteamNetworkingMessages_LibV2(); } + + // If running in context of steam, we also define a gameserver instance. + STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingMessages *SteamGameServerNetworkingMessages_LibV2(); + inline ISteamNetworkingMessages *SteamGameServerNetworkingMessages_Lib() { return SteamGameServerNetworkingMessages_LibV2(); } + + #ifndef STEAMNETWORKINGSOCKETS_STEAMAPI + inline ISteamNetworkingMessages *SteamNetworkingMessages() { return SteamNetworkingMessages_LibV2(); } + inline ISteamNetworkingMessages *SteamGameServerNetworkingMessages() { return SteamGameServerNetworkingMessages_LibV2(); } + #endif +#endif + +// Using Steamworks SDK +#ifdef STEAMNETWORKINGSOCKETS_STEAMAPI + + // Steamworks SDK + STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamNetworkingMessages *, SteamNetworkingMessages_SteamAPI, STEAMNETWORKINGMESSAGES_INTERFACE_VERSION ); + STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamNetworkingMessages *, SteamGameServerNetworkingMessages_SteamAPI, STEAMNETWORKINGMESSAGES_INTERFACE_VERSION ); + + #ifndef STEAMNETWORKINGSOCKETS_STANDALONELIB + inline ISteamNetworkingMessages *SteamNetworkingMessages() { return SteamNetworkingMessages_SteamAPI(); } + inline ISteamNetworkingMessages *SteamGameServerNetworkingMessages() { return SteamGameServerNetworkingMessages_SteamAPI(); } + #endif +#endif + +#endif // ISTEAMNETWORKINGMESSAGES diff --git a/external/steamworks/public/steam/isteamnetworkingsockets.h b/external/steamworks/public/steam/isteamnetworkingsockets.h new file mode 100644 index 0000000..14750a6 --- /dev/null +++ b/external/steamworks/public/steam/isteamnetworkingsockets.h @@ -0,0 +1,1030 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== + +#ifndef ISTEAMNETWORKINGSOCKETS +#define ISTEAMNETWORKINGSOCKETS +#pragma once + +#include "steamnetworkingtypes.h" +#include "steam_api_common.h" + +struct SteamNetAuthenticationStatus_t; +struct SteamNetworkingFakeIPResult_t; +class ISteamNetworkingConnectionSignaling; +class ISteamNetworkingSignalingRecvContext; +class ISteamNetworkingFakeUDPPort; + +//----------------------------------------------------------------------------- +/// Lower level networking API. +/// +/// - Connection-oriented API (like TCP, not UDP). When sending and receiving +/// messages, a connection handle is used. (For a UDP-style interface, where +/// the peer is identified by their address with each send/recv call, see +/// ISteamNetworkingMessages.) The typical pattern is for a "server" to "listen" +/// on a "listen socket." A "client" will "connect" to the server, and the +/// server will "accept" the connection. If you have a symmetric situation +/// where either peer may initiate the connection and server/client roles are +/// not clearly defined, check out k_ESteamNetworkingConfig_SymmetricConnect. +/// - But unlike TCP, it's message-oriented, not stream-oriented. +/// - Mix of reliable and unreliable messages +/// - Fragmentation and reassembly +/// - Supports connectivity over plain UDP +/// - Also supports SDR ("Steam Datagram Relay") connections, which are +/// addressed by the identity of the peer. There is a "P2P" use case and +/// a "hosted dedicated server" use case. +/// +/// Note that neither of the terms "connection" nor "socket" necessarily correspond +/// one-to-one with an underlying UDP socket. An attempt has been made to +/// keep the semantics as similar to the standard socket model when appropriate, +/// but some deviations do exist. +/// +/// See also: ISteamNetworkingMessages, the UDP-style interface. This API might be +/// easier to use, especially when porting existing UDP code. +class ISteamNetworkingSockets +{ +public: + + /// Creates a "server" socket that listens for clients to connect to by + /// calling ConnectByIPAddress, over ordinary UDP (IPv4 or IPv6) + /// + /// You must select a specific local port to listen on and set it + /// the port field of the local address. + /// + /// Usually you will set the IP portion of the address to zero (SteamNetworkingIPAddr::Clear()). + /// This means that you will not bind to any particular local interface (i.e. the same + /// as INADDR_ANY in plain socket code). Furthermore, if possible the socket will be bound + /// in "dual stack" mode, which means that it can accept both IPv4 and IPv6 client connections. + /// If you really do wish to bind a particular interface, then set the local address to the + /// appropriate IPv4 or IPv6 IP. + /// + /// If you need to set any initial config options, pass them here. See + /// SteamNetworkingConfigValue_t for more about why this is preferable to + /// setting the options "immediately" after creation. + /// + /// When a client attempts to connect, a SteamNetConnectionStatusChangedCallback_t + /// will be posted. The connection will be in the connecting state. + virtual HSteamListenSocket CreateListenSocketIP( const SteamNetworkingIPAddr &localAddress, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; + + /// Creates a connection and begins talking to a "server" over UDP at the + /// given IPv4 or IPv6 address. The remote host must be listening with a + /// matching call to CreateListenSocketIP on the specified port. + /// + /// A SteamNetConnectionStatusChangedCallback_t callback will be triggered when we start + /// connecting, and then another one on either timeout or successful connection. + /// + /// If the server does not have any identity configured, then their network address + /// will be the only identity in use. Or, the network host may provide a platform-specific + /// identity with or without a valid certificate to authenticate that identity. (These + /// details will be contained in the SteamNetConnectionStatusChangedCallback_t.) It's + /// up to your application to decide whether to allow the connection. + /// + /// By default, all connections will get basic encryption sufficient to prevent + /// casual eavesdropping. But note that without certificates (or a shared secret + /// distributed through some other out-of-band mechanism), you don't have any + /// way of knowing who is actually on the other end, and thus are vulnerable to + /// man-in-the-middle attacks. + /// + /// If you need to set any initial config options, pass them here. See + /// SteamNetworkingConfigValue_t for more about why this is preferable to + /// setting the options "immediately" after creation. + virtual HSteamNetConnection ConnectByIPAddress( const SteamNetworkingIPAddr &address, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; + + /// Like CreateListenSocketIP, but clients will connect using ConnectP2P. + /// + /// nLocalVirtualPort specifies how clients can connect to this socket using + /// ConnectP2P. It's very common for applications to only have one listening socket; + /// in that case, use zero. If you need to open multiple listen sockets and have clients + /// be able to connect to one or the other, then nLocalVirtualPort should be a small + /// integer (<1000) unique to each listen socket you create. + /// + /// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess() + /// when your app initializes. + /// + /// If you are listening on a dedicated servers in known data center, + /// then you can listen using this function instead of CreateHostedDedicatedServerListenSocket, + /// to allow clients to connect without a ticket. Any user that owns + /// the app and is signed into Steam will be able to attempt to connect to + /// your server. Also, a connection attempt may require the client to + /// be connected to Steam, which is one more moving part that may fail. When + /// tickets are used, then once a ticket is obtained, a client can connect to + /// your server even if they got disconnected from Steam or Steam is offline. + /// + /// If you need to set any initial config options, pass them here. See + /// SteamNetworkingConfigValue_t for more about why this is preferable to + /// setting the options "immediately" after creation. + virtual HSteamListenSocket CreateListenSocketP2P( int nLocalVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; + + /// Begin connecting to a peer that is identified using a platform-specific identifier. + /// This uses the default rendezvous service, which depends on the platform and library + /// configuration. (E.g. on Steam, it goes through the steam backend.) + /// + /// If you need to set any initial config options, pass them here. See + /// SteamNetworkingConfigValue_t for more about why this is preferable to + /// setting the options "immediately" after creation. + /// + /// To use your own signaling service, see: + /// - ConnectP2PCustomSignaling + /// - k_ESteamNetworkingConfig_Callback_CreateConnectionSignaling + virtual HSteamNetConnection ConnectP2P( const SteamNetworkingIdentity &identityRemote, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; + + /// Accept an incoming connection that has been received on a listen socket. + /// + /// When a connection attempt is received (perhaps after a few basic handshake + /// packets have been exchanged to prevent trivial spoofing), a connection interface + /// object is created in the k_ESteamNetworkingConnectionState_Connecting state + /// and a SteamNetConnectionStatusChangedCallback_t is posted. At this point, your + /// application MUST either accept or close the connection. (It may not ignore it.) + /// Accepting the connection will transition it either into the connected state, + /// or the finding route state, depending on the connection type. + /// + /// You should take action within a second or two, because accepting the connection is + /// what actually sends the reply notifying the client that they are connected. If you + /// delay taking action, from the client's perspective it is the same as the network + /// being unresponsive, and the client may timeout the connection attempt. In other + /// words, the client cannot distinguish between a delay caused by network problems + /// and a delay caused by the application. + /// + /// This means that if your application goes for more than a few seconds without + /// processing callbacks (for example, while loading a map), then there is a chance + /// that a client may attempt to connect in that interval and fail due to timeout. + /// + /// If the application does not respond to the connection attempt in a timely manner, + /// and we stop receiving communication from the client, the connection attempt will + /// be timed out locally, transitioning the connection to the + /// k_ESteamNetworkingConnectionState_ProblemDetectedLocally state. The client may also + /// close the connection before it is accepted, and a transition to the + /// k_ESteamNetworkingConnectionState_ClosedByPeer is also possible depending the exact + /// sequence of events. + /// + /// Returns k_EResultInvalidParam if the handle is invalid. + /// Returns k_EResultInvalidState if the connection is not in the appropriate state. + /// (Remember that the connection state could change in between the time that the + /// notification being posted to the queue and when it is received by the application.) + /// + /// A note about connection configuration options. If you need to set any configuration + /// options that are common to all connections accepted through a particular listen + /// socket, consider setting the options on the listen socket, since such options are + /// inherited automatically. If you really do need to set options that are connection + /// specific, it is safe to set them on the connection before accepting the connection. + virtual EResult AcceptConnection( HSteamNetConnection hConn ) = 0; + + /// Disconnects from the remote host and invalidates the connection handle. + /// Any unread data on the connection is discarded. + /// + /// nReason is an application defined code that will be received on the other + /// end and recorded (when possible) in backend analytics. The value should + /// come from a restricted range. (See ESteamNetConnectionEnd.) If you don't need + /// to communicate any information to the remote host, and do not want analytics to + /// be able to distinguish "normal" connection terminations from "exceptional" ones, + /// You may pass zero, in which case the generic value of + /// k_ESteamNetConnectionEnd_App_Generic will be used. + /// + /// pszDebug is an optional human-readable diagnostic string that will be received + /// by the remote host and recorded (when possible) in backend analytics. + /// + /// If you wish to put the socket into a "linger" state, where an attempt is made to + /// flush any remaining sent data, use bEnableLinger=true. Otherwise reliable data + /// is not flushed. + /// + /// If the connection has already ended and you are just freeing up the + /// connection interface, the reason code, debug string, and linger flag are + /// ignored. + virtual bool CloseConnection( HSteamNetConnection hPeer, int nReason, const char *pszDebug, bool bEnableLinger ) = 0; + + /// Destroy a listen socket. All the connections that were accepting on the listen + /// socket are closed ungracefully. + virtual bool CloseListenSocket( HSteamListenSocket hSocket ) = 0; + + /// Set connection user data. the data is returned in the following places + /// - You can query it using GetConnectionUserData. + /// - The SteamNetworkingmessage_t structure. + /// - The SteamNetConnectionInfo_t structure. + /// (Which is a member of SteamNetConnectionStatusChangedCallback_t -- but see WARNINGS below!!!!) + /// + /// Do you need to set this atomically when the connection is created? + /// See k_ESteamNetworkingConfig_ConnectionUserData. + /// + /// WARNING: Be *very careful* when using the value provided in callbacks structs. + /// Callbacks are queued, and the value that you will receive in your + /// callback is the userdata that was effective at the time the callback + /// was queued. There are subtle race conditions that can happen if you + /// don't understand this! + /// + /// If any incoming messages for this connection are queued, the userdata + /// field is updated, so that when when you receive messages (e.g. with + /// ReceiveMessagesOnConnection), they will always have the very latest + /// userdata. So the tricky race conditions that can happen with callbacks + /// do not apply to retrieving messages. + /// + /// Returns false if the handle is invalid. + virtual bool SetConnectionUserData( HSteamNetConnection hPeer, int64 nUserData ) = 0; + + /// Fetch connection user data. Returns -1 if handle is invalid + /// or if you haven't set any userdata on the connection. + virtual int64 GetConnectionUserData( HSteamNetConnection hPeer ) = 0; + + /// Set a name for the connection, used mostly for debugging + virtual void SetConnectionName( HSteamNetConnection hPeer, const char *pszName ) = 0; + + /// Fetch connection name. Returns false if handle is invalid + virtual bool GetConnectionName( HSteamNetConnection hPeer, char *pszName, int nMaxLen ) = 0; + + /// Send a message to the remote host on the specified connection. + /// + /// nSendFlags determines the delivery guarantees that will be provided, + /// when data should be buffered, etc. E.g. k_nSteamNetworkingSend_Unreliable + /// + /// Note that the semantics we use for messages are not precisely + /// the same as the semantics of a standard "stream" socket. + /// (SOCK_STREAM) For an ordinary stream socket, the boundaries + /// between chunks are not considered relevant, and the sizes of + /// the chunks of data written will not necessarily match up to + /// the sizes of the chunks that are returned by the reads on + /// the other end. The remote host might read a partial chunk, + /// or chunks might be coalesced. For the message semantics + /// used here, however, the sizes WILL match. Each send call + /// will match a successful read call on the remote host + /// one-for-one. If you are porting existing stream-oriented + /// code to the semantics of reliable messages, your code should + /// work the same, since reliable message semantics are more + /// strict than stream semantics. The only caveat is related to + /// performance: there is per-message overhead to retain the + /// message sizes, and so if your code sends many small chunks + /// of data, performance will suffer. Any code based on stream + /// sockets that does not write excessively small chunks will + /// work without any changes. + /// + /// The pOutMessageNumber is an optional pointer to receive the + /// message number assigned to the message, if sending was successful. + /// + /// Returns: + /// - k_EResultInvalidParam: invalid connection handle, or the individual message is too big. + /// (See k_cbMaxSteamNetworkingSocketsMessageSizeSend) + /// - k_EResultInvalidState: connection is in an invalid state + /// - k_EResultNoConnection: connection has ended + /// - k_EResultIgnored: You used k_nSteamNetworkingSend_NoDelay, and the message was dropped because + /// we were not ready to send it. + /// - k_EResultLimitExceeded: there was already too much data queued to be sent. + /// (See k_ESteamNetworkingConfig_SendBufferSize) + virtual EResult SendMessageToConnection( HSteamNetConnection hConn, const void *pData, uint32 cbData, int nSendFlags, int64 *pOutMessageNumber ) = 0; + + /// Send one or more messages without copying the message payload. + /// This is the most efficient way to send messages. To use this + /// function, you must first allocate a message object using + /// ISteamNetworkingUtils::AllocateMessage. (Do not declare one + /// on the stack or allocate your own.) + /// + /// You should fill in the message payload. You can either let + /// it allocate the buffer for you and then fill in the payload, + /// or if you already have a buffer allocated, you can just point + /// m_pData at your buffer and set the callback to the appropriate function + /// to free it. Note that if you use your own buffer, it MUST remain valid + /// until the callback is executed. And also note that your callback can be + /// invoked at any time from any thread (perhaps even before SendMessages + /// returns!), so it MUST be fast and threadsafe. + /// + /// You MUST also fill in: + /// - m_conn - the handle of the connection to send the message to + /// - m_nFlags - bitmask of k_nSteamNetworkingSend_xxx flags. + /// + /// All other fields are currently reserved and should not be modified. + /// + /// The library will take ownership of the message structures. They may + /// be modified or become invalid at any time, so you must not read them + /// after passing them to this function. + /// + /// pOutMessageNumberOrResult is an optional array that will receive, + /// for each message, the message number that was assigned to the message + /// if sending was successful. If sending failed, then a negative EResult + /// value is placed into the array. For example, the array will hold + /// -k_EResultInvalidState if the connection was in an invalid state. + /// See ISteamNetworkingSockets::SendMessageToConnection for possible + /// failure codes. + virtual void SendMessages( int nMessages, SteamNetworkingMessage_t *const *pMessages, int64 *pOutMessageNumberOrResult ) = 0; + + /// Flush any messages waiting on the Nagle timer and send them + /// at the next transmission opportunity (often that means right now). + /// + /// If Nagle is enabled (it's on by default) then when calling + /// SendMessageToConnection the message will be buffered, up to the Nagle time + /// before being sent, to merge small messages into the same packet. + /// (See k_ESteamNetworkingConfig_NagleTime) + /// + /// Returns: + /// k_EResultInvalidParam: invalid connection handle + /// k_EResultInvalidState: connection is in an invalid state + /// k_EResultNoConnection: connection has ended + /// k_EResultIgnored: We weren't (yet) connected, so this operation has no effect. + virtual EResult FlushMessagesOnConnection( HSteamNetConnection hConn ) = 0; + + /// Fetch the next available message(s) from the connection, if any. + /// Returns the number of messages returned into your array, up to nMaxMessages. + /// If the connection handle is invalid, -1 is returned. + /// + /// The order of the messages returned in the array is relevant. + /// Reliable messages will be received in the order they were sent (and with the + /// same sizes --- see SendMessageToConnection for on this subtle difference from a stream socket). + /// + /// Unreliable messages may be dropped, or delivered out of order with respect to + /// each other or with respect to reliable messages. The same unreliable message + /// may be received multiple times. + /// + /// If any messages are returned, you MUST call SteamNetworkingMessage_t::Release() on each + /// of them free up resources after you are done. It is safe to keep the object alive for + /// a little while (put it into some queue, etc), and you may call Release() from any thread. + virtual int ReceiveMessagesOnConnection( HSteamNetConnection hConn, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0; + + /// Returns basic information about the high-level state of the connection. + virtual bool GetConnectionInfo( HSteamNetConnection hConn, SteamNetConnectionInfo_t *pInfo ) = 0; + + /// Returns a small set of information about the real-time state of the connection + /// and the queue status of each lane. + /// + /// - pStatus may be NULL if the information is not desired. (E.g. you are only interested + /// in the lane information.) + /// - On entry, nLanes specifies the length of the pLanes array. This may be 0 + /// if you do not wish to receive any lane data. It's OK for this to be smaller than + /// the total number of configured lanes. + /// - pLanes points to an array that will receive lane-specific info. It can be NULL + /// if this is not needed. + /// + /// Return value: + /// - k_EResultNoConnection - connection handle is invalid or connection has been closed. + /// - k_EResultInvalidParam - nLanes is bad + virtual EResult GetConnectionRealTimeStatus( HSteamNetConnection hConn, SteamNetConnectionRealTimeStatus_t *pStatus, + int nLanes, SteamNetConnectionRealTimeLaneStatus_t *pLanes ) = 0; + + /// Returns detailed connection stats in text format. Useful + /// for dumping to a log, etc. + /// + /// Returns: + /// -1 failure (bad connection handle) + /// 0 OK, your buffer was filled in and '\0'-terminated + /// >0 Your buffer was either nullptr, or it was too small and the text got truncated. + /// Try again with a buffer of at least N bytes. + virtual int GetDetailedConnectionStatus( HSteamNetConnection hConn, char *pszBuf, int cbBuf ) = 0; + + /// Returns local IP and port that a listen socket created using CreateListenSocketIP is bound to. + /// + /// An IPv6 address of ::0 means "any IPv4 or IPv6" + /// An IPv6 address of ::ffff:0000:0000 means "any IPv4" + virtual bool GetListenSocketAddress( HSteamListenSocket hSocket, SteamNetworkingIPAddr *address ) = 0; + + /// Create a pair of connections that are talking to each other, e.g. a loopback connection. + /// This is very useful for testing, or so that your client/server code can work the same + /// even when you are running a local "server". + /// + /// The two connections will immediately be placed into the connected state, and no callbacks + /// will be posted immediately. After this, if you close either connection, the other connection + /// will receive a callback, exactly as if they were communicating over the network. You must + /// close *both* sides in order to fully clean up the resources! + /// + /// By default, internal buffers are used, completely bypassing the network, the chopping up of + /// messages into packets, encryption, copying the payload, etc. This means that loopback + /// packets, by default, will not simulate lag or loss. Passing true for bUseNetworkLoopback will + /// cause the socket pair to send packets through the local network loopback device (127.0.0.1) + /// on ephemeral ports. Fake lag and loss are supported in this case, and CPU time is expended + /// to encrypt and decrypt. + /// + /// If you wish to assign a specific identity to either connection, you may pass a particular + /// identity. Otherwise, if you pass nullptr, the respective connection will assume a generic + /// "localhost" identity. If you use real network loopback, this might be translated to the + /// actual bound loopback port. Otherwise, the port will be zero. + virtual bool CreateSocketPair( HSteamNetConnection *pOutConnection1, HSteamNetConnection *pOutConnection2, bool bUseNetworkLoopback, const SteamNetworkingIdentity *pIdentity1, const SteamNetworkingIdentity *pIdentity2 ) = 0; + + /// Configure multiple outbound messages streams ("lanes") on a connection, and + /// control head-of-line blocking between them. Messages within a given lane + /// are always sent in the order they are queued, but messages from different + /// lanes may be sent out of order. Each lane has its own message number + /// sequence. The first message sent on each lane will be assigned the number 1. + /// + /// Each lane has a "priority". Lanes with higher numeric values will only be processed + /// when all lanes with lower number values are empty. The magnitudes of the priority + /// values are not relevant, only their sort order. + /// + /// Each lane also is assigned a weight, which controls the approximate proportion + /// of the bandwidth that will be consumed by the lane, relative to other lanes + /// of the same priority. (This is assuming the lane stays busy. An idle lane + /// does not build up "credits" to be be spent once a message is queued.) + /// This value is only meaningful as a proportion, relative to other lanes with + /// the same priority. For lanes with different priorities, the strict priority + /// order will prevail, and their weights relative to each other are not relevant. + /// Thus, if a lane has a unique priority value, the weight value for that lane is + /// not relevant. + /// + /// Example: 3 lanes, with priorities [ 0, 10, 10 ] and weights [ (NA), 20, 5 ]. + /// Messages sent on the first will always be sent first, before messages in the + /// other two lanes. Its weight value is irrelevant, since there are no other + /// lanes with priority=0. The other two lanes will share bandwidth, with the second + /// and third lanes sharing bandwidth using a ratio of approximately 4:1. + /// (The weights [ NA, 4, 1 ] would be equivalent.) + /// + /// Notes: + /// - At the time of this writing, some code has performance cost that is linear + /// in the number of lanes, so keep the number of lanes to an absolute minimum. + /// 3 or so is fine; >8 is a lot. The max number of lanes on Steam is 255, + /// which is a very large number and not recommended! If you are compiling this + /// library from source, see STEAMNETWORKINGSOCKETS_MAX_LANES.) + /// - Lane priority values may be any int. Their absolute value is not relevant, + /// only the order matters. + /// - Weights must be positive, and due to implementation details, they are restricted + /// to 16-bit values. The absolute magnitudes don't matter, just the proportions. + /// - Messages sent on a lane index other than 0 have a small overhead on the wire, + /// so for maximum wire efficiency, lane 0 should be the "most common" lane, regardless + /// of priorities or weights. + /// - A connection has a single lane by default. Calling this function with + /// nNumLanes=1 is legal, but pointless, since the priority and weight values are + /// irrelevant in that case. + /// - You may reconfigure connection lanes at any time, however reducing the number of + /// lanes is not allowed. + /// - Reconfiguring lanes might restart any bandwidth sharing balancing. Usually you + /// will call this function once, near the start of the connection, perhaps after + /// exchanging a few messages. + /// - To assign all lanes the same priority, you may use pLanePriorities=NULL. + /// - If you wish all lanes with the same priority to share bandwidth equally (or + /// if no two lanes have the same priority value, and thus priority values are + /// irrelevant), you may use pLaneWeights=NULL + /// - Priorities and weights determine the order that messages are SENT on the wire. + /// There are NO GUARANTEES on the order that messages are RECEIVED! Due to packet + /// loss, out-of-order delivery, and subtle details of packet serialization, messages + /// might still be received slightly out-of-order! The *only* strong guarantee is that + /// *reliable* messages on the *same lane* will be delivered in the order they are sent. + /// - Each host configures the lanes for the packets they send; the lanes for the flow + /// in one direction are completely unrelated to the lanes in the opposite direction. + /// + /// Return value: + /// - k_EResultNoConnection - bad hConn + /// - k_EResultInvalidParam - Invalid number of lanes, bad weights, or you tried to reduce the number of lanes + /// - k_EResultInvalidState - Connection is already dead, etc + /// + /// See also: + /// SteamNetworkingMessage_t::m_idxLane + virtual EResult ConfigureConnectionLanes( HSteamNetConnection hConn, int nNumLanes, const int *pLanePriorities, const uint16 *pLaneWeights ) = 0; + + // + // Identity and authentication + // + + /// Get the identity assigned to this interface. + /// E.g. on Steam, this is the user's SteamID, or for the gameserver interface, the SteamID assigned + /// to the gameserver. Returns false and sets the result to an invalid identity if we don't know + /// our identity yet. (E.g. GameServer has not logged in. On Steam, the user will know their SteamID + /// even if they are not signed into Steam.) + virtual bool GetIdentity( SteamNetworkingIdentity *pIdentity ) = 0; + + /// Indicate our desire to be ready participate in authenticated communications. + /// If we are currently not ready, then steps will be taken to obtain the necessary + /// certificates. (This includes a certificate for us, as well as any CA certificates + /// needed to authenticate peers.) + /// + /// You can call this at program init time if you know that you are going to + /// be making authenticated connections, so that we will be ready immediately when + /// those connections are attempted. (Note that essentially all connections require + /// authentication, with the exception of ordinary UDP connections with authentication + /// disabled using k_ESteamNetworkingConfig_IP_AllowWithoutAuth.) If you don't call + /// this function, we will wait until a feature is utilized that that necessitates + /// these resources. + /// + /// You can also call this function to force a retry, if failure has occurred. + /// Once we make an attempt and fail, we will not automatically retry. + /// In this respect, the behavior of the system after trying and failing is the same + /// as before the first attempt: attempting authenticated communication or calling + /// this function will call the system to attempt to acquire the necessary resources. + /// + /// You can use GetAuthenticationStatus or listen for SteamNetAuthenticationStatus_t + /// to monitor the status. + /// + /// Returns the current value that would be returned from GetAuthenticationStatus. + virtual ESteamNetworkingAvailability InitAuthentication() = 0; + + /// Query our readiness to participate in authenticated communications. A + /// SteamNetAuthenticationStatus_t callback is posted any time this status changes, + /// but you can use this function to query it at any time. + /// + /// The value of SteamNetAuthenticationStatus_t::m_eAvail is returned. If you only + /// want this high level status, you can pass NULL for pDetails. If you want further + /// details, pass non-NULL to receive them. + virtual ESteamNetworkingAvailability GetAuthenticationStatus( SteamNetAuthenticationStatus_t *pDetails ) = 0; + + // + // Poll groups. A poll group is a set of connections that can be polled efficiently. + // (In our API, to "poll" a connection means to retrieve all pending messages. We + // actually don't have an API to "poll" the connection *state*, like BSD sockets.) + // + + /// Create a new poll group. + /// + /// You should destroy the poll group when you are done using DestroyPollGroup + virtual HSteamNetPollGroup CreatePollGroup() = 0; + + /// Destroy a poll group created with CreatePollGroup(). + /// + /// If there are any connections in the poll group, they are removed from the group, + /// and left in a state where they are not part of any poll group. + /// Returns false if passed an invalid poll group handle. + virtual bool DestroyPollGroup( HSteamNetPollGroup hPollGroup ) = 0; + + /// Assign a connection to a poll group. Note that a connection may only belong to a + /// single poll group. Adding a connection to a poll group implicitly removes it from + /// any other poll group it is in. + /// + /// You can pass k_HSteamNetPollGroup_Invalid to remove a connection from its current + /// poll group without adding it to a new poll group. + /// + /// If there are received messages currently pending on the connection, an attempt + /// is made to add them to the queue of messages for the poll group in approximately + /// the order that would have applied if the connection was already part of the poll + /// group at the time that the messages were received. + /// + /// Returns false if the connection handle is invalid, or if the poll group handle + /// is invalid (and not k_HSteamNetPollGroup_Invalid). + virtual bool SetConnectionPollGroup( HSteamNetConnection hConn, HSteamNetPollGroup hPollGroup ) = 0; + + /// Same as ReceiveMessagesOnConnection, but will return the next messages available + /// on any connection in the poll group. Examine SteamNetworkingMessage_t::m_conn + /// to know which connection. (SteamNetworkingMessage_t::m_nConnUserData might also + /// be useful.) + /// + /// Delivery order of messages among different connections will usually match the + /// order that the last packet was received which completed the message. But this + /// is not a strong guarantee, especially for packets received right as a connection + /// is being assigned to poll group. + /// + /// Delivery order of messages on the same connection is well defined and the + /// same guarantees are present as mentioned in ReceiveMessagesOnConnection. + /// (But the messages are not grouped by connection, so they will not necessarily + /// appear consecutively in the list; they may be interleaved with messages for + /// other connections.) + virtual int ReceiveMessagesOnPollGroup( HSteamNetPollGroup hPollGroup, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0; + + // + // Clients connecting to dedicated servers hosted in a data center, + // using tickets issued by your game coordinator. If you are not + // issuing your own tickets to restrict who can attempt to connect + // to your server, then you won't use these functions. + // + + /// Call this when you receive a ticket from your backend / matchmaking system. Puts the + /// ticket into a persistent cache, and optionally returns the parsed ticket. + /// + /// See stamdatagram_ticketgen.h for more details. + virtual bool ReceivedRelayAuthTicket( const void *pvTicket, int cbTicket, SteamDatagramRelayAuthTicket *pOutParsedTicket ) = 0; + + /// Search cache for a ticket to talk to the server on the specified virtual port. + /// If found, returns the number of seconds until the ticket expires, and optionally + /// the complete cracked ticket. Returns 0 if we don't have a ticket. + /// + /// Typically this is useful just to confirm that you have a ticket, before you + /// call ConnectToHostedDedicatedServer to connect to the server. + virtual int FindRelayAuthTicketForServer( const SteamNetworkingIdentity &identityGameServer, int nRemoteVirtualPort, SteamDatagramRelayAuthTicket *pOutParsedTicket ) = 0; + + /// Client call to connect to a server hosted in a Valve data center, on the specified virtual + /// port. You must have placed a ticket for this server into the cache, or else this connect + /// attempt will fail! If you are not issuing your own tickets, then to connect to a dedicated + /// server via SDR in auto-ticket mode, use ConnectP2P. (The server must be configured to allow + /// this type of connection by listening using CreateListenSocketP2P.) + /// + /// You may wonder why tickets are stored in a cache, instead of simply being passed as an argument + /// here. The reason is to make reconnection to a gameserver robust, even if the client computer loses + /// connection to Steam or the central backend, or the app is restarted or crashes, etc. + /// + /// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess() + /// when your app initializes + /// + /// If you need to set any initial config options, pass them here. See + /// SteamNetworkingConfigValue_t for more about why this is preferable to + /// setting the options "immediately" after creation. + virtual HSteamNetConnection ConnectToHostedDedicatedServer( const SteamNetworkingIdentity &identityTarget, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; + + // + // Servers hosted in data centers known to the Valve relay network + // + + /// Returns the value of the SDR_LISTEN_PORT environment variable. This + /// is the UDP server your server will be listening on. This will + /// configured automatically for you in production environments. + /// + /// In development, you'll need to set it yourself. See + /// https://partner.steamgames.com/doc/api/ISteamNetworkingSockets + /// for more information on how to configure dev environments. + virtual uint16 GetHostedDedicatedServerPort() = 0; + + /// Returns 0 if SDR_LISTEN_PORT is not set. Otherwise, returns the data center the server + /// is running in. This will be k_SteamDatagramPOPID_dev in non-production environment. + virtual SteamNetworkingPOPID GetHostedDedicatedServerPOPID() = 0; + + /// Return info about the hosted server. This contains the PoPID of the server, + /// and opaque routing information that can be used by the relays to send traffic + /// to your server. + /// + /// You will need to send this information to your backend, and put it in tickets, + /// so that the relays will know how to forward traffic from + /// clients to your server. See SteamDatagramRelayAuthTicket for more info. + /// + /// Also, note that the routing information is contained in SteamDatagramGameCoordinatorServerLogin, + /// so if possible, it's preferred to use GetGameCoordinatorServerLogin to send this info + /// to your game coordinator service, and also login securely at the same time. + /// + /// On a successful exit, k_EResultOK is returned + /// + /// Unsuccessful exit: + /// - Something other than k_EResultOK is returned. + /// - k_EResultInvalidState: We are not configured to listen for SDR (SDR_LISTEN_SOCKET + /// is not set.) + /// - k_EResultPending: we do not (yet) have the authentication information needed. + /// (See GetAuthenticationStatus.) If you use environment variables to pre-fetch + /// the network config, this data should always be available immediately. + /// - A non-localized diagnostic debug message will be placed in m_data that describes + /// the cause of the failure. + /// + /// NOTE: The returned blob is not encrypted. Send it to your backend, but don't + /// directly share it with clients. + virtual EResult GetHostedDedicatedServerAddress( SteamDatagramHostedAddress *pRouting ) = 0; + + /// Create a listen socket on the specified virtual port. The physical UDP port to use + /// will be determined by the SDR_LISTEN_PORT environment variable. If a UDP port is not + /// configured, this call will fail. + /// + /// This call MUST be made through the SteamGameServerNetworkingSockets() interface. + /// + /// This function should be used when you are using the ticket generator library + /// to issue your own tickets. Clients connecting to the server on this virtual + /// port will need a ticket, and they must connect using ConnectToHostedDedicatedServer. + /// + /// If you need to set any initial config options, pass them here. See + /// SteamNetworkingConfigValue_t for more about why this is preferable to + /// setting the options "immediately" after creation. + virtual HSteamListenSocket CreateHostedDedicatedServerListenSocket( int nLocalVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; + + /// Generate an authentication blob that can be used to securely login with + /// your backend, using SteamDatagram_ParseHostedServerLogin. (See + /// steamdatagram_gamecoordinator.h) + /// + /// Before calling the function: + /// - Populate the app data in pLoginInfo (m_cbAppData and m_appData). You can leave + /// all other fields uninitialized. + /// - *pcbSignedBlob contains the size of the buffer at pBlob. (It should be + /// at least k_cbMaxSteamDatagramGameCoordinatorServerLoginSerialized.) + /// + /// On a successful exit: + /// - k_EResultOK is returned + /// - All of the remaining fields of pLoginInfo will be filled out. + /// - *pcbSignedBlob contains the size of the serialized blob that has been + /// placed into pBlob. + /// + /// Unsuccessful exit: + /// - Something other than k_EResultOK is returned. + /// - k_EResultNotLoggedOn: you are not logged in (yet) + /// - See GetHostedDedicatedServerAddress for more potential failure return values. + /// - A non-localized diagnostic debug message will be placed in pBlob that describes + /// the cause of the failure. + /// + /// This works by signing the contents of the SteamDatagramGameCoordinatorServerLogin + /// with the cert that is issued to this server. In dev environments, it's OK if you do + /// not have a cert. (You will need to enable insecure dev login in SteamDatagram_ParseHostedServerLogin.) + /// Otherwise, you will need a signed cert. + /// + /// NOTE: The routing blob returned here is not encrypted. Send it to your backend + /// and don't share it directly with clients. + virtual EResult GetGameCoordinatorServerLogin( SteamDatagramGameCoordinatorServerLogin *pLoginInfo, int *pcbSignedBlob, void *pBlob ) = 0; + + + // + // Relayed connections using custom signaling protocol + // + // This is used if you have your own method of sending out-of-band + // signaling / rendezvous messages through a mutually trusted channel. + // + + /// Create a P2P "client" connection that does signaling over a custom + /// rendezvous/signaling channel. + /// + /// pSignaling points to a new object that you create just for this connection. + /// It must stay valid until Release() is called. Once you pass the + /// object to this function, it assumes ownership. Release() will be called + /// from within the function call if the call fails. Furthermore, until Release() + /// is called, you should be prepared for methods to be invoked on your + /// object from any thread! You need to make sure your object is threadsafe! + /// Furthermore, you should make sure that dispatching the methods is done + /// as quickly as possible. + /// + /// This function will immediately construct a connection in the "connecting" + /// state. Soon after (perhaps before this function returns, perhaps in another thread), + /// the connection will begin sending signaling messages by calling + /// ISteamNetworkingConnectionSignaling::SendSignal. + /// + /// When the remote peer accepts the connection (See + /// ISteamNetworkingSignalingRecvContext::OnConnectRequest), + /// it will begin sending signaling messages. When these messages are received, + /// you can pass them to the connection using ReceivedP2PCustomSignal. + /// + /// If you know the identity of the peer that you expect to be on the other end, + /// you can pass their identity to improve debug output or just detect bugs. + /// If you don't know their identity yet, you can pass NULL, and their + /// identity will be established in the connection handshake. + /// + /// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess() + /// when your app initializes + /// + /// If you need to set any initial config options, pass them here. See + /// SteamNetworkingConfigValue_t for more about why this is preferable to + /// setting the options "immediately" after creation. + virtual HSteamNetConnection ConnectP2PCustomSignaling( ISteamNetworkingConnectionSignaling *pSignaling, const SteamNetworkingIdentity *pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; + + /// Called when custom signaling has received a message. When your + /// signaling channel receives a message, it should save off whatever + /// routing information was in the envelope into the context object, + /// and then pass the payload to this function. + /// + /// A few different things can happen next, depending on the message: + /// + /// - If the signal is associated with existing connection, it is dealt + /// with immediately. If any replies need to be sent, they will be + /// dispatched using the ISteamNetworkingConnectionSignaling + /// associated with the connection. + /// - If the message represents a connection request (and the request + /// is not redundant for an existing connection), a new connection + /// will be created, and ReceivedConnectRequest will be called on your + /// context object to determine how to proceed. + /// - Otherwise, the message is for a connection that does not + /// exist (anymore). In this case, we *may* call SendRejectionReply + /// on your context object. + /// + /// In any case, we will not save off pContext or access it after this + /// function returns. + /// + /// Returns true if the message was parsed and dispatched without anything + /// unusual or suspicious happening. Returns false if there was some problem + /// with the message that prevented ordinary handling. (Debug output will + /// usually have more information.) + /// + /// If you expect to be using relayed connections, then you probably want + /// to call ISteamNetworkingUtils::InitRelayNetworkAccess() when your app initializes + virtual bool ReceivedP2PCustomSignal( const void *pMsg, int cbMsg, ISteamNetworkingSignalingRecvContext *pContext ) = 0; + + // + // Certificate provision by the application. On Steam, we normally handle all this automatically + // and you will not need to use these advanced functions. + // + + /// Get blob that describes a certificate request. You can send this to your game coordinator. + /// Upon entry, *pcbBlob should contain the size of the buffer. On successful exit, it will + /// return the number of bytes that were populated. You can pass pBlob=NULL to query for the required + /// size. (512 bytes is a conservative estimate.) + /// + /// Pass this blob to your game coordinator and call SteamDatagram_CreateCert. + virtual bool GetCertificateRequest( int *pcbBlob, void *pBlob, SteamNetworkingErrMsg &errMsg ) = 0; + + /// Set the certificate. The certificate blob should be the output of + /// SteamDatagram_CreateCert. + virtual bool SetCertificate( const void *pCertificate, int cbCertificate, SteamNetworkingErrMsg &errMsg ) = 0; + + /// Reset the identity associated with this instance. + /// Any open connections are closed. Any previous certificates, etc are discarded. + /// You can pass a specific identity that you want to use, or you can pass NULL, + /// in which case the identity will be invalid until you set it using SetCertificate + /// + /// NOTE: This function is not actually supported on Steam! It is included + /// for use on other platforms where the active user can sign out and + /// a new user can sign in. + virtual void ResetIdentity( const SteamNetworkingIdentity *pIdentity ) = 0; + + // + // Misc + // + + /// Invoke all callback functions queued for this interface. + /// See k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged, etc + /// + /// You don't need to call this if you are using Steam's callback dispatch + /// mechanism (SteamAPI_RunCallbacks and SteamGameserver_RunCallbacks). + virtual void RunCallbacks() = 0; + + // + // "FakeIP" system. + // + // A FakeIP is essentially a temporary, arbitrary identifier that + // happens to be a valid IPv4 address. The purpose of this system is to make it + // easy to integrate with existing code that identifies hosts using IPv4 addresses. + // The FakeIP address will never actually be used to send or receive any packets + // on the Internet, it is strictly an identifier. + // + // FakeIP addresses are designed to (hopefully) pass through existing code as + // transparently as possible, while conflicting with "real" addresses that might + // be in use on networks (both the Internet and LANs) in the same code as little + // as possible. At the time this comment is being written, they come from the + // 169.254.0.0/16 range, and the port number will always be >1024. HOWEVER, + // this is subject to change! Do not make assumptions about these addresses, + // or your code might break in the future. In particular, you should use + // functions such as ISteamNetworkingUtils::IsFakeIP to determine if an IP + // address is a "fake" one used by this system. + // + + /// Begin asynchronous process of allocating a fake IPv4 address that other + /// peers can use to contact us via P2P. IP addresses returned by this + /// function are globally unique for a given appid. + /// + /// nNumPorts is the numbers of ports you wish to reserve. This is useful + /// for the same reason that listening on multiple UDP ports is useful for + /// different types of traffic. Because these allocations come from a global + /// namespace, there is a relatively strict limit on the maximum number of + /// ports you may request. (At the time of this writing, the limit is 4.) + /// The port assignments are *not* guaranteed to have any particular order + /// or relationship! Do *not* assume they are contiguous, even though that + /// may often occur in practice. + /// + /// Returns false if a request was already in progress, true if a new request + /// was started. A SteamNetworkingFakeIPResult_t will be posted when the request + /// completes. + /// + /// For gameservers, you *must* call this after initializing the SDK but before + /// beginning login. Steam needs to know in advance that FakeIP will be used. + /// Everywhere your public IP would normally appear (such as the server browser) will be + /// replaced by the FakeIP, and the fake port at index 0. The request is actually queued + /// until the logon completes, so you must not wait until the allocation completes + /// before logging in. Except for trivial failures that can be detected locally + /// (e.g. invalid parameter), a SteamNetworkingFakeIPResult_t callback (whether success or + /// failure) will not be posted until after we have logged in. Furthermore, it is assumed + /// that FakeIP allocation is essential for your application to function, and so failure + /// will not be reported until *several* retries have been attempted. This process may + /// last several minutes. It is *highly* recommended to treat failure as fatal. + /// + /// To communicate using a connection-oriented (TCP-style) API: + /// - Server creates a listen socket using CreateListenSocketP2PFakeIP + /// - Client connects using ConnectByIPAddress, passing in the FakeIP address. + /// - The connection will behave mostly like a P2P connection. The identities + /// that appear in SteamNetConnectionInfo_t will be the FakeIP identity until + /// we know the real identity. Then it will be the real identity. If the + /// SteamNetConnectionInfo_t::m_addrRemote is valid, it will be a real IPv4 + /// address of a NAT-punched connection. Otherwise, it will not be valid. + /// + /// To communicate using an ad-hoc sendto/recv from (UDP-style) API, + /// use CreateFakeUDPPort. + virtual bool BeginAsyncRequestFakeIP( int nNumPorts ) = 0; + + /// Return info about the FakeIP and port(s) that we have been assigned, + /// if any. idxFirstPort is currently reserved and must be zero. + /// Make sure and check SteamNetworkingFakeIPResult_t::m_eResult + virtual void GetFakeIP( int idxFirstPort, SteamNetworkingFakeIPResult_t *pInfo ) = 0; + + /// Create a listen socket that will listen for P2P connections sent + /// to our FakeIP. A peer can initiate connections to this listen + /// socket by calling ConnectByIPAddress. + /// + /// idxFakePort refers to the *index* of the fake port requested, + /// not the actual port number. For example, pass 0 to refer to the + /// first port in the reservation. You must call this only after calling + /// BeginAsyncRequestFakeIP. However, you do not need to wait for the + /// request to complete before creating the listen socket. + virtual HSteamListenSocket CreateListenSocketP2PFakeIP( int idxFakePort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; + + /// If the connection was initiated using the "FakeIP" system, then we + /// we can get an IP address for the remote host. If the remote host had + /// a global FakeIP at the time the connection was established, this + /// function will return that global IP. Otherwise, a FakeIP that is + /// unique locally will be allocated from the local FakeIP address space, + /// and that will be returned. + /// + /// The allocation of local FakeIPs attempts to assign addresses in + /// a consistent manner. If multiple connections are made to the + /// same remote host, they *probably* will return the same FakeIP. + /// However, since the namespace is limited, this cannot be guaranteed. + /// + /// On failure, returns: + /// - k_EResultInvalidParam: invalid connection handle + /// - k_EResultIPNotFound: This connection wasn't made using FakeIP system + virtual EResult GetRemoteFakeIPForConnection( HSteamNetConnection hConn, SteamNetworkingIPAddr *pOutAddr ) = 0; + + /// Get an interface that can be used like a UDP port to send/receive + /// datagrams to a FakeIP address. This is intended to make it easy + /// to port existing UDP-based code to take advantage of SDR. + /// + /// idxFakeServerPort refers to the *index* of the port allocated using + /// BeginAsyncRequestFakeIP and is used to create "server" ports. You may + /// call this before the allocation has completed. However, any attempts + /// to send packets will fail until the allocation has succeeded. When + /// the peer receives packets sent from this interface, the from address + /// of the packet will be the globally-unique FakeIP. If you call this + /// function multiple times and pass the same (nonnegative) fake port index, + /// the same object will be returned, and this object is not reference counted. + /// + /// To create a "client" port (e.g. the equivalent of an ephemeral UDP port) + /// pass -1. In this case, a distinct object will be returned for each call. + /// When the peer receives packets sent from this interface, the peer will + /// assign a FakeIP from its own locally-controlled namespace. + virtual ISteamNetworkingFakeUDPPort *CreateFakeUDPPort( int idxFakeServerPort ) = 0; + +protected: + ~ISteamNetworkingSockets(); // Silence some warnings +}; +#define STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "SteamNetworkingSockets012" + +// Global accessors + +// Using standalone lib +#ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB + + static_assert( STEAMNETWORKINGSOCKETS_INTERFACE_VERSION[24] == '2', "Version mismatch" ); + STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamNetworkingSockets_LibV12(); + inline ISteamNetworkingSockets *SteamNetworkingSockets_Lib() { return SteamNetworkingSockets_LibV12(); } + + STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamGameServerNetworkingSockets_LibV12(); + inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets_Lib() { return SteamGameServerNetworkingSockets_LibV12(); } + + #ifndef STEAMNETWORKINGSOCKETS_STEAMAPI + inline ISteamNetworkingSockets *SteamNetworkingSockets() { return SteamNetworkingSockets_LibV12(); } + inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets() { return SteamGameServerNetworkingSockets_LibV12(); } + #endif +#endif + +// Using Steamworks SDK +#ifdef STEAMNETWORKINGSOCKETS_STEAMAPI + STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamNetworkingSockets *, SteamNetworkingSockets_SteamAPI, STEAMNETWORKINGSOCKETS_INTERFACE_VERSION ); + STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamNetworkingSockets *, SteamGameServerNetworkingSockets_SteamAPI, STEAMNETWORKINGSOCKETS_INTERFACE_VERSION ); + + #ifndef STEAMNETWORKINGSOCKETS_STANDALONELIB + inline ISteamNetworkingSockets *SteamNetworkingSockets() { return SteamNetworkingSockets_SteamAPI(); } + inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets() { return SteamGameServerNetworkingSockets_SteamAPI(); } + #endif +#endif + +/// Callback struct used to notify when a connection has changed state +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error "Must define VALVE_CALLBACK_PACK_SMALL or VALVE_CALLBACK_PACK_LARGE" +#endif + +/// This callback is posted whenever a connection is created, destroyed, or changes state. +/// The m_info field will contain a complete description of the connection at the time the +/// change occurred and the callback was posted. In particular, m_eState will have the +/// new connection state. +/// +/// You will usually need to listen for this callback to know when: +/// - A new connection arrives on a listen socket. +/// m_info.m_hListenSocket will be set, m_eOldState = k_ESteamNetworkingConnectionState_None, +/// and m_info.m_eState = k_ESteamNetworkingConnectionState_Connecting. +/// See ISteamNetworkigSockets::AcceptConnection. +/// - A connection you initiated has been accepted by the remote host. +/// m_eOldState = k_ESteamNetworkingConnectionState_Connecting, and +/// m_info.m_eState = k_ESteamNetworkingConnectionState_Connected. +/// Some connections might transition to k_ESteamNetworkingConnectionState_FindingRoute first. +/// - A connection has been actively rejected or closed by the remote host. +/// m_eOldState = k_ESteamNetworkingConnectionState_Connecting or k_ESteamNetworkingConnectionState_Connected, +/// and m_info.m_eState = k_ESteamNetworkingConnectionState_ClosedByPeer. m_info.m_eEndReason +/// and m_info.m_szEndDebug will have for more details. +/// NOTE: upon receiving this callback, you must still destroy the connection using +/// ISteamNetworkingSockets::CloseConnection to free up local resources. (The details +/// passed to the function are not used in this case, since the connection is already closed.) +/// - A problem was detected with the connection, and it has been closed by the local host. +/// The most common failure is timeout, but other configuration or authentication failures +/// can cause this. m_eOldState = k_ESteamNetworkingConnectionState_Connecting or +/// k_ESteamNetworkingConnectionState_Connected, and m_info.m_eState = k_ESteamNetworkingConnectionState_ProblemDetectedLocally. +/// m_info.m_eEndReason and m_info.m_szEndDebug will have for more details. +/// NOTE: upon receiving this callback, you must still destroy the connection using +/// ISteamNetworkingSockets::CloseConnection to free up local resources. (The details +/// passed to the function are not used in this case, since the connection is already closed.) +/// +/// Remember that callbacks are posted to a queue, and networking connections can +/// change at any time. It is possible that the connection has already changed +/// state by the time you process this callback. +/// +/// Also note that callbacks will be posted when connections are created and destroyed by your own API calls. +struct SteamNetConnectionStatusChangedCallback_t +{ + enum { k_iCallback = k_iSteamNetworkingSocketsCallbacks + 1 }; + + /// Connection handle + HSteamNetConnection m_hConn; + + /// Full connection info + SteamNetConnectionInfo_t m_info; + + /// Previous state. (Current state is in m_info.m_eState) + ESteamNetworkingConnectionState m_eOldState; +}; + +/// A struct used to describe our readiness to participate in authenticated, +/// encrypted communication. In order to do this we need: +/// +/// - The list of trusted CA certificates that might be relevant for this +/// app. +/// - A valid certificate issued by a CA. +/// +/// This callback is posted whenever the state of our readiness changes. +struct SteamNetAuthenticationStatus_t +{ + enum { k_iCallback = k_iSteamNetworkingSocketsCallbacks + 2 }; + + /// Status + ESteamNetworkingAvailability m_eAvail; + + /// Non-localized English language status. For diagnostic/debugging + /// purposes only. + char m_debugMsg[ 256 ]; +}; + +#pragma pack( pop ) + +#endif // ISTEAMNETWORKINGSOCKETS diff --git a/external/steamworks/public/steam/isteamnetworkingutils.h b/external/steamworks/public/steam/isteamnetworkingutils.h new file mode 100644 index 0000000..0381d09 --- /dev/null +++ b/external/steamworks/public/steam/isteamnetworkingutils.h @@ -0,0 +1,500 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Purpose: misc networking utilities +// +//============================================================================= + +#ifndef ISTEAMNETWORKINGUTILS +#define ISTEAMNETWORKINGUTILS +#pragma once + +#include "steamnetworkingtypes.h" +#include "steam_api_common.h" + +struct SteamDatagramRelayAuthTicket; +struct SteamRelayNetworkStatus_t; + +//----------------------------------------------------------------------------- +/// Misc networking utilities for checking the local networking environment +/// and estimating pings. +class ISteamNetworkingUtils +{ +public: + // + // Efficient message sending + // + + /// Allocate and initialize a message object. Usually the reason + /// you call this is to pass it to ISteamNetworkingSockets::SendMessages. + /// The returned object will have all of the relevant fields cleared to zero. + /// + /// Optionally you can also request that this system allocate space to + /// hold the payload itself. If cbAllocateBuffer is nonzero, the system + /// will allocate memory to hold a payload of at least cbAllocateBuffer bytes. + /// m_pData will point to the allocated buffer, m_cbSize will be set to the + /// size, and m_pfnFreeData will be set to the proper function to free up + /// the buffer. + /// + /// If cbAllocateBuffer=0, then no buffer is allocated. m_pData will be NULL, + /// m_cbSize will be zero, and m_pfnFreeData will be NULL. You will need to + /// set each of these. + virtual SteamNetworkingMessage_t *AllocateMessage( int cbAllocateBuffer ) = 0; + + // + // Access to Steam Datagram Relay (SDR) network + // + + // + // Initialization and status check + // + + /// If you know that you are going to be using the relay network (for example, + /// because you anticipate making P2P connections), call this to initialize the + /// relay network. If you do not call this, the initialization will + /// be delayed until the first time you use a feature that requires access + /// to the relay network, which will delay that first access. + /// + /// You can also call this to force a retry if the previous attempt has failed. + /// Performing any action that requires access to the relay network will also + /// trigger a retry, and so calling this function is never strictly necessary, + /// but it can be useful to call it a program launch time, if access to the + /// relay network is anticipated. + /// + /// Use GetRelayNetworkStatus or listen for SteamRelayNetworkStatus_t + /// callbacks to know when initialization has completed. + /// Typically initialization completes in a few seconds. + /// + /// Note: dedicated servers hosted in known data centers do *not* need + /// to call this, since they do not make routing decisions. However, if + /// the dedicated server will be using P2P functionality, it will act as + /// a "client" and this should be called. + inline void InitRelayNetworkAccess(); + + /// Fetch current status of the relay network. + /// + /// SteamRelayNetworkStatus_t is also a callback. It will be triggered on + /// both the user and gameserver interfaces any time the status changes, or + /// ping measurement starts or stops. + /// + /// SteamRelayNetworkStatus_t::m_eAvail is returned. If you want + /// more details, you can pass a non-NULL value. + virtual ESteamNetworkingAvailability GetRelayNetworkStatus( SteamRelayNetworkStatus_t *pDetails ) = 0; + + // + // "Ping location" functions + // + // We use the ping times to the valve relays deployed worldwide to + // generate a "marker" that describes the location of an Internet host. + // Given two such markers, we can estimate the network latency between + // two hosts, without sending any packets. The estimate is based on the + // optimal route that is found through the Valve network. If you are + // using the Valve network to carry the traffic, then this is precisely + // the ping you want. If you are not, then the ping time will probably + // still be a reasonable estimate. + // + // This is extremely useful to select peers for matchmaking! + // + // The markers can also be converted to a string, so they can be transmitted. + // We have a separate library you can use on your app's matchmaking/coordinating + // server to manipulate these objects. (See steamdatagram_gamecoordinator.h) + + /// Return location info for the current host. Returns the approximate + /// age of the data, in seconds, or -1 if no data is available. + /// + /// It takes a few seconds to initialize access to the relay network. If + /// you call this very soon after calling InitRelayNetworkAccess, + /// the data may not be available yet. + /// + /// This always return the most up-to-date information we have available + /// right now, even if we are in the middle of re-calculating ping times. + virtual float GetLocalPingLocation( SteamNetworkPingLocation_t &result ) = 0; + + /// Estimate the round-trip latency between two arbitrary locations, in + /// milliseconds. This is a conservative estimate, based on routing through + /// the relay network. For most basic relayed connections, this ping time + /// will be pretty accurate, since it will be based on the route likely to + /// be actually used. + /// + /// If a direct IP route is used (perhaps via NAT traversal), then the route + /// will be different, and the ping time might be better. Or it might actually + /// be a bit worse! Standard IP routing is frequently suboptimal! + /// + /// But even in this case, the estimate obtained using this method is a + /// reasonable upper bound on the ping time. (Also it has the advantage + /// of returning immediately and not sending any packets.) + /// + /// In a few cases we might not able to estimate the route. In this case + /// a negative value is returned. k_nSteamNetworkingPing_Failed means + /// the reason was because of some networking difficulty. (Failure to + /// ping, etc) k_nSteamNetworkingPing_Unknown is returned if we cannot + /// currently answer the question for some other reason. + /// + /// Do you need to be able to do this from a backend/matchmaking server? + /// You are looking for the "game coordinator" library. + virtual int EstimatePingTimeBetweenTwoLocations( const SteamNetworkPingLocation_t &location1, const SteamNetworkPingLocation_t &location2 ) = 0; + + /// Same as EstimatePingTime, but assumes that one location is the local host. + /// This is a bit faster, especially if you need to calculate a bunch of + /// these in a loop to find the fastest one. + /// + /// In rare cases this might return a slightly different estimate than combining + /// GetLocalPingLocation with EstimatePingTimeBetweenTwoLocations. That's because + /// this function uses a slightly more complete set of information about what + /// route would be taken. + virtual int EstimatePingTimeFromLocalHost( const SteamNetworkPingLocation_t &remoteLocation ) = 0; + + /// Convert a ping location into a text format suitable for sending over the wire. + /// The format is a compact and human readable. However, it is subject to change + /// so please do not parse it yourself. Your buffer must be at least + /// k_cchMaxSteamNetworkingPingLocationString bytes. + virtual void ConvertPingLocationToString( const SteamNetworkPingLocation_t &location, char *pszBuf, int cchBufSize ) = 0; + + /// Parse back SteamNetworkPingLocation_t string. Returns false if we couldn't understand + /// the string. + virtual bool ParsePingLocationString( const char *pszString, SteamNetworkPingLocation_t &result ) = 0; + + /// Check if the ping data of sufficient recency is available, and if + /// it's too old, start refreshing it. + /// + /// Please only call this function when you *really* do need to force an + /// immediate refresh of the data. (For example, in response to a specific + /// user input to refresh this information.) Don't call it "just in case", + /// before every connection, etc. That will cause extra traffic to be sent + /// for no benefit. The library will automatically refresh the information + /// as needed. + /// + /// Returns true if sufficiently recent data is already available. + /// + /// Returns false if sufficiently recent data is not available. In this + /// case, ping measurement is initiated, if it is not already active. + /// (You cannot restart a measurement already in progress.) + /// + /// You can use GetRelayNetworkStatus or listen for SteamRelayNetworkStatus_t + /// to know when ping measurement completes. + virtual bool CheckPingDataUpToDate( float flMaxAgeSeconds ) = 0; + + // + // List of Valve data centers, and ping times to them. This might + // be useful to you if you are use our hosting, or just need to measure + // latency to a cloud data center where we are running relays. + // + + /// Fetch ping time of best available relayed route from this host to + /// the specified data center. + virtual int GetPingToDataCenter( SteamNetworkingPOPID popID, SteamNetworkingPOPID *pViaRelayPoP ) = 0; + + /// Get *direct* ping time to the relays at the data center. + virtual int GetDirectPingToPOP( SteamNetworkingPOPID popID ) = 0; + + /// Get number of network points of presence in the config + virtual int GetPOPCount() = 0; + + /// Get list of all POP IDs. Returns the number of entries that were filled into + /// your list. + virtual int GetPOPList( SteamNetworkingPOPID *list, int nListSz ) = 0; + + // + // Misc + // + + /// Fetch current timestamp. This timer has the following properties: + /// + /// - Monotonicity is guaranteed. + /// - The initial value will be at least 24*3600*30*1e6, i.e. about + /// 30 days worth of microseconds. In this way, the timestamp value of + /// 0 will always be at least "30 days ago". Also, negative numbers + /// will never be returned. + /// - Wraparound / overflow is not a practical concern. + /// + /// If you are running under the debugger and stop the process, the clock + /// might not advance the full wall clock time that has elapsed between + /// calls. If the process is not blocked from normal operation, the + /// timestamp values will track wall clock time, even if you don't call + /// the function frequently. + /// + /// The value is only meaningful for this run of the process. Don't compare + /// it to values obtained on another computer, or other runs of the same process. + virtual SteamNetworkingMicroseconds GetLocalTimestamp() = 0; + + /// Set a function to receive network-related information that is useful for debugging. + /// This can be very useful during development, but it can also be useful for troubleshooting + /// problems with tech savvy end users. If you have a console or other log that customers + /// can examine, these log messages can often be helpful to troubleshoot network issues. + /// (Especially any warning/error messages.) + /// + /// The detail level indicates what message to invoke your callback on. Lower numeric + /// value means more important, and the value you pass is the lowest priority (highest + /// numeric value) you wish to receive callbacks for. + /// + /// The value here controls the detail level for most messages. You can control the + /// detail level for various subsystems (perhaps only for certain connections) by + /// adjusting the configuration values k_ESteamNetworkingConfig_LogLevel_Xxxxx. + /// + /// Except when debugging, you should only use k_ESteamNetworkingSocketsDebugOutputType_Msg + /// or k_ESteamNetworkingSocketsDebugOutputType_Warning. For best performance, do NOT + /// request a high detail level and then filter out messages in your callback. This incurs + /// all of the expense of formatting the messages, which are then discarded. Setting a high + /// priority value (low numeric value) here allows the library to avoid doing this work. + /// + /// IMPORTANT: This may be called from a service thread, while we own a mutex, etc. + /// Your output function must be threadsafe and fast! Do not make any other + /// Steamworks calls from within the handler. + virtual void SetDebugOutputFunction( ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ) = 0; + + // + // Fake IP + // + // Useful for interfacing with code that assumes peers are identified using an IPv4 address + // + + /// Return true if an IPv4 address is one that might be used as a "fake" one. + /// This function is fast; it just does some logical tests on the IP and does + /// not need to do any lookup operations. + inline bool IsFakeIPv4( uint32 nIPv4 ) { return GetIPv4FakeIPType( nIPv4 ) > k_ESteamNetworkingFakeIPType_NotFake; } + virtual ESteamNetworkingFakeIPType GetIPv4FakeIPType( uint32 nIPv4 ) = 0; + + /// Get the real identity associated with a given FakeIP. + /// + /// On failure, returns: + /// - k_EResultInvalidParam: the IP is not a FakeIP. + /// - k_EResultNoMatch: we don't recognize that FakeIP and don't know the corresponding identity. + /// + /// FakeIP's used by active connections, or the FakeIPs assigned to local identities, + /// will always work. FakeIPs for recently destroyed connections will continue to + /// return results for a little while, but not forever. At some point, we will forget + /// FakeIPs to save space. It's reasonably safe to assume that you can read back the + /// real identity of a connection very soon after it is destroyed. But do not wait + /// indefinitely. + virtual EResult GetRealIdentityForFakeIP( const SteamNetworkingIPAddr &fakeIP, SteamNetworkingIdentity *pOutRealIdentity ) = 0; + + // + // Set and get configuration values, see ESteamNetworkingConfigValue for individual descriptions. + // + + // Shortcuts for common cases. (Implemented as inline functions below) + bool SetGlobalConfigValueInt32( ESteamNetworkingConfigValue eValue, int32 val ); + bool SetGlobalConfigValueFloat( ESteamNetworkingConfigValue eValue, float val ); + bool SetGlobalConfigValueString( ESteamNetworkingConfigValue eValue, const char *val ); + bool SetGlobalConfigValuePtr( ESteamNetworkingConfigValue eValue, void *val ); + bool SetConnectionConfigValueInt32( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, int32 val ); + bool SetConnectionConfigValueFloat( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, float val ); + bool SetConnectionConfigValueString( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, const char *val ); + + // + // Set global callbacks. If you do not want to use Steam's callback dispatch mechanism and you + // want to use the same callback on all (or most) listen sockets and connections, then + // simply install these callbacks first thing, and you are good to go. + // See ISteamNetworkingSockets::RunCallbacks + // + bool SetGlobalCallback_SteamNetConnectionStatusChanged( FnSteamNetConnectionStatusChanged fnCallback ); + bool SetGlobalCallback_SteamNetAuthenticationStatusChanged( FnSteamNetAuthenticationStatusChanged fnCallback ); + bool SetGlobalCallback_SteamRelayNetworkStatusChanged( FnSteamRelayNetworkStatusChanged fnCallback ); + bool SetGlobalCallback_FakeIPResult( FnSteamNetworkingFakeIPResult fnCallback ); + bool SetGlobalCallback_MessagesSessionRequest( FnSteamNetworkingMessagesSessionRequest fnCallback ); + bool SetGlobalCallback_MessagesSessionFailed( FnSteamNetworkingMessagesSessionFailed fnCallback ); + + /// Set a configuration value. + /// - eValue: which value is being set + /// - eScope: Onto what type of object are you applying the setting? + /// - scopeArg: Which object you want to change? (Ignored for global scope). E.g. connection handle, listen socket handle, interface pointer, etc. + /// - eDataType: What type of data is in the buffer at pValue? This must match the type of the variable exactly! + /// - pArg: Value to set it to. You can pass NULL to remove a non-global setting at this scope, + /// causing the value for that object to use global defaults. Or at global scope, passing NULL + /// will reset any custom value and restore it to the system default. + /// NOTE: When setting pointers (e.g. callback functions), do not pass the function pointer directly. + /// Your argument should be a pointer to a function pointer. + virtual bool SetConfigValue( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj, + ESteamNetworkingConfigDataType eDataType, const void *pArg ) = 0; + + /// Set a configuration value, using a struct to pass the value. + /// (This is just a convenience shortcut; see below for the implementation and + /// a little insight into how SteamNetworkingConfigValue_t is used when + /// setting config options during listen socket and connection creation.) + bool SetConfigValueStruct( const SteamNetworkingConfigValue_t &opt, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj ); + + /// Get a configuration value. + /// - eValue: which value to fetch + /// - eScopeType: query setting on what type of object + /// - eScopeArg: the object to query the setting for + /// - pOutDataType: If non-NULL, the data type of the value is returned. + /// - pResult: Where to put the result. Pass NULL to query the required buffer size. (k_ESteamNetworkingGetConfigValue_BufferTooSmall will be returned.) + /// - cbResult: IN: the size of your buffer. OUT: the number of bytes filled in or required. + virtual ESteamNetworkingGetConfigValueResult GetConfigValue( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj, + ESteamNetworkingConfigDataType *pOutDataType, void *pResult, size_t *cbResult ) = 0; + + /// Get info about a configuration value. Returns the name of the value, + /// or NULL if the value doesn't exist. Other output parameters can be NULL + /// if you do not need them. + virtual const char *GetConfigValueInfo( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigDataType *pOutDataType, + ESteamNetworkingConfigScope *pOutScope ) = 0; + + /// Iterate the list of all configuration values in the current environment that it might + /// be possible to display or edit using a generic UI. To get the first iterable value, + /// pass k_ESteamNetworkingConfig_Invalid. Returns k_ESteamNetworkingConfig_Invalid + /// to signal end of list. + /// + /// The bEnumerateDevVars argument can be used to include "dev" vars. These are vars that + /// are recommended to only be editable in "debug" or "dev" mode and typically should not be + /// shown in a retail environment where a malicious local user might use this to cheat. + virtual ESteamNetworkingConfigValue IterateGenericEditableConfigValues( ESteamNetworkingConfigValue eCurrent, bool bEnumerateDevVars ) = 0; + + // + // String conversions. You'll usually access these using the respective + // inline methods. + // + virtual void SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr &addr, char *buf, size_t cbBuf, bool bWithPort ) = 0; + virtual bool SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr ) = 0; + virtual ESteamNetworkingFakeIPType SteamNetworkingIPAddr_GetFakeIPType( const SteamNetworkingIPAddr &addr ) = 0; + virtual void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf ) = 0; + virtual bool SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, const char *pszStr ) = 0; + +protected: + ~ISteamNetworkingUtils(); // Silence some warnings +}; +#define STEAMNETWORKINGUTILS_INTERFACE_VERSION "SteamNetworkingUtils004" + +// Global accessors +// Using standalone lib +#ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB + + // Standalone lib + static_assert( STEAMNETWORKINGUTILS_INTERFACE_VERSION[22] == '4', "Version mismatch" ); + STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingUtils *SteamNetworkingUtils_LibV4(); + inline ISteamNetworkingUtils *SteamNetworkingUtils_Lib() { return SteamNetworkingUtils_LibV4(); } + + #ifndef STEAMNETWORKINGSOCKETS_STEAMAPI + inline ISteamNetworkingUtils *SteamNetworkingUtils() { return SteamNetworkingUtils_LibV4(); } + #endif +#endif + +// Using Steamworks SDK +#ifdef STEAMNETWORKINGSOCKETS_STEAMAPI + STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamNetworkingUtils *, SteamNetworkingUtils_SteamAPI, + /* Prefer user version of the interface. But if it isn't found, then use + gameserver one. Yes, this is a completely terrible hack */ + SteamInternal_FindOrCreateUserInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ) ? + SteamInternal_FindOrCreateUserInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ) : + SteamInternal_FindOrCreateGameServerInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ), + "global", + STEAMNETWORKINGUTILS_INTERFACE_VERSION + ) + + #ifndef STEAMNETWORKINGSOCKETS_STANDALONELIB + inline ISteamNetworkingUtils *SteamNetworkingUtils() { return SteamNetworkingUtils_SteamAPI(); } + #endif +#endif + +/// A struct used to describe our readiness to use the relay network. +/// To do this we first need to fetch the network configuration, +/// which describes what POPs are available. +struct SteamRelayNetworkStatus_t +{ + enum { k_iCallback = k_iSteamNetworkingUtilsCallbacks + 1 }; + + /// Summary status. When this is "current", initialization has + /// completed. Anything else means you are not ready yet, or + /// there is a significant problem. + ESteamNetworkingAvailability m_eAvail; + + /// Nonzero if latency measurement is in progress (or pending, + /// awaiting a prerequisite). + int m_bPingMeasurementInProgress; + + /// Status obtaining the network config. This is a prerequisite + /// for relay network access. + /// + /// Failure to obtain the network config almost always indicates + /// a problem with the local internet connection. + ESteamNetworkingAvailability m_eAvailNetworkConfig; + + /// Current ability to communicate with ANY relay. Note that + /// the complete failure to communicate with any relays almost + /// always indicates a problem with the local Internet connection. + /// (However, just because you can reach a single relay doesn't + /// mean that the local connection is in perfect health.) + ESteamNetworkingAvailability m_eAvailAnyRelay; + + /// Non-localized English language status. For diagnostic/debugging + /// purposes only. + char m_debugMsg[ 256 ]; +}; + +#ifndef API_GEN + +/// Utility class for printing a SteamNetworkingIdentity. +/// E.g. printf( "Identity is '%s'\n", SteamNetworkingIdentityRender( identity ).c_str() ); +struct SteamNetworkingIdentityRender +{ + SteamNetworkingIdentityRender( const SteamNetworkingIdentity &x ) { x.ToString( buf, sizeof(buf) ); } + inline const char *c_str() const { return buf; } +private: + char buf[ SteamNetworkingIdentity::k_cchMaxString ]; +}; + +/// Utility class for printing a SteamNetworkingIPAddrRender. +struct SteamNetworkingIPAddrRender +{ + SteamNetworkingIPAddrRender( const SteamNetworkingIPAddr &x, bool bWithPort = true ) { x.ToString( buf, sizeof(buf), bWithPort ); } + inline const char *c_str() const { return buf; } +private: + char buf[ SteamNetworkingIPAddr::k_cchMaxString ]; +}; + +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// Internal stuff + +inline void ISteamNetworkingUtils::InitRelayNetworkAccess() { CheckPingDataUpToDate( 1e10f ); } +inline bool ISteamNetworkingUtils::SetGlobalConfigValueInt32( ESteamNetworkingConfigValue eValue, int32 val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Global, 0, k_ESteamNetworkingConfig_Int32, &val ); } +inline bool ISteamNetworkingUtils::SetGlobalConfigValueFloat( ESteamNetworkingConfigValue eValue, float val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Global, 0, k_ESteamNetworkingConfig_Float, &val ); } +inline bool ISteamNetworkingUtils::SetGlobalConfigValueString( ESteamNetworkingConfigValue eValue, const char *val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Global, 0, k_ESteamNetworkingConfig_String, val ); } +inline bool ISteamNetworkingUtils::SetGlobalConfigValuePtr( ESteamNetworkingConfigValue eValue, void *val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Global, 0, k_ESteamNetworkingConfig_Ptr, &val ); } // Note: passing pointer to pointer. +inline bool ISteamNetworkingUtils::SetConnectionConfigValueInt32( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, int32 val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Connection, hConn, k_ESteamNetworkingConfig_Int32, &val ); } +inline bool ISteamNetworkingUtils::SetConnectionConfigValueFloat( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, float val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Connection, hConn, k_ESteamNetworkingConfig_Float, &val ); } +inline bool ISteamNetworkingUtils::SetConnectionConfigValueString( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, const char *val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Connection, hConn, k_ESteamNetworkingConfig_String, val ); } +inline bool ISteamNetworkingUtils::SetGlobalCallback_SteamNetConnectionStatusChanged( FnSteamNetConnectionStatusChanged fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged, (void*)fnCallback ); } +inline bool ISteamNetworkingUtils::SetGlobalCallback_SteamNetAuthenticationStatusChanged( FnSteamNetAuthenticationStatusChanged fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_AuthStatusChanged, (void*)fnCallback ); } +inline bool ISteamNetworkingUtils::SetGlobalCallback_SteamRelayNetworkStatusChanged( FnSteamRelayNetworkStatusChanged fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_RelayNetworkStatusChanged, (void*)fnCallback ); } +inline bool ISteamNetworkingUtils::SetGlobalCallback_FakeIPResult( FnSteamNetworkingFakeIPResult fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_FakeIPResult, (void*)fnCallback ); } +inline bool ISteamNetworkingUtils::SetGlobalCallback_MessagesSessionRequest( FnSteamNetworkingMessagesSessionRequest fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_MessagesSessionRequest, (void*)fnCallback ); } +inline bool ISteamNetworkingUtils::SetGlobalCallback_MessagesSessionFailed( FnSteamNetworkingMessagesSessionFailed fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_MessagesSessionFailed, (void*)fnCallback ); } + +inline bool ISteamNetworkingUtils::SetConfigValueStruct( const SteamNetworkingConfigValue_t &opt, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj ) +{ + // Locate the argument. Strings are a special case, since the + // "value" (the whole string buffer) doesn't fit in the struct + // NOTE: for pointer values, we pass a pointer to the pointer, + // we do not pass the pointer directly. + const void *pVal = ( opt.m_eDataType == k_ESteamNetworkingConfig_String ) ? (const void *)opt.m_val.m_string : (const void *)&opt.m_val; + return SetConfigValue( opt.m_eValue, eScopeType, scopeObj, opt.m_eDataType, pVal ); +} + +// How to get helper functions. +#if defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) || defined(STEAMNETWORKINGSOCKETS_FOREXPORT) || defined( STEAMNETWORKINGSOCKETS_STANDALONELIB ) + + // Call direct to static functions + STEAMNETWORKINGSOCKETS_INTERFACE void SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr *pAddr, char *buf, size_t cbBuf, bool bWithPort ); + STEAMNETWORKINGSOCKETS_INTERFACE bool SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr ); + STEAMNETWORKINGSOCKETS_INTERFACE ESteamNetworkingFakeIPType SteamNetworkingIPAddr_GetFakeIPType( const SteamNetworkingIPAddr *pAddr ); + STEAMNETWORKINGSOCKETS_INTERFACE void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity *pIdentity, char *buf, size_t cbBuf ); + STEAMNETWORKINGSOCKETS_INTERFACE bool SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, size_t sizeofIdentity, const char *pszStr ); + inline void SteamNetworkingIPAddr::ToString( char *buf, size_t cbBuf, bool bWithPort ) const { SteamNetworkingIPAddr_ToString( this, buf, cbBuf, bWithPort ); } + inline bool SteamNetworkingIPAddr::ParseString( const char *pszStr ) { return SteamNetworkingIPAddr_ParseString( this, pszStr ); } + inline ESteamNetworkingFakeIPType SteamNetworkingIPAddr::GetFakeIPType() const { return SteamNetworkingIPAddr_GetFakeIPType( this ); } + inline void SteamNetworkingIdentity::ToString( char *buf, size_t cbBuf ) const { SteamNetworkingIdentity_ToString( this, buf, cbBuf ); } + inline bool SteamNetworkingIdentity::ParseString( const char *pszStr ) { return SteamNetworkingIdentity_ParseString( this, sizeof(*this), pszStr ); } + +#elif defined( STEAMNETWORKINGSOCKETS_STEAMAPI ) + // Using steamworks SDK - go through SteamNetworkingUtils() + inline void SteamNetworkingIPAddr::ToString( char *buf, size_t cbBuf, bool bWithPort ) const { SteamNetworkingUtils()->SteamNetworkingIPAddr_ToString( *this, buf, cbBuf, bWithPort ); } + inline bool SteamNetworkingIPAddr::ParseString( const char *pszStr ) { return SteamNetworkingUtils()->SteamNetworkingIPAddr_ParseString( this, pszStr ); } + inline ESteamNetworkingFakeIPType SteamNetworkingIPAddr::GetFakeIPType() const { return SteamNetworkingUtils()->SteamNetworkingIPAddr_GetFakeIPType( *this ); } + inline void SteamNetworkingIdentity::ToString( char *buf, size_t cbBuf ) const { SteamNetworkingUtils()->SteamNetworkingIdentity_ToString( *this, buf, cbBuf ); } + inline bool SteamNetworkingIdentity::ParseString( const char *pszStr ) { return SteamNetworkingUtils()->SteamNetworkingIdentity_ParseString( this, pszStr ); } +#else + #error "Invalid config" +#endif + +#endif // ISTEAMNETWORKINGUTILS diff --git a/external/steamworks/public/steam/isteamparentalsettings.h b/external/steamworks/public/steam/isteamparentalsettings.h new file mode 100644 index 0000000..63a1e9b --- /dev/null +++ b/external/steamworks/public/steam/isteamparentalsettings.h @@ -0,0 +1,65 @@ +//====== Copyright � 2013-, Valve Corporation, All rights reserved. ======= +// +// Purpose: Interface to Steam parental settings (Family View) +// +//============================================================================= + +#ifndef ISTEAMPARENTALSETTINGS_H +#define ISTEAMPARENTALSETTINGS_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + +// Feature types for parental settings +enum EParentalFeature +{ + k_EFeatureInvalid = 0, + k_EFeatureStore = 1, + k_EFeatureCommunity = 2, + k_EFeatureProfile = 3, + k_EFeatureFriends = 4, + k_EFeatureNews = 5, + k_EFeatureTrading = 6, + k_EFeatureSettings = 7, + k_EFeatureConsole = 8, + k_EFeatureBrowser = 9, + k_EFeatureParentalSetup = 10, + k_EFeatureLibrary = 11, + k_EFeatureTest = 12, + k_EFeatureSiteLicense = 13, + k_EFeatureKioskMode_Deprecated = 14, + k_EFeatureBlockAlways = 15, + k_EFeatureMax +}; + +class ISteamParentalSettings +{ +public: + virtual bool BIsParentalLockEnabled() = 0; + virtual bool BIsParentalLockLocked() = 0; + + virtual bool BIsAppBlocked( AppId_t nAppID ) = 0; + virtual bool BIsAppInBlockList( AppId_t nAppID ) = 0; + + virtual bool BIsFeatureBlocked( EParentalFeature eFeature ) = 0; + virtual bool BIsFeatureInBlockList( EParentalFeature eFeature ) = 0; +}; + +#define STEAMPARENTALSETTINGS_INTERFACE_VERSION "STEAMPARENTALSETTINGS_INTERFACE_VERSION001" + +// Global interface accessor +inline ISteamParentalSettings *SteamParentalSettings(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamParentalSettings *, SteamParentalSettings, STEAMPARENTALSETTINGS_INTERFACE_VERSION ); + +//----------------------------------------------------------------------------- +// Purpose: Callback for querying UGC +//----------------------------------------------------------------------------- +struct SteamParentalSettingsChanged_t +{ + enum { k_iCallback = k_ISteamParentalSettingsCallbacks + 1 }; +}; + + +#endif // ISTEAMPARENTALSETTINGS_H diff --git a/external/steamworks/public/steam/isteamps3overlayrenderer.h b/external/steamworks/public/steam/isteamps3overlayrenderer.h new file mode 100644 index 0000000..2cbb757 --- /dev/null +++ b/external/steamworks/public/steam/isteamps3overlayrenderer.h @@ -0,0 +1,91 @@ +//====== Copyright © 1996-2010, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface the game must provide Steam with on PS3 in order for the +// Steam overlay to render. +// +//============================================================================= + +#ifndef ISTEAMPS3OVERLAYRENDERER_H +#define ISTEAMPS3OVERLAYRENDERER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "cell/pad.h" + +//----------------------------------------------------------------------------- +// Purpose: Enum for supported gradient directions +//----------------------------------------------------------------------------- +enum EOverlayGradientDirection +{ + k_EOverlayGradientHorizontal = 1, + k_EOverlayGradientVertical = 2, + k_EOverlayGradientNone = 3, +}; + +// Helpers for fetching individual color components from ARGB packed DWORD colors Steam PS3 overlay renderer uses. +#define STEAM_COLOR_RED( color ) \ + (int)(((color)>>16)&0xff) + +#define STEAM_COLOR_GREEN( color ) \ + (int)(((color)>>8)&0xff) + +#define STEAM_COLOR_BLUE( color ) \ + (int)((color)&0xff) + +#define STEAM_COLOR_ALPHA( color ) \ + (int)(((color)>>24)&0xff) + + +//----------------------------------------------------------------------------- +// Purpose: Interface the game must expose to Steam for rendering +//----------------------------------------------------------------------------- +class ISteamPS3OverlayRenderHost +{ +public: + + // Interface for game engine to implement which Steam requires to render. + + // Draw a textured rect. This may use only part of the texture and will pass texture coords, it will also possibly request a gradient and will specify colors for vertexes. + virtual void DrawTexturedRect( int x0, int y0, int x1, int y1, float u0, float v0, float u1, float v1, int32 iTextureID, DWORD colorStart, DWORD colorEnd, EOverlayGradientDirection eDirection ) = 0; + + // Load a RGBA texture for Steam, or update a previously loaded one. Updates may be partial. You must not evict or remove this texture once Steam has uploaded it. + virtual void LoadOrUpdateTexture( int32 iTextureID, bool bIsFullTexture, int x0, int y0, uint32 uWidth, uint32 uHeight, int32 iBytes, char *pData ) = 0; + + // Delete a texture Steam previously uploaded + virtual void DeleteTexture( int32 iTextureID ) = 0; + + // Delete all previously uploaded textures + virtual void DeleteAllTextures() = 0; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Interface Steam exposes for the game to tell it when to render, etc. +//----------------------------------------------------------------------------- +class ISteamPS3OverlayRender +{ +public: + + // Call once at startup to initialize the Steam overlay and pass it your host interface ptr + virtual bool BHostInitialize( uint32 unScreenWidth, uint32 unScreenHeight, uint32 unRefreshRate, ISteamPS3OverlayRenderHost *pRenderHost, void *CellFontLib ) = 0; + + // Call this once a frame when you are ready for the Steam overlay to render (ie, right before flipping buffers, after all your rendering) + virtual void Render() = 0; + + // Call this everytime you read input on PS3. + // + // If this returns true, then the overlay is active and has consumed the input, your game + // should then ignore all the input until BHandleCellPadData once again returns false, which + // will mean the overlay is deactivated. + virtual bool BHandleCellPadData( const CellPadData &padData ) = 0; + + // Call this if you detect no controllers connected or that the XMB is intercepting input + // + // This is important to clear input state for the overlay, so keys left down during XMB activation + // are not continued to be processed. + virtual bool BResetInputState() = 0; +}; + + +#endif // ISTEAMPS3OVERLAYRENDERER_H \ No newline at end of file diff --git a/external/steamworks/public/steam/isteamremoteplay.h b/external/steamworks/public/steam/isteamremoteplay.h new file mode 100644 index 0000000..48f0081 --- /dev/null +++ b/external/steamworks/public/steam/isteamremoteplay.h @@ -0,0 +1,369 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ + +#ifndef ISTEAMREMOTEPLAY_H +#define ISTEAMREMOTEPLAY_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + + +//----------------------------------------------------------------------------- +// Purpose: The form factor of a device +//----------------------------------------------------------------------------- +enum ESteamDeviceFormFactor +{ + k_ESteamDeviceFormFactorUnknown = 0, + k_ESteamDeviceFormFactorPhone = 1, + k_ESteamDeviceFormFactorTablet = 2, + k_ESteamDeviceFormFactorComputer = 3, + k_ESteamDeviceFormFactorTV = 4, + k_ESteamDeviceFormFactorVRHeadset = 5, +}; + + +// Steam Remote Play session ID +typedef uint32 RemotePlaySessionID_t; + + +// Steam Remote Play mouse cursor ID +typedef uint32 RemotePlayCursorID_t; + + +//----------------------------------------------------------------------------- +// Purpose: The type of input in ERemotePlayInput_t +//----------------------------------------------------------------------------- +enum ERemotePlayInputType +{ + k_ERemotePlayInputUnknown, + k_ERemotePlayInputMouseMotion, + k_ERemotePlayInputMouseButtonDown, + k_ERemotePlayInputMouseButtonUp, + k_ERemotePlayInputMouseWheel, + k_ERemotePlayInputKeyDown, + k_ERemotePlayInputKeyUp +}; + + +//----------------------------------------------------------------------------- +// Purpose: Mouse buttons in ERemotePlayInput_t +//----------------------------------------------------------------------------- +enum ERemotePlayMouseButton +{ + k_ERemotePlayMouseButtonLeft = 0x0001, + k_ERemotePlayMouseButtonRight = 0x0002, + k_ERemotePlayMouseButtonMiddle = 0x0010, + k_ERemotePlayMouseButtonX1 = 0x0020, + k_ERemotePlayMouseButtonX2 = 0x0040, +}; + + +//----------------------------------------------------------------------------- +// Purpose: Mouse wheel direction in ERemotePlayInput_t +//----------------------------------------------------------------------------- +enum ERemotePlayMouseWheelDirection +{ + k_ERemotePlayMouseWheelUp = 1, + k_ERemotePlayMouseWheelDown = 2, + k_ERemotePlayMouseWheelLeft = 3, + k_ERemotePlayMouseWheelRight = 4, +}; + + +//----------------------------------------------------------------------------- +// Purpose: Key scancode in ERemotePlayInput_t +// +// This is a USB scancode value as defined for the Keyboard/Keypad Page (0x07) +// This enumeration isn't a complete list, just the most commonly used keys. +//----------------------------------------------------------------------------- +enum ERemotePlayScancode +{ + k_ERemotePlayScancodeUnknown = 0, + + k_ERemotePlayScancodeA = 4, + k_ERemotePlayScancodeB = 5, + k_ERemotePlayScancodeC = 6, + k_ERemotePlayScancodeD = 7, + k_ERemotePlayScancodeE = 8, + k_ERemotePlayScancodeF = 9, + k_ERemotePlayScancodeG = 10, + k_ERemotePlayScancodeH = 11, + k_ERemotePlayScancodeI = 12, + k_ERemotePlayScancodeJ = 13, + k_ERemotePlayScancodeK = 14, + k_ERemotePlayScancodeL = 15, + k_ERemotePlayScancodeM = 16, + k_ERemotePlayScancodeN = 17, + k_ERemotePlayScancodeO = 18, + k_ERemotePlayScancodeP = 19, + k_ERemotePlayScancodeQ = 20, + k_ERemotePlayScancodeR = 21, + k_ERemotePlayScancodeS = 22, + k_ERemotePlayScancodeT = 23, + k_ERemotePlayScancodeU = 24, + k_ERemotePlayScancodeV = 25, + k_ERemotePlayScancodeW = 26, + k_ERemotePlayScancodeX = 27, + k_ERemotePlayScancodeY = 28, + k_ERemotePlayScancodeZ = 29, + + k_ERemotePlayScancode1 = 30, + k_ERemotePlayScancode2 = 31, + k_ERemotePlayScancode3 = 32, + k_ERemotePlayScancode4 = 33, + k_ERemotePlayScancode5 = 34, + k_ERemotePlayScancode6 = 35, + k_ERemotePlayScancode7 = 36, + k_ERemotePlayScancode8 = 37, + k_ERemotePlayScancode9 = 38, + k_ERemotePlayScancode0 = 39, + + k_ERemotePlayScancodeReturn = 40, + k_ERemotePlayScancodeEscape = 41, + k_ERemotePlayScancodeBackspace = 42, + k_ERemotePlayScancodeTab = 43, + k_ERemotePlayScancodeSpace = 44, + k_ERemotePlayScancodeMinus = 45, + k_ERemotePlayScancodeEquals = 46, + k_ERemotePlayScancodeLeftBracket = 47, + k_ERemotePlayScancodeRightBracket = 48, + k_ERemotePlayScancodeBackslash = 49, + k_ERemotePlayScancodeSemicolon = 51, + k_ERemotePlayScancodeApostrophe = 52, + k_ERemotePlayScancodeGrave = 53, + k_ERemotePlayScancodeComma = 54, + k_ERemotePlayScancodePeriod = 55, + k_ERemotePlayScancodeSlash = 56, + k_ERemotePlayScancodeCapsLock = 57, + + k_ERemotePlayScancodeF1 = 58, + k_ERemotePlayScancodeF2 = 59, + k_ERemotePlayScancodeF3 = 60, + k_ERemotePlayScancodeF4 = 61, + k_ERemotePlayScancodeF5 = 62, + k_ERemotePlayScancodeF6 = 63, + k_ERemotePlayScancodeF7 = 64, + k_ERemotePlayScancodeF8 = 65, + k_ERemotePlayScancodeF9 = 66, + k_ERemotePlayScancodeF10 = 67, + k_ERemotePlayScancodeF11 = 68, + k_ERemotePlayScancodeF12 = 69, + + k_ERemotePlayScancodeInsert = 73, + k_ERemotePlayScancodeHome = 74, + k_ERemotePlayScancodePageUp = 75, + k_ERemotePlayScancodeDelete = 76, + k_ERemotePlayScancodeEnd = 77, + k_ERemotePlayScancodePageDown = 78, + k_ERemotePlayScancodeRight = 79, + k_ERemotePlayScancodeLeft = 80, + k_ERemotePlayScancodeDown = 81, + k_ERemotePlayScancodeUp = 82, + + k_ERemotePlayScancodeLeftControl = 224, + k_ERemotePlayScancodeLeftShift = 225, + k_ERemotePlayScancodeLeftAlt = 226, + k_ERemotePlayScancodeLeftGUI = 227, // windows, command (apple), meta + k_ERemotePlayScancodeRightControl = 228, + k_ERemotePlayScancodeRightShift = 229, + k_ERemotePlayScancodeRightALT = 230, + k_ERemotePlayScancodeRightGUI = 231, // windows, command (apple), meta +}; + + +//----------------------------------------------------------------------------- +// Purpose: Key modifier in ERemotePlayInput_t +//----------------------------------------------------------------------------- +enum ERemotePlayKeyModifier +{ + k_ERemotePlayKeyModifierNone = 0x0000, + k_ERemotePlayKeyModifierLeftShift = 0x0001, + k_ERemotePlayKeyModifierRightShift = 0x0002, + k_ERemotePlayKeyModifierLeftControl = 0x0040, + k_ERemotePlayKeyModifierRightControl = 0x0080, + k_ERemotePlayKeyModifierLeftAlt = 0x0100, + k_ERemotePlayKeyModifierRightAlt = 0x0200, + k_ERemotePlayKeyModifierLeftGUI = 0x0400, + k_ERemotePlayKeyModifierRightGUI = 0x0800, + k_ERemotePlayKeyModifierNumLock = 0x1000, + k_ERemotePlayKeyModifierCapsLock = 0x2000, + k_ERemotePlayKeyModifierMask = 0xFFFF, +}; + + +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + +// Mouse motion event data, valid when m_eType is k_ERemotePlayInputMouseMotion +struct RemotePlayInputMouseMotion_t +{ + bool m_bAbsolute; // True if this is absolute mouse motion and m_flNormalizedX and m_flNormalizedY are valid + float m_flNormalizedX; // The absolute X position of the mouse, normalized to the display, if m_bAbsolute is true + float m_flNormalizedY; // The absolute Y position of the mouse, normalized to the display, if m_bAbsolute is true + int m_nDeltaX; // Relative mouse motion in the X direction + int m_nDeltaY; // Relative mouse motion in the Y direction +}; + +// Mouse wheel event data, valid when m_eType is k_ERemotePlayInputMouseWheel +struct RemotePlayInputMouseWheel_t +{ + ERemotePlayMouseWheelDirection m_eDirection; + float m_flAmount; // 1.0f is a single click of the wheel, 120 units on Windows +}; + +// Key event data, valid when m_eType is k_ERemotePlayInputKeyDown or k_ERemotePlayInputKeyUp +struct RemotePlayInputKey_t +{ + int m_eScancode; // Keyboard scancode, common values are defined in ERemotePlayScancode + uint32 m_unModifiers; // Mask of ERemotePlayKeyModifier active for this key event + uint32 m_unKeycode; // UCS-4 character generated by the keypress, or 0 if it wasn't a character key, e.g. Delete or Left Arrow +}; + +struct RemotePlayInput_t +{ + RemotePlaySessionID_t m_unSessionID; + ERemotePlayInputType m_eType; + + union + { + // Mouse motion event data, valid when m_eType is k_ERemotePlayInputMouseMotion + RemotePlayInputMouseMotion_t m_MouseMotion; + + // Mouse button event data, valid when m_eType is k_ERemotePlayInputMouseButtonDown or k_ERemotePlayInputMouseButtonUp + ERemotePlayMouseButton m_eMouseButton; + + // Mouse wheel event data, valid when m_eType is k_ERemotePlayInputMouseWheel + RemotePlayInputMouseWheel_t m_MouseWheel; + + // Key event data, valid when m_eType is k_ERemotePlayInputKeyDown or k_ERemotePlayInputKeyUp + RemotePlayInputKey_t m_Key; + + // Unused space for future use + char padding[ 64 - ( sizeof( m_unSessionID ) + sizeof( m_eType ) ) ]; + }; +}; +//COMPILE_TIME_ASSERT( sizeof( RemotePlayInput_t ) == 64 ); + +#pragma pack( pop ) + + +//----------------------------------------------------------------------------- +// Purpose: Functions to provide information about Steam Remote Play sessions +//----------------------------------------------------------------------------- +class ISteamRemotePlay +{ +public: + // Get the number of currently connected Steam Remote Play sessions + virtual uint32 GetSessionCount() = 0; + + // Get the currently connected Steam Remote Play session ID at the specified index. Returns zero if index is out of bounds. + virtual RemotePlaySessionID_t GetSessionID( int iSessionIndex ) = 0; + + // Get the SteamID of the connected user + virtual CSteamID GetSessionSteamID( RemotePlaySessionID_t unSessionID ) = 0; + + // Get the name of the session client device + // This returns NULL if the sessionID is not valid + virtual const char *GetSessionClientName( RemotePlaySessionID_t unSessionID ) = 0; + + // Get the form factor of the session client device + virtual ESteamDeviceFormFactor GetSessionClientFormFactor( RemotePlaySessionID_t unSessionID ) = 0; + + // Get the resolution, in pixels, of the session client device + // This is set to 0x0 if the resolution is not available + virtual bool BGetSessionClientResolution( RemotePlaySessionID_t unSessionID, int *pnResolutionX, int *pnResolutionY ) = 0; + + // Show the Remote Play Together UI in the game overlay + // This returns false if your game is not configured for Remote Play Together + virtual bool ShowRemotePlayTogetherUI() = 0; + + // Invite a friend to Remote Play Together, or create a guest invite if steamIDFriend is empty + // This will automatically start Remote Play Together if it hasn't already been started + // This returns false if the invite can't be sent or your game is not configured for Remote Play Together + virtual bool BSendRemotePlayTogetherInvite( CSteamID steamIDFriend ) = 0; + + // Make mouse and keyboard input for Remote Play Together sessions available via GetInput() instead of being merged with local input + virtual bool BEnableRemotePlayTogetherDirectInput() = 0; + + // Merge Remote Play Together mouse and keyboard input with local input + virtual void DisableRemotePlayTogetherDirectInput() = 0; + + // Get input events from Remote Play Together sessions + // This is available after calling BEnableRemotePlayTogetherDirectInput() + // + // pInput is an array of input events that will be filled in by this function, up to unMaxEvents. + // This returns the number of events copied to pInput, or the number of events available if pInput is nullptr. + virtual uint32 GetInput( RemotePlayInput_t *pInput, uint32 unMaxEvents ) = 0; + + // Set the mouse cursor visibility for a remote player + // This is available after calling BEnableRemotePlayTogetherDirectInput() + virtual void SetMouseVisibility( RemotePlaySessionID_t unSessionID, bool bVisible ) = 0; + + // Set the mouse cursor position for a remote player + // This is available after calling BEnableRemotePlayTogetherDirectInput() + // + // This is used to warp the cursor to a specific location and isn't needed during normal event processing. + // + // The position is normalized relative to the window, where 0,0 is the upper left, and 1,1 is the lower right. + virtual void SetMousePosition( RemotePlaySessionID_t unSessionID, float flNormalizedX, float flNormalizedY ) = 0; + + // Create a cursor that can be used with SetMouseCursor() + // This is available after calling BEnableRemotePlayTogetherDirectInput() + // + // Parameters: + // nWidth - The width of the cursor, in pixels + // nHeight - The height of the cursor, in pixels + // nHotX - The X coordinate of the cursor hot spot in pixels, offset from the left of the cursor + // nHotY - The Y coordinate of the cursor hot spot in pixels, offset from the top of the cursor + // pBGRA - A pointer to the cursor pixels, with the color channels in red, green, blue, alpha order + // nPitch - The distance between pixel rows in bytes, defaults to nWidth * 4 + virtual RemotePlayCursorID_t CreateMouseCursor( int nWidth, int nHeight, int nHotX, int nHotY, const void *pBGRA, int nPitch = 0 ) = 0; + + // Set the mouse cursor for a remote player + // This is available after calling BEnableRemotePlayTogetherDirectInput() + // + // The cursor ID is a value returned by CreateMouseCursor() + virtual void SetMouseCursor( RemotePlaySessionID_t unSessionID, RemotePlayCursorID_t unCursorID ) = 0; +}; + +#define STEAMREMOTEPLAY_INTERFACE_VERSION "STEAMREMOTEPLAY_INTERFACE_VERSION003" + +// Global interface accessor +inline ISteamRemotePlay *SteamRemotePlay(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamRemotePlay *, SteamRemotePlay, STEAMREMOTEPLAY_INTERFACE_VERSION ); + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + + +STEAM_CALLBACK_BEGIN( SteamRemotePlaySessionConnected_t, k_iSteamRemotePlayCallbacks + 1 ) + STEAM_CALLBACK_MEMBER( 0, RemotePlaySessionID_t, m_unSessionID ) +STEAM_CALLBACK_END( 0 ) + + +STEAM_CALLBACK_BEGIN( SteamRemotePlaySessionDisconnected_t, k_iSteamRemotePlayCallbacks + 2 ) + STEAM_CALLBACK_MEMBER( 0, RemotePlaySessionID_t, m_unSessionID ) +STEAM_CALLBACK_END( 0 ) + + +STEAM_CALLBACK_BEGIN( SteamRemotePlayTogetherGuestInvite_t, k_iSteamRemotePlayCallbacks + 3 ) + STEAM_CALLBACK_MEMBER_ARRAY( 0, char, m_szConnectURL, 1024 ) +STEAM_CALLBACK_END( 0 ) + + +#pragma pack( pop ) + + +#endif // #define ISTEAMREMOTEPLAY_H diff --git a/external/steamworks/public/steam/isteamremotestorage.h b/external/steamworks/public/steam/isteamremotestorage.h new file mode 100644 index 0000000..93b7599 --- /dev/null +++ b/external/steamworks/public/steam/isteamremotestorage.h @@ -0,0 +1,661 @@ +//====== Copyright � 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: public interface to user remote file storage in Steam +// +//============================================================================= + +#ifndef ISTEAMREMOTESTORAGE_H +#define ISTEAMREMOTESTORAGE_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + + +//----------------------------------------------------------------------------- +// Purpose: Defines the largest allowed file size. Cloud files cannot be written +// in a single chunk over 100MB (and cannot be over 200MB total.) +//----------------------------------------------------------------------------- +const uint32 k_unMaxCloudFileChunkSize = 100 * 1024 * 1024; + + +//----------------------------------------------------------------------------- +// Purpose: Structure that contains an array of const char * strings and the number of those strings +//----------------------------------------------------------------------------- +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif +struct SteamParamStringArray_t +{ + const char ** m_ppStrings; + int32 m_nNumStrings; +}; +#pragma pack( pop ) + +// A handle to a piece of user generated content +typedef uint64 UGCHandle_t; +typedef uint64 PublishedFileUpdateHandle_t; +typedef uint64 PublishedFileId_t; +const PublishedFileId_t k_PublishedFileIdInvalid = 0; +const UGCHandle_t k_UGCHandleInvalid = 0xffffffffffffffffull; +const PublishedFileUpdateHandle_t k_PublishedFileUpdateHandleInvalid = 0xffffffffffffffffull; + +// Handle for writing to Steam Cloud +typedef uint64 UGCFileWriteStreamHandle_t; +const UGCFileWriteStreamHandle_t k_UGCFileStreamHandleInvalid = 0xffffffffffffffffull; + +const uint32 k_cchPublishedDocumentTitleMax = 128 + 1; +const uint32 k_cchPublishedDocumentDescriptionMax = 8000; +const uint32 k_cchPublishedDocumentChangeDescriptionMax = 8000; +const uint32 k_unEnumeratePublishedFilesMaxResults = 50; +const uint32 k_cchTagListMax = 1024 + 1; +const uint32 k_cchFilenameMax = 260; +const uint32 k_cchPublishedFileURLMax = 256; + + +enum ERemoteStoragePlatform +{ + k_ERemoteStoragePlatformNone = 0, + k_ERemoteStoragePlatformWindows = (1 << 0), + k_ERemoteStoragePlatformOSX = (1 << 1), + k_ERemoteStoragePlatformPS3 = (1 << 2), + k_ERemoteStoragePlatformLinux = (1 << 3), + k_ERemoteStoragePlatformSwitch = (1 << 4), + k_ERemoteStoragePlatformAndroid = (1 << 5), + k_ERemoteStoragePlatformIOS = (1 << 6), + // NB we get one more before we need to widen some things + + k_ERemoteStoragePlatformAll = 0xffffffff +}; + +enum ERemoteStoragePublishedFileVisibility +{ + k_ERemoteStoragePublishedFileVisibilityPublic = 0, + k_ERemoteStoragePublishedFileVisibilityFriendsOnly = 1, + k_ERemoteStoragePublishedFileVisibilityPrivate = 2, + k_ERemoteStoragePublishedFileVisibilityUnlisted = 3, +}; + + +enum EWorkshopFileType +{ + k_EWorkshopFileTypeFirst = 0, + + k_EWorkshopFileTypeCommunity = 0, // normal Workshop item that can be subscribed to + k_EWorkshopFileTypeMicrotransaction = 1, // Workshop item that is meant to be voted on for the purpose of selling in-game + k_EWorkshopFileTypeCollection = 2, // a collection of Workshop or Greenlight items + k_EWorkshopFileTypeArt = 3, // artwork + k_EWorkshopFileTypeVideo = 4, // external video + k_EWorkshopFileTypeScreenshot = 5, // screenshot + k_EWorkshopFileTypeGame = 6, // Greenlight game entry + k_EWorkshopFileTypeSoftware = 7, // Greenlight software entry + k_EWorkshopFileTypeConcept = 8, // Greenlight concept + k_EWorkshopFileTypeWebGuide = 9, // Steam web guide + k_EWorkshopFileTypeIntegratedGuide = 10, // application integrated guide + k_EWorkshopFileTypeMerch = 11, // Workshop merchandise meant to be voted on for the purpose of being sold + k_EWorkshopFileTypeControllerBinding = 12, // Steam Controller bindings + k_EWorkshopFileTypeSteamworksAccessInvite = 13, // internal + k_EWorkshopFileTypeSteamVideo = 14, // Steam video + k_EWorkshopFileTypeGameManagedItem = 15, // managed completely by the game, not the user, and not shown on the web + k_EWorkshopFileTypeClip = 16, // internal + + // Update k_EWorkshopFileTypeMax if you add values. + k_EWorkshopFileTypeMax = 17 + +}; + +enum EWorkshopVote +{ + k_EWorkshopVoteUnvoted = 0, + k_EWorkshopVoteFor = 1, + k_EWorkshopVoteAgainst = 2, + k_EWorkshopVoteLater = 3, +}; + +enum EWorkshopFileAction +{ + k_EWorkshopFileActionPlayed = 0, + k_EWorkshopFileActionCompleted = 1, +}; + +enum EWorkshopEnumerationType +{ + k_EWorkshopEnumerationTypeRankedByVote = 0, + k_EWorkshopEnumerationTypeRecent = 1, + k_EWorkshopEnumerationTypeTrending = 2, + k_EWorkshopEnumerationTypeFavoritesOfFriends = 3, + k_EWorkshopEnumerationTypeVotedByFriends = 4, + k_EWorkshopEnumerationTypeContentByFriends = 5, + k_EWorkshopEnumerationTypeRecentFromFollowedUsers = 6, +}; + +enum EWorkshopVideoProvider +{ + k_EWorkshopVideoProviderNone = 0, + k_EWorkshopVideoProviderYoutube = 1 +}; + + +enum EUGCReadAction +{ + // Keeps the file handle open unless the last byte is read. You can use this when reading large files (over 100MB) in sequential chunks. + // If the last byte is read, this will behave the same as k_EUGCRead_Close. Otherwise, it behaves the same as k_EUGCRead_ContinueReading. + // This value maintains the same behavior as before the EUGCReadAction parameter was introduced. + k_EUGCRead_ContinueReadingUntilFinished = 0, + + // Keeps the file handle open. Use this when using UGCRead to seek to different parts of the file. + // When you are done seeking around the file, make a final call with k_EUGCRead_Close to close it. + k_EUGCRead_ContinueReading = 1, + + // Frees the file handle. Use this when you're done reading the content. + // To read the file from Steam again you will need to call UGCDownload again. + k_EUGCRead_Close = 2, +}; + +enum ERemoteStorageLocalFileChange +{ + k_ERemoteStorageLocalFileChange_Invalid = 0, + + // The file was updated from another device + k_ERemoteStorageLocalFileChange_FileUpdated = 1, + + // The file was deleted by another device + k_ERemoteStorageLocalFileChange_FileDeleted = 2, +}; + +enum ERemoteStorageFilePathType +{ + k_ERemoteStorageFilePathType_Invalid = 0, + + // The file is directly accessed by the game and this is the full path + k_ERemoteStorageFilePathType_Absolute = 1, + + // The file is accessed via the ISteamRemoteStorage API and this is the filename + k_ERemoteStorageFilePathType_APIFilename = 2, +}; + + +//----------------------------------------------------------------------------- +// Purpose: Functions for accessing, reading and writing files stored remotely +// and cached locally +//----------------------------------------------------------------------------- +class ISteamRemoteStorage +{ + public: + // NOTE + // + // Filenames are case-insensitive, and will be converted to lowercase automatically. + // So "foo.bar" and "Foo.bar" are the same file, and if you write "Foo.bar" then + // iterate the files, the filename returned will be "foo.bar". + // + + // file operations + virtual bool FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0; + virtual int32 FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0; + + STEAM_CALL_RESULT( RemoteStorageFileWriteAsyncComplete_t ) + virtual SteamAPICall_t FileWriteAsync( const char *pchFile, const void *pvData, uint32 cubData ) = 0; + + STEAM_CALL_RESULT( RemoteStorageFileReadAsyncComplete_t ) + virtual SteamAPICall_t FileReadAsync( const char *pchFile, uint32 nOffset, uint32 cubToRead ) = 0; + virtual bool FileReadAsyncComplete( SteamAPICall_t hReadCall, void *pvBuffer, uint32 cubToRead ) = 0; + + virtual bool FileForget( const char *pchFile ) = 0; + virtual bool FileDelete( const char *pchFile ) = 0; + STEAM_CALL_RESULT( RemoteStorageFileShareResult_t ) + virtual SteamAPICall_t FileShare( const char *pchFile ) = 0; + virtual bool SetSyncPlatforms( const char *pchFile, ERemoteStoragePlatform eRemoteStoragePlatform ) = 0; + + // file operations that cause network IO + virtual UGCFileWriteStreamHandle_t FileWriteStreamOpen( const char *pchFile ) = 0; + virtual bool FileWriteStreamWriteChunk( UGCFileWriteStreamHandle_t writeHandle, const void *pvData, int32 cubData ) = 0; + virtual bool FileWriteStreamClose( UGCFileWriteStreamHandle_t writeHandle ) = 0; + virtual bool FileWriteStreamCancel( UGCFileWriteStreamHandle_t writeHandle ) = 0; + + // file information + virtual bool FileExists( const char *pchFile ) = 0; + virtual bool FilePersisted( const char *pchFile ) = 0; + virtual int32 GetFileSize( const char *pchFile ) = 0; + virtual int64 GetFileTimestamp( const char *pchFile ) = 0; + virtual ERemoteStoragePlatform GetSyncPlatforms( const char *pchFile ) = 0; + + // iteration + virtual int32 GetFileCount() = 0; + virtual const char *GetFileNameAndSize( int iFile, int32 *pnFileSizeInBytes ) = 0; + + // configuration management + virtual bool GetQuota( uint64 *pnTotalBytes, uint64 *puAvailableBytes ) = 0; + virtual bool IsCloudEnabledForAccount() = 0; + virtual bool IsCloudEnabledForApp() = 0; + virtual void SetCloudEnabledForApp( bool bEnabled ) = 0; + + // user generated content + + // Downloads a UGC file. A priority value of 0 will download the file immediately, + // otherwise it will wait to download the file until all downloads with a lower priority + // value are completed. Downloads with equal priority will occur simultaneously. + STEAM_CALL_RESULT( RemoteStorageDownloadUGCResult_t ) + virtual SteamAPICall_t UGCDownload( UGCHandle_t hContent, uint32 unPriority ) = 0; + + // Gets the amount of data downloaded so far for a piece of content. pnBytesExpected can be 0 if function returns false + // or if the transfer hasn't started yet, so be careful to check for that before dividing to get a percentage + virtual bool GetUGCDownloadProgress( UGCHandle_t hContent, int32 *pnBytesDownloaded, int32 *pnBytesExpected ) = 0; + + // Gets metadata for a file after it has been downloaded. This is the same metadata given in the RemoteStorageDownloadUGCResult_t call result + virtual bool GetUGCDetails( UGCHandle_t hContent, AppId_t *pnAppID, STEAM_OUT_STRING() char **ppchName, int32 *pnFileSizeInBytes, STEAM_OUT_STRUCT() CSteamID *pSteamIDOwner ) = 0; + + // After download, gets the content of the file. + // Small files can be read all at once by calling this function with an offset of 0 and cubDataToRead equal to the size of the file. + // Larger files can be read in chunks to reduce memory usage (since both sides of the IPC client and the game itself must allocate + // enough memory for each chunk). Once the last byte is read, the file is implicitly closed and further calls to UGCRead will fail + // unless UGCDownload is called again. + // For especially large files (anything over 100MB) it is a requirement that the file is read in chunks. + virtual int32 UGCRead( UGCHandle_t hContent, void *pvData, int32 cubDataToRead, uint32 cOffset, EUGCReadAction eAction ) = 0; + + // Functions to iterate through UGC that has finished downloading but has not yet been read via UGCRead() + virtual int32 GetCachedUGCCount() = 0; + virtual UGCHandle_t GetCachedUGCHandle( int32 iCachedContent ) = 0; + + // publishing UGC + STEAM_CALL_RESULT( RemoteStoragePublishFileProgress_t ) + virtual SteamAPICall_t PublishWorkshopFile( const char *pchFile, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t *pTags, EWorkshopFileType eWorkshopFileType ) = 0; + virtual PublishedFileUpdateHandle_t CreatePublishedFileUpdateRequest( PublishedFileId_t unPublishedFileId ) = 0; + virtual bool UpdatePublishedFileFile( PublishedFileUpdateHandle_t updateHandle, const char *pchFile ) = 0; + virtual bool UpdatePublishedFilePreviewFile( PublishedFileUpdateHandle_t updateHandle, const char *pchPreviewFile ) = 0; + virtual bool UpdatePublishedFileTitle( PublishedFileUpdateHandle_t updateHandle, const char *pchTitle ) = 0; + virtual bool UpdatePublishedFileDescription( PublishedFileUpdateHandle_t updateHandle, const char *pchDescription ) = 0; + virtual bool UpdatePublishedFileVisibility( PublishedFileUpdateHandle_t updateHandle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0; + virtual bool UpdatePublishedFileTags( PublishedFileUpdateHandle_t updateHandle, SteamParamStringArray_t *pTags ) = 0; + STEAM_CALL_RESULT( RemoteStorageUpdatePublishedFileResult_t ) + virtual SteamAPICall_t CommitPublishedFileUpdate( PublishedFileUpdateHandle_t updateHandle ) = 0; + // Gets published file details for the given publishedfileid. If unMaxSecondsOld is greater than 0, + // cached data may be returned, depending on how long ago it was cached. A value of 0 will force a refresh. + // A value of k_WorkshopForceLoadPublishedFileDetailsFromCache will use cached data if it exists, no matter how old it is. + STEAM_CALL_RESULT( RemoteStorageGetPublishedFileDetailsResult_t ) + virtual SteamAPICall_t GetPublishedFileDetails( PublishedFileId_t unPublishedFileId, uint32 unMaxSecondsOld ) = 0; + STEAM_CALL_RESULT( RemoteStorageDeletePublishedFileResult_t ) + virtual SteamAPICall_t DeletePublishedFile( PublishedFileId_t unPublishedFileId ) = 0; + // enumerate the files that the current user published with this app + STEAM_CALL_RESULT( RemoteStorageEnumerateUserPublishedFilesResult_t ) + virtual SteamAPICall_t EnumerateUserPublishedFiles( uint32 unStartIndex ) = 0; + STEAM_CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t ) + virtual SteamAPICall_t SubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0; + STEAM_CALL_RESULT( RemoteStorageEnumerateUserSubscribedFilesResult_t ) + virtual SteamAPICall_t EnumerateUserSubscribedFiles( uint32 unStartIndex ) = 0; + STEAM_CALL_RESULT( RemoteStorageUnsubscribePublishedFileResult_t ) + virtual SteamAPICall_t UnsubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0; + virtual bool UpdatePublishedFileSetChangeDescription( PublishedFileUpdateHandle_t updateHandle, const char *pchChangeDescription ) = 0; + STEAM_CALL_RESULT( RemoteStorageGetPublishedItemVoteDetailsResult_t ) + virtual SteamAPICall_t GetPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0; + STEAM_CALL_RESULT( RemoteStorageUpdateUserPublishedItemVoteResult_t ) + virtual SteamAPICall_t UpdateUserPublishedItemVote( PublishedFileId_t unPublishedFileId, bool bVoteUp ) = 0; + STEAM_CALL_RESULT( RemoteStorageGetPublishedItemVoteDetailsResult_t ) + virtual SteamAPICall_t GetUserPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0; + STEAM_CALL_RESULT( RemoteStorageEnumerateUserPublishedFilesResult_t ) + virtual SteamAPICall_t EnumerateUserSharedWorkshopFiles( CSteamID steamId, uint32 unStartIndex, SteamParamStringArray_t *pRequiredTags, SteamParamStringArray_t *pExcludedTags ) = 0; + STEAM_CALL_RESULT( RemoteStoragePublishFileProgress_t ) + virtual SteamAPICall_t PublishVideo( EWorkshopVideoProvider eVideoProvider, const char *pchVideoAccount, const char *pchVideoIdentifier, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t *pTags ) = 0; + STEAM_CALL_RESULT( RemoteStorageSetUserPublishedFileActionResult_t ) + virtual SteamAPICall_t SetUserPublishedFileAction( PublishedFileId_t unPublishedFileId, EWorkshopFileAction eAction ) = 0; + STEAM_CALL_RESULT( RemoteStorageEnumeratePublishedFilesByUserActionResult_t ) + virtual SteamAPICall_t EnumeratePublishedFilesByUserAction( EWorkshopFileAction eAction, uint32 unStartIndex ) = 0; + // this method enumerates the public view of workshop files + STEAM_CALL_RESULT( RemoteStorageEnumerateWorkshopFilesResult_t ) + virtual SteamAPICall_t EnumeratePublishedWorkshopFiles( EWorkshopEnumerationType eEnumerationType, uint32 unStartIndex, uint32 unCount, uint32 unDays, SteamParamStringArray_t *pTags, SteamParamStringArray_t *pUserTags ) = 0; + + STEAM_CALL_RESULT( RemoteStorageDownloadUGCResult_t ) + virtual SteamAPICall_t UGCDownloadToLocation( UGCHandle_t hContent, const char *pchLocation, uint32 unPriority ) = 0; + + // Cloud dynamic state change notification + virtual int32 GetLocalFileChangeCount() = 0; + virtual const char *GetLocalFileChange( int iFile, ERemoteStorageLocalFileChange *pEChangeType, ERemoteStorageFilePathType *pEFilePathType ) = 0; + + // Indicate to Steam the beginning / end of a set of local file + // operations - for example, writing a game save that requires updating two files. + virtual bool BeginFileWriteBatch() = 0; + virtual bool EndFileWriteBatch() = 0; +}; + +#define STEAMREMOTESTORAGE_INTERFACE_VERSION "STEAMREMOTESTORAGE_INTERFACE_VERSION016" + +// Global interface accessor +inline ISteamRemoteStorage *SteamRemoteStorage(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamRemoteStorage *, SteamRemoteStorage, STEAMREMOTESTORAGE_INTERFACE_VERSION ); + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + + + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to FileShare() +//----------------------------------------------------------------------------- +struct RemoteStorageFileShareResult_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 7 }; + EResult m_eResult; // The result of the operation + UGCHandle_t m_hFile; // The handle that can be shared with users and features + char m_rgchFilename[k_cchFilenameMax]; // The name of the file that was shared +}; + + +// k_iSteamRemoteStorageCallbacks + 8 is deprecated! Do not reuse + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to PublishFile() +//----------------------------------------------------------------------------- +struct RemoteStoragePublishFileResult_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 9 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; + bool m_bUserNeedsToAcceptWorkshopLegalAgreement; +}; + +// k_iSteamRemoteStorageCallbacks + 10 is deprecated! Do not reuse + + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to DeletePublishedFile() +//----------------------------------------------------------------------------- +struct RemoteStorageDeletePublishedFileResult_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 11 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to EnumerateUserPublishedFiles() +//----------------------------------------------------------------------------- +struct RemoteStorageEnumerateUserPublishedFilesResult_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 12 }; + EResult m_eResult; // The result of the operation. + int32 m_nResultsReturned; + int32 m_nTotalResultCount; + PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ]; +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to SubscribePublishedFile() +//----------------------------------------------------------------------------- +struct RemoteStorageSubscribePublishedFileResult_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 13 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to EnumerateSubscribePublishedFiles() +//----------------------------------------------------------------------------- +struct RemoteStorageEnumerateUserSubscribedFilesResult_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 14 }; + EResult m_eResult; // The result of the operation. + int32 m_nResultsReturned; + int32 m_nTotalResultCount; + PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ]; + uint32 m_rgRTimeSubscribed[ k_unEnumeratePublishedFilesMaxResults ]; +}; + +#if defined(VALVE_CALLBACK_PACK_SMALL) + VALVE_COMPILE_TIME_ASSERT( sizeof( RemoteStorageEnumerateUserSubscribedFilesResult_t ) == (1 + 1 + 1 + 50 + 100) * 4 ); +#elif defined(VALVE_CALLBACK_PACK_LARGE) + VALVE_COMPILE_TIME_ASSERT( sizeof( RemoteStorageEnumerateUserSubscribedFilesResult_t ) == (1 + 1 + 1 + 50 + 100) * 4 + 4 ); +#else +#warning You must first include steam_api_common.h +#endif + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to UnsubscribePublishedFile() +//----------------------------------------------------------------------------- +struct RemoteStorageUnsubscribePublishedFileResult_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 15 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to CommitPublishedFileUpdate() +//----------------------------------------------------------------------------- +struct RemoteStorageUpdatePublishedFileResult_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 16 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; + bool m_bUserNeedsToAcceptWorkshopLegalAgreement; +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to UGCDownload() +//----------------------------------------------------------------------------- +struct RemoteStorageDownloadUGCResult_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 17 }; + EResult m_eResult; // The result of the operation. + UGCHandle_t m_hFile; // The handle to the file that was attempted to be downloaded. + AppId_t m_nAppID; // ID of the app that created this file. + int32 m_nSizeInBytes; // The size of the file that was downloaded, in bytes. + char m_pchFileName[k_cchFilenameMax]; // The name of the file that was downloaded. + uint64 m_ulSteamIDOwner; // Steam ID of the user who created this content. +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to GetPublishedFileDetails() +//----------------------------------------------------------------------------- +struct RemoteStorageGetPublishedFileDetailsResult_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 18 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; + AppId_t m_nCreatorAppID; // ID of the app that created this file. + AppId_t m_nConsumerAppID; // ID of the app that will consume this file. + char m_rgchTitle[k_cchPublishedDocumentTitleMax]; // title of document + char m_rgchDescription[k_cchPublishedDocumentDescriptionMax]; // description of document + UGCHandle_t m_hFile; // The handle of the primary file + UGCHandle_t m_hPreviewFile; // The handle of the preview file + uint64 m_ulSteamIDOwner; // Steam ID of the user who created this content. + uint32 m_rtimeCreated; // time when the published file was created + uint32 m_rtimeUpdated; // time when the published file was last updated + ERemoteStoragePublishedFileVisibility m_eVisibility; + bool m_bBanned; + char m_rgchTags[k_cchTagListMax]; // comma separated list of all tags associated with this file + bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer + char m_pchFileName[k_cchFilenameMax]; // The name of the primary file + int32 m_nFileSize; // Size of the primary file + int32 m_nPreviewFileSize; // Size of the preview file + char m_rgchURL[k_cchPublishedFileURLMax]; // URL (for a video or a website) + EWorkshopFileType m_eFileType; // Type of the file + bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop +}; + + +struct RemoteStorageEnumerateWorkshopFilesResult_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 19 }; + EResult m_eResult; + int32 m_nResultsReturned; + int32 m_nTotalResultCount; + PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ]; + float m_rgScore[ k_unEnumeratePublishedFilesMaxResults ]; + AppId_t m_nAppId; + uint32 m_unStartIndex; +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of GetPublishedItemVoteDetails +//----------------------------------------------------------------------------- +struct RemoteStorageGetPublishedItemVoteDetailsResult_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 20 }; + EResult m_eResult; + PublishedFileId_t m_unPublishedFileId; + int32 m_nVotesFor; + int32 m_nVotesAgainst; + int32 m_nReports; + float m_fScore; +}; + + +//----------------------------------------------------------------------------- +// Purpose: User subscribed to a file for the app (from within the app or on the web) +//----------------------------------------------------------------------------- +struct RemoteStoragePublishedFileSubscribed_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 21 }; + PublishedFileId_t m_nPublishedFileId; // The published file id + AppId_t m_nAppID; // ID of the app that will consume this file. +}; + +//----------------------------------------------------------------------------- +// Purpose: User unsubscribed from a file for the app (from within the app or on the web) +//----------------------------------------------------------------------------- +struct RemoteStoragePublishedFileUnsubscribed_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 22 }; + PublishedFileId_t m_nPublishedFileId; // The published file id + AppId_t m_nAppID; // ID of the app that will consume this file. +}; + + +//----------------------------------------------------------------------------- +// Purpose: Published file that a user owns was deleted (from within the app or the web) +//----------------------------------------------------------------------------- +struct RemoteStoragePublishedFileDeleted_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 23 }; + PublishedFileId_t m_nPublishedFileId; // The published file id + AppId_t m_nAppID; // ID of the app that will consume this file. +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to UpdateUserPublishedItemVote() +//----------------------------------------------------------------------------- +struct RemoteStorageUpdateUserPublishedItemVoteResult_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 24 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; // The published file id +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to GetUserPublishedItemVoteDetails() +//----------------------------------------------------------------------------- +struct RemoteStorageUserVoteDetails_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 25 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; // The published file id + EWorkshopVote m_eVote; // what the user voted +}; + +struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 26 }; + EResult m_eResult; // The result of the operation. + int32 m_nResultsReturned; + int32 m_nTotalResultCount; + PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ]; +}; + +struct RemoteStorageSetUserPublishedFileActionResult_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 27 }; + EResult m_eResult; // The result of the operation. + PublishedFileId_t m_nPublishedFileId; // The published file id + EWorkshopFileAction m_eAction; // the action that was attempted +}; + +struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 28 }; + EResult m_eResult; // The result of the operation. + EWorkshopFileAction m_eAction; // the action that was filtered on + int32 m_nResultsReturned; + int32 m_nTotalResultCount; + PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ]; + uint32 m_rgRTimeUpdated[ k_unEnumeratePublishedFilesMaxResults ]; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Called periodically while a PublishWorkshopFile is in progress +//----------------------------------------------------------------------------- +struct RemoteStoragePublishFileProgress_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 29 }; + double m_dPercentFile; + bool m_bPreview; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Called when the content for a published file is updated +//----------------------------------------------------------------------------- +struct RemoteStoragePublishedFileUpdated_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 30 }; + PublishedFileId_t m_nPublishedFileId; // The published file id + AppId_t m_nAppID; // ID of the app that will consume this file. + uint64 m_ulUnused; // not used anymore +}; + +//----------------------------------------------------------------------------- +// Purpose: Called when a FileWriteAsync completes +//----------------------------------------------------------------------------- +struct RemoteStorageFileWriteAsyncComplete_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 31 }; + EResult m_eResult; // result +}; + +//----------------------------------------------------------------------------- +// Purpose: Called when a FileReadAsync completes +//----------------------------------------------------------------------------- +struct RemoteStorageFileReadAsyncComplete_t +{ + enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 32 }; + SteamAPICall_t m_hFileReadAsync; // call handle of the async read which was made + EResult m_eResult; // result + uint32 m_nOffset; // offset in the file this read was at + uint32 m_cubRead; // amount read - will the <= the amount requested +}; + +//----------------------------------------------------------------------------- +// Purpose: one or more files for this app have changed locally after syncing +// to remote session changes +// Note: only posted if this happens DURING the local app session +//----------------------------------------------------------------------------- +STEAM_CALLBACK_BEGIN( RemoteStorageLocalFileChange_t, k_iSteamRemoteStorageCallbacks + 33 ) +STEAM_CALLBACK_END( 0 ) + +#pragma pack( pop ) + + +#endif // ISTEAMREMOTESTORAGE_H diff --git a/external/steamworks/public/steam/isteamscreenshots.h b/external/steamworks/public/steam/isteamscreenshots.h new file mode 100644 index 0000000..b9feba0 --- /dev/null +++ b/external/steamworks/public/steam/isteamscreenshots.h @@ -0,0 +1,120 @@ +//====== Copyright � 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: public interface to user remote file storage in Steam +// +//============================================================================= + +#ifndef ISTEAMSCREENSHOTS_H +#define ISTEAMSCREENSHOTS_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + +const uint32 k_nScreenshotMaxTaggedUsers = 32; +const uint32 k_nScreenshotMaxTaggedPublishedFiles = 32; +const int k_cubUFSTagTypeMax = 255; +const int k_cubUFSTagValueMax = 255; + +// Required with of a thumbnail provided to AddScreenshotToLibrary. If you do not provide a thumbnail +// one will be generated. +const int k_ScreenshotThumbWidth = 200; + +// Handle is valid for the lifetime of your process and no longer +typedef uint32 ScreenshotHandle; +#define INVALID_SCREENSHOT_HANDLE 0 + +enum EVRScreenshotType +{ + k_EVRScreenshotType_None = 0, + k_EVRScreenshotType_Mono = 1, + k_EVRScreenshotType_Stereo = 2, + k_EVRScreenshotType_MonoCubemap = 3, + k_EVRScreenshotType_MonoPanorama = 4, + k_EVRScreenshotType_StereoPanorama = 5 +}; + +//----------------------------------------------------------------------------- +// Purpose: Functions for adding screenshots to the user's screenshot library +//----------------------------------------------------------------------------- +class ISteamScreenshots +{ +public: + // Writes a screenshot to the user's screenshot library given the raw image data, which must be in RGB format. + // The return value is a handle that is valid for the duration of the game process and can be used to apply tags. + virtual ScreenshotHandle WriteScreenshot( void *pubRGB, uint32 cubRGB, int nWidth, int nHeight ) = 0; + + // Adds a screenshot to the user's screenshot library from disk. If a thumbnail is provided, it must be 200 pixels wide and the same aspect ratio + // as the screenshot, otherwise a thumbnail will be generated if the user uploads the screenshot. The screenshots must be in either JPEG or TGA format. + // The return value is a handle that is valid for the duration of the game process and can be used to apply tags. + // JPEG, TGA, and PNG formats are supported. + virtual ScreenshotHandle AddScreenshotToLibrary( const char *pchFilename, const char *pchThumbnailFilename, int nWidth, int nHeight ) = 0; + + // Causes the Steam overlay to take a screenshot. If screenshots are being hooked by the game then a ScreenshotRequested_t callback is sent back to the game instead. + virtual void TriggerScreenshot() = 0; + + // Toggles whether the overlay handles screenshots when the user presses the screenshot hotkey, or the game handles them. If the game is hooking screenshots, + // then the ScreenshotRequested_t callback will be sent if the user presses the hotkey, and the game is expected to call WriteScreenshot or AddScreenshotToLibrary + // in response. + virtual void HookScreenshots( bool bHook ) = 0; + + // Sets metadata about a screenshot's location (for example, the name of the map) + virtual bool SetLocation( ScreenshotHandle hScreenshot, const char *pchLocation ) = 0; + + // Tags a user as being visible in the screenshot + virtual bool TagUser( ScreenshotHandle hScreenshot, CSteamID steamID ) = 0; + + // Tags a published file as being visible in the screenshot + virtual bool TagPublishedFile( ScreenshotHandle hScreenshot, PublishedFileId_t unPublishedFileID ) = 0; + + // Returns true if the app has hooked the screenshot + virtual bool IsScreenshotsHooked() = 0; + + // Adds a VR screenshot to the user's screenshot library from disk in the supported type. + // pchFilename should be the normal 2D image used in the library view + // pchVRFilename should contain the image that matches the correct type + // The return value is a handle that is valid for the duration of the game process and can be used to apply tags. + // JPEG, TGA, and PNG formats are supported. + virtual ScreenshotHandle AddVRScreenshotToLibrary( EVRScreenshotType eType, const char *pchFilename, const char *pchVRFilename ) = 0; +}; + +#define STEAMSCREENSHOTS_INTERFACE_VERSION "STEAMSCREENSHOTS_INTERFACE_VERSION003" + +// Global interface accessor +inline ISteamScreenshots *SteamScreenshots(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamScreenshots *, SteamScreenshots, STEAMSCREENSHOTS_INTERFACE_VERSION ); + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif +//----------------------------------------------------------------------------- +// Purpose: Screenshot successfully written or otherwise added to the library +// and can now be tagged +//----------------------------------------------------------------------------- +struct ScreenshotReady_t +{ + enum { k_iCallback = k_iSteamScreenshotsCallbacks + 1 }; + ScreenshotHandle m_hLocal; + EResult m_eResult; +}; + +//----------------------------------------------------------------------------- +// Purpose: Screenshot has been requested by the user. Only sent if +// HookScreenshots() has been called, in which case Steam will not take +// the screenshot itself. +//----------------------------------------------------------------------------- +struct ScreenshotRequested_t +{ + enum { k_iCallback = k_iSteamScreenshotsCallbacks + 2 }; +}; + +#pragma pack( pop ) + +#endif // ISTEAMSCREENSHOTS_H + diff --git a/external/steamworks/public/steam/isteamtimeline.h b/external/steamworks/public/steam/isteamtimeline.h new file mode 100644 index 0000000..f1d5bdd --- /dev/null +++ b/external/steamworks/public/steam/isteamtimeline.h @@ -0,0 +1,261 @@ +//====== Copyright � Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to Steam Timeline +// +//============================================================================= + +#ifndef ISTEAMTIMELINE_H +#define ISTEAMTIMELINE_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + +// Controls the color of the timeline bar segments. The value names listed here map to a multiplayer game, where +// the user starts a game (in menus), then joins a multiplayer session that first has a character selection lobby +// then finally the multiplayer session starts. However, you can also map these values to any type of game. In a single +// player game where you visit towns & dungeons, you could set k_ETimelineGameMode_Menus when the player is in a town +// buying items, k_ETimelineGameMode_Staging for when a dungeon is loading and k_ETimelineGameMode_Playing for when +// inside the dungeon fighting monsters. +enum ETimelineGameMode +{ + k_ETimelineGameMode_Invalid = 0, + k_ETimelineGameMode_Playing = 1, + k_ETimelineGameMode_Staging = 2, + k_ETimelineGameMode_Menus = 3, + k_ETimelineGameMode_LoadingScreen = 4, + + k_ETimelineGameMode_Max, // one past the last valid value +}; + +// Used in AddTimelineEvent, where Featured events will be offered before Standard events +enum ETimelineEventClipPriority +{ + k_ETimelineEventClipPriority_Invalid = 0, + k_ETimelineEventClipPriority_None = 1, + k_ETimelineEventClipPriority_Standard = 2, + k_ETimelineEventClipPriority_Featured = 3, +}; + + +const uint32 k_unMaxTimelinePriority = 1000; +const uint32 k_unTimelinePriority_KeepCurrentValue = 1000000; // Use with UpdateRangeTimelineEvent to not change the priority +const float k_flMaxTimelineEventDuration = 600.f; +const uint32 k_cchMaxPhaseIDLength = 64; + +typedef uint64 TimelineEventHandle_t; + + +//----------------------------------------------------------------------------- +// Purpose: Steam Timeline API +//----------------------------------------------------------------------------- +class ISteamTimeline +{ +public: + + // Sets a description for the current game state in the timeline. These help the user to find specific + // moments in the timeline when saving clips. Setting a new state description replaces any previous + // description. + // + // Examples could include: + // * Where the user is in the world in a single player game + // * Which round is happening in a multiplayer game + // * The current score for a sports game + // + // Parameters: + // - pchDescription: provide a localized string in the language returned by SteamUtils()->GetSteamUILanguage() + // - flTimeDelta: The time offset in seconds to apply to this event. Negative times indicate an + // event that happened in the past. + virtual void SetTimelineTooltip( const char *pchDescription, float flTimeDelta ) = 0; + virtual void ClearTimelineTooltip( float flTimeDelta ) = 0; + + // Changes the color of the timeline bar. See ETimelineGameMode comments for how to use each value + virtual void SetTimelineGameMode( ETimelineGameMode eMode ) = 0; + + /******************* Timeline Events *******************/ + + // The following functions add events and/or tags to the timeline. There are helpers to add simple events or tags in a single call. + // or you can use StartEvent and CloseEvent to customize what gets added. + // + // Examples of events to add could include: + // * a boss battle + // * a cut scene + // * a large team fight + // * picking up a new weapon or ammunition + // * scoring a goal + // + // Adding an event and a time range with the simple API: + // SteamTimeline()->AddSimpleTimelineEvent( "steam_heart", Localize( "#user healed" ), Localize( "#health_amount", 27 ), 15, 0, 0, k_ETimelineEventClipPriority_None ); + // SteamTimeline()->AddTaggedTimeRange( Localize( "#player_resting" ), "steam_flag", /* don't show filter */nullptr, 15, /* start now */0, 10 ); + // SteamTimeline()->AddTaggedTimeRange( Localize( "#player_cast_light" ), "steam_starburst", Localize( "#player_spells" ), 10, /* start 10 sec ago */ -10, 5 ); + // + // Adding a marker and time range in one event: + // TimelineEventHandle_t event = SteamTimeline()->StartEvent( /* start now */ 0 ); + // SteamTimeline()->ShowEventOnTimeline( event, "steam_heart", Localize( "#player_healed" ), Localize( "#player_healed_amount", 27 ), 15 ); + // SteamTimeline()->AddEventTag( event, Localize( "#player_cast_heal" ), "steam_heart", Localize( "#player_, 15, /* start now */0, 10 ); + // ... // time passes + // SteamTimeline()->CloseEvent( event ); + // + // Parameters used by the event functions: + // + // - ulOpenEvent: An event returned by StartEvent that has not yet had CancelEvent or CloseEvent called on it + // - ulEvent: An event that has had CloseEvent called on it, or an event returned from AddSimpleTimelineEvent or AddTaggedTimeRange (which + // are closed automatically.) + // - pchIcon: specify the name of the icon uploaded through the Steamworks Partner Site for your title + // or one of the provided icons that start with steam_ + // - pchTitle & pchDescription: provide a localized string in the language returned by + // SteamUtils()->GetSteamUILanguage() + // - unIconPriority: specify how important this range is compared to other markers provided by the game. + // Ranges with larger priority values will be displayed more prominently in the UI. This value + // may be between 0 and k_unMaxTimelinePriority. + // - flStartOffsetSeconds: The time that this range started relative to now. Negative times + // indicate an event that happened in the past. + // - flDurationSeconds: How long the time range should be in seconds. For instantaneous events, this + // should be 0 + // - ePossibleClip: By setting this parameter to Featured or Standard, the game indicates to Steam that it + // would be appropriate to offer this range as a clip to the user. For instantaneous events, the + // suggested clip will be for a short time before and after the event itself. + // - pchTagIcon: specify an icon name that will be used next to the tag name in the UI + // - pchTagName: The localized name of the tag to show in the UI. + // - pchTagGroup: The localized name of the tag group to show in the UI. If this is not specified, users will not be able to filter by this tag + // - unTagPriority: specify how important this tag is compared to other tags provided by the game. + // Returns: + // A TimelineEventHandle_t that can be used to make subsequent calls to refer to the timeline event. This event handle is invalid + // after the game exits. + + // quick helpers that add to the timeline in one call + virtual TimelineEventHandle_t AddInstantaneousTimelineEvent( const char *pchTitle, const char *pchDescription, const char *pchIcon, uint32 unIconPriority, float flStartOffsetSeconds = 0.f, ETimelineEventClipPriority ePossibleClip = k_ETimelineEventClipPriority_None ) = 0; + virtual TimelineEventHandle_t AddRangeTimelineEvent( const char *pchTitle, const char *pchDescription, const char *pchIcon, uint32 unIconPriority, float flStartOffsetSeconds = 0.f, float flDuration = 0.f, ETimelineEventClipPriority ePossibleClip = k_ETimelineEventClipPriority_None ) = 0; + + // Starts a timeline event at a the current time, plus an offset in seconds. This event must be ended with EndRangeTimelineEvent. + // Any timeline events that have not been ended when the game exits will be discarded. + virtual TimelineEventHandle_t StartRangeTimelineEvent( const char *pchTitle, const char *pchDescription, const char *pchIcon, uint32 unPriority, float flStartOffsetSeconds, ETimelineEventClipPriority ePossibleClip ) = 0; + + // Updates fields on a range timeline event that was started with StartRangeTimelineEvent, and which has not been ended. + virtual void UpdateRangeTimelineEvent( TimelineEventHandle_t ulEvent, const char *pchTitle, const char *pchDescription, const char *pchIcon, uint32 unPriority, ETimelineEventClipPriority ePossibleClip ) = 0; + + // Ends a range timeline event and shows it in the UI. + virtual void EndRangeTimelineEvent( TimelineEventHandle_t ulEvent, float flEndOffsetSeconds ) = 0; + + // delete the event from the timeline. This can be called on a timeline event from AddInstantaneousTimelineEvent, + // AddRangeTimelineEvent, or StartRangeTimelineEvent/EndRangeTimelineEvent. The timeline event handle must be from the + // current game process. + virtual void RemoveTimelineEvent( TimelineEventHandle_t ulEvent ) = 0; + + // add a tag to whatever time range is represented by the event + STEAM_CALL_RESULT( SteamTimelineEventRecordingExists_t ) + virtual SteamAPICall_t DoesEventRecordingExist( TimelineEventHandle_t ulEvent ) = 0; + + /******************* Game Phases *******************/ + + // Game phases allow the user to navigate their background recordings and clips. Exactly what a game phase means will vary game to game, but + // the game phase should be a section of gameplay that is usually between 10 minutes and a few hours in length, and should be the + // main way a user would think to divide up the game. These are presented to the user in a UI that shows the date the game was played, + // with one row per game slice. Game phases should be used to mark sections of gameplay that the user might be interested in watching. + // + // Examples could include: + // * A single match in a multiplayer PvP game + // * A chapter of a story-based singleplayer game + // * A single run in a roguelike + // + // Game phases are started with StartGamePhase, and while a phase is still happening, they can have tags and attributes added to them. + // + // Phase attributes represent generic text fields that can be updated throughout the duration of the phase. They are meant + // to be used for phase metadata that is not part of a well defined set of options. For example, a KDA attribute that starts + // with the value "0/0/0" and updates as the phase progresses, or something like a played-entered character name. Attributes + // can be set as many times as the game likes with SetGamePhaseAttribute, and only the last value will be shown to the user. + // + // Phase tags represent data with a well defined set of options, which could be data such as match resolution, hero played, + // game mode, etc. Tags can have an icon in addition to a text name. Multiple tags within the same group may be added per phase + // and all will be remembered. For example, AddGamePhaseTag may be called multiple times for a "Bosses Defeated" group, with + // different names and icons for each boss defeated during the phase, all of which will be shown to the user. + // + // The phase will continue until the game exits, until the game calls EndGamePhase, or until the game calls + // StartGamePhase to start a new phase. + // + // The game phase functions take these parameters: + // - pchTagIcon: The name of a game provided timeline icon or builtin "steam_" icon. + // - pchPhaseID: A game-provided persistent ID for a game phase. This could be a the match ID in a multiplayer game, a chapter name in a + // single player game, the ID of a character, etc. + // - pchTagName: The localized name of the tag in the language returned by SteamUtils()->GetSteamUILanguage(). + // - pchTagGroup: The localized name of the tag group. + // - pchAttributeValue: The localized name of the attribute. + // - pchAttributeGroup: The localized name of the attribute group. + // - unPriority: Used to order tags and attributes in the UI displayed to the user, with higher priority values leading + // to more prominent positioning. In contexts where there is limited space, lower priority items may be hidden. + virtual void StartGamePhase() = 0; + virtual void EndGamePhase() = 0; + + // Games can set a phase ID so they can refer back to a phase in OpenOverlayToPhase + virtual void SetGamePhaseID( const char *pchPhaseID ) = 0; + STEAM_CALL_RESULT( SteamTimelineGamePhaseRecordingExists_t ) + virtual SteamAPICall_t DoesGamePhaseRecordingExist( const char *pchPhaseID ) = 0; + + // Add a tag that applies to the entire phase + virtual void AddGamePhaseTag( const char *pchTagName, const char *pchTagIcon, const char *pchTagGroup, uint32 unPriority ) = 0; + + // Add a text attribute that applies to the entire phase + virtual void SetGamePhaseAttribute( const char *pchAttributeGroup, const char *pchAttributeValue, uint32 unPriority ) = 0; + + /******************* Opening the overlay *******************/ + + // Opens the Steam overlay to a game phase. + // + // Parameters: + // - pchPhaseID: The ID of a phase that was previously provided by the game in SetGamePhaseID. + virtual void OpenOverlayToGamePhase( const char *pchPhaseID ) = 0; + + // Opens the Steam overlay to a timeline event. + // + // Parameters: + // - ulEventID: The ID of a timeline event returned by StartEvent or AddSimpleTimelineEvent + virtual void OpenOverlayToTimelineEvent( const TimelineEventHandle_t ulEvent ) = 0; + +}; + +#define STEAMTIMELINE_INTERFACE_VERSION "STEAMTIMELINE_INTERFACE_V004" + +// Global interface accessor +inline ISteamTimeline *SteamTimeline(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamTimeline *, SteamTimeline, STEAMTIMELINE_INTERFACE_VERSION ); + + +//----------------------------------------------------------------------------- +// Purpose: Callback for querying UGC +//----------------------------------------------------------------------------- +struct SteamTimelineGamePhaseRecordingExists_t +{ + enum { k_iCallback = k_iSteamTimelineCallbacks + 1 }; + char m_rgchPhaseID[ k_cchMaxPhaseIDLength ]; + uint64 m_ulRecordingMS; + uint64 m_ulLongestClipMS; + uint32 m_unClipCount; + uint32 m_unScreenshotCount; +}; + +//----------------------------------------------------------------------------- +// Purpose: Callback for querying UGC +//----------------------------------------------------------------------------- +struct SteamTimelineEventRecordingExists_t +{ + enum { k_iCallback = k_iSteamTimelineCallbacks + 2 }; + uint64 m_ulEventID; + bool m_bRecordingExists; +}; + + + +#pragma pack( pop ) + + +#endif // ISTEAMTIMELINE_H diff --git a/external/steamworks/public/steam/isteamugc.h b/external/steamworks/public/steam/isteamugc.h new file mode 100644 index 0000000..1777688 --- /dev/null +++ b/external/steamworks/public/steam/isteamugc.h @@ -0,0 +1,638 @@ +//====== Copyright 1996-2013, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to steam ugc +// +//============================================================================= + +#ifndef ISTEAMUGC_H +#define ISTEAMUGC_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" +#include "isteamremotestorage.h" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + + +typedef uint64 UGCQueryHandle_t; +typedef uint64 UGCUpdateHandle_t; + + +const UGCQueryHandle_t k_UGCQueryHandleInvalid = 0xffffffffffffffffull; +const UGCUpdateHandle_t k_UGCUpdateHandleInvalid = 0xffffffffffffffffull; + + +// Matching UGC types for queries +enum EUGCMatchingUGCType +{ + k_EUGCMatchingUGCType_Items = 0, // both mtx items and ready-to-use items + k_EUGCMatchingUGCType_Items_Mtx = 1, + k_EUGCMatchingUGCType_Items_ReadyToUse = 2, + k_EUGCMatchingUGCType_Collections = 3, + k_EUGCMatchingUGCType_Artwork = 4, + k_EUGCMatchingUGCType_Videos = 5, + k_EUGCMatchingUGCType_Screenshots = 6, + k_EUGCMatchingUGCType_AllGuides = 7, // both web guides and integrated guides + k_EUGCMatchingUGCType_WebGuides = 8, + k_EUGCMatchingUGCType_IntegratedGuides = 9, + k_EUGCMatchingUGCType_UsableInGame = 10, // ready-to-use items and integrated guides + k_EUGCMatchingUGCType_ControllerBindings = 11, + k_EUGCMatchingUGCType_GameManagedItems = 12, // game managed items (not managed by users) + k_EUGCMatchingUGCType_All = ~0, // @note: will only be valid for CreateQueryUserUGCRequest requests +}; + +// Different lists of published UGC for a user. +// If the current logged in user is different than the specified user, then some options may not be allowed. +enum EUserUGCList +{ + k_EUserUGCList_Published, + k_EUserUGCList_VotedOn, + k_EUserUGCList_VotedUp, + k_EUserUGCList_VotedDown, + k_EUserUGCList_WillVoteLater, + k_EUserUGCList_Favorited, + k_EUserUGCList_Subscribed, + k_EUserUGCList_UsedOrPlayed, + k_EUserUGCList_Followed, +}; + +// Sort order for user published UGC lists (defaults to creation order descending) +enum EUserUGCListSortOrder +{ + k_EUserUGCListSortOrder_CreationOrderDesc, + k_EUserUGCListSortOrder_CreationOrderAsc, + k_EUserUGCListSortOrder_TitleAsc, + k_EUserUGCListSortOrder_LastUpdatedDesc, + k_EUserUGCListSortOrder_SubscriptionDateDesc, + k_EUserUGCListSortOrder_VoteScoreDesc, + k_EUserUGCListSortOrder_ForModeration, +}; + +// Combination of sorting and filtering for queries across all UGC +enum EUGCQuery +{ + k_EUGCQuery_RankedByVote = 0, + k_EUGCQuery_RankedByPublicationDate = 1, + k_EUGCQuery_AcceptedForGameRankedByAcceptanceDate = 2, + k_EUGCQuery_RankedByTrend = 3, + k_EUGCQuery_FavoritedByFriendsRankedByPublicationDate = 4, + k_EUGCQuery_CreatedByFriendsRankedByPublicationDate = 5, + k_EUGCQuery_RankedByNumTimesReported = 6, + k_EUGCQuery_CreatedByFollowedUsersRankedByPublicationDate = 7, + k_EUGCQuery_NotYetRated = 8, + k_EUGCQuery_RankedByTotalVotesAsc = 9, + k_EUGCQuery_RankedByVotesUp = 10, + k_EUGCQuery_RankedByTextSearch = 11, + k_EUGCQuery_RankedByTotalUniqueSubscriptions = 12, + k_EUGCQuery_RankedByPlaytimeTrend = 13, + k_EUGCQuery_RankedByTotalPlaytime = 14, + k_EUGCQuery_RankedByAveragePlaytimeTrend = 15, + k_EUGCQuery_RankedByLifetimeAveragePlaytime = 16, + k_EUGCQuery_RankedByPlaytimeSessionsTrend = 17, + k_EUGCQuery_RankedByLifetimePlaytimeSessions = 18, + k_EUGCQuery_RankedByLastUpdatedDate = 19, +}; + +enum EItemUpdateStatus +{ + k_EItemUpdateStatusInvalid = 0, // The item update handle was invalid, job might be finished, listen too SubmitItemUpdateResult_t + k_EItemUpdateStatusPreparingConfig = 1, // The item update is processing configuration data + k_EItemUpdateStatusPreparingContent = 2, // The item update is reading and processing content files + k_EItemUpdateStatusUploadingContent = 3, // The item update is uploading content changes to Steam + k_EItemUpdateStatusUploadingPreviewFile = 4, // The item update is uploading new preview file image + k_EItemUpdateStatusCommittingChanges = 5 // The item update is committing all changes +}; + +enum EItemState +{ + k_EItemStateNone = 0, // item not tracked on client + k_EItemStateSubscribed = 1, // current user is subscribed to this item. Not just cached. + k_EItemStateLegacyItem = 2, // item was created with ISteamRemoteStorage + k_EItemStateInstalled = 4, // item is installed and usable (but maybe out of date) + k_EItemStateNeedsUpdate = 8, // items needs an update. Either because it's not installed yet or creator updated content + k_EItemStateDownloading = 16, // item update is currently downloading + k_EItemStateDownloadPending = 32, // DownloadItem() was called for this item, content isn't available until DownloadItemResult_t is fired + k_EItemStateDisabledLocally = 64, // Item is disabled locally, so it shouldn't be considered subscribed +}; + +enum EItemStatistic +{ + k_EItemStatistic_NumSubscriptions = 0, + k_EItemStatistic_NumFavorites = 1, + k_EItemStatistic_NumFollowers = 2, + k_EItemStatistic_NumUniqueSubscriptions = 3, + k_EItemStatistic_NumUniqueFavorites = 4, + k_EItemStatistic_NumUniqueFollowers = 5, + k_EItemStatistic_NumUniqueWebsiteViews = 6, + k_EItemStatistic_ReportScore = 7, + k_EItemStatistic_NumSecondsPlayed = 8, + k_EItemStatistic_NumPlaytimeSessions = 9, + k_EItemStatistic_NumComments = 10, + k_EItemStatistic_NumSecondsPlayedDuringTimePeriod = 11, + k_EItemStatistic_NumPlaytimeSessionsDuringTimePeriod = 12, +}; + +enum EItemPreviewType +{ + k_EItemPreviewType_Image = 0, // standard image file expected (e.g. jpg, png, gif, etc.) + k_EItemPreviewType_YouTubeVideo = 1, // video id is stored + k_EItemPreviewType_Sketchfab = 2, // model id is stored + k_EItemPreviewType_EnvironmentMap_HorizontalCross = 3, // standard image file expected - cube map in the layout + // +---+---+-------+ + // | |Up | | + // +---+---+---+---+ + // | L | F | R | B | + // +---+---+---+---+ + // | |Dn | | + // +---+---+---+---+ + k_EItemPreviewType_EnvironmentMap_LatLong = 4, // standard image file expected + k_EItemPreviewType_Clip = 5, // clip id is stored + k_EItemPreviewType_ReservedMax = 255, // you can specify your own types above this value +}; + +enum EUGCContentDescriptorID +{ + k_EUGCContentDescriptor_NudityOrSexualContent = 1, + k_EUGCContentDescriptor_FrequentViolenceOrGore = 2, + k_EUGCContentDescriptor_AdultOnlySexualContent = 3, + k_EUGCContentDescriptor_GratuitousSexualContent = 4, + k_EUGCContentDescriptor_AnyMatureContent = 5, +}; + +const uint32 kNumUGCResultsPerPage = 50; +const uint32 k_cchDeveloperMetadataMax = 5000; + +// Details for a single published file/UGC +struct SteamUGCDetails_t +{ + PublishedFileId_t m_nPublishedFileId; + EResult m_eResult; // The result of the operation. + EWorkshopFileType m_eFileType; // Type of the file + AppId_t m_nCreatorAppID; // ID of the app that created this file. + AppId_t m_nConsumerAppID; // ID of the app that will consume this file. + char m_rgchTitle[k_cchPublishedDocumentTitleMax]; // title of document + char m_rgchDescription[k_cchPublishedDocumentDescriptionMax]; // description of document + uint64 m_ulSteamIDOwner; // Steam ID of the user who created this content. + uint32 m_rtimeCreated; // time when the published file was created + uint32 m_rtimeUpdated; // time when the published file was last updated + uint32 m_rtimeAddedToUserList; // time when the user added the published file to their list (not always applicable) + ERemoteStoragePublishedFileVisibility m_eVisibility; // visibility + bool m_bBanned; // whether the file was banned + bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop + bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer + char m_rgchTags[k_cchTagListMax]; // comma separated list of all tags associated with this file + // file/url information + UGCHandle_t m_hFile; // The handle of the primary file + UGCHandle_t m_hPreviewFile; // The handle of the preview file + char m_pchFileName[k_cchFilenameMax]; // The cloud filename of the primary file + int32 m_nFileSize; // Size of the primary file (for legacy items which only support one file). This may not be accurate for non-legacy items which can be greater than 4gb in size. + int32 m_nPreviewFileSize; // Size of the preview file + char m_rgchURL[k_cchPublishedFileURLMax]; // URL (for a video or a website) + // voting information + uint32 m_unVotesUp; // number of votes up + uint32 m_unVotesDown; // number of votes down + float m_flScore; // calculated score + // collection details + uint32 m_unNumChildren; + uint64 m_ulTotalFilesSize; // Total size of all files (non-legacy), excluding the preview file +}; + +//----------------------------------------------------------------------------- +// Purpose: Steam UGC support API +//----------------------------------------------------------------------------- +class ISteamUGC +{ +public: + + // Query UGC associated with a user. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1. + virtual UGCQueryHandle_t CreateQueryUserUGCRequest( AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0; + + // Query for all matching UGC. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1. + STEAM_FLAT_NAME( CreateQueryAllUGCRequestPage ) + virtual UGCQueryHandle_t CreateQueryAllUGCRequest( EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0; + + // Query for all matching UGC using the new deep paging interface. Creator app id or consumer app id must be valid and be set to the current running app. pchCursor should be set to NULL or "*" to get the first result set. + STEAM_FLAT_NAME( CreateQueryAllUGCRequestCursor ) + virtual UGCQueryHandle_t CreateQueryAllUGCRequest( EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, const char *pchCursor = NULL ) = 0; + + // Query for the details of the given published file ids (the RequestUGCDetails call is deprecated and replaced with this) + virtual UGCQueryHandle_t CreateQueryUGCDetailsRequest( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0; + + // Send the query to Steam + STEAM_CALL_RESULT( SteamUGCQueryCompleted_t ) + virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0; + + // Retrieve an individual result after receiving the callback for querying UGC + virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0; + virtual uint32 GetQueryUGCNumTags( UGCQueryHandle_t handle, uint32 index ) = 0; + virtual bool GetQueryUGCTag( UGCQueryHandle_t handle, uint32 index, uint32 indexTag, STEAM_OUT_STRING_COUNT( cchValueSize ) char* pchValue, uint32 cchValueSize ) = 0; + virtual bool GetQueryUGCTagDisplayName( UGCQueryHandle_t handle, uint32 index, uint32 indexTag, STEAM_OUT_STRING_COUNT( cchValueSize ) char* pchValue, uint32 cchValueSize ) = 0; + virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURL, uint32 cchURLSize ) = 0; + virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchMetadatasize) char *pchMetadata, uint32 cchMetadatasize ) = 0; + virtual bool GetQueryUGCChildren( UGCQueryHandle_t handle, uint32 index, PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0; + virtual bool GetQueryUGCStatistic( UGCQueryHandle_t handle, uint32 index, EItemStatistic eStatType, uint64 *pStatValue ) = 0; + virtual uint32 GetQueryUGCNumAdditionalPreviews( UGCQueryHandle_t handle, uint32 index ) = 0; + virtual bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint32 index, uint32 previewIndex, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURLOrVideoID, uint32 cchURLSize, STEAM_OUT_STRING_COUNT(cchOriginalFileNameSize) char *pchOriginalFileName, uint32 cchOriginalFileNameSize, EItemPreviewType *pPreviewType ) = 0; + virtual uint32 GetQueryUGCNumKeyValueTags( UGCQueryHandle_t handle, uint32 index ) = 0; + virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, uint32 keyValueTagIndex, STEAM_OUT_STRING_COUNT(cchKeySize) char *pchKey, uint32 cchKeySize, STEAM_OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0; + + // Return the first value matching the pchKey. Note that a key may map to multiple values. Returns false if there was an error or no matching value was found. + STEAM_FLAT_NAME( GetQueryFirstUGCKeyValueTag ) + virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, const char *pchKey, STEAM_OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0; + + // Some items can specify that they have a version that is valid for a range of game versions (Steam branch) + virtual uint32 GetNumSupportedGameVersions( UGCQueryHandle_t handle, uint32 index ) = 0; + virtual bool GetSupportedGameVersionData( UGCQueryHandle_t handle, uint32 index, uint32 versionIndex, STEAM_OUT_STRING_COUNT( cchGameBranchSize ) char *pchGameBranchMin, STEAM_OUT_STRING_COUNT( cchGameBranchSize ) char *pchGameBranchMax, uint32 cchGameBranchSize ) = 0; + + virtual uint32 GetQueryUGCContentDescriptors( UGCQueryHandle_t handle, uint32 index, EUGCContentDescriptorID *pvecDescriptors, uint32 cMaxEntries ) = 0; + + // Release the request to free up memory, after retrieving results + virtual bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) = 0; + + // Options to set for querying UGC + virtual bool AddRequiredTag( UGCQueryHandle_t handle, const char *pTagName ) = 0; + virtual bool AddRequiredTagGroup( UGCQueryHandle_t handle, const SteamParamStringArray_t *pTagGroups ) = 0; // match any of the tags in this group + virtual bool AddExcludedTag( UGCQueryHandle_t handle, const char *pTagName ) = 0; + virtual bool SetReturnOnlyIDs( UGCQueryHandle_t handle, bool bReturnOnlyIDs ) = 0; + virtual bool SetReturnKeyValueTags( UGCQueryHandle_t handle, bool bReturnKeyValueTags ) = 0; + virtual bool SetReturnLongDescription( UGCQueryHandle_t handle, bool bReturnLongDescription ) = 0; + virtual bool SetReturnMetadata( UGCQueryHandle_t handle, bool bReturnMetadata ) = 0; + virtual bool SetReturnChildren( UGCQueryHandle_t handle, bool bReturnChildren ) = 0; + virtual bool SetReturnAdditionalPreviews( UGCQueryHandle_t handle, bool bReturnAdditionalPreviews ) = 0; + virtual bool SetReturnTotalOnly( UGCQueryHandle_t handle, bool bReturnTotalOnly ) = 0; + virtual bool SetReturnPlaytimeStats( UGCQueryHandle_t handle, uint32 unDays ) = 0; + virtual bool SetLanguage( UGCQueryHandle_t handle, const char *pchLanguage ) = 0; + virtual bool SetAllowCachedResponse( UGCQueryHandle_t handle, uint32 unMaxAgeSeconds ) = 0; + virtual bool SetAdminQuery( UGCUpdateHandle_t handle, bool bAdminQuery ) = 0; // admin queries return hidden items + + // Options only for querying user UGC + virtual bool SetCloudFileNameFilter( UGCQueryHandle_t handle, const char *pMatchCloudFileName ) = 0; + + // Options only for querying all UGC + virtual bool SetMatchAnyTag( UGCQueryHandle_t handle, bool bMatchAnyTag ) = 0; + virtual bool SetSearchText( UGCQueryHandle_t handle, const char *pSearchText ) = 0; + virtual bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint32 unDays ) = 0; + virtual bool SetTimeCreatedDateRange( UGCQueryHandle_t handle, RTime32 rtStart, RTime32 rtEnd ) = 0; + virtual bool SetTimeUpdatedDateRange( UGCQueryHandle_t handle, RTime32 rtStart, RTime32 rtEnd ) = 0; + virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0; + + // DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead! + STEAM_CALL_RESULT( SteamUGCRequestUGCDetailsResult_t ) + virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0; + + // Steam Workshop Creator API + STEAM_CALL_RESULT( CreateItemResult_t ) + virtual SteamAPICall_t CreateItem( AppId_t nConsumerAppId, EWorkshopFileType eFileType ) = 0; // create new item for this app with no content attached yet + + virtual UGCUpdateHandle_t StartItemUpdate( AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID ) = 0; // start an UGC item update. Set changed properties before commiting update with CommitItemUpdate() + + virtual bool SetItemTitle( UGCUpdateHandle_t handle, const char *pchTitle ) = 0; // change the title of an UGC item + virtual bool SetItemDescription( UGCUpdateHandle_t handle, const char *pchDescription ) = 0; // change the description of an UGC item + virtual bool SetItemUpdateLanguage( UGCUpdateHandle_t handle, const char *pchLanguage ) = 0; // specify the language of the title or description that will be set + virtual bool SetItemMetadata( UGCUpdateHandle_t handle, const char *pchMetaData ) = 0; // change the metadata of an UGC item (max = k_cchDeveloperMetadataMax) + virtual bool SetItemVisibility( UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0; // change the visibility of an UGC item + virtual bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags, bool bAllowAdminTags = false ) = 0; // change the tags of an UGC item + virtual bool SetItemContent( UGCUpdateHandle_t handle, const char *pszContentFolder ) = 0; // update item content from this local folder + virtual bool SetItemPreview( UGCUpdateHandle_t handle, const char *pszPreviewFile ) = 0; // change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size + virtual bool SetAllowLegacyUpload( UGCUpdateHandle_t handle, bool bAllowLegacyUpload ) = 0; // use legacy upload for a single small file. The parameter to SetItemContent() should either be a directory with one file or the full path to the file. The file must also be less than 10MB in size. + virtual bool RemoveAllItemKeyValueTags( UGCUpdateHandle_t handle ) = 0; // remove all existing key-value tags (you can add new ones via the AddItemKeyValueTag function) + virtual bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle, const char *pchKey ) = 0; // remove any existing key-value tags with the specified key + virtual bool AddItemKeyValueTag( UGCUpdateHandle_t handle, const char *pchKey, const char *pchValue ) = 0; // add new key-value tags for the item. Note that there can be multiple values for a tag. + virtual bool AddItemPreviewFile( UGCUpdateHandle_t handle, const char *pszPreviewFile, EItemPreviewType type ) = 0; // add preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size + virtual bool AddItemPreviewVideo( UGCUpdateHandle_t handle, const char *pszVideoID ) = 0; // add preview video for this item + virtual bool UpdateItemPreviewFile( UGCUpdateHandle_t handle, uint32 index, const char *pszPreviewFile ) = 0; // updates an existing preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size + virtual bool UpdateItemPreviewVideo( UGCUpdateHandle_t handle, uint32 index, const char *pszVideoID ) = 0; // updates an existing preview video for this item + virtual bool RemoveItemPreview( UGCUpdateHandle_t handle, uint32 index ) = 0; // remove a preview by index starting at 0 (previews are sorted) + virtual bool AddContentDescriptor( UGCUpdateHandle_t handle, EUGCContentDescriptorID descid ) = 0; + virtual bool RemoveContentDescriptor( UGCUpdateHandle_t handle, EUGCContentDescriptorID descid ) = 0; + virtual bool SetRequiredGameVersions( UGCUpdateHandle_t handle, const char *pszGameBranchMin, const char *pszGameBranchMax ) = 0; // an empty string for either parameter means that it will match any version on that end of the range. This will only be applied if the actual content has been changed. + + STEAM_CALL_RESULT( SubmitItemUpdateResult_t ) + virtual SteamAPICall_t SubmitItemUpdate( UGCUpdateHandle_t handle, const char *pchChangeNote ) = 0; // commit update process started with StartItemUpdate() + virtual EItemUpdateStatus GetItemUpdateProgress( UGCUpdateHandle_t handle, uint64 *punBytesProcessed, uint64* punBytesTotal ) = 0; + + // Steam Workshop Consumer API + STEAM_CALL_RESULT( SetUserItemVoteResult_t ) + virtual SteamAPICall_t SetUserItemVote( PublishedFileId_t nPublishedFileID, bool bVoteUp ) = 0; + STEAM_CALL_RESULT( GetUserItemVoteResult_t ) + virtual SteamAPICall_t GetUserItemVote( PublishedFileId_t nPublishedFileID ) = 0; + STEAM_CALL_RESULT( UserFavoriteItemsListChanged_t ) + virtual SteamAPICall_t AddItemToFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0; + STEAM_CALL_RESULT( UserFavoriteItemsListChanged_t ) + virtual SteamAPICall_t RemoveItemFromFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0; + STEAM_CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t ) + virtual SteamAPICall_t SubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // subscribe to this item, will be installed ASAP + STEAM_CALL_RESULT( RemoteStorageUnsubscribePublishedFileResult_t ) + virtual SteamAPICall_t UnsubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // unsubscribe from this item, will be uninstalled after game quits + virtual uint32 GetNumSubscribedItems( bool bIncludeLocallyDisabled = false ) = 0; // number of subscribed items + virtual uint32 GetSubscribedItems( PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries, bool bIncludeLocallyDisabled = false ) = 0; // all subscribed item PublishFileIDs + + // get EItemState flags about item on this client + virtual uint32 GetItemState( PublishedFileId_t nPublishedFileID ) = 0; + + // get info about currently installed content on disc for items that have k_EItemStateInstalled set + // if k_EItemStateLegacyItem is set, pchFolder contains the path to the legacy file itself (not a folder) + virtual bool GetItemInstallInfo( PublishedFileId_t nPublishedFileID, uint64 *punSizeOnDisk, STEAM_OUT_STRING_COUNT( cchFolderSize ) char *pchFolder, uint32 cchFolderSize, uint32 *punTimeStamp ) = 0; + + // get info about pending update for items that have k_EItemStateNeedsUpdate set. punBytesTotal will be valid after download started once + virtual bool GetItemDownloadInfo( PublishedFileId_t nPublishedFileID, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0; + + // download new or update already installed item. If function returns true, wait for DownloadItemResult_t. If the item is already installed, + // then files on disk should not be used until callback received. If item is not subscribed to, it will be cached for some time. + // If bHighPriority is set, any other item download will be suspended and this item downloaded ASAP. + virtual bool DownloadItem( PublishedFileId_t nPublishedFileID, bool bHighPriority ) = 0; + + // game servers can set a specific workshop folder before issuing any UGC commands. + // This is helpful if you want to support multiple game servers running out of the same install folder + virtual bool BInitWorkshopForGameServer( DepotId_t unWorkshopDepotID, const char *pszFolder ) = 0; + + // SuspendDownloads( true ) will suspend all workshop downloads until SuspendDownloads( false ) is called or the game ends + virtual void SuspendDownloads( bool bSuspend ) = 0; + + // usage tracking + STEAM_CALL_RESULT( StartPlaytimeTrackingResult_t ) + virtual SteamAPICall_t StartPlaytimeTracking( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0; + STEAM_CALL_RESULT( StopPlaytimeTrackingResult_t ) + virtual SteamAPICall_t StopPlaytimeTracking( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0; + STEAM_CALL_RESULT( StopPlaytimeTrackingResult_t ) + virtual SteamAPICall_t StopPlaytimeTrackingForAllItems() = 0; + + // parent-child relationship or dependency management + STEAM_CALL_RESULT( AddUGCDependencyResult_t ) + virtual SteamAPICall_t AddDependency( PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ) = 0; + STEAM_CALL_RESULT( RemoveUGCDependencyResult_t ) + virtual SteamAPICall_t RemoveDependency( PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ) = 0; + + // add/remove app dependence/requirements (usually DLC) + STEAM_CALL_RESULT( AddAppDependencyResult_t ) + virtual SteamAPICall_t AddAppDependency( PublishedFileId_t nPublishedFileID, AppId_t nAppID ) = 0; + STEAM_CALL_RESULT( RemoveAppDependencyResult_t ) + virtual SteamAPICall_t RemoveAppDependency( PublishedFileId_t nPublishedFileID, AppId_t nAppID ) = 0; + // request app dependencies. note that whatever callback you register for GetAppDependenciesResult_t may be called multiple times + // until all app dependencies have been returned + STEAM_CALL_RESULT( GetAppDependenciesResult_t ) + virtual SteamAPICall_t GetAppDependencies( PublishedFileId_t nPublishedFileID ) = 0; + + // delete the item without prompting the user + STEAM_CALL_RESULT( DeleteItemResult_t ) + virtual SteamAPICall_t DeleteItem( PublishedFileId_t nPublishedFileID ) = 0; + + // Show the app's latest Workshop EULA to the user in an overlay window, where they can accept it or not + virtual bool ShowWorkshopEULA() = 0; + // Retrieve information related to the user's acceptance or not of the app's specific Workshop EULA + STEAM_CALL_RESULT( WorkshopEULAStatus_t ) + virtual SteamAPICall_t GetWorkshopEULAStatus() = 0; + + // Return the user's community content descriptor preferences + virtual uint32 GetUserContentDescriptorPreferences( EUGCContentDescriptorID *pvecDescriptors, uint32 cMaxEntries ) = 0; + + // Sets whether the item should be disabled locally or not. This means that it will not be returned in GetSubscribedItems() by default. + virtual bool SetItemsDisabledLocally( PublishedFileId_t *pvecPublishedFileIDs, uint32 unNumPublishedFileIDs, bool bDisabledLocally ) = 0; + + // Set the local load order for these items. If there are any items not in the given list, they will sort by the time subscribed. + virtual bool SetSubscriptionsLoadOrder( PublishedFileId_t *pvecPublishedFileIDs, uint32 unNumPublishedFileIDs ) = 0; +}; + +#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION021" + +// Global interface accessor +inline ISteamUGC *SteamUGC(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamUGC *, SteamUGC, STEAMUGC_INTERFACE_VERSION ); + +// Global accessor for the gameserver client +inline ISteamUGC *SteamGameServerUGC(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamUGC *, SteamGameServerUGC, STEAMUGC_INTERFACE_VERSION ); + +//----------------------------------------------------------------------------- +// Purpose: Callback for querying UGC +//----------------------------------------------------------------------------- +struct SteamUGCQueryCompleted_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 1 }; + UGCQueryHandle_t m_handle; + EResult m_eResult; + uint32 m_unNumResultsReturned; + uint32 m_unTotalMatchingResults; + bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache + char m_rgchNextCursor[k_cchPublishedFileURLMax]; // If a paging cursor was used, then this will be the next cursor to get the next result set. +}; + + +//----------------------------------------------------------------------------- +// Purpose: Callback for requesting details on one piece of UGC +//----------------------------------------------------------------------------- +struct SteamUGCRequestUGCDetailsResult_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 2 }; + SteamUGCDetails_t m_details; + bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache +}; + + +//----------------------------------------------------------------------------- +// Purpose: result for ISteamUGC::CreateItem() +//----------------------------------------------------------------------------- +struct CreateItemResult_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 3 }; + EResult m_eResult; + PublishedFileId_t m_nPublishedFileId; // new item got this UGC PublishFileID + bool m_bUserNeedsToAcceptWorkshopLegalAgreement; +}; + + +//----------------------------------------------------------------------------- +// Purpose: result for ISteamUGC::SubmitItemUpdate() +//----------------------------------------------------------------------------- +struct SubmitItemUpdateResult_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 4 }; + EResult m_eResult; + bool m_bUserNeedsToAcceptWorkshopLegalAgreement; + PublishedFileId_t m_nPublishedFileId; +}; + + +//----------------------------------------------------------------------------- +// Purpose: a Workshop item has been installed or updated +//----------------------------------------------------------------------------- +struct ItemInstalled_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 5 }; + AppId_t m_unAppID; + PublishedFileId_t m_nPublishedFileId; + UGCHandle_t m_hLegacyContent; + uint64 m_unManifestID; +}; + + +//----------------------------------------------------------------------------- +// Purpose: result of DownloadItem(), existing item files can be accessed again +//----------------------------------------------------------------------------- +struct DownloadItemResult_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 6 }; + AppId_t m_unAppID; + PublishedFileId_t m_nPublishedFileId; + EResult m_eResult; +}; + +//----------------------------------------------------------------------------- +// Purpose: result of AddItemToFavorites() or RemoveItemFromFavorites() +//----------------------------------------------------------------------------- +struct UserFavoriteItemsListChanged_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 7 }; + PublishedFileId_t m_nPublishedFileId; + EResult m_eResult; + bool m_bWasAddRequest; +}; + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to SetUserItemVote() +//----------------------------------------------------------------------------- +struct SetUserItemVoteResult_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 8 }; + PublishedFileId_t m_nPublishedFileId; + EResult m_eResult; + bool m_bVoteUp; +}; + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to GetUserItemVote() +//----------------------------------------------------------------------------- +struct GetUserItemVoteResult_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 9 }; + PublishedFileId_t m_nPublishedFileId; + EResult m_eResult; + bool m_bVotedUp; + bool m_bVotedDown; + bool m_bVoteSkipped; +}; + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to StartPlaytimeTracking() +//----------------------------------------------------------------------------- +struct StartPlaytimeTrackingResult_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 10 }; + EResult m_eResult; +}; + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to StopPlaytimeTracking() +//----------------------------------------------------------------------------- +struct StopPlaytimeTrackingResult_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 11 }; + EResult m_eResult; +}; + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to AddDependency +//----------------------------------------------------------------------------- +struct AddUGCDependencyResult_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 12 }; + EResult m_eResult; + PublishedFileId_t m_nPublishedFileId; + PublishedFileId_t m_nChildPublishedFileId; +}; + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to RemoveDependency +//----------------------------------------------------------------------------- +struct RemoveUGCDependencyResult_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 13 }; + EResult m_eResult; + PublishedFileId_t m_nPublishedFileId; + PublishedFileId_t m_nChildPublishedFileId; +}; + + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to AddAppDependency +//----------------------------------------------------------------------------- +struct AddAppDependencyResult_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 14 }; + EResult m_eResult; + PublishedFileId_t m_nPublishedFileId; + AppId_t m_nAppID; +}; + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to RemoveAppDependency +//----------------------------------------------------------------------------- +struct RemoveAppDependencyResult_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 15 }; + EResult m_eResult; + PublishedFileId_t m_nPublishedFileId; + AppId_t m_nAppID; +}; + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to GetAppDependencies. Callback may be called +// multiple times until all app dependencies have been returned. +//----------------------------------------------------------------------------- +struct GetAppDependenciesResult_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 16 }; + EResult m_eResult; + PublishedFileId_t m_nPublishedFileId; + AppId_t m_rgAppIDs[32]; + uint32 m_nNumAppDependencies; // number returned in this struct + uint32 m_nTotalNumAppDependencies; // total found +}; + +//----------------------------------------------------------------------------- +// Purpose: The result of a call to DeleteItem +//----------------------------------------------------------------------------- +struct DeleteItemResult_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 17 }; + EResult m_eResult; + PublishedFileId_t m_nPublishedFileId; +}; + + +//----------------------------------------------------------------------------- +// Purpose: signal that the list of subscribed items changed +//----------------------------------------------------------------------------- +struct UserSubscribedItemsListChanged_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 18 }; + AppId_t m_nAppID; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Status of the user's acceptable/rejection of the app's specific Workshop EULA +//----------------------------------------------------------------------------- +struct WorkshopEULAStatus_t +{ + enum { k_iCallback = k_iSteamUGCCallbacks + 20 }; + EResult m_eResult; + AppId_t m_nAppID; + uint32 m_unVersion; + RTime32 m_rtAction; + bool m_bAccepted; + bool m_bNeedsAction; +}; + +#pragma pack( pop ) + +#endif // ISTEAMUGC_H diff --git a/external/steamworks/public/steam/isteamuser.h b/external/steamworks/public/steam/isteamuser.h new file mode 100644 index 0000000..b694206 --- /dev/null +++ b/external/steamworks/public/steam/isteamuser.h @@ -0,0 +1,439 @@ +//====== Copyright (c) 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to user account information in Steam +// +//============================================================================= + +#ifndef ISTEAMUSER_H +#define ISTEAMUSER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + +//----------------------------------------------------------------------------- +// Purpose: Functions for accessing and manipulating a steam account +// associated with one client instance +//----------------------------------------------------------------------------- +class ISteamUser +{ +public: + // returns the HSteamUser this interface represents + // this is only used internally by the API, and by a few select interfaces that support multi-user + virtual HSteamUser GetHSteamUser() = 0; + + // returns true if the Steam client current has a live connection to the Steam servers. + // If false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy. + // The Steam client will automatically be trying to recreate the connection as often as possible. + virtual bool BLoggedOn() = 0; + + // returns the CSteamID of the account currently logged into the Steam client + // a CSteamID is a unique identifier for an account, and used to differentiate users in all parts of the Steamworks API + virtual CSteamID GetSteamID() = 0; + + // Multiplayer Authentication functions + + // InitiateGameConnection() starts the state machine for authenticating the game client with the game server + // It is the client portion of a three-way handshake between the client, the game server, and the steam servers + // + // Parameters: + // void *pAuthBlob - a pointer to empty memory that will be filled in with the authentication token. + // int cbMaxAuthBlob - the number of bytes of allocated memory in pBlob. Should be at least 2048 bytes. + // CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client + // CGameID gameID - the ID of the current game. For games without mods, this is just CGameID( ) + // uint32 unIPServer, uint16 usPortServer - the IP address of the game server + // bool bSecure - whether or not the client thinks that the game server is reporting itself as secure (i.e. VAC is running) + // + // return value - returns the number of bytes written to pBlob. If the return is 0, then the buffer passed in was too small, and the call has failed + // The contents of pBlob should then be sent to the game server, for it to use to complete the authentication process. + // + // DEPRECATED! This function will be removed from the SDK in an upcoming version. + // Please migrate to BeginAuthSession and related functions. + virtual int InitiateGameConnection_DEPRECATED( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure ) = 0; + + // notify of disconnect + // needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection() call + // + // DEPRECATED! This function will be removed from the SDK in an upcoming version. + // Please migrate to BeginAuthSession and related functions. + virtual void TerminateGameConnection_DEPRECATED( uint32 unIPServer, uint16 usPortServer ) = 0; + + // Legacy functions + + // used by only a few games to track usage events + virtual void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = "" ) = 0; + + // get the local storage folder for current Steam account to write application data, e.g. save games, configs etc. + // this will usually be something like "C:\Progam Files\Steam\userdata\\\local" + virtual bool GetUserDataFolder( char *pchBuffer, int cubBuffer ) = 0; + + // Starts voice recording. Once started, use GetVoice() to get the data + virtual void StartVoiceRecording( ) = 0; + + // Stops voice recording. Because people often release push-to-talk keys early, the system will keep recording for + // a little bit after this function is called. GetVoice() should continue to be called until it returns + // k_eVoiceResultNotRecording + virtual void StopVoiceRecording( ) = 0; + + // Determine the size of captured audio data that is available from GetVoice. + // Most applications will only use compressed data and should ignore the other + // parameters, which exist primarily for backwards compatibility. See comments + // below for further explanation of "uncompressed" data. + virtual EVoiceResult GetAvailableVoice( uint32 *pcbCompressed, uint32 *pcbUncompressed_Deprecated = 0, uint32 nUncompressedVoiceDesiredSampleRate_Deprecated = 0 ) = 0; + + // --------------------------------------------------------------------------- + // NOTE: "uncompressed" audio is a deprecated feature and should not be used + // by most applications. It is raw single-channel 16-bit PCM wave data which + // may have been run through preprocessing filters and/or had silence removed, + // so the uncompressed audio could have a shorter duration than you expect. + // There may be no data at all during long periods of silence. Also, fetching + // uncompressed audio will cause GetVoice to discard any leftover compressed + // audio, so you must fetch both types at once. Finally, GetAvailableVoice is + // not precisely accurate when the uncompressed size is requested. So if you + // really need to use uncompressed audio, you should call GetVoice frequently + // with two very large (20kb+) output buffers instead of trying to allocate + // perfectly-sized buffers. But most applications should ignore all of these + // details and simply leave the "uncompressed" parameters as NULL/zero. + // --------------------------------------------------------------------------- + + // Read captured audio data from the microphone buffer. This should be called + // at least once per frame, and preferably every few milliseconds, to keep the + // microphone input delay as low as possible. Most applications will only use + // compressed data and should pass NULL/zero for the "uncompressed" parameters. + // Compressed data can be transmitted by your application and decoded into raw + // using the DecompressVoice function below. + virtual EVoiceResult GetVoice( bool bWantCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, bool bWantUncompressed_Deprecated = false, void *pUncompressedDestBuffer_Deprecated = 0, uint32 cbUncompressedDestBufferSize_Deprecated = 0, uint32 *nUncompressBytesWritten_Deprecated = 0, uint32 nUncompressedVoiceDesiredSampleRate_Deprecated = 0 ) = 0; + + // Decodes the compressed voice data returned by GetVoice. The output data is + // raw single-channel 16-bit PCM audio. The decoder supports any sample rate + // from 11025 to 48000; see GetVoiceOptimalSampleRate() below for details. + // If the output buffer is not large enough, then *nBytesWritten will be set + // to the required buffer size, and k_EVoiceResultBufferTooSmall is returned. + // It is suggested to start with a 20kb buffer and reallocate as necessary. + virtual EVoiceResult DecompressVoice( const void *pCompressed, uint32 cbCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, uint32 nDesiredSampleRate ) = 0; + + // This returns the native sample rate of the Steam voice decompressor; using + // this sample rate for DecompressVoice will perform the least CPU processing. + // However, the final audio quality will depend on how well the audio device + // (and/or your application's audio output SDK) deals with lower sample rates. + // You may find that you get the best audio output quality when you ignore + // this function and use the native sample rate of your audio output device, + // which is usually 48000 or 44100. + virtual uint32 GetVoiceOptimalSampleRate() = 0; + + // Retrieve ticket to be sent to the entity who wishes to authenticate you. + // pcbTicket retrieves the length of the actual ticket. + // SteamNetworkingIdentity is an optional input parameter to hold the public IP address or SteamID of the entity you are connecting to + // if an IP address is passed Steam will only allow the ticket to be used by an entity with that IP address + // if a Steam ID is passed Steam will only allow the ticket to be used by that Steam ID + // not to be used for "ISteamUserAuth\AuthenticateUserTicket" - it will fail + virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSteamNetworkingIdentity ) = 0; + + // Request a ticket which will be used for webapi "ISteamUserAuth\AuthenticateUserTicket" + // pchIdentity is an optional input parameter to identify the service the ticket will be sent to + // the ticket will be returned in callback GetTicketForWebApiResponse_t + virtual HAuthTicket GetAuthTicketForWebApi( const char *pchIdentity ) = 0; + + // Authenticate ticket from entity steamID to be sure it is valid and isnt reused + // Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse ) + virtual EBeginAuthSessionResult BeginAuthSession( const void *pAuthTicket, int cbAuthTicket, CSteamID steamID ) = 0; + + // Stop tracking started by BeginAuthSession - called when no longer playing game with this entity + virtual void EndAuthSession( CSteamID steamID ) = 0; + + // Cancel auth ticket from GetAuthSessionTicket, called when no longer playing game with the entity you gave the ticket to + virtual void CancelAuthTicket( HAuthTicket hAuthTicket ) = 0; + + // After receiving a user's authentication data, and passing it to BeginAuthSession, use this function + // to determine if the user owns downloadable content specified by the provided AppID. + virtual EUserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID, AppId_t appID ) = 0; + + // returns true if this users looks like they are behind a NAT device. Only valid once the user has connected to steam + // (i.e a SteamServersConnected_t has been issued) and may not catch all forms of NAT. + virtual bool BIsBehindNAT() = 0; + + // set data to be replicated to friends so that they can join your game + // CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client + // uint32 unIPServer, uint16 usPortServer - the IP address of the game server + virtual void AdvertiseGame( CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer ) = 0; + + // Requests a ticket encrypted with an app specific shared key + // pDataToInclude, cbDataToInclude will be encrypted into the ticket + // ( This is asynchronous, you must wait for the ticket to be completed by the server ) + STEAM_CALL_RESULT( EncryptedAppTicketResponse_t ) + virtual SteamAPICall_t RequestEncryptedAppTicket( void *pDataToInclude, int cbDataToInclude ) = 0; + + // Retrieves a finished ticket. + // If no ticket is available, or your buffer is too small, returns false. + // Upon exit, *pcbTicket will be either the size of the ticket copied into your buffer + // (if true was returned), or the size needed (if false was returned). To determine the + // proper size of the ticket, you can pass pTicket=NULL and cbMaxTicket=0; if a ticket + // is available, *pcbTicket will contain the size needed, otherwise it will be zero. + virtual bool GetEncryptedAppTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0; + + // Trading Card badges data access + // if you only have one set of cards, the series will be 1 + // the user has can have two different badges for a series; the regular (max level 5) and the foil (max level 1) + virtual int GetGameBadgeLevel( int nSeries, bool bFoil ) = 0; + + // gets the Steam Level of the user, as shown on their profile + virtual int GetPlayerSteamLevel() = 0; + + // Requests a URL which authenticates an in-game browser for store check-out, + // and then redirects to the specified URL. As long as the in-game browser + // accepts and handles session cookies, Steam microtransaction checkout pages + // will automatically recognize the user instead of presenting a login page. + // The result of this API call will be a StoreAuthURLResponse_t callback. + // NOTE: The URL has a very short lifetime to prevent history-snooping attacks, + // so you should only call this API when you are about to launch the browser, + // or else immediately navigate to the result URL using a hidden browser window. + // NOTE 2: The resulting authorization cookie has an expiration time of one day, + // so it would be a good idea to request and visit a new auth URL every 12 hours. + STEAM_CALL_RESULT( StoreAuthURLResponse_t ) + virtual SteamAPICall_t RequestStoreAuthURL( const char *pchRedirectURL ) = 0; + + // gets whether the users phone number is verified + virtual bool BIsPhoneVerified() = 0; + + // gets whether the user has two factor enabled on their account + virtual bool BIsTwoFactorEnabled() = 0; + + // gets whether the users phone number is identifying + virtual bool BIsPhoneIdentifying() = 0; + + // gets whether the users phone number is awaiting (re)verification + virtual bool BIsPhoneRequiringVerification() = 0; + + STEAM_CALL_RESULT( MarketEligibilityResponse_t ) + virtual SteamAPICall_t GetMarketEligibility() = 0; + + // Retrieves anti indulgence / duration control for current user + STEAM_CALL_RESULT( DurationControl_t ) + virtual SteamAPICall_t GetDurationControl() = 0; + + // Advise steam china duration control system about the online state of the game. + // This will prevent offline gameplay time from counting against a user's + // playtime limits. + virtual bool BSetDurationControlOnlineState( EDurationControlOnlineState eNewState ) = 0; + +}; + +#define STEAMUSER_INTERFACE_VERSION "SteamUser023" + +// Global interface accessor +inline ISteamUser *SteamUser(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamUser *, SteamUser, STEAMUSER_INTERFACE_VERSION ); + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + + +//----------------------------------------------------------------------------- +// Purpose: Called when an authenticated connection to the Steam back-end has been established. +// This means the Steam client now has a working connection to the Steam servers. +// Usually this will have occurred before the game has launched, and should +// only be seen if the user has dropped connection due to a networking issue +// or a Steam server update. +//----------------------------------------------------------------------------- +struct SteamServersConnected_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 1 }; +}; + +//----------------------------------------------------------------------------- +// Purpose: called when a connection attempt has failed +// this will occur periodically if the Steam client is not connected, +// and has failed in it's retry to establish a connection +//----------------------------------------------------------------------------- +struct SteamServerConnectFailure_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 2 }; + EResult m_eResult; + bool m_bStillRetrying; +}; + + +//----------------------------------------------------------------------------- +// Purpose: called if the client has lost connection to the Steam servers +// real-time services will be disabled until a matching SteamServersConnected_t has been posted +//----------------------------------------------------------------------------- +struct SteamServersDisconnected_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 3 }; + EResult m_eResult; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Sent by the Steam server to the client telling it to disconnect from the specified game server, +// which it may be in the process of or already connected to. +// The game client should immediately disconnect upon receiving this message. +// This can usually occur if the user doesn't have rights to play on the game server. +//----------------------------------------------------------------------------- +struct ClientGameServerDeny_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 13 }; + + uint32 m_uAppID; + uint32 m_unGameServerIP; + uint16 m_usGameServerPort; + uint16 m_bSecure; + uint32 m_uReason; +}; + + +//----------------------------------------------------------------------------- +// Purpose: called when the callback system for this client is in an error state (and has flushed pending callbacks) +// When getting this message the client should disconnect from Steam, reset any stored Steam state and reconnect. +// This usually occurs in the rare event the Steam client has some kind of fatal error. +//----------------------------------------------------------------------------- +struct IPCFailure_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 17 }; + enum EFailureType + { + k_EFailureFlushedCallbackQueue, + k_EFailurePipeFail, + }; + uint8 m_eFailureType; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Signaled whenever licenses change +//----------------------------------------------------------------------------- +struct LicensesUpdated_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 25 }; +}; + + +//----------------------------------------------------------------------------- +// callback for BeginAuthSession +//----------------------------------------------------------------------------- +struct ValidateAuthTicketResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 43 }; + CSteamID m_SteamID; + EAuthSessionResponse m_eAuthSessionResponse; + CSteamID m_OwnerSteamID; // different from m_SteamID if borrowed +}; + + +//----------------------------------------------------------------------------- +// Purpose: called when a user has responded to a microtransaction authorization request +//----------------------------------------------------------------------------- +struct MicroTxnAuthorizationResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 52 }; + + uint32 m_unAppID; // AppID for this microtransaction + uint64 m_ulOrderID; // OrderID provided for the microtransaction + uint8 m_bAuthorized; // if user authorized transaction +}; + + +//----------------------------------------------------------------------------- +// Purpose: Result from RequestEncryptedAppTicket +//----------------------------------------------------------------------------- +struct EncryptedAppTicketResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 54 }; + + EResult m_eResult; +}; + +//----------------------------------------------------------------------------- +// callback for GetAuthSessionTicket +//----------------------------------------------------------------------------- +struct GetAuthSessionTicketResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 63 }; + HAuthTicket m_hAuthTicket; + EResult m_eResult; +}; + +//----------------------------------------------------------------------------- +// Purpose: sent to your game in response to a steam://gamewebcallback/ command +//----------------------------------------------------------------------------- +struct GameWebCallback_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 64 }; + char m_szURL[256]; +}; + +//----------------------------------------------------------------------------- +// Purpose: sent to your game in response to ISteamUser::RequestStoreAuthURL +//----------------------------------------------------------------------------- +struct StoreAuthURLResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 65 }; + char m_szURL[512]; +}; + + +//----------------------------------------------------------------------------- +// Purpose: sent in response to ISteamUser::GetMarketEligibility +//----------------------------------------------------------------------------- +struct MarketEligibilityResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 66 }; + bool m_bAllowed; + EMarketNotAllowedReasonFlags m_eNotAllowedReason; + RTime32 m_rtAllowedAtTime; + + int m_cdaySteamGuardRequiredDays; // The number of days any user is required to have had Steam Guard before they can use the market + int m_cdayNewDeviceCooldown; // The number of days after initial device authorization a user must wait before using the market on that device +}; + + +//----------------------------------------------------------------------------- +// Purpose: sent for games with enabled anti indulgence / duration control, for +// enabled users. Lets the game know whether the user can keep playing or +// whether the game should exit, and returns info about remaining gameplay time. +// +// This callback is fired asynchronously in response to timers triggering. +// It is also fired in response to calls to GetDurationControl(). +//----------------------------------------------------------------------------- +struct DurationControl_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 67 }; + + EResult m_eResult; // result of call (always k_EResultOK for asynchronous timer-based notifications) + AppId_t m_appid; // appid generating playtime + + bool m_bApplicable; // is duration control applicable to user + game combination + int32 m_csecsLast5h; // playtime since most recent 5 hour gap in playtime, only counting up to regulatory limit of playtime, in seconds + + EDurationControlProgress m_progress; // recommended progress (either everything is fine, or please exit game) + EDurationControlNotification m_notification; // notification to show, if any (always k_EDurationControlNotification_None for API calls) + + int32 m_csecsToday; // playtime on current calendar day + int32 m_csecsRemaining; // playtime remaining until the user hits a regulatory limit +}; + + +//----------------------------------------------------------------------------- +// callback for GetTicketForWebApi +//----------------------------------------------------------------------------- +struct GetTicketForWebApiResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 68 }; + HAuthTicket m_hAuthTicket; + EResult m_eResult; + int m_cubTicket; + static const int k_nCubTicketMaxLength = 2560; + uint8 m_rgubTicket[k_nCubTicketMaxLength]; +}; + + +#pragma pack( pop ) + +#endif // ISTEAMUSER_H diff --git a/external/steamworks/public/steam/isteamuserstats.h b/external/steamworks/public/steam/isteamuserstats.h new file mode 100644 index 0000000..d4a83aa --- /dev/null +++ b/external/steamworks/public/steam/isteamuserstats.h @@ -0,0 +1,476 @@ +//====== Copyright � 1996-2009, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to stats, achievements, and leaderboards +// +//============================================================================= + +#ifndef ISTEAMUSERSTATS_H +#define ISTEAMUSERSTATS_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" +#include "isteamremotestorage.h" + +// size limit on stat or achievement name (UTF-8 encoded) +enum { k_cchStatNameMax = 128 }; + +// maximum number of bytes for a leaderboard name (UTF-8 encoded) +enum { k_cchLeaderboardNameMax = 128 }; + +// maximum number of details int32's storable for a single leaderboard entry +enum { k_cLeaderboardDetailsMax = 64 }; + +// handle to a single leaderboard +typedef uint64 SteamLeaderboard_t; + +// handle to a set of downloaded entries in a leaderboard +typedef uint64 SteamLeaderboardEntries_t; + +// type of data request, when downloading leaderboard entries +enum ELeaderboardDataRequest +{ + k_ELeaderboardDataRequestGlobal = 0, + k_ELeaderboardDataRequestGlobalAroundUser = 1, + k_ELeaderboardDataRequestFriends = 2, + k_ELeaderboardDataRequestUsers = 3 +}; + +// the sort order of a leaderboard +enum ELeaderboardSortMethod +{ + k_ELeaderboardSortMethodNone = 0, + k_ELeaderboardSortMethodAscending = 1, // top-score is lowest number + k_ELeaderboardSortMethodDescending = 2, // top-score is highest number +}; + +// the display type (used by the Steam Community web site) for a leaderboard +enum ELeaderboardDisplayType +{ + k_ELeaderboardDisplayTypeNone = 0, + k_ELeaderboardDisplayTypeNumeric = 1, // simple numerical score + k_ELeaderboardDisplayTypeTimeSeconds = 2, // the score represents a time, in seconds + k_ELeaderboardDisplayTypeTimeMilliSeconds = 3, // the score represents a time, in milliseconds +}; + +enum ELeaderboardUploadScoreMethod +{ + k_ELeaderboardUploadScoreMethodNone = 0, + k_ELeaderboardUploadScoreMethodKeepBest = 1, // Leaderboard will keep user's best score + k_ELeaderboardUploadScoreMethodForceUpdate = 2, // Leaderboard will always replace score with specified +}; + +// a single entry in a leaderboard, as returned by GetDownloadedLeaderboardEntry() +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + +struct LeaderboardEntry_t +{ + CSteamID m_steamIDUser; // user with the entry - use SteamFriends()->GetFriendPersonaName() & SteamFriends()->GetFriendAvatar() to get more info + int32 m_nGlobalRank; // [1..N], where N is the number of users with an entry in the leaderboard + int32 m_nScore; // score as set in the leaderboard + int32 m_cDetails; // number of int32 details available for this entry + UGCHandle_t m_hUGC; // handle for UGC attached to the entry +}; + +#pragma pack( pop ) + + +//----------------------------------------------------------------------------- +// Purpose: Functions for accessing stats, achievements, and leaderboard information +//----------------------------------------------------------------------------- +class ISteamUserStats +{ +public: + + // Note: this call is no longer required as it is managed by the Steam client + // The game stats and achievements will be synchronized with Steam before + // the game process begins. + // virtual bool RequestCurrentStats() = 0; + + // Data accessors + STEAM_FLAT_NAME( GetStatInt32 ) + virtual bool GetStat( const char *pchName, int32 *pData ) = 0; + + STEAM_FLAT_NAME( GetStatFloat ) + virtual bool GetStat( const char *pchName, float *pData ) = 0; + + // Set / update data + STEAM_FLAT_NAME( SetStatInt32 ) + virtual bool SetStat( const char *pchName, int32 nData ) = 0; + + STEAM_FLAT_NAME( SetStatFloat ) + virtual bool SetStat( const char *pchName, float fData ) = 0; + + virtual bool UpdateAvgRateStat( const char *pchName, float flCountThisSession, double dSessionLength ) = 0; + + // Achievement flag accessors + virtual bool GetAchievement( const char *pchName, bool *pbAchieved ) = 0; + virtual bool SetAchievement( const char *pchName ) = 0; + virtual bool ClearAchievement( const char *pchName ) = 0; + + // Get the achievement status, and the time it was unlocked if unlocked. + // If the return value is true, but the unlock time is zero, that means it was unlocked before Steam + // began tracking achievement unlock times (December 2009). Time is seconds since January 1, 1970. + virtual bool GetAchievementAndUnlockTime( const char *pchName, bool *pbAchieved, uint32 *punUnlockTime ) = 0; + + // Store the current data on the server, will get a callback when set + // And one callback for every new achievement + // + // If the callback has a result of k_EResultInvalidParam, one or more stats + // uploaded has been rejected, either because they broke constraints + // or were out of date. In this case the server sends back updated values. + // The stats should be re-iterated to keep in sync. + virtual bool StoreStats() = 0; + + // Achievement / GroupAchievement metadata + + // Gets the icon of the achievement, which is a handle to be used in ISteamUtils::GetImageRGBA(), or 0 if none set. + // A return value of 0 may indicate we are still fetching data, and you can wait for the UserAchievementIconFetched_t callback + // which will notify you when the bits are ready. If the callback still returns zero, then there is no image set for the + // specified achievement. + virtual int GetAchievementIcon( const char *pchName ) = 0; + + // Get general attributes for an achievement. Accepts the following keys: + // - "name" and "desc" for retrieving the localized achievement name and description (returned in UTF8) + // - "hidden" for retrieving if an achievement is hidden (returns "0" when not hidden, "1" when hidden) + virtual const char *GetAchievementDisplayAttribute( const char *pchName, const char *pchKey ) = 0; + + // Achievement progress - triggers an AchievementProgress callback, that is all. + // Calling this w/ N out of N progress will NOT set the achievement, the game must still do that. + virtual bool IndicateAchievementProgress( const char *pchName, uint32 nCurProgress, uint32 nMaxProgress ) = 0; + + // Used for iterating achievements. In general games should not need these functions because they should have a + // list of existing achievements compiled into them + virtual uint32 GetNumAchievements() = 0; + // Get achievement name iAchievement in [0,GetNumAchievements) + virtual const char *GetAchievementName( uint32 iAchievement ) = 0; + + // Friends stats & achievements + + // downloads stats for the user + // returns a UserStatsReceived_t received when completed + // if the other user has no stats, UserStatsReceived_t.m_eResult will be set to k_EResultFail + // these stats won't be auto-updated; you'll need to call RequestUserStats() again to refresh any data + STEAM_CALL_RESULT( UserStatsReceived_t ) + virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0; + + // requests stat information for a user, usable after a successful call to RequestUserStats() + STEAM_FLAT_NAME( GetUserStatInt32 ) + virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, int32 *pData ) = 0; + + STEAM_FLAT_NAME( GetUserStatFloat ) + virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0; + + virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0; + // See notes for GetAchievementAndUnlockTime above + virtual bool GetUserAchievementAndUnlockTime( CSteamID steamIDUser, const char *pchName, bool *pbAchieved, uint32 *punUnlockTime ) = 0; + + // Reset stats + virtual bool ResetAllStats( bool bAchievementsToo ) = 0; + + // Leaderboard functions + + // asks the Steam back-end for a leaderboard by name, and will create it if it's not yet + // This call is asynchronous, with the result returned in LeaderboardFindResult_t + STEAM_CALL_RESULT(LeaderboardFindResult_t) + virtual SteamAPICall_t FindOrCreateLeaderboard( const char *pchLeaderboardName, ELeaderboardSortMethod eLeaderboardSortMethod, ELeaderboardDisplayType eLeaderboardDisplayType ) = 0; + + // as above, but won't create the leaderboard if it's not found + // This call is asynchronous, with the result returned in LeaderboardFindResult_t + STEAM_CALL_RESULT( LeaderboardFindResult_t ) + virtual SteamAPICall_t FindLeaderboard( const char *pchLeaderboardName ) = 0; + + // returns the name of a leaderboard + virtual const char *GetLeaderboardName( SteamLeaderboard_t hSteamLeaderboard ) = 0; + + // returns the total number of entries in a leaderboard, as of the last request + virtual int GetLeaderboardEntryCount( SteamLeaderboard_t hSteamLeaderboard ) = 0; + + // returns the sort method of the leaderboard + virtual ELeaderboardSortMethod GetLeaderboardSortMethod( SteamLeaderboard_t hSteamLeaderboard ) = 0; + + // returns the display type of the leaderboard + virtual ELeaderboardDisplayType GetLeaderboardDisplayType( SteamLeaderboard_t hSteamLeaderboard ) = 0; + + // Asks the Steam back-end for a set of rows in the leaderboard. + // This call is asynchronous, with the result returned in LeaderboardScoresDownloaded_t + // LeaderboardScoresDownloaded_t will contain a handle to pull the results from GetDownloadedLeaderboardEntries() (below) + // You can ask for more entries than exist, and it will return as many as do exist. + // k_ELeaderboardDataRequestGlobal requests rows in the leaderboard from the full table, with nRangeStart & nRangeEnd in the range [1, TotalEntries] + // k_ELeaderboardDataRequestGlobalAroundUser requests rows around the current user, nRangeStart being negate + // e.g. DownloadLeaderboardEntries( hLeaderboard, k_ELeaderboardDataRequestGlobalAroundUser, -3, 3 ) will return 7 rows, 3 before the user, 3 after + // k_ELeaderboardDataRequestFriends requests all the rows for friends of the current user + STEAM_CALL_RESULT( LeaderboardScoresDownloaded_t ) + virtual SteamAPICall_t DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) = 0; + // as above, but downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers + // if a user doesn't have a leaderboard entry, they won't be included in the result + // a max of 100 users can be downloaded at a time, with only one outstanding call at a time + STEAM_CALL_RESULT( LeaderboardScoresDownloaded_t ) + virtual SteamAPICall_t DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, + STEAM_ARRAY_COUNT_D(cUsers, Array of users to retrieve) CSteamID *prgUsers, int cUsers ) = 0; + + // Returns data about a single leaderboard entry + // use a for loop from 0 to LeaderboardScoresDownloaded_t::m_cEntryCount to get all the downloaded entries + // e.g. + // void OnLeaderboardScoresDownloaded( LeaderboardScoresDownloaded_t *pLeaderboardScoresDownloaded ) + // { + // for ( int index = 0; index < pLeaderboardScoresDownloaded->m_cEntryCount; index++ ) + // { + // LeaderboardEntry_t leaderboardEntry; + // int32 details[3]; // we know this is how many we've stored previously + // GetDownloadedLeaderboardEntry( pLeaderboardScoresDownloaded->m_hSteamLeaderboardEntries, index, &leaderboardEntry, details, 3 ); + // assert( leaderboardEntry.m_cDetails == 3 ); + // ... + // } + // once you've accessed all the entries, the data will be free'd, and the SteamLeaderboardEntries_t handle will become invalid + virtual bool GetDownloadedLeaderboardEntry( SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, LeaderboardEntry_t *pLeaderboardEntry, int32 *pDetails, int cDetailsMax ) = 0; + + // Uploads a user score to the Steam back-end. + // This call is asynchronous, with the result returned in LeaderboardScoreUploaded_t + // Details are extra game-defined information regarding how the user got that score + // pScoreDetails points to an array of int32's, cScoreDetailsCount is the number of int32's in the list + STEAM_CALL_RESULT( LeaderboardScoreUploaded_t ) + virtual SteamAPICall_t UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int32 nScore, const int32 *pScoreDetails, int cScoreDetailsCount ) = 0; + + // Attaches a piece of user generated content the user's entry on a leaderboard. + // hContent is a handle to a piece of user generated content that was shared using ISteamUserRemoteStorage::FileShare(). + // This call is asynchronous, with the result returned in LeaderboardUGCSet_t. + STEAM_CALL_RESULT( LeaderboardUGCSet_t ) + virtual SteamAPICall_t AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ) = 0; + + // Retrieves the number of players currently playing your game (online + offline) + // This call is asynchronous, with the result returned in NumberOfCurrentPlayers_t + STEAM_CALL_RESULT( NumberOfCurrentPlayers_t ) + virtual SteamAPICall_t GetNumberOfCurrentPlayers() = 0; + + // Requests that Steam fetch data on the percentage of players who have received each achievement + // for the game globally. + // This call is asynchronous, with the result returned in GlobalAchievementPercentagesReady_t. + STEAM_CALL_RESULT( GlobalAchievementPercentagesReady_t ) + virtual SteamAPICall_t RequestGlobalAchievementPercentages() = 0; + + // Get the info on the most achieved achievement for the game, returns an iterator index you can use to fetch + // the next most achieved afterwards. Will return -1 if there is no data on achievement + // percentages (ie, you haven't called RequestGlobalAchievementPercentages and waited on the callback). + virtual int GetMostAchievedAchievementInfo( char *pchName, uint32 unNameBufLen, float *pflPercent, bool *pbAchieved ) = 0; + + // Get the info on the next most achieved achievement for the game. Call this after GetMostAchievedAchievementInfo or another + // GetNextMostAchievedAchievementInfo call passing the iterator from the previous call. Returns -1 after the last + // achievement has been iterated. + virtual int GetNextMostAchievedAchievementInfo( int iIteratorPrevious, char *pchName, uint32 unNameBufLen, float *pflPercent, bool *pbAchieved ) = 0; + + // Returns the percentage of users who have achieved the specified achievement. + virtual bool GetAchievementAchievedPercent( const char *pchName, float *pflPercent ) = 0; + + // Requests global stats data, which is available for stats marked as "aggregated". + // This call is asynchronous, with the results returned in GlobalStatsReceived_t. + // nHistoryDays specifies how many days of day-by-day history to retrieve in addition + // to the overall totals. The limit is 60. + STEAM_CALL_RESULT( GlobalStatsReceived_t ) + virtual SteamAPICall_t RequestGlobalStats( int nHistoryDays ) = 0; + + // Gets the lifetime totals for an aggregated stat + STEAM_FLAT_NAME( GetGlobalStatInt64 ) + virtual bool GetGlobalStat( const char *pchStatName, int64 *pData ) = 0; + + STEAM_FLAT_NAME( GetGlobalStatDouble ) + virtual bool GetGlobalStat( const char *pchStatName, double *pData ) = 0; + + // Gets history for an aggregated stat. pData will be filled with daily values, starting with today. + // So when called, pData[0] will be today, pData[1] will be yesterday, and pData[2] will be two days ago, + // etc. cubData is the size in bytes of the pubData buffer. Returns the number of + // elements actually set. + + STEAM_FLAT_NAME( GetGlobalStatHistoryInt64 ) + virtual int32 GetGlobalStatHistory( const char *pchStatName, STEAM_ARRAY_COUNT(cubData) int64 *pData, uint32 cubData ) = 0; + + STEAM_FLAT_NAME( GetGlobalStatHistoryDouble ) + virtual int32 GetGlobalStatHistory( const char *pchStatName, STEAM_ARRAY_COUNT(cubData) double *pData, uint32 cubData ) = 0; + + // For achievements that have related Progress stats, use this to query what the bounds of that progress are. + // You may want this info to selectively call IndicateAchievementProgress when appropriate milestones of progress + // have been made, to show a progress notification to the user. + STEAM_FLAT_NAME( GetAchievementProgressLimitsInt32 ) + virtual bool GetAchievementProgressLimits( const char *pchName, int32 *pnMinProgress, int32 *pnMaxProgress ) = 0; + + STEAM_FLAT_NAME( GetAchievementProgressLimitsFloat ) + virtual bool GetAchievementProgressLimits( const char *pchName, float *pfMinProgress, float *pfMaxProgress ) = 0; + +}; + +#define STEAMUSERSTATS_INTERFACE_VERSION "STEAMUSERSTATS_INTERFACE_VERSION013" + +// Global interface accessor +inline ISteamUserStats *SteamUserStats(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamUserStats *, SteamUserStats, STEAMUSERSTATS_INTERFACE_VERSION ); + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + +//----------------------------------------------------------------------------- +// Purpose: called when the latests stats and achievements have been received +// from the server +//----------------------------------------------------------------------------- +struct UserStatsReceived_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 1 }; + uint64 m_nGameID; // Game these stats are for + EResult m_eResult; // Success / error fetching the stats + CSteamID m_steamIDUser; // The user for whom the stats are retrieved for +}; + + +//----------------------------------------------------------------------------- +// Purpose: result of a request to store the user stats for a game +//----------------------------------------------------------------------------- +struct UserStatsStored_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 2 }; + uint64 m_nGameID; // Game these stats are for + EResult m_eResult; // success / error +}; + + +//----------------------------------------------------------------------------- +// Purpose: result of a request to store the achievements for a game, or an +// "indicate progress" call. If both m_nCurProgress and m_nMaxProgress +// are zero, that means the achievement has been fully unlocked. +//----------------------------------------------------------------------------- +struct UserAchievementStored_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 3 }; + + uint64 m_nGameID; // Game this is for + bool m_bGroupAchievement; // if this is a "group" achievement + char m_rgchAchievementName[k_cchStatNameMax]; // name of the achievement + uint32 m_nCurProgress; // current progress towards the achievement + uint32 m_nMaxProgress; // "out of" this many +}; + + +//----------------------------------------------------------------------------- +// Purpose: call result for finding a leaderboard, returned as a result of FindOrCreateLeaderboard() or FindLeaderboard() +// use CCallResult<> to map this async result to a member function +//----------------------------------------------------------------------------- +struct LeaderboardFindResult_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 4 }; + SteamLeaderboard_t m_hSteamLeaderboard; // handle to the leaderboard serarched for, 0 if no leaderboard found + uint8 m_bLeaderboardFound; // 0 if no leaderboard found +}; + + +//----------------------------------------------------------------------------- +// Purpose: call result indicating scores for a leaderboard have been downloaded and are ready to be retrieved, returned as a result of DownloadLeaderboardEntries() +// use CCallResult<> to map this async result to a member function +//----------------------------------------------------------------------------- +struct LeaderboardScoresDownloaded_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 5 }; + SteamLeaderboard_t m_hSteamLeaderboard; + SteamLeaderboardEntries_t m_hSteamLeaderboardEntries; // the handle to pass into GetDownloadedLeaderboardEntries() + int m_cEntryCount; // the number of entries downloaded +}; + + +//----------------------------------------------------------------------------- +// Purpose: call result indicating scores has been uploaded, returned as a result of UploadLeaderboardScore() +// use CCallResult<> to map this async result to a member function +//----------------------------------------------------------------------------- +struct LeaderboardScoreUploaded_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 6 }; + uint8 m_bSuccess; // 1 if the call was successful + SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was + int32 m_nScore; // the score that was attempted to set + uint8 m_bScoreChanged; // true if the score in the leaderboard change, false if the existing score was better + int m_nGlobalRankNew; // the new global rank of the user in this leaderboard + int m_nGlobalRankPrevious; // the previous global rank of the user in this leaderboard; 0 if the user had no existing entry in the leaderboard +}; + +struct NumberOfCurrentPlayers_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 7 }; + uint8 m_bSuccess; // 1 if the call was successful + int32 m_cPlayers; // Number of players currently playing +}; + + + +//----------------------------------------------------------------------------- +// Purpose: Callback indicating that a user's stats have been unloaded. +// Call RequestUserStats again to access stats for this user +//----------------------------------------------------------------------------- +struct UserStatsUnloaded_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 8 }; + CSteamID m_steamIDUser; // User whose stats have been unloaded +}; + + + +//----------------------------------------------------------------------------- +// Purpose: Callback indicating that an achievement icon has been fetched +//----------------------------------------------------------------------------- +struct UserAchievementIconFetched_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 9 }; + + CGameID m_nGameID; // Game this is for + char m_rgchAchievementName[k_cchStatNameMax]; // name of the achievement + bool m_bAchieved; // Is the icon for the achieved or not achieved version? + int m_nIconHandle; // Handle to the image, which can be used in SteamUtils()->GetImageRGBA(), 0 means no image is set for the achievement +}; + + +//----------------------------------------------------------------------------- +// Purpose: Callback indicating that global achievement percentages are fetched +//----------------------------------------------------------------------------- +struct GlobalAchievementPercentagesReady_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 10 }; + + uint64 m_nGameID; // Game this is for + EResult m_eResult; // Result of the operation +}; + + +//----------------------------------------------------------------------------- +// Purpose: call result indicating UGC has been uploaded, returned as a result of SetLeaderboardUGC() +//----------------------------------------------------------------------------- +struct LeaderboardUGCSet_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 11 }; + EResult m_eResult; // The result of the operation + SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was +}; + + +//----------------------------------------------------------------------------- +// Purpose: callback indicating global stats have been received. +// Returned as a result of RequestGlobalStats() +//----------------------------------------------------------------------------- +struct GlobalStatsReceived_t +{ + enum { k_iCallback = k_iSteamUserStatsCallbacks + 12 }; + uint64 m_nGameID; // Game global stats were requested for + EResult m_eResult; // The result of the request +}; + +#pragma pack( pop ) + + +#endif // ISTEAMUSER_H diff --git a/external/steamworks/public/steam/isteamutils.h b/external/steamworks/public/steam/isteamutils.h new file mode 100644 index 0000000..7a4909d --- /dev/null +++ b/external/steamworks/public/steam/isteamutils.h @@ -0,0 +1,343 @@ +//====== Copyright � 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to utility functions in Steam +// +//============================================================================= + +#ifndef ISTEAMUTILS_H +#define ISTEAMUTILS_H + +#include "steam_api_common.h" + + +// Steam API call failure results +enum ESteamAPICallFailure +{ + k_ESteamAPICallFailureNone = -1, // no failure + k_ESteamAPICallFailureSteamGone = 0, // the local Steam process has gone away + k_ESteamAPICallFailureNetworkFailure = 1, // the network connection to Steam has been broken, or was already broken + // SteamServersDisconnected_t callback will be sent around the same time + // SteamServersConnected_t will be sent when the client is able to talk to the Steam servers again + k_ESteamAPICallFailureInvalidHandle = 2, // the SteamAPICall_t handle passed in no longer exists + k_ESteamAPICallFailureMismatchedCallback = 3,// GetAPICallResult() was called with the wrong callback type for this API call +}; + + +// Input modes for the Big Picture gamepad text entry +enum EGamepadTextInputMode +{ + k_EGamepadTextInputModeNormal = 0, + k_EGamepadTextInputModePassword = 1 +}; + + +// Controls number of allowed lines for the Big Picture gamepad text entry +enum EGamepadTextInputLineMode +{ + k_EGamepadTextInputLineModeSingleLine = 0, + k_EGamepadTextInputLineModeMultipleLines = 1 +}; + +enum EFloatingGamepadTextInputMode +{ + k_EFloatingGamepadTextInputModeModeSingleLine = 0, // Enter dismisses the keyboard + k_EFloatingGamepadTextInputModeModeMultipleLines = 1, // User needs to explictly close the keyboard + k_EFloatingGamepadTextInputModeModeEmail = 2, // Keyboard layout is email, enter dismisses the keyboard + k_EFloatingGamepadTextInputModeModeNumeric = 3, // Keyboard layout is numeric, enter dismisses the keyboard + +}; + +// The context where text filtering is being done +enum ETextFilteringContext +{ + k_ETextFilteringContextUnknown = 0, // Unknown context + k_ETextFilteringContextGameContent = 1, // Game content, only legally required filtering is performed + k_ETextFilteringContextChat = 2, // Chat from another player + k_ETextFilteringContextName = 3, // Character or item name +}; + + +//----------------------------------------------------------------------------- +// Purpose: interface to user independent utility functions +//----------------------------------------------------------------------------- +class ISteamUtils +{ +public: + // return the number of seconds since the user + virtual uint32 GetSecondsSinceAppActive() = 0; + virtual uint32 GetSecondsSinceComputerActive() = 0; + + // the universe this client is connecting to + virtual EUniverse GetConnectedUniverse() = 0; + + // Steam server time. Number of seconds since January 1, 1970, GMT (i.e unix time) + virtual uint32 GetServerRealTime() = 0; + + // returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database) + // e.g "US" or "UK". + virtual const char *GetIPCountry() = 0; + + // returns true if the image exists, and valid sizes were filled out + virtual bool GetImageSize( int iImage, uint32 *pnWidth, uint32 *pnHeight ) = 0; + + // returns true if the image exists, and the buffer was successfully filled out + // results are returned in RGBA format + // the destination buffer size should be 4 * height * width * sizeof(char) + virtual bool GetImageRGBA( int iImage, uint8 *pubDest, int nDestBufferSize ) = 0; + + // Deprecated. Do not call this. + STEAM_PRIVATE_API( virtual bool GetCSERIPPort( uint32 *unIP, uint16 *usPort ) = 0; ) + + // return the amount of battery power left in the current system in % [0..100], 255 for being on AC power + virtual uint8 GetCurrentBatteryPower() = 0; + + // returns the appID of the current process + virtual uint32 GetAppID() = 0; + + // Sets the position where the overlay instance for the currently calling game should show notifications. + // This position is per-game and if this function is called from outside of a game context it will do nothing. + virtual void SetOverlayNotificationPosition( ENotificationPosition eNotificationPosition ) = 0; + + // API asynchronous call results + // can be used directly, but more commonly used via the callback dispatch API (see steam_api.h) + virtual bool IsAPICallCompleted( SteamAPICall_t hSteamAPICall, bool *pbFailed ) = 0; + virtual ESteamAPICallFailure GetAPICallFailureReason( SteamAPICall_t hSteamAPICall ) = 0; + virtual bool GetAPICallResult( SteamAPICall_t hSteamAPICall, void *pCallback, int cubCallback, int iCallbackExpected, bool *pbFailed ) = 0; + + // Deprecated. Applications should use SteamAPI_RunCallbacks() instead. Game servers do not need to call this function. + STEAM_PRIVATE_API( virtual void RunFrame() = 0; ) + + // returns the number of IPC calls made since the last time this function was called + // Used for perf debugging so you can understand how many IPC calls your game makes per frame + // Every IPC call is at minimum a thread context switch if not a process one so you want to rate + // control how often you do them. + virtual uint32 GetIPCCallCount() = 0; + + // API warning handling + // 'int' is the severity; 0 for msg, 1 for warning + // 'const char *' is the text of the message + // callbacks will occur directly after the API function is called that generated the warning or message + virtual void SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction ) = 0; + + // Returns true if the overlay is running & the user can access it. The overlay process could take a few seconds to + // start & hook the game process, so this function will initially return false while the overlay is loading. + virtual bool IsOverlayEnabled() = 0; + + // Normally this call is unneeded if your game has a constantly running frame loop that calls the + // D3D Present API, or OGL SwapBuffers API every frame. + // + // However, if you have a game that only refreshes the screen on an event driven basis then that can break + // the overlay, as it uses your Present/SwapBuffers calls to drive it's internal frame loop and it may also + // need to Present() to the screen any time an even needing a notification happens or when the overlay is + // brought up over the game by a user. You can use this API to ask the overlay if it currently need a present + // in that case, and then you can check for this periodically (roughly 33hz is desirable) and make sure you + // refresh the screen with Present or SwapBuffers to allow the overlay to do it's work. + virtual bool BOverlayNeedsPresent() = 0; + + // Asynchronous call to check if an executable file has been signed using the public key set on the signing tab + // of the partner site, for example to refuse to load modified executable files. + // The result is returned in CheckFileSignature_t. + // k_ECheckFileSignatureNoSignaturesFoundForThisApp - This app has not been configured on the signing tab of the partner site to enable this function. + // k_ECheckFileSignatureNoSignaturesFoundForThisFile - This file is not listed on the signing tab for the partner site. + // k_ECheckFileSignatureFileNotFound - The file does not exist on disk. + // k_ECheckFileSignatureInvalidSignature - The file exists, and the signing tab has been set for this file, but the file is either not signed or the signature does not match. + // k_ECheckFileSignatureValidSignature - The file is signed and the signature is valid. + STEAM_CALL_RESULT( CheckFileSignature_t ) + virtual SteamAPICall_t CheckFileSignature( const char *szFileName ) = 0; + + // Activates the full-screen text input dialog which takes a initial text string and returns the text the user has typed + virtual bool ShowGamepadTextInput( EGamepadTextInputMode eInputMode, EGamepadTextInputLineMode eLineInputMode, const char *pchDescription, uint32 unCharMax, const char *pchExistingText ) = 0; + + // Returns previously entered text & length + virtual uint32 GetEnteredGamepadTextLength() = 0; + virtual bool GetEnteredGamepadTextInput( char *pchText, uint32 cchText ) = 0; + + // returns the language the steam client is running in, you probably want ISteamApps::GetCurrentGameLanguage instead, this is for very special usage cases + virtual const char *GetSteamUILanguage() = 0; + + // returns true if Steam itself is running in VR mode + virtual bool IsSteamRunningInVR() = 0; + + // Sets the inset of the overlay notification from the corner specified by SetOverlayNotificationPosition. + virtual void SetOverlayNotificationInset( int nHorizontalInset, int nVerticalInset ) = 0; + + // returns true if Steam & the Steam Overlay are running in Big Picture mode + // Games much be launched through the Steam client to enable the Big Picture overlay. During development, + // a game can be added as a non-steam game to the developers library to test this feature + virtual bool IsSteamInBigPictureMode() = 0; + + // ask SteamUI to create and render its OpenVR dashboard + virtual void StartVRDashboard() = 0; + + // Returns true if the HMD content will be streamed via Steam Remote Play + virtual bool IsVRHeadsetStreamingEnabled() = 0; + + // Set whether the HMD content will be streamed via Steam Remote Play + // If this is set to true, then the scene in the HMD headset will be streamed, and remote input will not be allowed. + // If this is set to false, then the application window will be streamed instead, and remote input will be allowed. + // The default is true unless "VRHeadsetStreaming" "0" is in the extended appinfo for a game. + // (this is useful for games that have asymmetric multiplayer gameplay) + virtual void SetVRHeadsetStreamingEnabled( bool bEnabled ) = 0; + + // Returns whether this steam client is a Steam China specific client, vs the global client. + virtual bool IsSteamChinaLauncher() = 0; + + // Initializes text filtering, loading dictionaries for the language the game is running in. + // unFilterOptions are reserved for future use and should be set to 0 + // Returns false if filtering is unavailable for the game's language, in which case FilterText() will act as a passthrough. + // + // Users can customize the text filter behavior in their Steam Account preferences: + // https://store.steampowered.com/account/preferences#CommunityContentPreferences + virtual bool InitFilterText( uint32 unFilterOptions = 0 ) = 0; + + // Filters the provided input message and places the filtered result into pchOutFilteredText, using legally required filtering and additional filtering based on the context and user settings + // eContext is the type of content in the input string + // sourceSteamID is the Steam ID that is the source of the input string (e.g. the player with the name, or who said the chat text) + // pchInputText is the input string that should be filtered, which can be ASCII or UTF-8 + // pchOutFilteredText is where the output will be placed, even if no filtering is performed + // nByteSizeOutFilteredText is the size (in bytes) of pchOutFilteredText, should be at least strlen(pchInputText)+1 + // Returns the number of characters (not bytes) filtered + virtual int FilterText( ETextFilteringContext eContext, CSteamID sourceSteamID, const char *pchInputMessage, char *pchOutFilteredText, uint32 nByteSizeOutFilteredText ) = 0; + + // Return what we believe your current ipv6 connectivity to "the internet" is on the specified protocol. + // This does NOT tell you if the Steam client is currently connected to Steam via ipv6. + virtual ESteamIPv6ConnectivityState GetIPv6ConnectivityState( ESteamIPv6ConnectivityProtocol eProtocol ) = 0; + + // returns true if currently running on the Steam Deck device + virtual bool IsSteamRunningOnSteamDeck() = 0; + + // Opens a floating keyboard over the game content and sends OS keyboard keys directly to the game. + // The text field position is specified in pixels relative the origin of the game window and is used to position the floating keyboard in a way that doesn't cover the text field + virtual bool ShowFloatingGamepadTextInput( EFloatingGamepadTextInputMode eKeyboardMode, int nTextFieldXPosition, int nTextFieldYPosition, int nTextFieldWidth, int nTextFieldHeight ) = 0; + + // In game launchers that don't have controller support you can call this to have Steam Input translate the controller input into mouse/kb to navigate the launcher + virtual void SetGameLauncherMode( bool bLauncherMode ) = 0; + + // Dismisses the floating keyboard. + virtual bool DismissFloatingGamepadTextInput() = 0; + + // Dismisses the full-screen text input dialog. + virtual bool DismissGamepadTextInput() = 0; +}; + +#define STEAMUTILS_INTERFACE_VERSION "SteamUtils010" + +// Global interface accessor +inline ISteamUtils *SteamUtils(); +STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamUtils *, SteamUtils, SteamInternal_FindOrCreateUserInterface( 0, STEAMUTILS_INTERFACE_VERSION ), "user", STEAMUTILS_INTERFACE_VERSION ); + +// Global accessor for the gameserver client +inline ISteamUtils *SteamGameServerUtils(); +STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamUtils *, SteamGameServerUtils, SteamInternal_FindOrCreateGameServerInterface( 0, STEAMUTILS_INTERFACE_VERSION ), "gameserver", STEAMUTILS_INTERFACE_VERSION ); + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + +//----------------------------------------------------------------------------- +// Purpose: The country of the user changed +//----------------------------------------------------------------------------- +struct IPCountry_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 1 }; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Fired when running on a handheld PC or laptop with less than 10 minutes of battery is left, fires then every minute +//----------------------------------------------------------------------------- +struct LowBatteryPower_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 2 }; + uint8 m_nMinutesBatteryLeft; +}; + + +//----------------------------------------------------------------------------- +// Purpose: called when a SteamAsyncCall_t has completed (or failed) +//----------------------------------------------------------------------------- +struct SteamAPICallCompleted_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 3 }; + SteamAPICall_t m_hAsyncCall; + int m_iCallback; + uint32 m_cubParam; +}; + + +//----------------------------------------------------------------------------- +// called when Steam wants to shutdown +//----------------------------------------------------------------------------- +struct SteamShutdown_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 4 }; +}; + +//----------------------------------------------------------------------------- +// results for CheckFileSignature +//----------------------------------------------------------------------------- +enum ECheckFileSignature +{ + k_ECheckFileSignatureInvalidSignature = 0, + k_ECheckFileSignatureValidSignature = 1, + k_ECheckFileSignatureFileNotFound = 2, + k_ECheckFileSignatureNoSignaturesFoundForThisApp = 3, + k_ECheckFileSignatureNoSignaturesFoundForThisFile = 4, +}; + +//----------------------------------------------------------------------------- +// callback for CheckFileSignature +//----------------------------------------------------------------------------- +struct CheckFileSignature_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 5 }; + ECheckFileSignature m_eCheckFileSignature; +}; + + +// k_iSteamUtilsCallbacks + 13 is taken + + +//----------------------------------------------------------------------------- +// Full Screen gamepad text input has been closed +//----------------------------------------------------------------------------- +struct GamepadTextInputDismissed_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 14 }; + bool m_bSubmitted; // true if user entered & accepted text (Call ISteamUtils::GetEnteredGamepadTextInput() for text), false if canceled input + uint32 m_unSubmittedText; + AppId_t m_unAppID; +}; + +// k_iSteamUtilsCallbacks + 15 through 35 are taken + +STEAM_CALLBACK_BEGIN( AppResumingFromSuspend_t, k_iSteamUtilsCallbacks + 36 ) +STEAM_CALLBACK_END(0) + +// k_iSteamUtilsCallbacks + 37 is taken + +//----------------------------------------------------------------------------- +// The floating on-screen keyboard has been closed +//----------------------------------------------------------------------------- +struct FloatingGamepadTextInputDismissed_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 38 }; +}; + +//----------------------------------------------------------------------------- +// The text filtering dictionary has changed +//----------------------------------------------------------------------------- +struct FilterTextDictionaryChanged_t +{ + enum { k_iCallback = k_iSteamUtilsCallbacks + 39 }; + int m_eLanguage; // One of ELanguage, or k_LegallyRequiredFiltering +}; + +#pragma pack( pop ) + +#endif // ISTEAMUTILS_H diff --git a/external/steamworks/public/steam/isteamvideo.h b/external/steamworks/public/steam/isteamvideo.h new file mode 100644 index 0000000..7ce29ad --- /dev/null +++ b/external/steamworks/public/steam/isteamvideo.h @@ -0,0 +1,74 @@ +//====== Copyright © 1996-2014 Valve Corporation, All rights reserved. ======= +// +// Purpose: interface to Steam Video +// +//============================================================================= + +#ifndef ISTEAMVIDEO_H +#define ISTEAMVIDEO_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + +//----------------------------------------------------------------------------- +// Purpose: Steam Video API +//----------------------------------------------------------------------------- +class ISteamVideo +{ +public: + + // Get a URL suitable for streaming the given Video app ID's video + virtual void GetVideoURL( AppId_t unVideoAppID ) = 0; + + // returns true if user is uploading a live broadcast + virtual bool IsBroadcasting( int *pnNumViewers ) = 0; + + // Get the OPF Details for 360 Video Playback + STEAM_CALL_BACK( GetOPFSettingsResult_t ) + virtual void GetOPFSettings( AppId_t unVideoAppID ) = 0; + virtual bool GetOPFStringForApp( AppId_t unVideoAppID, char *pchBuffer, int32 *pnBufferSize ) = 0; + + +}; + +#define STEAMVIDEO_INTERFACE_VERSION "STEAMVIDEO_INTERFACE_V007" + +// Global interface accessor +inline ISteamVideo *SteamVideo(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamVideo *, SteamVideo, STEAMVIDEO_INTERFACE_VERSION ); + +STEAM_CALLBACK_BEGIN( GetVideoURLResult_t, k_iSteamVideoCallbacks + 11 ) + STEAM_CALLBACK_MEMBER( 0, EResult, m_eResult ) + STEAM_CALLBACK_MEMBER( 1, AppId_t, m_unVideoAppID ) + STEAM_CALLBACK_MEMBER( 2, char, m_rgchURL[256] ) +STEAM_CALLBACK_END(3) + + +STEAM_CALLBACK_BEGIN( GetOPFSettingsResult_t, k_iSteamVideoCallbacks + 24 ) + STEAM_CALLBACK_MEMBER( 0, EResult, m_eResult ) + STEAM_CALLBACK_MEMBER( 1, AppId_t, m_unVideoAppID ) +STEAM_CALLBACK_END(2) + +STEAM_CALLBACK_BEGIN( BroadcastUploadStart_t, k_iSteamVideoCallbacks + 4 ) + STEAM_CALLBACK_MEMBER( 0, bool, m_bIsRTMP ) +STEAM_CALLBACK_END( 1 ) + +STEAM_CALLBACK_BEGIN( BroadcastUploadStop_t, k_iSteamVideoCallbacks + 5 ) + STEAM_CALLBACK_MEMBER( 0, EBroadcastUploadResult, m_eResult ) +STEAM_CALLBACK_END( 1 ) + +#pragma pack( pop ) + + +#endif // ISTEAMVIDEO_H diff --git a/external/steamworks/public/steam/lib/linux32/libsdkencryptedappticket.so b/external/steamworks/public/steam/lib/linux32/libsdkencryptedappticket.so new file mode 100644 index 0000000..674dd1a Binary files /dev/null and b/external/steamworks/public/steam/lib/linux32/libsdkencryptedappticket.so differ diff --git a/external/steamworks/public/steam/lib/linux64/libsdkencryptedappticket.so b/external/steamworks/public/steam/lib/linux64/libsdkencryptedappticket.so new file mode 100644 index 0000000..dfbb28f Binary files /dev/null and b/external/steamworks/public/steam/lib/linux64/libsdkencryptedappticket.so differ diff --git a/external/steamworks/public/steam/lib/osx/libsdkencryptedappticket.dylib b/external/steamworks/public/steam/lib/osx/libsdkencryptedappticket.dylib new file mode 100644 index 0000000..639ed84 Binary files /dev/null and b/external/steamworks/public/steam/lib/osx/libsdkencryptedappticket.dylib differ diff --git a/external/steamworks/public/steam/lib/win32/sdkencryptedappticket.dll b/external/steamworks/public/steam/lib/win32/sdkencryptedappticket.dll new file mode 100644 index 0000000..3e23334 Binary files /dev/null and b/external/steamworks/public/steam/lib/win32/sdkencryptedappticket.dll differ diff --git a/external/steamworks/public/steam/lib/win32/sdkencryptedappticket.lib b/external/steamworks/public/steam/lib/win32/sdkencryptedappticket.lib new file mode 100644 index 0000000..4dca6a3 Binary files /dev/null and b/external/steamworks/public/steam/lib/win32/sdkencryptedappticket.lib differ diff --git a/external/steamworks/public/steam/lib/win64/sdkencryptedappticket64.dll b/external/steamworks/public/steam/lib/win64/sdkencryptedappticket64.dll new file mode 100644 index 0000000..bba9e32 Binary files /dev/null and b/external/steamworks/public/steam/lib/win64/sdkencryptedappticket64.dll differ diff --git a/external/steamworks/public/steam/lib/win64/sdkencryptedappticket64.lib b/external/steamworks/public/steam/lib/win64/sdkencryptedappticket64.lib new file mode 100644 index 0000000..1bccffe Binary files /dev/null and b/external/steamworks/public/steam/lib/win64/sdkencryptedappticket64.lib differ diff --git a/external/steamworks/public/steam/matchmakingtypes.h b/external/steamworks/public/steam/matchmakingtypes.h new file mode 100644 index 0000000..b15af3f --- /dev/null +++ b/external/steamworks/public/steam/matchmakingtypes.h @@ -0,0 +1,231 @@ +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#ifndef MATCHMAKINGTYPES_H +#define MATCHMAKINGTYPES_H + +#include +#include + +// +// Max size (in bytes of UTF-8 data, not in characters) of server fields, including null terminator. +// WARNING: These cannot be changed easily, without breaking clients using old interfaces. +// +const int k_cbMaxGameServerGameDir = 32; +const int k_cbMaxGameServerMapName = 32; +const int k_cbMaxGameServerGameDescription = 64; +const int k_cbMaxGameServerName = 64; +const int k_cbMaxGameServerTags = 128; +const int k_cbMaxGameServerGameData = 2048; + +/// Store key/value pair used in matchmaking queries. +/// +/// Actually, the name Key/Value is a bit misleading. The "key" is better +/// understood as "filter operation code" and the "value" is the operand to this +/// filter operation. The meaning of the operand depends upon the filter. +struct MatchMakingKeyValuePair_t +{ + MatchMakingKeyValuePair_t() { m_szKey[0] = m_szValue[0] = 0; } + MatchMakingKeyValuePair_t( const char *pchKey, const char *pchValue ) + { + strncpy( m_szKey, pchKey, sizeof(m_szKey) ); // this is a public header, use basic c library string funcs only! + m_szKey[ sizeof( m_szKey ) - 1 ] = '\0'; + strncpy( m_szValue, pchValue, sizeof(m_szValue) ); + m_szValue[ sizeof( m_szValue ) - 1 ] = '\0'; + } + char m_szKey[ 256 ]; + char m_szValue[ 256 ]; +}; + + +enum EMatchMakingServerResponse +{ + eServerResponded = 0, + eServerFailedToRespond, + eNoServersListedOnMasterServer // for the Internet query type, returned in response callback if no servers of this type match +}; + +// servernetadr_t is all the addressing info the serverbrowser needs to know about a game server, +// namely: its IP, its connection port, and its query port. +class servernetadr_t +{ +public: + + servernetadr_t() : m_usConnectionPort( 0 ), m_usQueryPort( 0 ), m_unIP( 0 ) {} + + void Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort ); + + // Access the query port. + uint16 GetQueryPort() const; + void SetQueryPort( uint16 usPort ); + + // Access the connection port. + uint16 GetConnectionPort() const; + void SetConnectionPort( uint16 usPort ); + + // Access the IP + uint32 GetIP() const; + void SetIP( uint32 unIP ); + + // This gets the 'a.b.c.d:port' string with the connection port (instead of the query port). + const char *GetConnectionAddressString() const; + const char *GetQueryAddressString() const; + + // Comparison operators and functions. + bool operator<(const servernetadr_t &netadr) const; + void operator=( const servernetadr_t &that ) + { + m_usConnectionPort = that.m_usConnectionPort; + m_usQueryPort = that.m_usQueryPort; + m_unIP = that.m_unIP; + } + + +private: + const char *ToString( uint32 unIP, uint16 usPort ) const; + uint16 m_usConnectionPort; // (in HOST byte order) + uint16 m_usQueryPort; + uint32 m_unIP; +}; + + +inline void servernetadr_t::Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort ) +{ + m_unIP = ip; + m_usQueryPort = usQueryPort; + m_usConnectionPort = usConnectionPort; +} + +inline uint16 servernetadr_t::GetQueryPort() const +{ + return m_usQueryPort; +} + +inline void servernetadr_t::SetQueryPort( uint16 usPort ) +{ + m_usQueryPort = usPort; +} + +inline uint16 servernetadr_t::GetConnectionPort() const +{ + return m_usConnectionPort; +} + +inline void servernetadr_t::SetConnectionPort( uint16 usPort ) +{ + m_usConnectionPort = usPort; +} + +inline uint32 servernetadr_t::GetIP() const +{ + return m_unIP; +} + +inline void servernetadr_t::SetIP( uint32 unIP ) +{ + m_unIP = unIP; +} + +inline const char *servernetadr_t::ToString( uint32 unIP, uint16 usPort ) const +{ + static char s[4][64]; + static int nBuf = 0; + unsigned char *ipByte = (unsigned char *)&unIP; +#ifdef VALVE_BIG_ENDIAN + snprintf(s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[0]), (int)(ipByte[1]), (int)(ipByte[2]), (int)(ipByte[3]), usPort ); +#else + snprintf(s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort ); +#endif + const char *pchRet = s[nBuf]; + ++nBuf; + nBuf %= ( (sizeof(s)/sizeof(s[0])) ); + return pchRet; +} + +inline const char* servernetadr_t::GetConnectionAddressString() const +{ + return ToString( m_unIP, m_usConnectionPort ); +} + +inline const char* servernetadr_t::GetQueryAddressString() const +{ + return ToString( m_unIP, m_usQueryPort ); +} + +inline bool servernetadr_t::operator<(const servernetadr_t &netadr) const +{ + return ( m_unIP < netadr.m_unIP ) || ( m_unIP == netadr.m_unIP && m_usQueryPort < netadr.m_usQueryPort ); +} + +//----------------------------------------------------------------------------- +// Purpose: Data describing a single server +//----------------------------------------------------------------------------- +class gameserveritem_t +{ +public: + gameserveritem_t(); + + const char* GetName() const; + void SetName( const char *pName ); + +public: + servernetadr_t m_NetAdr; ///< IP/Query Port/Connection Port for this server + int m_nPing; ///< current ping time in milliseconds + bool m_bHadSuccessfulResponse; ///< server has responded successfully in the past + bool m_bDoNotRefresh; ///< server is marked as not responding and should no longer be refreshed + char m_szGameDir[k_cbMaxGameServerGameDir]; ///< current game directory + char m_szMap[k_cbMaxGameServerMapName]; ///< current map + char m_szGameDescription[k_cbMaxGameServerGameDescription]; ///< game description + uint32 m_nAppID; ///< Steam App ID of this server + int m_nPlayers; ///< total number of players currently on the server. INCLUDES BOTS!! + int m_nMaxPlayers; ///< Maximum players that can join this server + int m_nBotPlayers; ///< Number of bots (i.e simulated players) on this server + bool m_bPassword; ///< true if this server needs a password to join + bool m_bSecure; ///< Is this server protected by VAC + uint32 m_ulTimeLastPlayed; ///< time (in unix time) when this server was last played on (for favorite/history servers) + int m_nServerVersion; ///< server version as reported to Steam + +private: + + /// Game server name + char m_szServerName[k_cbMaxGameServerName]; + + // For data added after SteamMatchMaking001 add it here +public: + /// the tags this server exposes + char m_szGameTags[k_cbMaxGameServerTags]; + + /// steamID of the game server - invalid if it's doesn't have one (old server, or not connected to Steam) + CSteamID m_steamID; +}; + + +inline gameserveritem_t::gameserveritem_t() +{ + m_szGameDir[0] = m_szMap[0] = m_szGameDescription[0] = m_szServerName[0] = 0; + m_bHadSuccessfulResponse = m_bDoNotRefresh = m_bPassword = m_bSecure = false; + m_nPing = m_nAppID = m_nPlayers = m_nMaxPlayers = m_nBotPlayers = m_ulTimeLastPlayed = m_nServerVersion = 0; + m_szGameTags[0] = 0; +} + +inline const char* gameserveritem_t::GetName() const +{ + // Use the IP address as the name if nothing is set yet. + if ( m_szServerName[0] == 0 ) + return m_NetAdr.GetConnectionAddressString(); + else + return m_szServerName; +} + +inline void gameserveritem_t::SetName( const char *pName ) +{ + strncpy( m_szServerName, pName, sizeof( m_szServerName ) ); + m_szServerName[ sizeof( m_szServerName ) - 1 ] = '\0'; +} + + +#endif // MATCHMAKINGTYPES_H diff --git a/external/steamworks/public/steam/steam_api.h b/external/steamworks/public/steam/steam_api.h new file mode 100644 index 0000000..9d65351 --- /dev/null +++ b/external/steamworks/public/steam/steam_api.h @@ -0,0 +1,266 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// This header includes *all* of the interfaces and callback structures +// in the Steamworks SDK, and some high level functions to control the SDK +// (init, shutdown, etc) that you probably only need in one or two files. +// +// To save your compile times, we recommend that you not include this file +// in header files. Instead, include the specific headers for the interfaces +// and callback structures you need. The one file you might consider including +// in your precompiled header (e.g. stdafx.h) is steam_api_common.h +// +//============================================================================= + +#ifndef STEAM_API_H +#define STEAM_API_H +#ifdef _WIN32 +#pragma once +#endif + +// Basic stuff +#include "steam_api_common.h" + +// All of the interfaces +#include "isteamclient.h" +#include "isteamuser.h" +#include "isteamfriends.h" +#include "isteamutils.h" +#include "isteammatchmaking.h" +#include "isteamuserstats.h" +#include "isteamapps.h" +#include "isteamnetworking.h" +#include "isteamremotestorage.h" +#include "isteamscreenshots.h" +#include "isteammusic.h" +#include "isteammusicremote.h" +#include "isteamhttp.h" +#include "isteamcontroller.h" +#include "isteamugc.h" +#include "isteamhtmlsurface.h" +#include "isteaminventory.h" +#include "isteamtimeline.h" +#include "isteamvideo.h" +#include "isteamparentalsettings.h" +#include "isteaminput.h" +#include "isteamremoteplay.h" +#include "isteamnetworkingmessages.h" +#include "isteamnetworkingsockets.h" +#include "isteamnetworkingutils.h" + + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// Steam API setup & shutdown +// +// These functions manage loading, initializing and shutdown of the steamclient.dll +// +//----------------------------------------------------------------------------------------------------------------------------------------------------------// + +enum ESteamAPIInitResult +{ + k_ESteamAPIInitResult_OK = 0, + k_ESteamAPIInitResult_FailedGeneric = 1, // Some other failure + k_ESteamAPIInitResult_NoSteamClient = 2, // We cannot connect to Steam, steam probably isn't running + k_ESteamAPIInitResult_VersionMismatch = 3, // Steam client appears to be out of date +}; + +// Initializing the Steamworks SDK +// ----------------------------- +// +// There are three different methods you can use to initialize the Steamworks SDK, depending on +// your project's environment. You should only use one method in your project. +// +// If you are able to include this C++ header in your project, we recommend using the following +// initialization methods. They will ensure that all ISteam* interfaces defined in other +// C++ header files have versions that are supported by the user's Steam Client: +// - SteamAPI_InitEx() for new projects so you can show a detailed error message to the user +// - SteamAPI_Init() for existing projects that only display a generic error message +// +// If you are unable to include this C++ header in your project and are dynamically loading +// Steamworks SDK methods from dll/so, you can use the following method: +// - SteamAPI_InitFlat() + + +// See "Initializing the Steamworks SDK" above for how to choose an init method. +// On success k_ESteamAPIInitResult_OK is returned. Otherwise, returns a value that can be used +// to create a localized error message for the user. If pOutErrMsg is non-NULL, +// it will receive an example error message, in English, that explains the reason for the failure. +// +// Example usage: +// +// SteamErrMsg errMsg; +// if ( SteamAPI_Init(&errMsg) != k_ESteamAPIInitResult_OK ) +// FatalError( "Failed to init Steam. %s", errMsg ); +inline ESteamAPIInitResult SteamAPI_InitEx( SteamErrMsg *pOutErrMsg ); + +// See "Initializing the Steamworks SDK" above for how to choose an init method. +// Returns true on success +inline bool SteamAPI_Init() +{ + return SteamAPI_InitEx( NULL ) == k_ESteamAPIInitResult_OK; +} + +// See "Initializing the Steamworks SDK" above for how to choose an init method. +// Same usage as SteamAPI_InitEx(), however does not verify ISteam* interfaces are +// supported by the user's client and is exported from the dll +S_API ESteamAPIInitResult S_CALLTYPE SteamAPI_InitFlat( SteamErrMsg *pOutErrMsg ); + +// SteamAPI_Shutdown should be called during process shutdown if possible. +S_API void S_CALLTYPE SteamAPI_Shutdown(); + +// SteamAPI_RestartAppIfNecessary ensures that your executable was launched through Steam. +// +// Returns true if the current process should terminate. Steam is now re-launching your application. +// +// Returns false if no action needs to be taken. This means that your executable was started through +// the Steam client, or a steam_appid.txt file is present in your game's directory (for development). +// Your current process should continue if false is returned. +// +// NOTE: If you use the Steam DRM wrapper on your primary executable file, this check is unnecessary +// since the DRM wrapper will ensure that your application was launched properly through Steam. +S_API bool S_CALLTYPE SteamAPI_RestartAppIfNecessary( uint32 unOwnAppID ); + +// Many Steam API functions allocate a small amount of thread-local memory for parameter storage. +// SteamAPI_ReleaseCurrentThreadMemory() will free API memory associated with the calling thread. +// This function is also called automatically by SteamAPI_RunCallbacks(), so a single-threaded +// program never needs to explicitly call this function. +S_API void S_CALLTYPE SteamAPI_ReleaseCurrentThreadMemory(); + + +// crash dump recording functions +S_API void S_CALLTYPE SteamAPI_WriteMiniDump( uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID ); +S_API void S_CALLTYPE SteamAPI_SetMiniDumpComment( const char *pchMsg ); + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// steamclient.dll private wrapper functions +// +// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases +//----------------------------------------------------------------------------------------------------------------------------------------------------------// + +// SteamAPI_IsSteamRunning() returns true if Steam is currently running +S_API bool S_CALLTYPE SteamAPI_IsSteamRunning(); + +// returns the filename path of the current running Steam process, used if you need to load an explicit steam dll by name. +// DEPRECATED - implementation is Windows only, and the path returned is a UTF-8 string which must be converted to UTF-16 for use with Win32 APIs +S_API const char *SteamAPI_GetSteamInstallPath(); + +// sets whether or not Steam_RunCallbacks() should do a try {} catch (...) {} around calls to issuing callbacks +// This is ignored if you are using the manual callback dispatch method +S_API void SteamAPI_SetTryCatchCallbacks( bool bTryCatchCallbacks ); + +#if defined( VERSION_SAFE_STEAM_API_INTERFACES ) +// exists only for backwards compat with code written against older SDKs +S_API bool S_CALLTYPE SteamAPI_InitSafe(); +#endif + +#if defined(USE_BREAKPAD_HANDLER) || defined(STEAM_API_EXPORTS) +// this should be called before the game initialized the steam APIs +// pchDate should be of the format "Mmm dd yyyy" (such as from the __ DATE __ macro ) +// pchTime should be of the format "hh:mm:ss" (such as from the __ TIME __ macro ) +// bFullMemoryDumps (Win32 only) -- writes out a uuid-full.dmp in the client/dumps folder +// pvContext-- can be NULL, will be the void * context passed into m_pfnPreMinidumpCallback +// PFNPreMinidumpCallback m_pfnPreMinidumpCallback -- optional callback which occurs just before a .dmp file is written during a crash. Applications can hook this to allow adding additional information into the .dmp comment stream. +S_API void S_CALLTYPE SteamAPI_UseBreakpadCrashHandler( char const *pchVersion, char const *pchDate, char const *pchTime, bool bFullMemoryDumps, void *pvContext, PFNPreMinidumpCallback m_pfnPreMinidumpCallback ); +S_API void S_CALLTYPE SteamAPI_SetBreakpadAppID( uint32 unAppID ); +#endif + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// +// Manual callback loop +// +// An alternative method for dispatching callbacks. Similar to a windows message loop. +// +// If you use the manual callback dispatch, you must NOT use: +// +// - SteamAPI_RunCallbacks or SteamGameServer_RunCallbacks +// - STEAM_CALLBACK, CCallResult, CCallback, or CCallbackManual +// +// Here is the basic template for replacing SteamAPI_RunCallbacks() with manual dispatch +/* + + HSteamPipe hSteamPipe = SteamAPI_GetHSteamPipe(); // See also SteamGameServer_GetHSteamPipe() + SteamAPI_ManualDispatch_RunFrame( hSteamPipe ) + CallbackMsg_t callback; + while ( SteamAPI_ManualDispatch_GetNextCallback( hSteamPipe, &callback ) ) + { + // Check for dispatching API call results + if ( callback.m_iCallback == SteamAPICallCompleted_t::k_iCallback ) + { + SteamAPICallCompleted_t *pCallCompleted = (SteamAPICallCompleted_t *)callback. + void *pTmpCallResult = malloc( pCallback->m_cubParam ); + bool bFailed; + if ( SteamAPI_ManualDispatch_GetAPICallResult( hSteamPipe, pCallCompleted->m_hAsyncCall, pTmpCallResult, pCallback->m_cubParam, pCallback->m_iCallback, &bFailed ) ) + { + // Dispatch the call result to the registered handler(s) for the + // call identified by pCallCompleted->m_hAsyncCall + } + free( pTmpCallResult ); + } + else + { + // Look at callback.m_iCallback to see what kind of callback it is, + // and dispatch to appropriate handler(s) + } + SteamAPI_ManualDispatch_FreeLastCallback( hSteamPipe ); + } + +*/ +//----------------------------------------------------------------------------------------------------------------------------------------------------------// + +/// Inform the API that you wish to use manual event dispatch. This must be called after SteamAPI_Init, but before +/// you use any of the other manual dispatch functions below. +S_API void S_CALLTYPE SteamAPI_ManualDispatch_Init(); + +/// Perform certain periodic actions that need to be performed. +S_API void S_CALLTYPE SteamAPI_ManualDispatch_RunFrame( HSteamPipe hSteamPipe ); + +/// Fetch the next pending callback on the given pipe, if any. If a callback is available, true is returned +/// and the structure is populated. In this case, you MUST call SteamAPI_ManualDispatch_FreeLastCallback +/// (after dispatching the callback) before calling SteamAPI_ManualDispatch_GetNextCallback again. +S_API bool S_CALLTYPE SteamAPI_ManualDispatch_GetNextCallback( HSteamPipe hSteamPipe, CallbackMsg_t *pCallbackMsg ); + +/// You must call this after dispatching the callback, if SteamAPI_ManualDispatch_GetNextCallback returns true. +S_API void S_CALLTYPE SteamAPI_ManualDispatch_FreeLastCallback( HSteamPipe hSteamPipe ); + +/// Return the call result for the specified call on the specified pipe. You really should +/// only call this in a handler for SteamAPICallCompleted_t callback. +S_API bool S_CALLTYPE SteamAPI_ManualDispatch_GetAPICallResult( HSteamPipe hSteamPipe, SteamAPICall_t hSteamAPICall, void *pCallback, int cubCallback, int iCallbackExpected, bool *pbFailed ); + +// Internal implementation of SteamAPI_InitEx. This is done in a way that checks +// all of the versions of interfaces from headers being compiled into this code. +S_API ESteamAPIInitResult S_CALLTYPE SteamInternal_SteamAPI_Init( const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg ); +inline ESteamAPIInitResult SteamAPI_InitEx( SteamErrMsg *pOutErrMsg ) +{ + const char *pszInternalCheckInterfaceVersions = + STEAMUTILS_INTERFACE_VERSION "\0" + STEAMNETWORKINGUTILS_INTERFACE_VERSION "\0" + STEAMAPPS_INTERFACE_VERSION "\0" + STEAMCONTROLLER_INTERFACE_VERSION "\0" + STEAMFRIENDS_INTERFACE_VERSION "\0" + STEAMGAMESEARCH_INTERFACE_VERSION "\0" + STEAMHTMLSURFACE_INTERFACE_VERSION "\0" + STEAMHTTP_INTERFACE_VERSION "\0" + STEAMINPUT_INTERFACE_VERSION "\0" + STEAMINVENTORY_INTERFACE_VERSION "\0" + STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION "\0" + STEAMMATCHMAKING_INTERFACE_VERSION "\0" + STEAMMUSICREMOTE_INTERFACE_VERSION "\0" + STEAMMUSIC_INTERFACE_VERSION "\0" + STEAMNETWORKINGMESSAGES_INTERFACE_VERSION "\0" + STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "\0" + STEAMNETWORKING_INTERFACE_VERSION "\0" + STEAMPARENTALSETTINGS_INTERFACE_VERSION "\0" + STEAMPARTIES_INTERFACE_VERSION "\0" + STEAMREMOTEPLAY_INTERFACE_VERSION "\0" + STEAMREMOTESTORAGE_INTERFACE_VERSION "\0" + STEAMSCREENSHOTS_INTERFACE_VERSION "\0" + STEAMUGC_INTERFACE_VERSION "\0" + STEAMUSERSTATS_INTERFACE_VERSION "\0" + STEAMUSER_INTERFACE_VERSION "\0" + STEAMVIDEO_INTERFACE_VERSION "\0" + + "\0"; + + return SteamInternal_SteamAPI_Init( pszInternalCheckInterfaceVersions, pOutErrMsg ); +} + +#endif // STEAM_API_H diff --git a/external/steamworks/public/steam/steam_api.json b/external/steamworks/public/steam/steam_api.json new file mode 100644 index 0000000..f201387 --- /dev/null +++ b/external/steamworks/public/steam/steam_api.json @@ -0,0 +1,14623 @@ +{ + "callback_structs": [ + { + "callback_id": 101, + "fields": [], + "struct": "SteamServersConnected_t" + }, + { + "callback_id": 102, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_bStillRetrying", "fieldtype":"bool" } + ], + "struct": "SteamServerConnectFailure_t" + }, + { + "callback_id": 103, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" } + ], + "struct": "SteamServersDisconnected_t" + }, + { + "callback_id": 113, + "fields": [ + { "fieldname":"m_uAppID", "fieldtype":"uint32" }, + { "fieldname":"m_unGameServerIP", "fieldtype":"uint32" }, + { "fieldname":"m_usGameServerPort", "fieldtype":"uint16" }, + { "fieldname":"m_bSecure", "fieldtype":"uint16" }, + { "fieldname":"m_uReason", "fieldtype":"uint32" } + ], + "struct": "ClientGameServerDeny_t" + }, + { + "callback_id": 117, + "enums": [ + { + "enumname": "EFailureType", + "fqname": "IPCFailure_t::EFailureType", + "values": [ + { "name":"k_EFailureFlushedCallbackQueue", "value":"0" }, + { "name":"k_EFailurePipeFail", "value":"1" } + ] + } + ], + "fields": [ + { "fieldname":"m_eFailureType", "fieldtype":"uint8" } + ], + "struct": "IPCFailure_t" + }, + { + "callback_id": 125, + "fields": [], + "struct": "LicensesUpdated_t" + }, + { + "callback_id": 143, + "fields": [ + { "fieldname":"m_SteamID", "fieldtype":"CSteamID" }, + { "fieldname":"m_eAuthSessionResponse", "fieldtype":"EAuthSessionResponse" }, + { "fieldname":"m_OwnerSteamID", "fieldtype":"CSteamID" } + ], + "struct": "ValidateAuthTicketResponse_t" + }, + { + "callback_id": 152, + "fields": [ + { "fieldname":"m_unAppID", "fieldtype":"uint32" }, + { "fieldname":"m_ulOrderID", "fieldtype":"uint64" }, + { "fieldname":"m_bAuthorized", "fieldtype":"uint8" } + ], + "struct": "MicroTxnAuthorizationResponse_t" + }, + { + "callback_id": 154, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" } + ], + "struct": "EncryptedAppTicketResponse_t" + }, + { + "callback_id": 163, + "fields": [ + { "fieldname":"m_hAuthTicket", "fieldtype":"HAuthTicket" }, + { "fieldname":"m_eResult", "fieldtype":"EResult" } + ], + "struct": "GetAuthSessionTicketResponse_t" + }, + { + "callback_id": 164, + "fields": [ + { "fieldname":"m_szURL", "fieldtype":"char [256]" } + ], + "struct": "GameWebCallback_t" + }, + { + "callback_id": 165, + "fields": [ + { "fieldname":"m_szURL", "fieldtype":"char [512]" } + ], + "struct": "StoreAuthURLResponse_t" + }, + { + "callback_id": 166, + "fields": [ + { "fieldname":"m_bAllowed", "fieldtype":"bool" }, + { "fieldname":"m_eNotAllowedReason", "fieldtype":"EMarketNotAllowedReasonFlags" }, + { "fieldname":"m_rtAllowedAtTime", "fieldtype":"RTime32" }, + { "fieldname":"m_cdaySteamGuardRequiredDays", "fieldtype":"int" }, + { "fieldname":"m_cdayNewDeviceCooldown", "fieldtype":"int" } + ], + "struct": "MarketEligibilityResponse_t" + }, + { + "callback_id": 167, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_appid", "fieldtype":"AppId_t" }, + { "fieldname":"m_bApplicable", "fieldtype":"bool" }, + { "fieldname":"m_csecsLast5h", "fieldtype":"int32" }, + { "fieldname":"m_progress", "fieldtype":"EDurationControlProgress" }, + { "fieldname":"m_notification", "fieldtype":"EDurationControlNotification" }, + { "fieldname":"m_csecsToday", "fieldtype":"int32" }, + { "fieldname":"m_csecsRemaining", "fieldtype":"int32" } + ], + "struct": "DurationControl_t" + }, + { + "callback_id": 168, + "fields": [ + { "fieldname":"m_hAuthTicket", "fieldtype":"HAuthTicket" }, + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_cubTicket", "fieldtype":"int" }, + { "fieldname":"m_rgubTicket", "fieldtype":"uint8 [2560]" } + ], + "struct": "GetTicketForWebApiResponse_t" + }, + { + "callback_id": 304, + "fields": [ + { "fieldname":"m_ulSteamID", "fieldtype":"uint64" }, + { "fieldname":"m_nChangeFlags", "fieldtype":"int" } + ], + "struct": "PersonaStateChange_t" + }, + { + "callback_id": 331, + "fields": [ + { "fieldname":"m_bActive", "fieldtype":"uint8" }, + { "fieldname":"m_bUserInitiated", "fieldtype":"bool" }, + { "fieldname":"m_nAppID", "fieldtype":"AppId_t" }, + { "fieldname":"m_dwOverlayPID", "fieldtype":"uint32" } + ], + "struct": "GameOverlayActivated_t" + }, + { + "callback_id": 332, + "fields": [ + { "fieldname":"m_rgchServer", "fieldtype":"char [64]" }, + { "fieldname":"m_rgchPassword", "fieldtype":"char [64]" } + ], + "struct": "GameServerChangeRequested_t" + }, + { + "callback_id": 333, + "fields": [ + { "fieldname":"m_steamIDLobby", "fieldtype":"CSteamID" }, + { "fieldname":"m_steamIDFriend", "fieldtype":"CSteamID" } + ], + "struct": "GameLobbyJoinRequested_t" + }, + { + "callback_id": 334, + "fields": [ + { "fieldname":"m_steamID", "fieldtype":"CSteamID" }, + { "fieldname":"m_iImage", "fieldtype":"int" }, + { "fieldname":"m_iWide", "fieldtype":"int" }, + { "fieldname":"m_iTall", "fieldtype":"int" } + ], + "struct": "AvatarImageLoaded_t" + }, + { + "callback_id": 335, + "fields": [ + { "fieldname":"m_steamIDClan", "fieldtype":"CSteamID" }, + { "fieldname":"m_cOfficers", "fieldtype":"int" }, + { "fieldname":"m_bSuccess", "fieldtype":"uint8" } + ], + "struct": "ClanOfficerListResponse_t" + }, + { + "callback_id": 336, + "fields": [ + { "fieldname":"m_steamIDFriend", "fieldtype":"CSteamID" }, + { "fieldname":"m_nAppID", "fieldtype":"AppId_t" } + ], + "struct": "FriendRichPresenceUpdate_t" + }, + { + "callback_id": 337, + "fields": [ + { "fieldname":"m_steamIDFriend", "fieldtype":"CSteamID" }, + { "fieldname":"m_rgchConnect", "fieldtype":"char [256]" } + ], + "struct": "GameRichPresenceJoinRequested_t" + }, + { + "callback_id": 338, + "fields": [ + { "fieldname":"m_steamIDClanChat", "fieldtype":"CSteamID" }, + { "fieldname":"m_steamIDUser", "fieldtype":"CSteamID" }, + { "fieldname":"m_iMessageID", "fieldtype":"int" } + ], + "struct": "GameConnectedClanChatMsg_t" + }, + { + "callback_id": 339, + "fields": [ + { "fieldname":"m_steamIDClanChat", "fieldtype":"CSteamID" }, + { "fieldname":"m_steamIDUser", "fieldtype":"CSteamID" } + ], + "struct": "GameConnectedChatJoin_t" + }, + { + "callback_id": 340, + "fields": [ + { "fieldname":"m_steamIDClanChat", "fieldtype":"CSteamID" }, + { "fieldname":"m_steamIDUser", "fieldtype":"CSteamID" }, + { "fieldname":"m_bKicked", "fieldtype":"bool" }, + { "fieldname":"m_bDropped", "fieldtype":"bool" } + ], + "struct": "GameConnectedChatLeave_t" + }, + { + "callback_id": 341, + "fields": [ + { "fieldname":"m_bSuccess", "fieldtype":"bool" } + ], + "struct": "DownloadClanActivityCountsResult_t" + }, + { + "callback_id": 342, + "fields": [ + { "fieldname":"m_steamIDClanChat", "fieldtype":"CSteamID" }, + { "fieldname":"m_eChatRoomEnterResponse", "fieldtype":"EChatRoomEnterResponse" } + ], + "struct": "JoinClanChatRoomCompletionResult_t" + }, + { + "callback_id": 343, + "fields": [ + { "fieldname":"m_steamIDUser", "fieldtype":"CSteamID" }, + { "fieldname":"m_iMessageID", "fieldtype":"int" } + ], + "struct": "GameConnectedFriendChatMsg_t" + }, + { + "callback_id": 344, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_steamID", "fieldtype":"CSteamID" }, + { "fieldname":"m_nCount", "fieldtype":"int" } + ], + "struct": "FriendsGetFollowerCount_t" + }, + { + "callback_id": 345, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_steamID", "fieldtype":"CSteamID" }, + { "fieldname":"m_bIsFollowing", "fieldtype":"bool" } + ], + "struct": "FriendsIsFollowing_t" + }, + { + "callback_id": 346, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_rgSteamID", "fieldtype":"CSteamID [50]" }, + { "fieldname":"m_nResultsReturned", "fieldtype":"int32" }, + { "fieldname":"m_nTotalResultCount", "fieldtype":"int32" } + ], + "struct": "FriendsEnumerateFollowingList_t" + }, + { + "callback_id": 348, + "fields": [], + "struct": "UnreadChatMessagesChanged_t" + }, + { + "callback_id": 349, + "fields": [ + { "fieldname":"rgchURI", "fieldtype":"char [1024]" } + ], + "struct": "OverlayBrowserProtocolNavigation_t" + }, + { + "callback_id": 350, + "fields": [ + { "fieldname":"m_steamID", "fieldtype":"CSteamID" } + ], + "struct": "EquippedProfileItemsChanged_t" + }, + { + "callback_id": 351, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_steamID", "fieldtype":"CSteamID" }, + { "fieldname":"m_bHasAnimatedAvatar", "fieldtype":"bool" }, + { "fieldname":"m_bHasAvatarFrame", "fieldtype":"bool" }, + { "fieldname":"m_bHasProfileModifier", "fieldtype":"bool" }, + { "fieldname":"m_bHasProfileBackground", "fieldtype":"bool" }, + { "fieldname":"m_bHasMiniProfileBackground", "fieldtype":"bool" }, + { "fieldname":"m_bFromCache", "fieldtype":"bool" } + ], + "struct": "EquippedProfileItems_t" + }, + { + "callback_id": 701, + "fields": [], + "struct": "IPCountry_t" + }, + { + "callback_id": 702, + "fields": [ + { "fieldname":"m_nMinutesBatteryLeft", "fieldtype":"uint8" } + ], + "struct": "LowBatteryPower_t" + }, + { + "callback_id": 703, + "fields": [ + { "fieldname":"m_hAsyncCall", "fieldtype":"SteamAPICall_t" }, + { "fieldname":"m_iCallback", "fieldtype":"int" }, + { "fieldname":"m_cubParam", "fieldtype":"uint32" } + ], + "struct": "SteamAPICallCompleted_t" + }, + { + "callback_id": 704, + "fields": [], + "struct": "SteamShutdown_t" + }, + { + "callback_id": 705, + "fields": [ + { "fieldname":"m_eCheckFileSignature", "fieldtype":"ECheckFileSignature" } + ], + "struct": "CheckFileSignature_t" + }, + { + "callback_id": 714, + "fields": [ + { "fieldname":"m_bSubmitted", "fieldtype":"bool" }, + { "fieldname":"m_unSubmittedText", "fieldtype":"uint32" }, + { "fieldname":"m_unAppID", "fieldtype":"AppId_t" } + ], + "struct": "GamepadTextInputDismissed_t" + }, + { + "callback_id": 736, + "fields": [], + "struct": "AppResumingFromSuspend_t" + }, + { + "callback_id": 738, + "fields": [], + "struct": "FloatingGamepadTextInputDismissed_t" + }, + { + "callback_id": 739, + "fields": [ + { "fieldname":"m_eLanguage", "fieldtype":"int" } + ], + "struct": "FilterTextDictionaryChanged_t" + }, + { + "callback_id": 502, + "fields": [ + { "fieldname":"m_nIP", "fieldtype":"uint32" }, + { "fieldname":"m_nQueryPort", "fieldtype":"uint32" }, + { "fieldname":"m_nConnPort", "fieldtype":"uint32" }, + { "fieldname":"m_nAppID", "fieldtype":"uint32" }, + { "fieldname":"m_nFlags", "fieldtype":"uint32" }, + { "fieldname":"m_bAdd", "fieldtype":"bool" }, + { "fieldname":"m_unAccountId", "fieldtype":"AccountID_t" } + ], + "struct": "FavoritesListChanged_t" + }, + { + "callback_id": 503, + "fields": [ + { "fieldname":"m_ulSteamIDUser", "fieldtype":"uint64" }, + { "fieldname":"m_ulSteamIDLobby", "fieldtype":"uint64" }, + { "fieldname":"m_ulGameID", "fieldtype":"uint64" } + ], + "struct": "LobbyInvite_t" + }, + { + "callback_id": 504, + "fields": [ + { "fieldname":"m_ulSteamIDLobby", "fieldtype":"uint64" }, + { "fieldname":"m_rgfChatPermissions", "fieldtype":"uint32" }, + { "fieldname":"m_bLocked", "fieldtype":"bool" }, + { "fieldname":"m_EChatRoomEnterResponse", "fieldtype":"uint32" } + ], + "struct": "LobbyEnter_t" + }, + { + "callback_id": 505, + "fields": [ + { "fieldname":"m_ulSteamIDLobby", "fieldtype":"uint64" }, + { "fieldname":"m_ulSteamIDMember", "fieldtype":"uint64" }, + { "fieldname":"m_bSuccess", "fieldtype":"uint8" } + ], + "struct": "LobbyDataUpdate_t" + }, + { + "callback_id": 506, + "fields": [ + { "fieldname":"m_ulSteamIDLobby", "fieldtype":"uint64" }, + { "fieldname":"m_ulSteamIDUserChanged", "fieldtype":"uint64" }, + { "fieldname":"m_ulSteamIDMakingChange", "fieldtype":"uint64" }, + { "fieldname":"m_rgfChatMemberStateChange", "fieldtype":"uint32" } + ], + "struct": "LobbyChatUpdate_t" + }, + { + "callback_id": 507, + "fields": [ + { "fieldname":"m_ulSteamIDLobby", "fieldtype":"uint64" }, + { "fieldname":"m_ulSteamIDUser", "fieldtype":"uint64" }, + { "fieldname":"m_eChatEntryType", "fieldtype":"uint8" }, + { "fieldname":"m_iChatID", "fieldtype":"uint32" } + ], + "struct": "LobbyChatMsg_t" + }, + { + "callback_id": 509, + "fields": [ + { "fieldname":"m_ulSteamIDLobby", "fieldtype":"uint64" }, + { "fieldname":"m_ulSteamIDGameServer", "fieldtype":"uint64" }, + { "fieldname":"m_unIP", "fieldtype":"uint32" }, + { "fieldname":"m_usPort", "fieldtype":"uint16" } + ], + "struct": "LobbyGameCreated_t" + }, + { + "callback_id": 510, + "fields": [ + { "fieldname":"m_nLobbiesMatching", "fieldtype":"uint32" } + ], + "struct": "LobbyMatchList_t" + }, + { + "callback_id": 512, + "fields": [ + { "fieldname":"m_ulSteamIDLobby", "fieldtype":"uint64" }, + { "fieldname":"m_ulSteamIDAdmin", "fieldtype":"uint64" }, + { "fieldname":"m_bKickedDueToDisconnect", "fieldtype":"uint8" } + ], + "struct": "LobbyKicked_t" + }, + { + "callback_id": 513, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_ulSteamIDLobby", "fieldtype":"uint64" } + ], + "struct": "LobbyCreated_t" + }, + { + "callback_id": 516, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" } + ], + "struct": "FavoritesListAccountsUpdated_t" + }, + { + "callback_id": 5201, + "fields": [ + { "fieldname":"m_ullSearchID", "fieldtype":"uint64" }, + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_lobbyID", "fieldtype":"CSteamID" }, + { "fieldname":"m_steamIDEndedSearch", "fieldtype":"CSteamID" }, + { "fieldname":"m_nSecondsRemainingEstimate", "fieldtype":"int32" }, + { "fieldname":"m_cPlayersSearching", "fieldtype":"int32" } + ], + "struct": "SearchForGameProgressCallback_t" + }, + { + "callback_id": 5202, + "fields": [ + { "fieldname":"m_ullSearchID", "fieldtype":"uint64" }, + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nCountPlayersInGame", "fieldtype":"int32" }, + { "fieldname":"m_nCountAcceptedGame", "fieldtype":"int32" }, + { "fieldname":"m_steamIDHost", "fieldtype":"CSteamID" }, + { "fieldname":"m_bFinalCallback", "fieldtype":"bool" } + ], + "struct": "SearchForGameResultCallback_t" + }, + { + "callback_id": 5211, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_ullSearchID", "fieldtype":"uint64" } + ], + "struct": "RequestPlayersForGameProgressCallback_t" + }, + { + "callback_id": 5212, + "enums": [ + { + "enumname": "PlayerAcceptState_t", + "fqname": "RequestPlayersForGameResultCallback_t::PlayerAcceptState_t", + "values": [ + { "name":"k_EStateUnknown", "value":"0" }, + { "name":"k_EStatePlayerAccepted", "value":"1" }, + { "name":"k_EStatePlayerDeclined", "value":"2" } + ] + } + ], + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_ullSearchID", "fieldtype":"uint64" }, + { "fieldname":"m_SteamIDPlayerFound", "fieldtype":"CSteamID" }, + { "fieldname":"m_SteamIDLobby", "fieldtype":"CSteamID" }, + { "fieldname":"m_ePlayerAcceptState", "fieldtype":"RequestPlayersForGameResultCallback_t::PlayerAcceptState_t" }, + { "fieldname":"m_nPlayerIndex", "fieldtype":"int32" }, + { "fieldname":"m_nTotalPlayersFound", "fieldtype":"int32" }, + { "fieldname":"m_nTotalPlayersAcceptedGame", "fieldtype":"int32" }, + { "fieldname":"m_nSuggestedTeamIndex", "fieldtype":"int32" }, + { "fieldname":"m_ullUniqueGameID", "fieldtype":"uint64" } + ], + "struct": "RequestPlayersForGameResultCallback_t" + }, + { + "callback_id": 5213, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_ullSearchID", "fieldtype":"uint64" }, + { "fieldname":"m_ullUniqueGameID", "fieldtype":"uint64" } + ], + "struct": "RequestPlayersForGameFinalResultCallback_t" + }, + { + "callback_id": 5214, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"ullUniqueGameID", "fieldtype":"uint64" }, + { "fieldname":"steamIDPlayer", "fieldtype":"CSteamID" } + ], + "struct": "SubmitPlayerResultResultCallback_t" + }, + { + "callback_id": 5215, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"ullUniqueGameID", "fieldtype":"uint64" } + ], + "struct": "EndGameResultCallback_t" + }, + { + "callback_id": 5301, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_ulBeaconID", "fieldtype":"PartyBeaconID_t" }, + { "fieldname":"m_SteamIDBeaconOwner", "fieldtype":"CSteamID" }, + { "fieldname":"m_rgchConnectString", "fieldtype":"char [256]" } + ], + "struct": "JoinPartyCallback_t" + }, + { + "callback_id": 5302, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_ulBeaconID", "fieldtype":"PartyBeaconID_t" } + ], + "struct": "CreateBeaconCallback_t" + }, + { + "callback_id": 5303, + "fields": [ + { "fieldname":"m_ulBeaconID", "fieldtype":"PartyBeaconID_t" }, + { "fieldname":"m_steamIDJoiner", "fieldtype":"CSteamID" } + ], + "struct": "ReservationNotificationCallback_t" + }, + { + "callback_id": 5304, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" } + ], + "struct": "ChangeNumOpenSlotsCallback_t" + }, + { + "callback_id": 5305, + "fields": [], + "struct": "AvailableBeaconLocationsUpdated_t" + }, + { + "callback_id": 5306, + "fields": [], + "struct": "ActiveBeaconsUpdated_t" + }, + { + "callback_id": 1307, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_hFile", "fieldtype":"UGCHandle_t" }, + { "fieldname":"m_rgchFilename", "fieldtype":"char [260]" } + ], + "struct": "RemoteStorageFileShareResult_t" + }, + { + "callback_id": 1309, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_bUserNeedsToAcceptWorkshopLegalAgreement", "fieldtype":"bool" } + ], + "struct": "RemoteStoragePublishFileResult_t" + }, + { + "callback_id": 1311, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" } + ], + "struct": "RemoteStorageDeletePublishedFileResult_t" + }, + { + "callback_id": 1312, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nResultsReturned", "fieldtype":"int32" }, + { "fieldname":"m_nTotalResultCount", "fieldtype":"int32" }, + { "fieldname":"m_rgPublishedFileId", "fieldtype":"PublishedFileId_t [50]" } + ], + "struct": "RemoteStorageEnumerateUserPublishedFilesResult_t" + }, + { + "callback_id": 1313, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" } + ], + "struct": "RemoteStorageSubscribePublishedFileResult_t" + }, + { + "callback_id": 1314, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nResultsReturned", "fieldtype":"int32" }, + { "fieldname":"m_nTotalResultCount", "fieldtype":"int32" }, + { "fieldname":"m_rgPublishedFileId", "fieldtype":"PublishedFileId_t [50]" }, + { "fieldname":"m_rgRTimeSubscribed", "fieldtype":"uint32 [50]" } + ], + "struct": "RemoteStorageEnumerateUserSubscribedFilesResult_t" + }, + { + "callback_id": 1315, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" } + ], + "struct": "RemoteStorageUnsubscribePublishedFileResult_t" + }, + { + "callback_id": 1316, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_bUserNeedsToAcceptWorkshopLegalAgreement", "fieldtype":"bool" } + ], + "struct": "RemoteStorageUpdatePublishedFileResult_t" + }, + { + "callback_id": 1317, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_hFile", "fieldtype":"UGCHandle_t" }, + { "fieldname":"m_nAppID", "fieldtype":"AppId_t" }, + { "fieldname":"m_nSizeInBytes", "fieldtype":"int32" }, + { "fieldname":"m_pchFileName", "fieldtype":"char [260]" }, + { "fieldname":"m_ulSteamIDOwner", "fieldtype":"uint64" } + ], + "struct": "RemoteStorageDownloadUGCResult_t" + }, + { + "callback_id": 1318, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_nCreatorAppID", "fieldtype":"AppId_t" }, + { "fieldname":"m_nConsumerAppID", "fieldtype":"AppId_t" }, + { "fieldname":"m_rgchTitle", "fieldtype":"char [129]" }, + { "fieldname":"m_rgchDescription", "fieldtype":"char [8000]" }, + { "fieldname":"m_hFile", "fieldtype":"UGCHandle_t" }, + { "fieldname":"m_hPreviewFile", "fieldtype":"UGCHandle_t" }, + { "fieldname":"m_ulSteamIDOwner", "fieldtype":"uint64" }, + { "fieldname":"m_rtimeCreated", "fieldtype":"uint32" }, + { "fieldname":"m_rtimeUpdated", "fieldtype":"uint32" }, + { "fieldname":"m_eVisibility", "fieldtype":"ERemoteStoragePublishedFileVisibility" }, + { "fieldname":"m_bBanned", "fieldtype":"bool" }, + { "fieldname":"m_rgchTags", "fieldtype":"char [1025]" }, + { "fieldname":"m_bTagsTruncated", "fieldtype":"bool" }, + { "fieldname":"m_pchFileName", "fieldtype":"char [260]" }, + { "fieldname":"m_nFileSize", "fieldtype":"int32" }, + { "fieldname":"m_nPreviewFileSize", "fieldtype":"int32" }, + { "fieldname":"m_rgchURL", "fieldtype":"char [256]" }, + { "fieldname":"m_eFileType", "fieldtype":"EWorkshopFileType" }, + { "fieldname":"m_bAcceptedForUse", "fieldtype":"bool" } + ], + "struct": "RemoteStorageGetPublishedFileDetailsResult_t" + }, + { + "callback_id": 1319, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nResultsReturned", "fieldtype":"int32" }, + { "fieldname":"m_nTotalResultCount", "fieldtype":"int32" }, + { "fieldname":"m_rgPublishedFileId", "fieldtype":"PublishedFileId_t [50]" }, + { "fieldname":"m_rgScore", "fieldtype":"float [50]" }, + { "fieldname":"m_nAppId", "fieldtype":"AppId_t" }, + { "fieldname":"m_unStartIndex", "fieldtype":"uint32" } + ], + "struct": "RemoteStorageEnumerateWorkshopFilesResult_t" + }, + { + "callback_id": 1320, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_unPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_nVotesFor", "fieldtype":"int32" }, + { "fieldname":"m_nVotesAgainst", "fieldtype":"int32" }, + { "fieldname":"m_nReports", "fieldtype":"int32" }, + { "fieldname":"m_fScore", "fieldtype":"float" } + ], + "struct": "RemoteStorageGetPublishedItemVoteDetailsResult_t" + }, + { + "callback_id": 1321, + "fields": [ + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_nAppID", "fieldtype":"AppId_t" } + ], + "struct": "RemoteStoragePublishedFileSubscribed_t" + }, + { + "callback_id": 1322, + "fields": [ + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_nAppID", "fieldtype":"AppId_t" } + ], + "struct": "RemoteStoragePublishedFileUnsubscribed_t" + }, + { + "callback_id": 1323, + "fields": [ + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_nAppID", "fieldtype":"AppId_t" } + ], + "struct": "RemoteStoragePublishedFileDeleted_t" + }, + { + "callback_id": 1324, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" } + ], + "struct": "RemoteStorageUpdateUserPublishedItemVoteResult_t" + }, + { + "callback_id": 1325, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_eVote", "fieldtype":"EWorkshopVote" } + ], + "struct": "RemoteStorageUserVoteDetails_t" + }, + { + "callback_id": 1326, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nResultsReturned", "fieldtype":"int32" }, + { "fieldname":"m_nTotalResultCount", "fieldtype":"int32" }, + { "fieldname":"m_rgPublishedFileId", "fieldtype":"PublishedFileId_t [50]" } + ], + "struct": "RemoteStorageEnumerateUserSharedWorkshopFilesResult_t" + }, + { + "callback_id": 1327, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_eAction", "fieldtype":"EWorkshopFileAction" } + ], + "struct": "RemoteStorageSetUserPublishedFileActionResult_t" + }, + { + "callback_id": 1328, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_eAction", "fieldtype":"EWorkshopFileAction" }, + { "fieldname":"m_nResultsReturned", "fieldtype":"int32" }, + { "fieldname":"m_nTotalResultCount", "fieldtype":"int32" }, + { "fieldname":"m_rgPublishedFileId", "fieldtype":"PublishedFileId_t [50]" }, + { "fieldname":"m_rgRTimeUpdated", "fieldtype":"uint32 [50]" } + ], + "struct": "RemoteStorageEnumeratePublishedFilesByUserActionResult_t" + }, + { + "callback_id": 1329, + "fields": [ + { "fieldname":"m_dPercentFile", "fieldtype":"double" }, + { "fieldname":"m_bPreview", "fieldtype":"bool" } + ], + "struct": "RemoteStoragePublishFileProgress_t" + }, + { + "callback_id": 1330, + "fields": [ + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_nAppID", "fieldtype":"AppId_t" }, + { "fieldname":"m_ulUnused", "fieldtype":"uint64" } + ], + "struct": "RemoteStoragePublishedFileUpdated_t" + }, + { + "callback_id": 1331, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" } + ], + "struct": "RemoteStorageFileWriteAsyncComplete_t" + }, + { + "callback_id": 1332, + "fields": [ + { "fieldname":"m_hFileReadAsync", "fieldtype":"SteamAPICall_t" }, + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nOffset", "fieldtype":"uint32" }, + { "fieldname":"m_cubRead", "fieldtype":"uint32" } + ], + "struct": "RemoteStorageFileReadAsyncComplete_t" + }, + { + "callback_id": 1333, + "fields": [], + "struct": "RemoteStorageLocalFileChange_t" + }, + { + "callback_id": 1101, + "fields": [ + { "fieldname":"m_nGameID", "fieldtype":"uint64" }, + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_steamIDUser", "fieldtype":"CSteamID" } + ], + "struct": "UserStatsReceived_t" + }, + { + "callback_id": 1102, + "fields": [ + { "fieldname":"m_nGameID", "fieldtype":"uint64" }, + { "fieldname":"m_eResult", "fieldtype":"EResult" } + ], + "struct": "UserStatsStored_t" + }, + { + "callback_id": 1103, + "fields": [ + { "fieldname":"m_nGameID", "fieldtype":"uint64" }, + { "fieldname":"m_bGroupAchievement", "fieldtype":"bool" }, + { "fieldname":"m_rgchAchievementName", "fieldtype":"char [128]" }, + { "fieldname":"m_nCurProgress", "fieldtype":"uint32" }, + { "fieldname":"m_nMaxProgress", "fieldtype":"uint32" } + ], + "struct": "UserAchievementStored_t" + }, + { + "callback_id": 1104, + "fields": [ + { "fieldname":"m_hSteamLeaderboard", "fieldtype":"SteamLeaderboard_t" }, + { "fieldname":"m_bLeaderboardFound", "fieldtype":"uint8" } + ], + "struct": "LeaderboardFindResult_t" + }, + { + "callback_id": 1105, + "fields": [ + { "fieldname":"m_hSteamLeaderboard", "fieldtype":"SteamLeaderboard_t" }, + { "fieldname":"m_hSteamLeaderboardEntries", "fieldtype":"SteamLeaderboardEntries_t" }, + { "fieldname":"m_cEntryCount", "fieldtype":"int" } + ], + "struct": "LeaderboardScoresDownloaded_t" + }, + { + "callback_id": 1106, + "fields": [ + { "fieldname":"m_bSuccess", "fieldtype":"uint8" }, + { "fieldname":"m_hSteamLeaderboard", "fieldtype":"SteamLeaderboard_t" }, + { "fieldname":"m_nScore", "fieldtype":"int32" }, + { "fieldname":"m_bScoreChanged", "fieldtype":"uint8" }, + { "fieldname":"m_nGlobalRankNew", "fieldtype":"int" }, + { "fieldname":"m_nGlobalRankPrevious", "fieldtype":"int" } + ], + "struct": "LeaderboardScoreUploaded_t" + }, + { + "callback_id": 1107, + "fields": [ + { "fieldname":"m_bSuccess", "fieldtype":"uint8" }, + { "fieldname":"m_cPlayers", "fieldtype":"int32" } + ], + "struct": "NumberOfCurrentPlayers_t" + }, + { + "callback_id": 1108, + "fields": [ + { "fieldname":"m_steamIDUser", "fieldtype":"CSteamID" } + ], + "struct": "UserStatsUnloaded_t" + }, + { + "callback_id": 1109, + "fields": [ + { "fieldname":"m_nGameID", "fieldtype":"CGameID" }, + { "fieldname":"m_rgchAchievementName", "fieldtype":"char [128]" }, + { "fieldname":"m_bAchieved", "fieldtype":"bool" }, + { "fieldname":"m_nIconHandle", "fieldtype":"int" } + ], + "struct": "UserAchievementIconFetched_t" + }, + { + "callback_id": 1110, + "fields": [ + { "fieldname":"m_nGameID", "fieldtype":"uint64" }, + { "fieldname":"m_eResult", "fieldtype":"EResult" } + ], + "struct": "GlobalAchievementPercentagesReady_t" + }, + { + "callback_id": 1111, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_hSteamLeaderboard", "fieldtype":"SteamLeaderboard_t" } + ], + "struct": "LeaderboardUGCSet_t" + }, + { + "callback_id": 1112, + "fields": [ + { "fieldname":"m_nGameID", "fieldtype":"uint64" }, + { "fieldname":"m_eResult", "fieldtype":"EResult" } + ], + "struct": "GlobalStatsReceived_t" + }, + { + "callback_id": 1005, + "fields": [ + { "fieldname":"m_nAppID", "fieldtype":"AppId_t" } + ], + "struct": "DlcInstalled_t" + }, + { + "callback_id": 1014, + "fields": [], + "struct": "NewUrlLaunchParameters_t" + }, + { + "callback_id": 1021, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nAppID", "fieldtype":"uint32" }, + { "fieldname":"m_cchKeyLength", "fieldtype":"uint32" }, + { "fieldname":"m_rgchKey", "fieldtype":"char [240]" } + ], + "struct": "AppProofOfPurchaseKeyResponse_t" + }, + { + "callback_id": 1023, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_ulFileSize", "fieldtype":"uint64" }, + { "fieldname":"m_FileSHA", "fieldtype":"uint8 [20]" }, + { "fieldname":"m_unFlags", "fieldtype":"uint32" } + ], + "struct": "FileDetailsResult_t" + }, + { + "callback_id": 1030, + "fields": [ + { "fieldname":"m_unAppID", "fieldtype":"AppId_t" }, + { "fieldname":"m_bIsOffline", "fieldtype":"bool" }, + { "fieldname":"m_unSecondsAllowed", "fieldtype":"uint32" }, + { "fieldname":"m_unSecondsPlayed", "fieldtype":"uint32" } + ], + "struct": "TimedTrialStatus_t" + }, + { + "callback_id": 1202, + "fields": [ + { "fieldname":"m_steamIDRemote", "fieldtype":"CSteamID" } + ], + "struct": "P2PSessionRequest_t" + }, + { + "callback_id": 1203, + "fields": [ + { "fieldname":"m_steamIDRemote", "fieldtype":"CSteamID" }, + { "fieldname":"m_eP2PSessionError", "fieldtype":"uint8" } + ], + "struct": "P2PSessionConnectFail_t" + }, + { + "callback_id": 1201, + "fields": [ + { "fieldname":"m_hSocket", "fieldtype":"SNetSocket_t" }, + { "fieldname":"m_hListenSocket", "fieldtype":"SNetListenSocket_t" }, + { "fieldname":"m_steamIDRemote", "fieldtype":"CSteamID" }, + { "fieldname":"m_eSNetSocketState", "fieldtype":"int" } + ], + "struct": "SocketStatusCallback_t" + }, + { + "callback_id": 2301, + "fields": [ + { "fieldname":"m_hLocal", "fieldtype":"ScreenshotHandle" }, + { "fieldname":"m_eResult", "fieldtype":"EResult" } + ], + "struct": "ScreenshotReady_t" + }, + { + "callback_id": 2302, + "fields": [], + "struct": "ScreenshotRequested_t" + }, + { + "callback_id": 4001, + "fields": [], + "struct": "PlaybackStatusHasChanged_t" + }, + { + "callback_id": 4002, + "fields": [ + { "fieldname":"m_flNewVolume", "fieldtype":"float" } + ], + "struct": "VolumeHasChanged_t" + }, + { + "callback_id": 4101, + "fields": [], + "struct": "MusicPlayerRemoteWillActivate_t" + }, + { + "callback_id": 4102, + "fields": [], + "struct": "MusicPlayerRemoteWillDeactivate_t" + }, + { + "callback_id": 4103, + "fields": [], + "struct": "MusicPlayerRemoteToFront_t" + }, + { + "callback_id": 4104, + "fields": [], + "struct": "MusicPlayerWillQuit_t" + }, + { + "callback_id": 4105, + "fields": [], + "struct": "MusicPlayerWantsPlay_t" + }, + { + "callback_id": 4106, + "fields": [], + "struct": "MusicPlayerWantsPause_t" + }, + { + "callback_id": 4107, + "fields": [], + "struct": "MusicPlayerWantsPlayPrevious_t" + }, + { + "callback_id": 4108, + "fields": [], + "struct": "MusicPlayerWantsPlayNext_t" + }, + { + "callback_id": 4109, + "fields": [ + { "fieldname":"m_bShuffled", "fieldtype":"bool" } + ], + "struct": "MusicPlayerWantsShuffled_t" + }, + { + "callback_id": 4110, + "fields": [ + { "fieldname":"m_bLooped", "fieldtype":"bool" } + ], + "struct": "MusicPlayerWantsLooped_t" + }, + { + "callback_id": 4011, + "fields": [ + { "fieldname":"m_flNewVolume", "fieldtype":"float" } + ], + "struct": "MusicPlayerWantsVolume_t" + }, + { + "callback_id": 4012, + "fields": [ + { "fieldname":"nID", "fieldtype":"int" } + ], + "struct": "MusicPlayerSelectsQueueEntry_t" + }, + { + "callback_id": 4013, + "fields": [ + { "fieldname":"nID", "fieldtype":"int" } + ], + "struct": "MusicPlayerSelectsPlaylistEntry_t" + }, + { + "callback_id": 4114, + "fields": [ + { "fieldname":"m_nPlayingRepeatStatus", "fieldtype":"int" } + ], + "struct": "MusicPlayerWantsPlayingRepeatStatus_t" + }, + { + "callback_id": 2101, + "fields": [ + { "fieldname":"m_hRequest", "fieldtype":"HTTPRequestHandle" }, + { "fieldname":"m_ulContextValue", "fieldtype":"uint64" }, + { "fieldname":"m_bRequestSuccessful", "fieldtype":"bool" }, + { "fieldname":"m_eStatusCode", "fieldtype":"EHTTPStatusCode" }, + { "fieldname":"m_unBodySize", "fieldtype":"uint32" } + ], + "struct": "HTTPRequestCompleted_t" + }, + { + "callback_id": 2102, + "fields": [ + { "fieldname":"m_hRequest", "fieldtype":"HTTPRequestHandle" }, + { "fieldname":"m_ulContextValue", "fieldtype":"uint64" } + ], + "struct": "HTTPRequestHeadersReceived_t" + }, + { + "callback_id": 2103, + "fields": [ + { "fieldname":"m_hRequest", "fieldtype":"HTTPRequestHandle" }, + { "fieldname":"m_ulContextValue", "fieldtype":"uint64" }, + { "fieldname":"m_cOffset", "fieldtype":"uint32" }, + { "fieldname":"m_cBytesReceived", "fieldtype":"uint32" } + ], + "struct": "HTTPRequestDataReceived_t" + }, + { + "callback_id": 2801, + "fields": [ + { "fieldname":"m_ulConnectedDeviceHandle", "fieldtype":"InputHandle_t" } + ], + "struct": "SteamInputDeviceConnected_t" + }, + { + "callback_id": 2802, + "fields": [ + { "fieldname":"m_ulDisconnectedDeviceHandle", "fieldtype":"InputHandle_t" } + ], + "struct": "SteamInputDeviceDisconnected_t" + }, + { + "callback_id": 2803, + "fields": [ + { "fieldname":"m_unAppID", "fieldtype":"AppId_t" }, + { "fieldname":"m_ulDeviceHandle", "fieldtype":"InputHandle_t" }, + { "fieldname":"m_ulMappingCreator", "fieldtype":"CSteamID" }, + { "fieldname":"m_unMajorRevision", "fieldtype":"uint32" }, + { "fieldname":"m_unMinorRevision", "fieldtype":"uint32" }, + { "fieldname":"m_bUsesSteamInputAPI", "fieldtype":"bool" }, + { "fieldname":"m_bUsesGamepadAPI", "fieldtype":"bool" } + ], + "struct": "SteamInputConfigurationLoaded_t" + }, + { + "callback_id": 2804, + "fields": [ + { "fieldname":"m_unAppID", "fieldtype":"AppId_t" }, + { "fieldname":"m_ulDeviceHandle", "fieldtype":"InputHandle_t" }, + { "fieldname":"m_eDeviceType", "fieldtype":"ESteamInputType" }, + { "fieldname":"m_nOldGamepadSlot", "fieldtype":"int" }, + { "fieldname":"m_nNewGamepadSlot", "fieldtype":"int" } + ], + "struct": "SteamInputGamepadSlotChange_t" + }, + { + "callback_id": 3401, + "fields": [ + { "fieldname":"m_handle", "fieldtype":"UGCQueryHandle_t" }, + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_unNumResultsReturned", "fieldtype":"uint32" }, + { "fieldname":"m_unTotalMatchingResults", "fieldtype":"uint32" }, + { "fieldname":"m_bCachedData", "fieldtype":"bool" }, + { "fieldname":"m_rgchNextCursor", "fieldtype":"char [256]" } + ], + "struct": "SteamUGCQueryCompleted_t" + }, + { + "callback_id": 3402, + "fields": [ + { "fieldname":"m_details", "fieldtype":"SteamUGCDetails_t" }, + { "fieldname":"m_bCachedData", "fieldtype":"bool" } + ], + "struct": "SteamUGCRequestUGCDetailsResult_t" + }, + { + "callback_id": 3403, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_bUserNeedsToAcceptWorkshopLegalAgreement", "fieldtype":"bool" } + ], + "struct": "CreateItemResult_t" + }, + { + "callback_id": 3404, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_bUserNeedsToAcceptWorkshopLegalAgreement", "fieldtype":"bool" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" } + ], + "struct": "SubmitItemUpdateResult_t" + }, + { + "callback_id": 3405, + "fields": [ + { "fieldname":"m_unAppID", "fieldtype":"AppId_t" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_hLegacyContent", "fieldtype":"UGCHandle_t" }, + { "fieldname":"m_unManifestID", "fieldtype":"uint64" } + ], + "struct": "ItemInstalled_t" + }, + { + "callback_id": 3406, + "fields": [ + { "fieldname":"m_unAppID", "fieldtype":"AppId_t" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_eResult", "fieldtype":"EResult" } + ], + "struct": "DownloadItemResult_t" + }, + { + "callback_id": 3407, + "fields": [ + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_bWasAddRequest", "fieldtype":"bool" } + ], + "struct": "UserFavoriteItemsListChanged_t" + }, + { + "callback_id": 3408, + "fields": [ + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_bVoteUp", "fieldtype":"bool" } + ], + "struct": "SetUserItemVoteResult_t" + }, + { + "callback_id": 3409, + "fields": [ + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_bVotedUp", "fieldtype":"bool" }, + { "fieldname":"m_bVotedDown", "fieldtype":"bool" }, + { "fieldname":"m_bVoteSkipped", "fieldtype":"bool" } + ], + "struct": "GetUserItemVoteResult_t" + }, + { + "callback_id": 3410, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" } + ], + "struct": "StartPlaytimeTrackingResult_t" + }, + { + "callback_id": 3411, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" } + ], + "struct": "StopPlaytimeTrackingResult_t" + }, + { + "callback_id": 3412, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_nChildPublishedFileId", "fieldtype":"PublishedFileId_t" } + ], + "struct": "AddUGCDependencyResult_t" + }, + { + "callback_id": 3413, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_nChildPublishedFileId", "fieldtype":"PublishedFileId_t" } + ], + "struct": "RemoveUGCDependencyResult_t" + }, + { + "callback_id": 3414, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_nAppID", "fieldtype":"AppId_t" } + ], + "struct": "AddAppDependencyResult_t" + }, + { + "callback_id": 3415, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_nAppID", "fieldtype":"AppId_t" } + ], + "struct": "RemoveAppDependencyResult_t" + }, + { + "callback_id": 3416, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_rgAppIDs", "fieldtype":"AppId_t [32]" }, + { "fieldname":"m_nNumAppDependencies", "fieldtype":"uint32" }, + { "fieldname":"m_nTotalNumAppDependencies", "fieldtype":"uint32" } + ], + "struct": "GetAppDependenciesResult_t" + }, + { + "callback_id": 3417, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" } + ], + "struct": "DeleteItemResult_t" + }, + { + "callback_id": 3418, + "fields": [ + { "fieldname":"m_nAppID", "fieldtype":"AppId_t" } + ], + "struct": "UserSubscribedItemsListChanged_t" + }, + { + "callback_id": 3420, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nAppID", "fieldtype":"AppId_t" }, + { "fieldname":"m_unVersion", "fieldtype":"uint32" }, + { "fieldname":"m_rtAction", "fieldtype":"RTime32" }, + { "fieldname":"m_bAccepted", "fieldtype":"bool" }, + { "fieldname":"m_bNeedsAction", "fieldtype":"bool" } + ], + "struct": "WorkshopEULAStatus_t" + }, + { + "callback_id": 4501, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" } + ], + "struct": "HTML_BrowserReady_t" + }, + { + "callback_id": 4502, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"pBGRA", "fieldtype":"const char *" }, + { "fieldname":"unWide", "fieldtype":"uint32" }, + { "fieldname":"unTall", "fieldtype":"uint32" }, + { "fieldname":"unUpdateX", "fieldtype":"uint32" }, + { "fieldname":"unUpdateY", "fieldtype":"uint32" }, + { "fieldname":"unUpdateWide", "fieldtype":"uint32" }, + { "fieldname":"unUpdateTall", "fieldtype":"uint32" }, + { "fieldname":"unScrollX", "fieldtype":"uint32" }, + { "fieldname":"unScrollY", "fieldtype":"uint32" }, + { "fieldname":"flPageScale", "fieldtype":"float" }, + { "fieldname":"unPageSerial", "fieldtype":"uint32" } + ], + "struct": "HTML_NeedsPaint_t" + }, + { + "callback_id": 4503, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"pchURL", "fieldtype":"const char *" }, + { "fieldname":"pchTarget", "fieldtype":"const char *" }, + { "fieldname":"pchPostData", "fieldtype":"const char *" }, + { "fieldname":"bIsRedirect", "fieldtype":"bool" } + ], + "struct": "HTML_StartRequest_t" + }, + { + "callback_id": 4504, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" } + ], + "struct": "HTML_CloseBrowser_t" + }, + { + "callback_id": 4505, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"pchURL", "fieldtype":"const char *" }, + { "fieldname":"pchPostData", "fieldtype":"const char *" }, + { "fieldname":"bIsRedirect", "fieldtype":"bool" }, + { "fieldname":"pchPageTitle", "fieldtype":"const char *" }, + { "fieldname":"bNewNavigation", "fieldtype":"bool" } + ], + "struct": "HTML_URLChanged_t" + }, + { + "callback_id": 4506, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"pchURL", "fieldtype":"const char *" }, + { "fieldname":"pchPageTitle", "fieldtype":"const char *" } + ], + "struct": "HTML_FinishedRequest_t" + }, + { + "callback_id": 4507, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"pchURL", "fieldtype":"const char *" } + ], + "struct": "HTML_OpenLinkInNewTab_t" + }, + { + "callback_id": 4508, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"pchTitle", "fieldtype":"const char *" } + ], + "struct": "HTML_ChangedTitle_t" + }, + { + "callback_id": 4509, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"unResults", "fieldtype":"uint32" }, + { "fieldname":"unCurrentMatch", "fieldtype":"uint32" } + ], + "struct": "HTML_SearchResults_t" + }, + { + "callback_id": 4510, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"bCanGoBack", "fieldtype":"bool" }, + { "fieldname":"bCanGoForward", "fieldtype":"bool" } + ], + "struct": "HTML_CanGoBackAndForward_t" + }, + { + "callback_id": 4511, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"unScrollMax", "fieldtype":"uint32" }, + { "fieldname":"unScrollCurrent", "fieldtype":"uint32" }, + { "fieldname":"flPageScale", "fieldtype":"float" }, + { "fieldname":"bVisible", "fieldtype":"bool" }, + { "fieldname":"unPageSize", "fieldtype":"uint32" } + ], + "struct": "HTML_HorizontalScroll_t" + }, + { + "callback_id": 4512, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"unScrollMax", "fieldtype":"uint32" }, + { "fieldname":"unScrollCurrent", "fieldtype":"uint32" }, + { "fieldname":"flPageScale", "fieldtype":"float" }, + { "fieldname":"bVisible", "fieldtype":"bool" }, + { "fieldname":"unPageSize", "fieldtype":"uint32" } + ], + "struct": "HTML_VerticalScroll_t" + }, + { + "callback_id": 4513, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"x", "fieldtype":"uint32" }, + { "fieldname":"y", "fieldtype":"uint32" }, + { "fieldname":"pchURL", "fieldtype":"const char *" }, + { "fieldname":"bInput", "fieldtype":"bool" }, + { "fieldname":"bLiveLink", "fieldtype":"bool" } + ], + "struct": "HTML_LinkAtPosition_t" + }, + { + "callback_id": 4514, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"pchMessage", "fieldtype":"const char *" } + ], + "struct": "HTML_JSAlert_t" + }, + { + "callback_id": 4515, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"pchMessage", "fieldtype":"const char *" } + ], + "struct": "HTML_JSConfirm_t" + }, + { + "callback_id": 4516, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"pchTitle", "fieldtype":"const char *" }, + { "fieldname":"pchInitialFile", "fieldtype":"const char *" } + ], + "struct": "HTML_FileOpenDialog_t" + }, + { + "callback_id": 4521, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"pchURL", "fieldtype":"const char *" }, + { "fieldname":"unX", "fieldtype":"uint32" }, + { "fieldname":"unY", "fieldtype":"uint32" }, + { "fieldname":"unWide", "fieldtype":"uint32" }, + { "fieldname":"unTall", "fieldtype":"uint32" }, + { "fieldname":"unNewWindow_BrowserHandle_IGNORE", "fieldtype":"HHTMLBrowser" } + ], + "struct": "HTML_NewWindow_t" + }, + { + "callback_id": 4522, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"eMouseCursor", "fieldtype":"uint32" } + ], + "struct": "HTML_SetCursor_t" + }, + { + "callback_id": 4523, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"pchMsg", "fieldtype":"const char *" } + ], + "struct": "HTML_StatusText_t" + }, + { + "callback_id": 4524, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"pchMsg", "fieldtype":"const char *" } + ], + "struct": "HTML_ShowToolTip_t" + }, + { + "callback_id": 4525, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"pchMsg", "fieldtype":"const char *" } + ], + "struct": "HTML_UpdateToolTip_t" + }, + { + "callback_id": 4526, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" } + ], + "struct": "HTML_HideToolTip_t" + }, + { + "callback_id": 4527, + "fields": [ + { "fieldname":"unBrowserHandle", "fieldtype":"HHTMLBrowser" }, + { "fieldname":"unOldBrowserHandle", "fieldtype":"HHTMLBrowser" } + ], + "struct": "HTML_BrowserRestarted_t" + }, + { + "callback_id": 4700, + "fields": [ + { "fieldname":"m_handle", "fieldtype":"SteamInventoryResult_t" }, + { "fieldname":"m_result", "fieldtype":"EResult" } + ], + "struct": "SteamInventoryResultReady_t" + }, + { + "callback_id": 4701, + "fields": [ + { "fieldname":"m_handle", "fieldtype":"SteamInventoryResult_t" } + ], + "struct": "SteamInventoryFullUpdate_t" + }, + { + "callback_id": 4702, + "fields": [], + "struct": "SteamInventoryDefinitionUpdate_t" + }, + { + "callback_id": 4703, + "fields": [ + { "fieldname":"m_result", "fieldtype":"EResult" }, + { "fieldname":"m_steamID", "fieldtype":"CSteamID" }, + { "fieldname":"m_numEligiblePromoItemDefs", "fieldtype":"int" }, + { "fieldname":"m_bCachedData", "fieldtype":"bool" } + ], + "struct": "SteamInventoryEligiblePromoItemDefIDs_t" + }, + { + "callback_id": 4704, + "fields": [ + { "fieldname":"m_result", "fieldtype":"EResult" }, + { "fieldname":"m_ulOrderID", "fieldtype":"uint64" }, + { "fieldname":"m_ulTransID", "fieldtype":"uint64" } + ], + "struct": "SteamInventoryStartPurchaseResult_t" + }, + { + "callback_id": 4705, + "fields": [ + { "fieldname":"m_result", "fieldtype":"EResult" }, + { "fieldname":"m_rgchCurrency", "fieldtype":"char [4]" } + ], + "struct": "SteamInventoryRequestPricesResult_t" + }, + { + "callback_id": 6001, + "fields": [ + { "fieldname":"m_rgchPhaseID", "fieldtype":"char [64]" }, + { "fieldname":"m_ulRecordingMS", "fieldtype":"uint64" }, + { "fieldname":"m_ulLongestClipMS", "fieldtype":"uint64" }, + { "fieldname":"m_unClipCount", "fieldtype":"uint32" }, + { "fieldname":"m_unScreenshotCount", "fieldtype":"uint32" } + ], + "struct": "SteamTimelineGamePhaseRecordingExists_t" + }, + { + "callback_id": 6002, + "fields": [ + { "fieldname":"m_ulEventID", "fieldtype":"uint64" }, + { "fieldname":"m_bRecordingExists", "fieldtype":"bool" } + ], + "struct": "SteamTimelineEventRecordingExists_t" + }, + { + "callback_id": 4611, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_unVideoAppID", "fieldtype":"AppId_t" }, + { "fieldname":"m_rgchURL", "fieldtype":"char [256]" } + ], + "struct": "GetVideoURLResult_t" + }, + { + "callback_id": 4624, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_unVideoAppID", "fieldtype":"AppId_t" } + ], + "struct": "GetOPFSettingsResult_t" + }, + { + "callback_id": 4604, + "fields": [ + { "fieldname":"m_bIsRTMP", "fieldtype":"bool" } + ], + "struct": "BroadcastUploadStart_t" + }, + { + "callback_id": 4605, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EBroadcastUploadResult" } + ], + "struct": "BroadcastUploadStop_t" + }, + { + "callback_id": 5001, + "fields": [], + "struct": "SteamParentalSettingsChanged_t" + }, + { + "callback_id": 5701, + "fields": [ + { "fieldname":"m_unSessionID", "fieldtype":"RemotePlaySessionID_t" } + ], + "struct": "SteamRemotePlaySessionConnected_t" + }, + { + "callback_id": 5702, + "fields": [ + { "fieldname":"m_unSessionID", "fieldtype":"RemotePlaySessionID_t" } + ], + "struct": "SteamRemotePlaySessionDisconnected_t" + }, + { + "callback_id": 5703, + "fields": [ + { "fieldname":"m_szConnectURL", "fieldtype":"char [1024]" } + ], + "struct": "SteamRemotePlayTogetherGuestInvite_t" + }, + { + "callback_id": 1251, + "fields": [ + { "fieldname":"m_identityRemote", "fieldtype":"SteamNetworkingIdentity" } + ], + "struct": "SteamNetworkingMessagesSessionRequest_t" + }, + { + "callback_id": 1252, + "fields": [ + { "fieldname":"m_info", "fieldtype":"SteamNetConnectionInfo_t" } + ], + "struct": "SteamNetworkingMessagesSessionFailed_t" + }, + { + "callback_id": 1221, + "fields": [ + { "fieldname":"m_hConn", "fieldtype":"HSteamNetConnection" }, + { "fieldname":"m_info", "fieldtype":"SteamNetConnectionInfo_t" }, + { "fieldname":"m_eOldState", "fieldtype":"ESteamNetworkingConnectionState" } + ], + "struct": "SteamNetConnectionStatusChangedCallback_t" + }, + { + "callback_id": 1222, + "fields": [ + { "fieldname":"m_eAvail", "fieldtype":"ESteamNetworkingAvailability" }, + { "fieldname":"m_debugMsg", "fieldtype":"char [256]" } + ], + "struct": "SteamNetAuthenticationStatus_t" + }, + { + "callback_id": 1281, + "fields": [ + { "fieldname":"m_eAvail", "fieldtype":"ESteamNetworkingAvailability" }, + { "fieldname":"m_bPingMeasurementInProgress", "fieldtype":"int" }, + { "fieldname":"m_eAvailNetworkConfig", "fieldtype":"ESteamNetworkingAvailability" }, + { "fieldname":"m_eAvailAnyRelay", "fieldtype":"ESteamNetworkingAvailability" }, + { "fieldname":"m_debugMsg", "fieldtype":"char [256]" } + ], + "struct": "SteamRelayNetworkStatus_t" + }, + { + "callback_id": 201, + "fields": [ + { "fieldname":"m_SteamID", "fieldtype":"CSteamID" }, + { "fieldname":"m_OwnerSteamID", "fieldtype":"CSteamID" } + ], + "struct": "GSClientApprove_t" + }, + { + "callback_id": 202, + "fields": [ + { "fieldname":"m_SteamID", "fieldtype":"CSteamID" }, + { "fieldname":"m_eDenyReason", "fieldtype":"EDenyReason" }, + { "fieldname":"m_rgchOptionalText", "fieldtype":"char [128]" } + ], + "struct": "GSClientDeny_t" + }, + { + "callback_id": 203, + "fields": [ + { "fieldname":"m_SteamID", "fieldtype":"CSteamID" }, + { "fieldname":"m_eDenyReason", "fieldtype":"EDenyReason" } + ], + "struct": "GSClientKick_t" + }, + { + "callback_id": 206, + "fields": [ + { "fieldname":"m_SteamID", "fieldtype":"uint64" }, + { "fieldname":"m_pchAchievement", "fieldtype":"char [128]" }, + { "fieldname":"m_bUnlocked", "fieldtype":"bool" } + ], + "struct": "GSClientAchievementStatus_t" + }, + { + "callback_id": 115, + "fields": [ + { "fieldname":"m_bSecure", "fieldtype":"uint8" } + ], + "struct": "GSPolicyResponse_t" + }, + { + "callback_id": 207, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_nRank", "fieldtype":"int32" }, + { "fieldname":"m_unTotalConnects", "fieldtype":"uint32" }, + { "fieldname":"m_unTotalMinutesPlayed", "fieldtype":"uint32" } + ], + "struct": "GSGameplayStats_t" + }, + { + "callback_id": 208, + "fields": [ + { "fieldname":"m_SteamIDUser", "fieldtype":"CSteamID" }, + { "fieldname":"m_SteamIDGroup", "fieldtype":"CSteamID" }, + { "fieldname":"m_bMember", "fieldtype":"bool" }, + { "fieldname":"m_bOfficer", "fieldtype":"bool" } + ], + "struct": "GSClientGroupStatus_t" + }, + { + "callback_id": 209, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_unReputationScore", "fieldtype":"uint32" }, + { "fieldname":"m_bBanned", "fieldtype":"bool" }, + { "fieldname":"m_unBannedIP", "fieldtype":"uint32" }, + { "fieldname":"m_usBannedPort", "fieldtype":"uint16" }, + { "fieldname":"m_ulBannedGameID", "fieldtype":"uint64" }, + { "fieldname":"m_unBanExpires", "fieldtype":"uint32" } + ], + "struct": "GSReputation_t" + }, + { + "callback_id": 210, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" } + ], + "struct": "AssociateWithClanResult_t" + }, + { + "callback_id": 211, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_cPlayersThatDontLikeCandidate", "fieldtype":"int" }, + { "fieldname":"m_cPlayersThatCandidateDoesntLike", "fieldtype":"int" }, + { "fieldname":"m_cClanPlayersThatDontLikeCandidate", "fieldtype":"int" }, + { "fieldname":"m_SteamIDCandidate", "fieldtype":"CSteamID" } + ], + "struct": "ComputeNewPlayerCompatibilityResult_t" + }, + { + "callback_id": 1800, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_steamIDUser", "fieldtype":"CSteamID" } + ], + "struct": "GSStatsReceived_t" + }, + { + "callback_id": 1801, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_steamIDUser", "fieldtype":"CSteamID" } + ], + "struct": "GSStatsStored_t" + }, + { + "callback_id": 1108, + "fields": [ + { "fieldname":"m_steamIDUser", "fieldtype":"CSteamID" } + ], + "struct": "GSStatsUnloaded_t" + }, + { + "callback_id": 1223, + "consts": [ + { "constname":"k_nMaxReturnPorts", "consttype":"int", "constval":"8" } + ], + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_identity", "fieldtype":"SteamNetworkingIdentity" }, + { "fieldname":"m_unIP", "fieldtype":"uint32" }, + { "fieldname":"m_unPorts", "fieldtype":"uint16 [8]" } + ], + "struct": "SteamNetworkingFakeIPResult_t" + } + ], + "consts": [ + { "constname":"k_uAppIdInvalid", "consttype":"AppId_t", "constval":"0x0" }, + { "constname":"k_uDepotIdInvalid", "consttype":"DepotId_t", "constval":"0x0" }, + { "constname":"k_uAPICallInvalid", "consttype":"SteamAPICall_t", "constval":"0x0" }, + { "constname":"k_uAccountIdInvalid", "consttype":"AccountID_t", "constval":"0" }, + { "constname":"k_ulPartyBeaconIdInvalid", "consttype":"PartyBeaconID_t", "constval":"0" }, + { "constname":"k_HAuthTicketInvalid", "consttype":"HAuthTicket", "constval":"0" }, + { "constname":"k_unSteamAccountIDMask", "consttype":"unsigned int", "constval":"0xFFFFFFFF" }, + { "constname":"k_unSteamAccountInstanceMask", "consttype":"unsigned int", "constval":"0x000FFFFF" }, + { "constname":"k_unSteamUserDefaultInstance", "consttype":"unsigned int", "constval":"1" }, + { "constname":"k_cchGameExtraInfoMax", "consttype":"int", "constval":"64" }, + { "constname":"k_cchMaxSteamErrMsg", "consttype":"int", "constval":"1024" }, + { "constname":"k_cchMaxFriendsGroupName", "consttype":"int", "constval":"64" }, + { "constname":"k_cFriendsGroupLimit", "consttype":"int", "constval":"100" }, + { "constname":"k_FriendsGroupID_Invalid", "consttype":"FriendsGroupID_t", "constval":"- 1" }, + { "constname":"k_cEnumerateFollowersMax", "consttype":"int", "constval":"50" }, + { "constname":"k_usFriendGameInfoQueryPort_NotInitialized", "consttype":"uint16", "constval":"0xFFFF" }, + { "constname":"k_usFriendGameInfoQueryPort_Error", "consttype":"uint16", "constval":"0xFFFE" }, + { "constname":"k_cubChatMetadataMax", "consttype":"uint32", "constval":"8192" }, + { "constname":"k_cbMaxGameServerGameDir", "consttype":"int", "constval":"32" }, + { "constname":"k_cbMaxGameServerMapName", "consttype":"int", "constval":"32" }, + { "constname":"k_cbMaxGameServerGameDescription", "consttype":"int", "constval":"64" }, + { "constname":"k_cbMaxGameServerName", "consttype":"int", "constval":"64" }, + { "constname":"k_cbMaxGameServerTags", "consttype":"int", "constval":"128" }, + { "constname":"k_cbMaxGameServerGameData", "consttype":"int", "constval":"2048" }, + { "constname":"HSERVERQUERY_INVALID", "consttype":"int", "constval":"0xffffffff" }, + { "constname":"k_unFavoriteFlagNone", "consttype":"uint32", "constval":"0x00" }, + { "constname":"k_unFavoriteFlagFavorite", "consttype":"uint32", "constval":"0x01" }, + { "constname":"k_unFavoriteFlagHistory", "consttype":"uint32", "constval":"0x02" }, + { "constname":"k_unMaxCloudFileChunkSize", "consttype":"uint32", "constval":"100 * 1024 * 1024" }, + { "constname":"k_PublishedFileIdInvalid", "consttype":"PublishedFileId_t", "constval":"0" }, + { "constname":"k_UGCHandleInvalid", "consttype":"UGCHandle_t", "constval":"0xffffffffffffffffull" }, + { "constname":"k_PublishedFileUpdateHandleInvalid", "consttype":"PublishedFileUpdateHandle_t", "constval":"0xffffffffffffffffull" }, + { "constname":"k_UGCFileStreamHandleInvalid", "consttype":"UGCFileWriteStreamHandle_t", "constval":"0xffffffffffffffffull" }, + { "constname":"k_cchPublishedDocumentTitleMax", "consttype":"uint32", "constval":"128 + 1" }, + { "constname":"k_cchPublishedDocumentDescriptionMax", "consttype":"uint32", "constval":"8000" }, + { "constname":"k_cchPublishedDocumentChangeDescriptionMax", "consttype":"uint32", "constval":"8000" }, + { "constname":"k_unEnumeratePublishedFilesMaxResults", "consttype":"uint32", "constval":"50" }, + { "constname":"k_cchTagListMax", "consttype":"uint32", "constval":"1024 + 1" }, + { "constname":"k_cchFilenameMax", "consttype":"uint32", "constval":"260" }, + { "constname":"k_cchPublishedFileURLMax", "consttype":"uint32", "constval":"256" }, + { "constname":"k_cubAppProofOfPurchaseKeyMax", "consttype":"int", "constval":"240" }, + { "constname":"k_nScreenshotMaxTaggedUsers", "consttype":"uint32", "constval":"32" }, + { "constname":"k_nScreenshotMaxTaggedPublishedFiles", "consttype":"uint32", "constval":"32" }, + { "constname":"k_cubUFSTagTypeMax", "consttype":"int", "constval":"255" }, + { "constname":"k_cubUFSTagValueMax", "consttype":"int", "constval":"255" }, + { "constname":"k_ScreenshotThumbWidth", "consttype":"int", "constval":"200" }, + { "constname":"k_UGCQueryHandleInvalid", "consttype":"UGCQueryHandle_t", "constval":"0xffffffffffffffffull" }, + { "constname":"k_UGCUpdateHandleInvalid", "consttype":"UGCUpdateHandle_t", "constval":"0xffffffffffffffffull" }, + { "constname":"kNumUGCResultsPerPage", "consttype":"uint32", "constval":"50" }, + { "constname":"k_cchDeveloperMetadataMax", "consttype":"uint32", "constval":"5000" }, + { "constname":"INVALID_HTMLBROWSER", "consttype":"uint32", "constval":"0" }, + { "constname":"k_SteamItemInstanceIDInvalid", "consttype":"SteamItemInstanceID_t", "constval":"( SteamItemInstanceID_t ) ~ 0" }, + { "constname":"k_SteamInventoryResultInvalid", "consttype":"SteamInventoryResult_t", "constval":"- 1" }, + { "constname":"k_SteamInventoryUpdateHandleInvalid", "consttype":"SteamInventoryUpdateHandle_t", "constval":"0xffffffffffffffffull" }, + { "constname":"k_unMaxTimelinePriority", "consttype":"uint32", "constval":"1000" }, + { "constname":"k_unTimelinePriority_KeepCurrentValue", "consttype":"uint32", "constval":"1000000" }, + { "constname":"k_flMaxTimelineEventDuration", "consttype":"float", "constval":"600.f" }, + { "constname":"k_cchMaxPhaseIDLength", "consttype":"uint32", "constval":"64" }, + { "constname":"k_HSteamNetConnection_Invalid", "consttype":"HSteamNetConnection", "constval":"0" }, + { "constname":"k_HSteamListenSocket_Invalid", "consttype":"HSteamListenSocket", "constval":"0" }, + { "constname":"k_HSteamNetPollGroup_Invalid", "consttype":"HSteamNetPollGroup", "constval":"0" }, + { "constname":"k_cchMaxSteamNetworkingErrMsg", "consttype":"int", "constval":"1024" }, + { "constname":"k_cchSteamNetworkingMaxConnectionCloseReason", "consttype":"int", "constval":"128" }, + { "constname":"k_cchSteamNetworkingMaxConnectionDescription", "consttype":"int", "constval":"128" }, + { "constname":"k_cchSteamNetworkingMaxConnectionAppName", "consttype":"int", "constval":"32" }, + { "constname":"k_nSteamNetworkConnectionInfoFlags_Unauthenticated", "consttype":"int", "constval":"1" }, + { "constname":"k_nSteamNetworkConnectionInfoFlags_Unencrypted", "consttype":"int", "constval":"2" }, + { "constname":"k_nSteamNetworkConnectionInfoFlags_LoopbackBuffers", "consttype":"int", "constval":"4" }, + { "constname":"k_nSteamNetworkConnectionInfoFlags_Fast", "consttype":"int", "constval":"8" }, + { "constname":"k_nSteamNetworkConnectionInfoFlags_Relayed", "consttype":"int", "constval":"16" }, + { "constname":"k_nSteamNetworkConnectionInfoFlags_DualWifi", "consttype":"int", "constval":"32" }, + { "constname":"k_cbMaxSteamNetworkingSocketsMessageSizeSend", "consttype":"int", "constval":"512 * 1024" }, + { "constname":"k_nSteamNetworkingSend_Unreliable", "consttype":"int", "constval":"0" }, + { "constname":"k_nSteamNetworkingSend_NoNagle", "consttype":"int", "constval":"1" }, + { "constname":"k_nSteamNetworkingSend_UnreliableNoNagle", "consttype":"int", "constval":"k_nSteamNetworkingSend_Unreliable | k_nSteamNetworkingSend_NoNagle" }, + { "constname":"k_nSteamNetworkingSend_NoDelay", "consttype":"int", "constval":"4" }, + { "constname":"k_nSteamNetworkingSend_UnreliableNoDelay", "consttype":"int", "constval":"k_nSteamNetworkingSend_Unreliable | k_nSteamNetworkingSend_NoDelay | k_nSteamNetworkingSend_NoNagle" }, + { "constname":"k_nSteamNetworkingSend_Reliable", "consttype":"int", "constval":"8" }, + { "constname":"k_nSteamNetworkingSend_ReliableNoNagle", "consttype":"int", "constval":"k_nSteamNetworkingSend_Reliable | k_nSteamNetworkingSend_NoNagle" }, + { "constname":"k_nSteamNetworkingSend_UseCurrentThread", "consttype":"int", "constval":"16" }, + { "constname":"k_nSteamNetworkingSend_AutoRestartBrokenSession", "consttype":"int", "constval":"32" }, + { "constname":"k_cchMaxSteamNetworkingPingLocationString", "consttype":"int", "constval":"1024" }, + { "constname":"k_nSteamNetworkingPing_Failed", "consttype":"int", "constval":"- 1" }, + { "constname":"k_nSteamNetworkingPing_Unknown", "consttype":"int", "constval":"- 2" }, + { "constname":"k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Default", "consttype":"int", "constval":"- 1" }, + { "constname":"k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Disable", "consttype":"int", "constval":"0" }, + { "constname":"k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Relay", "consttype":"int", "constval":"1" }, + { "constname":"k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Private", "consttype":"int", "constval":"2" }, + { "constname":"k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Public", "consttype":"int", "constval":"4" }, + { "constname":"k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_All", "consttype":"int", "constval":"0x7fffffff" }, + { "constname":"k_SteamDatagramPOPID_dev", "consttype":"SteamNetworkingPOPID", "constval":"( ( uint32 ) 'd' << 16U ) | ( ( uint32 ) 'e' << 8U ) | ( uint32 ) 'v'" }, + { "constname":"STEAMGAMESERVER_QUERY_PORT_SHARED", "consttype":"uint16", "constval":"0xffff" }, + { "constname":"MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE", "consttype":"uint16", "constval":"STEAMGAMESERVER_QUERY_PORT_SHARED" }, + { "constname":"k_cbSteamDatagramMaxSerializedTicket", "consttype":"uint32", "constval":"512" }, + { "constname":"k_cbMaxSteamDatagramGameCoordinatorServerLoginAppData", "consttype":"uint32", "constval":"2048" }, + { "constname":"k_cbMaxSteamDatagramGameCoordinatorServerLoginSerialized", "consttype":"uint32", "constval":"4096" }, + { "constname":"k_cbSteamNetworkingSocketsFakeUDPPortRecommendedMTU", "consttype":"int", "constval":"1200" }, + { "constname":"k_cbSteamNetworkingSocketsFakeUDPPortMaxMessageSize", "consttype":"int", "constval":"4096" } + ], + "enums": [ + { + "enumname": "ESteamIPType", + "values": [ + { "name":"k_ESteamIPTypeIPv4", "value":"0" }, + { "name":"k_ESteamIPTypeIPv6", "value":"1" } + ] + }, + { + "enumname": "EUniverse", + "values": [ + { "name":"k_EUniverseInvalid", "value":"0" }, + { "name":"k_EUniversePublic", "value":"1" }, + { "name":"k_EUniverseBeta", "value":"2" }, + { "name":"k_EUniverseInternal", "value":"3" }, + { "name":"k_EUniverseDev", "value":"4" }, + { "name":"k_EUniverseMax", "value":"5" } + ] + }, + { + "enumname": "EResult", + "values": [ + { "name":"k_EResultNone", "value":"0" }, + { "name":"k_EResultOK", "value":"1" }, + { "name":"k_EResultFail", "value":"2" }, + { "name":"k_EResultNoConnection", "value":"3" }, + { "name":"k_EResultInvalidPassword", "value":"5" }, + { "name":"k_EResultLoggedInElsewhere", "value":"6" }, + { "name":"k_EResultInvalidProtocolVer", "value":"7" }, + { "name":"k_EResultInvalidParam", "value":"8" }, + { "name":"k_EResultFileNotFound", "value":"9" }, + { "name":"k_EResultBusy", "value":"10" }, + { "name":"k_EResultInvalidState", "value":"11" }, + { "name":"k_EResultInvalidName", "value":"12" }, + { "name":"k_EResultInvalidEmail", "value":"13" }, + { "name":"k_EResultDuplicateName", "value":"14" }, + { "name":"k_EResultAccessDenied", "value":"15" }, + { "name":"k_EResultTimeout", "value":"16" }, + { "name":"k_EResultBanned", "value":"17" }, + { "name":"k_EResultAccountNotFound", "value":"18" }, + { "name":"k_EResultInvalidSteamID", "value":"19" }, + { "name":"k_EResultServiceUnavailable", "value":"20" }, + { "name":"k_EResultNotLoggedOn", "value":"21" }, + { "name":"k_EResultPending", "value":"22" }, + { "name":"k_EResultEncryptionFailure", "value":"23" }, + { "name":"k_EResultInsufficientPrivilege", "value":"24" }, + { "name":"k_EResultLimitExceeded", "value":"25" }, + { "name":"k_EResultRevoked", "value":"26" }, + { "name":"k_EResultExpired", "value":"27" }, + { "name":"k_EResultAlreadyRedeemed", "value":"28" }, + { "name":"k_EResultDuplicateRequest", "value":"29" }, + { "name":"k_EResultAlreadyOwned", "value":"30" }, + { "name":"k_EResultIPNotFound", "value":"31" }, + { "name":"k_EResultPersistFailed", "value":"32" }, + { "name":"k_EResultLockingFailed", "value":"33" }, + { "name":"k_EResultLogonSessionReplaced", "value":"34" }, + { "name":"k_EResultConnectFailed", "value":"35" }, + { "name":"k_EResultHandshakeFailed", "value":"36" }, + { "name":"k_EResultIOFailure", "value":"37" }, + { "name":"k_EResultRemoteDisconnect", "value":"38" }, + { "name":"k_EResultShoppingCartNotFound", "value":"39" }, + { "name":"k_EResultBlocked", "value":"40" }, + { "name":"k_EResultIgnored", "value":"41" }, + { "name":"k_EResultNoMatch", "value":"42" }, + { "name":"k_EResultAccountDisabled", "value":"43" }, + { "name":"k_EResultServiceReadOnly", "value":"44" }, + { "name":"k_EResultAccountNotFeatured", "value":"45" }, + { "name":"k_EResultAdministratorOK", "value":"46" }, + { "name":"k_EResultContentVersion", "value":"47" }, + { "name":"k_EResultTryAnotherCM", "value":"48" }, + { "name":"k_EResultPasswordRequiredToKickSession", "value":"49" }, + { "name":"k_EResultAlreadyLoggedInElsewhere", "value":"50" }, + { "name":"k_EResultSuspended", "value":"51" }, + { "name":"k_EResultCancelled", "value":"52" }, + { "name":"k_EResultDataCorruption", "value":"53" }, + { "name":"k_EResultDiskFull", "value":"54" }, + { "name":"k_EResultRemoteCallFailed", "value":"55" }, + { "name":"k_EResultPasswordUnset", "value":"56" }, + { "name":"k_EResultExternalAccountUnlinked", "value":"57" }, + { "name":"k_EResultPSNTicketInvalid", "value":"58" }, + { "name":"k_EResultExternalAccountAlreadyLinked", "value":"59" }, + { "name":"k_EResultRemoteFileConflict", "value":"60" }, + { "name":"k_EResultIllegalPassword", "value":"61" }, + { "name":"k_EResultSameAsPreviousValue", "value":"62" }, + { "name":"k_EResultAccountLogonDenied", "value":"63" }, + { "name":"k_EResultCannotUseOldPassword", "value":"64" }, + { "name":"k_EResultInvalidLoginAuthCode", "value":"65" }, + { "name":"k_EResultAccountLogonDeniedNoMail", "value":"66" }, + { "name":"k_EResultHardwareNotCapableOfIPT", "value":"67" }, + { "name":"k_EResultIPTInitError", "value":"68" }, + { "name":"k_EResultParentalControlRestricted", "value":"69" }, + { "name":"k_EResultFacebookQueryError", "value":"70" }, + { "name":"k_EResultExpiredLoginAuthCode", "value":"71" }, + { "name":"k_EResultIPLoginRestrictionFailed", "value":"72" }, + { "name":"k_EResultAccountLockedDown", "value":"73" }, + { "name":"k_EResultAccountLogonDeniedVerifiedEmailRequired", "value":"74" }, + { "name":"k_EResultNoMatchingURL", "value":"75" }, + { "name":"k_EResultBadResponse", "value":"76" }, + { "name":"k_EResultRequirePasswordReEntry", "value":"77" }, + { "name":"k_EResultValueOutOfRange", "value":"78" }, + { "name":"k_EResultUnexpectedError", "value":"79" }, + { "name":"k_EResultDisabled", "value":"80" }, + { "name":"k_EResultInvalidCEGSubmission", "value":"81" }, + { "name":"k_EResultRestrictedDevice", "value":"82" }, + { "name":"k_EResultRegionLocked", "value":"83" }, + { "name":"k_EResultRateLimitExceeded", "value":"84" }, + { "name":"k_EResultAccountLoginDeniedNeedTwoFactor", "value":"85" }, + { "name":"k_EResultItemDeleted", "value":"86" }, + { "name":"k_EResultAccountLoginDeniedThrottle", "value":"87" }, + { "name":"k_EResultTwoFactorCodeMismatch", "value":"88" }, + { "name":"k_EResultTwoFactorActivationCodeMismatch", "value":"89" }, + { "name":"k_EResultAccountAssociatedToMultiplePartners", "value":"90" }, + { "name":"k_EResultNotModified", "value":"91" }, + { "name":"k_EResultNoMobileDevice", "value":"92" }, + { "name":"k_EResultTimeNotSynced", "value":"93" }, + { "name":"k_EResultSmsCodeFailed", "value":"94" }, + { "name":"k_EResultAccountLimitExceeded", "value":"95" }, + { "name":"k_EResultAccountActivityLimitExceeded", "value":"96" }, + { "name":"k_EResultPhoneActivityLimitExceeded", "value":"97" }, + { "name":"k_EResultRefundToWallet", "value":"98" }, + { "name":"k_EResultEmailSendFailure", "value":"99" }, + { "name":"k_EResultNotSettled", "value":"100" }, + { "name":"k_EResultNeedCaptcha", "value":"101" }, + { "name":"k_EResultGSLTDenied", "value":"102" }, + { "name":"k_EResultGSOwnerDenied", "value":"103" }, + { "name":"k_EResultInvalidItemType", "value":"104" }, + { "name":"k_EResultIPBanned", "value":"105" }, + { "name":"k_EResultGSLTExpired", "value":"106" }, + { "name":"k_EResultInsufficientFunds", "value":"107" }, + { "name":"k_EResultTooManyPending", "value":"108" }, + { "name":"k_EResultNoSiteLicensesFound", "value":"109" }, + { "name":"k_EResultWGNetworkSendExceeded", "value":"110" }, + { "name":"k_EResultAccountNotFriends", "value":"111" }, + { "name":"k_EResultLimitedUserAccount", "value":"112" }, + { "name":"k_EResultCantRemoveItem", "value":"113" }, + { "name":"k_EResultAccountDeleted", "value":"114" }, + { "name":"k_EResultExistingUserCancelledLicense", "value":"115" }, + { "name":"k_EResultCommunityCooldown", "value":"116" }, + { "name":"k_EResultNoLauncherSpecified", "value":"117" }, + { "name":"k_EResultMustAgreeToSSA", "value":"118" }, + { "name":"k_EResultLauncherMigrated", "value":"119" }, + { "name":"k_EResultSteamRealmMismatch", "value":"120" }, + { "name":"k_EResultInvalidSignature", "value":"121" }, + { "name":"k_EResultParseFailure", "value":"122" }, + { "name":"k_EResultNoVerifiedPhone", "value":"123" }, + { "name":"k_EResultInsufficientBattery", "value":"124" }, + { "name":"k_EResultChargerRequired", "value":"125" }, + { "name":"k_EResultCachedCredentialInvalid", "value":"126" }, + { "name":"K_EResultPhoneNumberIsVOIP", "value":"127" }, + { "name":"k_EResultNotSupported", "value":"128" }, + { "name":"k_EResultFamilySizeLimitExceeded", "value":"129" }, + { "name":"k_EResultOfflineAppCacheInvalid", "value":"130" } + ] + }, + { + "enumname": "EVoiceResult", + "values": [ + { "name":"k_EVoiceResultOK", "value":"0" }, + { "name":"k_EVoiceResultNotInitialized", "value":"1" }, + { "name":"k_EVoiceResultNotRecording", "value":"2" }, + { "name":"k_EVoiceResultNoData", "value":"3" }, + { "name":"k_EVoiceResultBufferTooSmall", "value":"4" }, + { "name":"k_EVoiceResultDataCorrupted", "value":"5" }, + { "name":"k_EVoiceResultRestricted", "value":"6" }, + { "name":"k_EVoiceResultUnsupportedCodec", "value":"7" }, + { "name":"k_EVoiceResultReceiverOutOfDate", "value":"8" }, + { "name":"k_EVoiceResultReceiverDidNotAnswer", "value":"9" } + ] + }, + { + "enumname": "EDenyReason", + "values": [ + { "name":"k_EDenyInvalid", "value":"0" }, + { "name":"k_EDenyInvalidVersion", "value":"1" }, + { "name":"k_EDenyGeneric", "value":"2" }, + { "name":"k_EDenyNotLoggedOn", "value":"3" }, + { "name":"k_EDenyNoLicense", "value":"4" }, + { "name":"k_EDenyCheater", "value":"5" }, + { "name":"k_EDenyLoggedInElseWhere", "value":"6" }, + { "name":"k_EDenyUnknownText", "value":"7" }, + { "name":"k_EDenyIncompatibleAnticheat", "value":"8" }, + { "name":"k_EDenyMemoryCorruption", "value":"9" }, + { "name":"k_EDenyIncompatibleSoftware", "value":"10" }, + { "name":"k_EDenySteamConnectionLost", "value":"11" }, + { "name":"k_EDenySteamConnectionError", "value":"12" }, + { "name":"k_EDenySteamResponseTimedOut", "value":"13" }, + { "name":"k_EDenySteamValidationStalled", "value":"14" }, + { "name":"k_EDenySteamOwnerLeftGuestUser", "value":"15" } + ] + }, + { + "enumname": "EBeginAuthSessionResult", + "values": [ + { "name":"k_EBeginAuthSessionResultOK", "value":"0" }, + { "name":"k_EBeginAuthSessionResultInvalidTicket", "value":"1" }, + { "name":"k_EBeginAuthSessionResultDuplicateRequest", "value":"2" }, + { "name":"k_EBeginAuthSessionResultInvalidVersion", "value":"3" }, + { "name":"k_EBeginAuthSessionResultGameMismatch", "value":"4" }, + { "name":"k_EBeginAuthSessionResultExpiredTicket", "value":"5" } + ] + }, + { + "enumname": "EAuthSessionResponse", + "values": [ + { "name":"k_EAuthSessionResponseOK", "value":"0" }, + { "name":"k_EAuthSessionResponseUserNotConnectedToSteam", "value":"1" }, + { "name":"k_EAuthSessionResponseNoLicenseOrExpired", "value":"2" }, + { "name":"k_EAuthSessionResponseVACBanned", "value":"3" }, + { "name":"k_EAuthSessionResponseLoggedInElseWhere", "value":"4" }, + { "name":"k_EAuthSessionResponseVACCheckTimedOut", "value":"5" }, + { "name":"k_EAuthSessionResponseAuthTicketCanceled", "value":"6" }, + { "name":"k_EAuthSessionResponseAuthTicketInvalidAlreadyUsed", "value":"7" }, + { "name":"k_EAuthSessionResponseAuthTicketInvalid", "value":"8" }, + { "name":"k_EAuthSessionResponsePublisherIssuedBan", "value":"9" }, + { "name":"k_EAuthSessionResponseAuthTicketNetworkIdentityFailure", "value":"10" } + ] + }, + { + "enumname": "EUserHasLicenseForAppResult", + "values": [ + { "name":"k_EUserHasLicenseResultHasLicense", "value":"0" }, + { "name":"k_EUserHasLicenseResultDoesNotHaveLicense", "value":"1" }, + { "name":"k_EUserHasLicenseResultNoAuth", "value":"2" } + ] + }, + { + "enumname": "EAccountType", + "values": [ + { "name":"k_EAccountTypeInvalid", "value":"0" }, + { "name":"k_EAccountTypeIndividual", "value":"1" }, + { "name":"k_EAccountTypeMultiseat", "value":"2" }, + { "name":"k_EAccountTypeGameServer", "value":"3" }, + { "name":"k_EAccountTypeAnonGameServer", "value":"4" }, + { "name":"k_EAccountTypePending", "value":"5" }, + { "name":"k_EAccountTypeContentServer", "value":"6" }, + { "name":"k_EAccountTypeClan", "value":"7" }, + { "name":"k_EAccountTypeChat", "value":"8" }, + { "name":"k_EAccountTypeConsoleUser", "value":"9" }, + { "name":"k_EAccountTypeAnonUser", "value":"10" }, + { "name":"k_EAccountTypeMax", "value":"11" } + ] + }, + { + "enumname": "EChatEntryType", + "values": [ + { "name":"k_EChatEntryTypeInvalid", "value":"0" }, + { "name":"k_EChatEntryTypeChatMsg", "value":"1" }, + { "name":"k_EChatEntryTypeTyping", "value":"2" }, + { "name":"k_EChatEntryTypeInviteGame", "value":"3" }, + { "name":"k_EChatEntryTypeEmote", "value":"4" }, + { "name":"k_EChatEntryTypeLeftConversation", "value":"6" }, + { "name":"k_EChatEntryTypeEntered", "value":"7" }, + { "name":"k_EChatEntryTypeWasKicked", "value":"8" }, + { "name":"k_EChatEntryTypeWasBanned", "value":"9" }, + { "name":"k_EChatEntryTypeDisconnected", "value":"10" }, + { "name":"k_EChatEntryTypeHistoricalChat", "value":"11" }, + { "name":"k_EChatEntryTypeLinkBlocked", "value":"14" } + ] + }, + { + "enumname": "EChatRoomEnterResponse", + "values": [ + { "name":"k_EChatRoomEnterResponseSuccess", "value":"1" }, + { "name":"k_EChatRoomEnterResponseDoesntExist", "value":"2" }, + { "name":"k_EChatRoomEnterResponseNotAllowed", "value":"3" }, + { "name":"k_EChatRoomEnterResponseFull", "value":"4" }, + { "name":"k_EChatRoomEnterResponseError", "value":"5" }, + { "name":"k_EChatRoomEnterResponseBanned", "value":"6" }, + { "name":"k_EChatRoomEnterResponseLimited", "value":"7" }, + { "name":"k_EChatRoomEnterResponseClanDisabled", "value":"8" }, + { "name":"k_EChatRoomEnterResponseCommunityBan", "value":"9" }, + { "name":"k_EChatRoomEnterResponseMemberBlockedYou", "value":"10" }, + { "name":"k_EChatRoomEnterResponseYouBlockedMember", "value":"11" }, + { "name":"k_EChatRoomEnterResponseRatelimitExceeded", "value":"15" } + ] + }, + { + "enumname": "EChatSteamIDInstanceFlags", + "values": [ + { "name":"k_EChatAccountInstanceMask", "value":"4095" }, + { "name":"k_EChatInstanceFlagClan", "value":"524288" }, + { "name":"k_EChatInstanceFlagLobby", "value":"262144" }, + { "name":"k_EChatInstanceFlagMMSLobby", "value":"131072" } + ] + }, + { + "enumname": "ENotificationPosition", + "values": [ + { "name":"k_EPositionInvalid", "value":"-1" }, + { "name":"k_EPositionTopLeft", "value":"0" }, + { "name":"k_EPositionTopRight", "value":"1" }, + { "name":"k_EPositionBottomLeft", "value":"2" }, + { "name":"k_EPositionBottomRight", "value":"3" } + ] + }, + { + "enumname": "EBroadcastUploadResult", + "values": [ + { "name":"k_EBroadcastUploadResultNone", "value":"0" }, + { "name":"k_EBroadcastUploadResultOK", "value":"1" }, + { "name":"k_EBroadcastUploadResultInitFailed", "value":"2" }, + { "name":"k_EBroadcastUploadResultFrameFailed", "value":"3" }, + { "name":"k_EBroadcastUploadResultTimeout", "value":"4" }, + { "name":"k_EBroadcastUploadResultBandwidthExceeded", "value":"5" }, + { "name":"k_EBroadcastUploadResultLowFPS", "value":"6" }, + { "name":"k_EBroadcastUploadResultMissingKeyFrames", "value":"7" }, + { "name":"k_EBroadcastUploadResultNoConnection", "value":"8" }, + { "name":"k_EBroadcastUploadResultRelayFailed", "value":"9" }, + { "name":"k_EBroadcastUploadResultSettingsChanged", "value":"10" }, + { "name":"k_EBroadcastUploadResultMissingAudio", "value":"11" }, + { "name":"k_EBroadcastUploadResultTooFarBehind", "value":"12" }, + { "name":"k_EBroadcastUploadResultTranscodeBehind", "value":"13" }, + { "name":"k_EBroadcastUploadResultNotAllowedToPlay", "value":"14" }, + { "name":"k_EBroadcastUploadResultBusy", "value":"15" }, + { "name":"k_EBroadcastUploadResultBanned", "value":"16" }, + { "name":"k_EBroadcastUploadResultAlreadyActive", "value":"17" }, + { "name":"k_EBroadcastUploadResultForcedOff", "value":"18" }, + { "name":"k_EBroadcastUploadResultAudioBehind", "value":"19" }, + { "name":"k_EBroadcastUploadResultShutdown", "value":"20" }, + { "name":"k_EBroadcastUploadResultDisconnect", "value":"21" }, + { "name":"k_EBroadcastUploadResultVideoInitFailed", "value":"22" }, + { "name":"k_EBroadcastUploadResultAudioInitFailed", "value":"23" } + ] + }, + { + "enumname": "EMarketNotAllowedReasonFlags", + "values": [ + { "name":"k_EMarketNotAllowedReason_None", "value":"0" }, + { "name":"k_EMarketNotAllowedReason_TemporaryFailure", "value":"1" }, + { "name":"k_EMarketNotAllowedReason_AccountDisabled", "value":"2" }, + { "name":"k_EMarketNotAllowedReason_AccountLockedDown", "value":"4" }, + { "name":"k_EMarketNotAllowedReason_AccountLimited", "value":"8" }, + { "name":"k_EMarketNotAllowedReason_TradeBanned", "value":"16" }, + { "name":"k_EMarketNotAllowedReason_AccountNotTrusted", "value":"32" }, + { "name":"k_EMarketNotAllowedReason_SteamGuardNotEnabled", "value":"64" }, + { "name":"k_EMarketNotAllowedReason_SteamGuardOnlyRecentlyEnabled", "value":"128" }, + { "name":"k_EMarketNotAllowedReason_RecentPasswordReset", "value":"256" }, + { "name":"k_EMarketNotAllowedReason_NewPaymentMethod", "value":"512" }, + { "name":"k_EMarketNotAllowedReason_InvalidCookie", "value":"1024" }, + { "name":"k_EMarketNotAllowedReason_UsingNewDevice", "value":"2048" }, + { "name":"k_EMarketNotAllowedReason_RecentSelfRefund", "value":"4096" }, + { "name":"k_EMarketNotAllowedReason_NewPaymentMethodCannotBeVerified", "value":"8192" }, + { "name":"k_EMarketNotAllowedReason_NoRecentPurchases", "value":"16384" }, + { "name":"k_EMarketNotAllowedReason_AcceptedWalletGift", "value":"32768" } + ] + }, + { + "enumname": "EDurationControlProgress", + "values": [ + { "name":"k_EDurationControlProgress_Full", "value":"0" }, + { "name":"k_EDurationControlProgress_Half", "value":"1" }, + { "name":"k_EDurationControlProgress_None", "value":"2" }, + { "name":"k_EDurationControl_ExitSoon_3h", "value":"3" }, + { "name":"k_EDurationControl_ExitSoon_5h", "value":"4" }, + { "name":"k_EDurationControl_ExitSoon_Night", "value":"5" } + ] + }, + { + "enumname": "EDurationControlNotification", + "values": [ + { "name":"k_EDurationControlNotification_None", "value":"0" }, + { "name":"k_EDurationControlNotification_1Hour", "value":"1" }, + { "name":"k_EDurationControlNotification_3Hours", "value":"2" }, + { "name":"k_EDurationControlNotification_HalfProgress", "value":"3" }, + { "name":"k_EDurationControlNotification_NoProgress", "value":"4" }, + { "name":"k_EDurationControlNotification_ExitSoon_3h", "value":"5" }, + { "name":"k_EDurationControlNotification_ExitSoon_5h", "value":"6" }, + { "name":"k_EDurationControlNotification_ExitSoon_Night", "value":"7" } + ] + }, + { + "enumname": "EDurationControlOnlineState", + "values": [ + { "name":"k_EDurationControlOnlineState_Invalid", "value":"0" }, + { "name":"k_EDurationControlOnlineState_Offline", "value":"1" }, + { "name":"k_EDurationControlOnlineState_Online", "value":"2" }, + { "name":"k_EDurationControlOnlineState_OnlineHighPri", "value":"3" } + ] + }, + { + "enumname": "EBetaBranchFlags", + "values": [ + { "name":"k_EBetaBranch_None", "value":"0" }, + { "name":"k_EBetaBranch_Default", "value":"1" }, + { "name":"k_EBetaBranch_Available", "value":"2" }, + { "name":"k_EBetaBranch_Private", "value":"4" }, + { "name":"k_EBetaBranch_Selected", "value":"8" }, + { "name":"k_EBetaBranch_Installed", "value":"16" } + ] + }, + { + "enumname": "EGameSearchErrorCode_t", + "values": [ + { "name":"k_EGameSearchErrorCode_OK", "value":"1" }, + { "name":"k_EGameSearchErrorCode_Failed_Search_Already_In_Progress", "value":"2" }, + { "name":"k_EGameSearchErrorCode_Failed_No_Search_In_Progress", "value":"3" }, + { "name":"k_EGameSearchErrorCode_Failed_Not_Lobby_Leader", "value":"4" }, + { "name":"k_EGameSearchErrorCode_Failed_No_Host_Available", "value":"5" }, + { "name":"k_EGameSearchErrorCode_Failed_Search_Params_Invalid", "value":"6" }, + { "name":"k_EGameSearchErrorCode_Failed_Offline", "value":"7" }, + { "name":"k_EGameSearchErrorCode_Failed_NotAuthorized", "value":"8" }, + { "name":"k_EGameSearchErrorCode_Failed_Unknown_Error", "value":"9" } + ] + }, + { + "enumname": "EPlayerResult_t", + "values": [ + { "name":"k_EPlayerResultFailedToConnect", "value":"1" }, + { "name":"k_EPlayerResultAbandoned", "value":"2" }, + { "name":"k_EPlayerResultKicked", "value":"3" }, + { "name":"k_EPlayerResultIncomplete", "value":"4" }, + { "name":"k_EPlayerResultCompleted", "value":"5" } + ] + }, + { + "enumname": "ESteamIPv6ConnectivityProtocol", + "values": [ + { "name":"k_ESteamIPv6ConnectivityProtocol_Invalid", "value":"0" }, + { "name":"k_ESteamIPv6ConnectivityProtocol_HTTP", "value":"1" }, + { "name":"k_ESteamIPv6ConnectivityProtocol_UDP", "value":"2" } + ] + }, + { + "enumname": "ESteamIPv6ConnectivityState", + "values": [ + { "name":"k_ESteamIPv6ConnectivityState_Unknown", "value":"0" }, + { "name":"k_ESteamIPv6ConnectivityState_Good", "value":"1" }, + { "name":"k_ESteamIPv6ConnectivityState_Bad", "value":"2" } + ] + }, + { + "enumname": "EFriendRelationship", + "values": [ + { "name":"k_EFriendRelationshipNone", "value":"0" }, + { "name":"k_EFriendRelationshipBlocked", "value":"1" }, + { "name":"k_EFriendRelationshipRequestRecipient", "value":"2" }, + { "name":"k_EFriendRelationshipFriend", "value":"3" }, + { "name":"k_EFriendRelationshipRequestInitiator", "value":"4" }, + { "name":"k_EFriendRelationshipIgnored", "value":"5" }, + { "name":"k_EFriendRelationshipIgnoredFriend", "value":"6" }, + { "name":"k_EFriendRelationshipSuggested_DEPRECATED", "value":"7" }, + { "name":"k_EFriendRelationshipMax", "value":"8" } + ] + }, + { + "enumname": "EPersonaState", + "values": [ + { "name":"k_EPersonaStateOffline", "value":"0" }, + { "name":"k_EPersonaStateOnline", "value":"1" }, + { "name":"k_EPersonaStateBusy", "value":"2" }, + { "name":"k_EPersonaStateAway", "value":"3" }, + { "name":"k_EPersonaStateSnooze", "value":"4" }, + { "name":"k_EPersonaStateLookingToTrade", "value":"5" }, + { "name":"k_EPersonaStateLookingToPlay", "value":"6" }, + { "name":"k_EPersonaStateInvisible", "value":"7" }, + { "name":"k_EPersonaStateMax", "value":"8" } + ] + }, + { + "enumname": "EFriendFlags", + "values": [ + { "name":"k_EFriendFlagNone", "value":"0" }, + { "name":"k_EFriendFlagBlocked", "value":"1" }, + { "name":"k_EFriendFlagFriendshipRequested", "value":"2" }, + { "name":"k_EFriendFlagImmediate", "value":"4" }, + { "name":"k_EFriendFlagClanMember", "value":"8" }, + { "name":"k_EFriendFlagOnGameServer", "value":"16" }, + { "name":"k_EFriendFlagRequestingFriendship", "value":"128" }, + { "name":"k_EFriendFlagRequestingInfo", "value":"256" }, + { "name":"k_EFriendFlagIgnored", "value":"512" }, + { "name":"k_EFriendFlagIgnoredFriend", "value":"1024" }, + { "name":"k_EFriendFlagChatMember", "value":"4096" }, + { "name":"k_EFriendFlagAll", "value":"65535" } + ] + }, + { + "enumname": "EOverlayToStoreFlag", + "values": [ + { "name":"k_EOverlayToStoreFlag_None", "value":"0" }, + { "name":"k_EOverlayToStoreFlag_AddToCart", "value":"1" }, + { "name":"k_EOverlayToStoreFlag_AddToCartAndShow", "value":"2" } + ] + }, + { + "enumname": "EActivateGameOverlayToWebPageMode", + "values": [ + { "name":"k_EActivateGameOverlayToWebPageMode_Default", "value":"0" }, + { "name":"k_EActivateGameOverlayToWebPageMode_Modal", "value":"1" } + ] + }, + { + "enumname": "ECommunityProfileItemType", + "values": [ + { "name":"k_ECommunityProfileItemType_AnimatedAvatar", "value":"0" }, + { "name":"k_ECommunityProfileItemType_AvatarFrame", "value":"1" }, + { "name":"k_ECommunityProfileItemType_ProfileModifier", "value":"2" }, + { "name":"k_ECommunityProfileItemType_ProfileBackground", "value":"3" }, + { "name":"k_ECommunityProfileItemType_MiniProfileBackground", "value":"4" } + ] + }, + { + "enumname": "ECommunityProfileItemProperty", + "values": [ + { "name":"k_ECommunityProfileItemProperty_ImageSmall", "value":"0" }, + { "name":"k_ECommunityProfileItemProperty_ImageLarge", "value":"1" }, + { "name":"k_ECommunityProfileItemProperty_InternalName", "value":"2" }, + { "name":"k_ECommunityProfileItemProperty_Title", "value":"3" }, + { "name":"k_ECommunityProfileItemProperty_Description", "value":"4" }, + { "name":"k_ECommunityProfileItemProperty_AppID", "value":"5" }, + { "name":"k_ECommunityProfileItemProperty_TypeID", "value":"6" }, + { "name":"k_ECommunityProfileItemProperty_Class", "value":"7" }, + { "name":"k_ECommunityProfileItemProperty_MovieWebM", "value":"8" }, + { "name":"k_ECommunityProfileItemProperty_MovieMP4", "value":"9" }, + { "name":"k_ECommunityProfileItemProperty_MovieWebMSmall", "value":"10" }, + { "name":"k_ECommunityProfileItemProperty_MovieMP4Small", "value":"11" } + ] + }, + { + "enumname": "EPersonaChange", + "values": [ + { "name":"k_EPersonaChangeName", "value":"1" }, + { "name":"k_EPersonaChangeStatus", "value":"2" }, + { "name":"k_EPersonaChangeComeOnline", "value":"4" }, + { "name":"k_EPersonaChangeGoneOffline", "value":"8" }, + { "name":"k_EPersonaChangeGamePlayed", "value":"16" }, + { "name":"k_EPersonaChangeGameServer", "value":"32" }, + { "name":"k_EPersonaChangeAvatar", "value":"64" }, + { "name":"k_EPersonaChangeJoinedSource", "value":"128" }, + { "name":"k_EPersonaChangeLeftSource", "value":"256" }, + { "name":"k_EPersonaChangeRelationshipChanged", "value":"512" }, + { "name":"k_EPersonaChangeNameFirstSet", "value":"1024" }, + { "name":"k_EPersonaChangeBroadcast", "value":"2048" }, + { "name":"k_EPersonaChangeNickname", "value":"4096" }, + { "name":"k_EPersonaChangeSteamLevel", "value":"8192" }, + { "name":"k_EPersonaChangeRichPresence", "value":"16384" } + ] + }, + { + "enumname": "ESteamAPICallFailure", + "values": [ + { "name":"k_ESteamAPICallFailureNone", "value":"-1" }, + { "name":"k_ESteamAPICallFailureSteamGone", "value":"0" }, + { "name":"k_ESteamAPICallFailureNetworkFailure", "value":"1" }, + { "name":"k_ESteamAPICallFailureInvalidHandle", "value":"2" }, + { "name":"k_ESteamAPICallFailureMismatchedCallback", "value":"3" } + ] + }, + { + "enumname": "EGamepadTextInputMode", + "values": [ + { "name":"k_EGamepadTextInputModeNormal", "value":"0" }, + { "name":"k_EGamepadTextInputModePassword", "value":"1" } + ] + }, + { + "enumname": "EGamepadTextInputLineMode", + "values": [ + { "name":"k_EGamepadTextInputLineModeSingleLine", "value":"0" }, + { "name":"k_EGamepadTextInputLineModeMultipleLines", "value":"1" } + ] + }, + { + "enumname": "EFloatingGamepadTextInputMode", + "values": [ + { "name":"k_EFloatingGamepadTextInputModeModeSingleLine", "value":"0" }, + { "name":"k_EFloatingGamepadTextInputModeModeMultipleLines", "value":"1" }, + { "name":"k_EFloatingGamepadTextInputModeModeEmail", "value":"2" }, + { "name":"k_EFloatingGamepadTextInputModeModeNumeric", "value":"3" } + ] + }, + { + "enumname": "ETextFilteringContext", + "values": [ + { "name":"k_ETextFilteringContextUnknown", "value":"0" }, + { "name":"k_ETextFilteringContextGameContent", "value":"1" }, + { "name":"k_ETextFilteringContextChat", "value":"2" }, + { "name":"k_ETextFilteringContextName", "value":"3" } + ] + }, + { + "enumname": "ECheckFileSignature", + "values": [ + { "name":"k_ECheckFileSignatureInvalidSignature", "value":"0" }, + { "name":"k_ECheckFileSignatureValidSignature", "value":"1" }, + { "name":"k_ECheckFileSignatureFileNotFound", "value":"2" }, + { "name":"k_ECheckFileSignatureNoSignaturesFoundForThisApp", "value":"3" }, + { "name":"k_ECheckFileSignatureNoSignaturesFoundForThisFile", "value":"4" } + ] + }, + { + "enumname": "EMatchMakingServerResponse", + "values": [ + { "name":"eServerResponded", "value":"0" }, + { "name":"eServerFailedToRespond", "value":"1" }, + { "name":"eNoServersListedOnMasterServer", "value":"2" } + ] + }, + { + "enumname": "ELobbyType", + "values": [ + { "name":"k_ELobbyTypePrivate", "value":"0" }, + { "name":"k_ELobbyTypeFriendsOnly", "value":"1" }, + { "name":"k_ELobbyTypePublic", "value":"2" }, + { "name":"k_ELobbyTypeInvisible", "value":"3" }, + { "name":"k_ELobbyTypePrivateUnique", "value":"4" } + ] + }, + { + "enumname": "ELobbyComparison", + "values": [ + { "name":"k_ELobbyComparisonEqualToOrLessThan", "value":"-2" }, + { "name":"k_ELobbyComparisonLessThan", "value":"-1" }, + { "name":"k_ELobbyComparisonEqual", "value":"0" }, + { "name":"k_ELobbyComparisonGreaterThan", "value":"1" }, + { "name":"k_ELobbyComparisonEqualToOrGreaterThan", "value":"2" }, + { "name":"k_ELobbyComparisonNotEqual", "value":"3" } + ] + }, + { + "enumname": "ELobbyDistanceFilter", + "values": [ + { "name":"k_ELobbyDistanceFilterClose", "value":"0" }, + { "name":"k_ELobbyDistanceFilterDefault", "value":"1" }, + { "name":"k_ELobbyDistanceFilterFar", "value":"2" }, + { "name":"k_ELobbyDistanceFilterWorldwide", "value":"3" } + ] + }, + { + "enumname": "EChatMemberStateChange", + "values": [ + { "name":"k_EChatMemberStateChangeEntered", "value":"1" }, + { "name":"k_EChatMemberStateChangeLeft", "value":"2" }, + { "name":"k_EChatMemberStateChangeDisconnected", "value":"4" }, + { "name":"k_EChatMemberStateChangeKicked", "value":"8" }, + { "name":"k_EChatMemberStateChangeBanned", "value":"16" } + ] + }, + { + "enumname": "ESteamPartyBeaconLocationType", + "values": [ + { "name":"k_ESteamPartyBeaconLocationType_Invalid", "value":"0" }, + { "name":"k_ESteamPartyBeaconLocationType_ChatGroup", "value":"1" }, + { "name":"k_ESteamPartyBeaconLocationType_Max", "value":"2" } + ] + }, + { + "enumname": "ESteamPartyBeaconLocationData", + "values": [ + { "name":"k_ESteamPartyBeaconLocationDataInvalid", "value":"0" }, + { "name":"k_ESteamPartyBeaconLocationDataName", "value":"1" }, + { "name":"k_ESteamPartyBeaconLocationDataIconURLSmall", "value":"2" }, + { "name":"k_ESteamPartyBeaconLocationDataIconURLMedium", "value":"3" }, + { "name":"k_ESteamPartyBeaconLocationDataIconURLLarge", "value":"4" } + ] + }, + { + "enumname": "ERemoteStoragePlatform", + "values": [ + { "name":"k_ERemoteStoragePlatformNone", "value":"0" }, + { "name":"k_ERemoteStoragePlatformWindows", "value":"1" }, + { "name":"k_ERemoteStoragePlatformOSX", "value":"2" }, + { "name":"k_ERemoteStoragePlatformPS3", "value":"4" }, + { "name":"k_ERemoteStoragePlatformLinux", "value":"8" }, + { "name":"k_ERemoteStoragePlatformSwitch", "value":"16" }, + { "name":"k_ERemoteStoragePlatformAndroid", "value":"32" }, + { "name":"k_ERemoteStoragePlatformIOS", "value":"64" }, + { "name":"k_ERemoteStoragePlatformAll", "value":"-1" } + ] + }, + { + "enumname": "ERemoteStoragePublishedFileVisibility", + "values": [ + { "name":"k_ERemoteStoragePublishedFileVisibilityPublic", "value":"0" }, + { "name":"k_ERemoteStoragePublishedFileVisibilityFriendsOnly", "value":"1" }, + { "name":"k_ERemoteStoragePublishedFileVisibilityPrivate", "value":"2" }, + { "name":"k_ERemoteStoragePublishedFileVisibilityUnlisted", "value":"3" } + ] + }, + { + "enumname": "EWorkshopFileType", + "values": [ + { "name":"k_EWorkshopFileTypeFirst", "value":"0" }, + { "name":"k_EWorkshopFileTypeCommunity", "value":"0" }, + { "name":"k_EWorkshopFileTypeMicrotransaction", "value":"1" }, + { "name":"k_EWorkshopFileTypeCollection", "value":"2" }, + { "name":"k_EWorkshopFileTypeArt", "value":"3" }, + { "name":"k_EWorkshopFileTypeVideo", "value":"4" }, + { "name":"k_EWorkshopFileTypeScreenshot", "value":"5" }, + { "name":"k_EWorkshopFileTypeGame", "value":"6" }, + { "name":"k_EWorkshopFileTypeSoftware", "value":"7" }, + { "name":"k_EWorkshopFileTypeConcept", "value":"8" }, + { "name":"k_EWorkshopFileTypeWebGuide", "value":"9" }, + { "name":"k_EWorkshopFileTypeIntegratedGuide", "value":"10" }, + { "name":"k_EWorkshopFileTypeMerch", "value":"11" }, + { "name":"k_EWorkshopFileTypeControllerBinding", "value":"12" }, + { "name":"k_EWorkshopFileTypeSteamworksAccessInvite", "value":"13" }, + { "name":"k_EWorkshopFileTypeSteamVideo", "value":"14" }, + { "name":"k_EWorkshopFileTypeGameManagedItem", "value":"15" }, + { "name":"k_EWorkshopFileTypeClip", "value":"16" }, + { "name":"k_EWorkshopFileTypeMax", "value":"17" } + ] + }, + { + "enumname": "EWorkshopVote", + "values": [ + { "name":"k_EWorkshopVoteUnvoted", "value":"0" }, + { "name":"k_EWorkshopVoteFor", "value":"1" }, + { "name":"k_EWorkshopVoteAgainst", "value":"2" }, + { "name":"k_EWorkshopVoteLater", "value":"3" } + ] + }, + { + "enumname": "EWorkshopFileAction", + "values": [ + { "name":"k_EWorkshopFileActionPlayed", "value":"0" }, + { "name":"k_EWorkshopFileActionCompleted", "value":"1" } + ] + }, + { + "enumname": "EWorkshopEnumerationType", + "values": [ + { "name":"k_EWorkshopEnumerationTypeRankedByVote", "value":"0" }, + { "name":"k_EWorkshopEnumerationTypeRecent", "value":"1" }, + { "name":"k_EWorkshopEnumerationTypeTrending", "value":"2" }, + { "name":"k_EWorkshopEnumerationTypeFavoritesOfFriends", "value":"3" }, + { "name":"k_EWorkshopEnumerationTypeVotedByFriends", "value":"4" }, + { "name":"k_EWorkshopEnumerationTypeContentByFriends", "value":"5" }, + { "name":"k_EWorkshopEnumerationTypeRecentFromFollowedUsers", "value":"6" } + ] + }, + { + "enumname": "EWorkshopVideoProvider", + "values": [ + { "name":"k_EWorkshopVideoProviderNone", "value":"0" }, + { "name":"k_EWorkshopVideoProviderYoutube", "value":"1" } + ] + }, + { + "enumname": "EUGCReadAction", + "values": [ + { "name":"k_EUGCRead_ContinueReadingUntilFinished", "value":"0" }, + { "name":"k_EUGCRead_ContinueReading", "value":"1" }, + { "name":"k_EUGCRead_Close", "value":"2" } + ] + }, + { + "enumname": "ERemoteStorageLocalFileChange", + "values": [ + { "name":"k_ERemoteStorageLocalFileChange_Invalid", "value":"0" }, + { "name":"k_ERemoteStorageLocalFileChange_FileUpdated", "value":"1" }, + { "name":"k_ERemoteStorageLocalFileChange_FileDeleted", "value":"2" } + ] + }, + { + "enumname": "ERemoteStorageFilePathType", + "values": [ + { "name":"k_ERemoteStorageFilePathType_Invalid", "value":"0" }, + { "name":"k_ERemoteStorageFilePathType_Absolute", "value":"1" }, + { "name":"k_ERemoteStorageFilePathType_APIFilename", "value":"2" } + ] + }, + { + "enumname": "ELeaderboardDataRequest", + "values": [ + { "name":"k_ELeaderboardDataRequestGlobal", "value":"0" }, + { "name":"k_ELeaderboardDataRequestGlobalAroundUser", "value":"1" }, + { "name":"k_ELeaderboardDataRequestFriends", "value":"2" }, + { "name":"k_ELeaderboardDataRequestUsers", "value":"3" } + ] + }, + { + "enumname": "ELeaderboardSortMethod", + "values": [ + { "name":"k_ELeaderboardSortMethodNone", "value":"0" }, + { "name":"k_ELeaderboardSortMethodAscending", "value":"1" }, + { "name":"k_ELeaderboardSortMethodDescending", "value":"2" } + ] + }, + { + "enumname": "ELeaderboardDisplayType", + "values": [ + { "name":"k_ELeaderboardDisplayTypeNone", "value":"0" }, + { "name":"k_ELeaderboardDisplayTypeNumeric", "value":"1" }, + { "name":"k_ELeaderboardDisplayTypeTimeSeconds", "value":"2" }, + { "name":"k_ELeaderboardDisplayTypeTimeMilliSeconds", "value":"3" } + ] + }, + { + "enumname": "ELeaderboardUploadScoreMethod", + "values": [ + { "name":"k_ELeaderboardUploadScoreMethodNone", "value":"0" }, + { "name":"k_ELeaderboardUploadScoreMethodKeepBest", "value":"1" }, + { "name":"k_ELeaderboardUploadScoreMethodForceUpdate", "value":"2" } + ] + }, + { + "enumname": "EP2PSessionError", + "values": [ + { "name":"k_EP2PSessionErrorNone", "value":"0" }, + { "name":"k_EP2PSessionErrorNoRightsToApp", "value":"2" }, + { "name":"k_EP2PSessionErrorTimeout", "value":"4" }, + { "name":"k_EP2PSessionErrorNotRunningApp_DELETED", "value":"1" }, + { "name":"k_EP2PSessionErrorDestinationNotLoggedIn_DELETED", "value":"3" }, + { "name":"k_EP2PSessionErrorMax", "value":"5" } + ] + }, + { + "enumname": "EP2PSend", + "values": [ + { "name":"k_EP2PSendUnreliable", "value":"0" }, + { "name":"k_EP2PSendUnreliableNoDelay", "value":"1" }, + { "name":"k_EP2PSendReliable", "value":"2" }, + { "name":"k_EP2PSendReliableWithBuffering", "value":"3" } + ] + }, + { + "enumname": "ESNetSocketState", + "values": [ + { "name":"k_ESNetSocketStateInvalid", "value":"0" }, + { "name":"k_ESNetSocketStateConnected", "value":"1" }, + { "name":"k_ESNetSocketStateInitiated", "value":"10" }, + { "name":"k_ESNetSocketStateLocalCandidatesFound", "value":"11" }, + { "name":"k_ESNetSocketStateReceivedRemoteCandidates", "value":"12" }, + { "name":"k_ESNetSocketStateChallengeHandshake", "value":"15" }, + { "name":"k_ESNetSocketStateDisconnecting", "value":"21" }, + { "name":"k_ESNetSocketStateLocalDisconnect", "value":"22" }, + { "name":"k_ESNetSocketStateTimeoutDuringConnect", "value":"23" }, + { "name":"k_ESNetSocketStateRemoteEndDisconnected", "value":"24" }, + { "name":"k_ESNetSocketStateConnectionBroken", "value":"25" } + ] + }, + { + "enumname": "ESNetSocketConnectionType", + "values": [ + { "name":"k_ESNetSocketConnectionTypeNotConnected", "value":"0" }, + { "name":"k_ESNetSocketConnectionTypeUDP", "value":"1" }, + { "name":"k_ESNetSocketConnectionTypeUDPRelay", "value":"2" } + ] + }, + { + "enumname": "EVRScreenshotType", + "values": [ + { "name":"k_EVRScreenshotType_None", "value":"0" }, + { "name":"k_EVRScreenshotType_Mono", "value":"1" }, + { "name":"k_EVRScreenshotType_Stereo", "value":"2" }, + { "name":"k_EVRScreenshotType_MonoCubemap", "value":"3" }, + { "name":"k_EVRScreenshotType_MonoPanorama", "value":"4" }, + { "name":"k_EVRScreenshotType_StereoPanorama", "value":"5" } + ] + }, + { + "enumname": "AudioPlayback_Status", + "values": [ + { "name":"AudioPlayback_Undefined", "value":"0" }, + { "name":"AudioPlayback_Playing", "value":"1" }, + { "name":"AudioPlayback_Paused", "value":"2" }, + { "name":"AudioPlayback_Idle", "value":"3" } + ] + }, + { + "enumname": "EHTTPMethod", + "values": [ + { "name":"k_EHTTPMethodInvalid", "value":"0" }, + { "name":"k_EHTTPMethodGET", "value":"1" }, + { "name":"k_EHTTPMethodHEAD", "value":"2" }, + { "name":"k_EHTTPMethodPOST", "value":"3" }, + { "name":"k_EHTTPMethodPUT", "value":"4" }, + { "name":"k_EHTTPMethodDELETE", "value":"5" }, + { "name":"k_EHTTPMethodOPTIONS", "value":"6" }, + { "name":"k_EHTTPMethodPATCH", "value":"7" } + ] + }, + { + "enumname": "EHTTPStatusCode", + "values": [ + { "name":"k_EHTTPStatusCodeInvalid", "value":"0" }, + { "name":"k_EHTTPStatusCode100Continue", "value":"100" }, + { "name":"k_EHTTPStatusCode101SwitchingProtocols", "value":"101" }, + { "name":"k_EHTTPStatusCode200OK", "value":"200" }, + { "name":"k_EHTTPStatusCode201Created", "value":"201" }, + { "name":"k_EHTTPStatusCode202Accepted", "value":"202" }, + { "name":"k_EHTTPStatusCode203NonAuthoritative", "value":"203" }, + { "name":"k_EHTTPStatusCode204NoContent", "value":"204" }, + { "name":"k_EHTTPStatusCode205ResetContent", "value":"205" }, + { "name":"k_EHTTPStatusCode206PartialContent", "value":"206" }, + { "name":"k_EHTTPStatusCode300MultipleChoices", "value":"300" }, + { "name":"k_EHTTPStatusCode301MovedPermanently", "value":"301" }, + { "name":"k_EHTTPStatusCode302Found", "value":"302" }, + { "name":"k_EHTTPStatusCode303SeeOther", "value":"303" }, + { "name":"k_EHTTPStatusCode304NotModified", "value":"304" }, + { "name":"k_EHTTPStatusCode305UseProxy", "value":"305" }, + { "name":"k_EHTTPStatusCode307TemporaryRedirect", "value":"307" }, + { "name":"k_EHTTPStatusCode308PermanentRedirect", "value":"308" }, + { "name":"k_EHTTPStatusCode400BadRequest", "value":"400" }, + { "name":"k_EHTTPStatusCode401Unauthorized", "value":"401" }, + { "name":"k_EHTTPStatusCode402PaymentRequired", "value":"402" }, + { "name":"k_EHTTPStatusCode403Forbidden", "value":"403" }, + { "name":"k_EHTTPStatusCode404NotFound", "value":"404" }, + { "name":"k_EHTTPStatusCode405MethodNotAllowed", "value":"405" }, + { "name":"k_EHTTPStatusCode406NotAcceptable", "value":"406" }, + { "name":"k_EHTTPStatusCode407ProxyAuthRequired", "value":"407" }, + { "name":"k_EHTTPStatusCode408RequestTimeout", "value":"408" }, + { "name":"k_EHTTPStatusCode409Conflict", "value":"409" }, + { "name":"k_EHTTPStatusCode410Gone", "value":"410" }, + { "name":"k_EHTTPStatusCode411LengthRequired", "value":"411" }, + { "name":"k_EHTTPStatusCode412PreconditionFailed", "value":"412" }, + { "name":"k_EHTTPStatusCode413RequestEntityTooLarge", "value":"413" }, + { "name":"k_EHTTPStatusCode414RequestURITooLong", "value":"414" }, + { "name":"k_EHTTPStatusCode415UnsupportedMediaType", "value":"415" }, + { "name":"k_EHTTPStatusCode416RequestedRangeNotSatisfiable", "value":"416" }, + { "name":"k_EHTTPStatusCode417ExpectationFailed", "value":"417" }, + { "name":"k_EHTTPStatusCode4xxUnknown", "value":"418" }, + { "name":"k_EHTTPStatusCode429TooManyRequests", "value":"429" }, + { "name":"k_EHTTPStatusCode444ConnectionClosed", "value":"444" }, + { "name":"k_EHTTPStatusCode500InternalServerError", "value":"500" }, + { "name":"k_EHTTPStatusCode501NotImplemented", "value":"501" }, + { "name":"k_EHTTPStatusCode502BadGateway", "value":"502" }, + { "name":"k_EHTTPStatusCode503ServiceUnavailable", "value":"503" }, + { "name":"k_EHTTPStatusCode504GatewayTimeout", "value":"504" }, + { "name":"k_EHTTPStatusCode505HTTPVersionNotSupported", "value":"505" }, + { "name":"k_EHTTPStatusCode5xxUnknown", "value":"599" } + ] + }, + { + "enumname": "EInputSourceMode", + "values": [ + { "name":"k_EInputSourceMode_None", "value":"0" }, + { "name":"k_EInputSourceMode_Dpad", "value":"1" }, + { "name":"k_EInputSourceMode_Buttons", "value":"2" }, + { "name":"k_EInputSourceMode_FourButtons", "value":"3" }, + { "name":"k_EInputSourceMode_AbsoluteMouse", "value":"4" }, + { "name":"k_EInputSourceMode_RelativeMouse", "value":"5" }, + { "name":"k_EInputSourceMode_JoystickMove", "value":"6" }, + { "name":"k_EInputSourceMode_JoystickMouse", "value":"7" }, + { "name":"k_EInputSourceMode_JoystickCamera", "value":"8" }, + { "name":"k_EInputSourceMode_ScrollWheel", "value":"9" }, + { "name":"k_EInputSourceMode_Trigger", "value":"10" }, + { "name":"k_EInputSourceMode_TouchMenu", "value":"11" }, + { "name":"k_EInputSourceMode_MouseJoystick", "value":"12" }, + { "name":"k_EInputSourceMode_MouseRegion", "value":"13" }, + { "name":"k_EInputSourceMode_RadialMenu", "value":"14" }, + { "name":"k_EInputSourceMode_SingleButton", "value":"15" }, + { "name":"k_EInputSourceMode_Switches", "value":"16" } + ] + }, + { + "enumname": "EInputActionOrigin", + "values": [ + { "name":"k_EInputActionOrigin_None", "value":"0" }, + { "name":"k_EInputActionOrigin_SteamController_A", "value":"1" }, + { "name":"k_EInputActionOrigin_SteamController_B", "value":"2" }, + { "name":"k_EInputActionOrigin_SteamController_X", "value":"3" }, + { "name":"k_EInputActionOrigin_SteamController_Y", "value":"4" }, + { "name":"k_EInputActionOrigin_SteamController_LeftBumper", "value":"5" }, + { "name":"k_EInputActionOrigin_SteamController_RightBumper", "value":"6" }, + { "name":"k_EInputActionOrigin_SteamController_LeftGrip", "value":"7" }, + { "name":"k_EInputActionOrigin_SteamController_RightGrip", "value":"8" }, + { "name":"k_EInputActionOrigin_SteamController_Start", "value":"9" }, + { "name":"k_EInputActionOrigin_SteamController_Back", "value":"10" }, + { "name":"k_EInputActionOrigin_SteamController_LeftPad_Touch", "value":"11" }, + { "name":"k_EInputActionOrigin_SteamController_LeftPad_Swipe", "value":"12" }, + { "name":"k_EInputActionOrigin_SteamController_LeftPad_Click", "value":"13" }, + { "name":"k_EInputActionOrigin_SteamController_LeftPad_DPadNorth", "value":"14" }, + { "name":"k_EInputActionOrigin_SteamController_LeftPad_DPadSouth", "value":"15" }, + { "name":"k_EInputActionOrigin_SteamController_LeftPad_DPadWest", "value":"16" }, + { "name":"k_EInputActionOrigin_SteamController_LeftPad_DPadEast", "value":"17" }, + { "name":"k_EInputActionOrigin_SteamController_RightPad_Touch", "value":"18" }, + { "name":"k_EInputActionOrigin_SteamController_RightPad_Swipe", "value":"19" }, + { "name":"k_EInputActionOrigin_SteamController_RightPad_Click", "value":"20" }, + { "name":"k_EInputActionOrigin_SteamController_RightPad_DPadNorth", "value":"21" }, + { "name":"k_EInputActionOrigin_SteamController_RightPad_DPadSouth", "value":"22" }, + { "name":"k_EInputActionOrigin_SteamController_RightPad_DPadWest", "value":"23" }, + { "name":"k_EInputActionOrigin_SteamController_RightPad_DPadEast", "value":"24" }, + { "name":"k_EInputActionOrigin_SteamController_LeftTrigger_Pull", "value":"25" }, + { "name":"k_EInputActionOrigin_SteamController_LeftTrigger_Click", "value":"26" }, + { "name":"k_EInputActionOrigin_SteamController_RightTrigger_Pull", "value":"27" }, + { "name":"k_EInputActionOrigin_SteamController_RightTrigger_Click", "value":"28" }, + { "name":"k_EInputActionOrigin_SteamController_LeftStick_Move", "value":"29" }, + { "name":"k_EInputActionOrigin_SteamController_LeftStick_Click", "value":"30" }, + { "name":"k_EInputActionOrigin_SteamController_LeftStick_DPadNorth", "value":"31" }, + { "name":"k_EInputActionOrigin_SteamController_LeftStick_DPadSouth", "value":"32" }, + { "name":"k_EInputActionOrigin_SteamController_LeftStick_DPadWest", "value":"33" }, + { "name":"k_EInputActionOrigin_SteamController_LeftStick_DPadEast", "value":"34" }, + { "name":"k_EInputActionOrigin_SteamController_Gyro_Move", "value":"35" }, + { "name":"k_EInputActionOrigin_SteamController_Gyro_Pitch", "value":"36" }, + { "name":"k_EInputActionOrigin_SteamController_Gyro_Yaw", "value":"37" }, + { "name":"k_EInputActionOrigin_SteamController_Gyro_Roll", "value":"38" }, + { "name":"k_EInputActionOrigin_SteamController_Reserved0", "value":"39" }, + { "name":"k_EInputActionOrigin_SteamController_Reserved1", "value":"40" }, + { "name":"k_EInputActionOrigin_SteamController_Reserved2", "value":"41" }, + { "name":"k_EInputActionOrigin_SteamController_Reserved3", "value":"42" }, + { "name":"k_EInputActionOrigin_SteamController_Reserved4", "value":"43" }, + { "name":"k_EInputActionOrigin_SteamController_Reserved5", "value":"44" }, + { "name":"k_EInputActionOrigin_SteamController_Reserved6", "value":"45" }, + { "name":"k_EInputActionOrigin_SteamController_Reserved7", "value":"46" }, + { "name":"k_EInputActionOrigin_SteamController_Reserved8", "value":"47" }, + { "name":"k_EInputActionOrigin_SteamController_Reserved9", "value":"48" }, + { "name":"k_EInputActionOrigin_SteamController_Reserved10", "value":"49" }, + { "name":"k_EInputActionOrigin_PS4_X", "value":"50" }, + { "name":"k_EInputActionOrigin_PS4_Circle", "value":"51" }, + { "name":"k_EInputActionOrigin_PS4_Triangle", "value":"52" }, + { "name":"k_EInputActionOrigin_PS4_Square", "value":"53" }, + { "name":"k_EInputActionOrigin_PS4_LeftBumper", "value":"54" }, + { "name":"k_EInputActionOrigin_PS4_RightBumper", "value":"55" }, + { "name":"k_EInputActionOrigin_PS4_Options", "value":"56" }, + { "name":"k_EInputActionOrigin_PS4_Share", "value":"57" }, + { "name":"k_EInputActionOrigin_PS4_LeftPad_Touch", "value":"58" }, + { "name":"k_EInputActionOrigin_PS4_LeftPad_Swipe", "value":"59" }, + { "name":"k_EInputActionOrigin_PS4_LeftPad_Click", "value":"60" }, + { "name":"k_EInputActionOrigin_PS4_LeftPad_DPadNorth", "value":"61" }, + { "name":"k_EInputActionOrigin_PS4_LeftPad_DPadSouth", "value":"62" }, + { "name":"k_EInputActionOrigin_PS4_LeftPad_DPadWest", "value":"63" }, + { "name":"k_EInputActionOrigin_PS4_LeftPad_DPadEast", "value":"64" }, + { "name":"k_EInputActionOrigin_PS4_RightPad_Touch", "value":"65" }, + { "name":"k_EInputActionOrigin_PS4_RightPad_Swipe", "value":"66" }, + { "name":"k_EInputActionOrigin_PS4_RightPad_Click", "value":"67" }, + { "name":"k_EInputActionOrigin_PS4_RightPad_DPadNorth", "value":"68" }, + { "name":"k_EInputActionOrigin_PS4_RightPad_DPadSouth", "value":"69" }, + { "name":"k_EInputActionOrigin_PS4_RightPad_DPadWest", "value":"70" }, + { "name":"k_EInputActionOrigin_PS4_RightPad_DPadEast", "value":"71" }, + { "name":"k_EInputActionOrigin_PS4_CenterPad_Touch", "value":"72" }, + { "name":"k_EInputActionOrigin_PS4_CenterPad_Swipe", "value":"73" }, + { "name":"k_EInputActionOrigin_PS4_CenterPad_Click", "value":"74" }, + { "name":"k_EInputActionOrigin_PS4_CenterPad_DPadNorth", "value":"75" }, + { "name":"k_EInputActionOrigin_PS4_CenterPad_DPadSouth", "value":"76" }, + { "name":"k_EInputActionOrigin_PS4_CenterPad_DPadWest", "value":"77" }, + { "name":"k_EInputActionOrigin_PS4_CenterPad_DPadEast", "value":"78" }, + { "name":"k_EInputActionOrigin_PS4_LeftTrigger_Pull", "value":"79" }, + { "name":"k_EInputActionOrigin_PS4_LeftTrigger_Click", "value":"80" }, + { "name":"k_EInputActionOrigin_PS4_RightTrigger_Pull", "value":"81" }, + { "name":"k_EInputActionOrigin_PS4_RightTrigger_Click", "value":"82" }, + { "name":"k_EInputActionOrigin_PS4_LeftStick_Move", "value":"83" }, + { "name":"k_EInputActionOrigin_PS4_LeftStick_Click", "value":"84" }, + { "name":"k_EInputActionOrigin_PS4_LeftStick_DPadNorth", "value":"85" }, + { "name":"k_EInputActionOrigin_PS4_LeftStick_DPadSouth", "value":"86" }, + { "name":"k_EInputActionOrigin_PS4_LeftStick_DPadWest", "value":"87" }, + { "name":"k_EInputActionOrigin_PS4_LeftStick_DPadEast", "value":"88" }, + { "name":"k_EInputActionOrigin_PS4_RightStick_Move", "value":"89" }, + { "name":"k_EInputActionOrigin_PS4_RightStick_Click", "value":"90" }, + { "name":"k_EInputActionOrigin_PS4_RightStick_DPadNorth", "value":"91" }, + { "name":"k_EInputActionOrigin_PS4_RightStick_DPadSouth", "value":"92" }, + { "name":"k_EInputActionOrigin_PS4_RightStick_DPadWest", "value":"93" }, + { "name":"k_EInputActionOrigin_PS4_RightStick_DPadEast", "value":"94" }, + { "name":"k_EInputActionOrigin_PS4_DPad_North", "value":"95" }, + { "name":"k_EInputActionOrigin_PS4_DPad_South", "value":"96" }, + { "name":"k_EInputActionOrigin_PS4_DPad_West", "value":"97" }, + { "name":"k_EInputActionOrigin_PS4_DPad_East", "value":"98" }, + { "name":"k_EInputActionOrigin_PS4_Gyro_Move", "value":"99" }, + { "name":"k_EInputActionOrigin_PS4_Gyro_Pitch", "value":"100" }, + { "name":"k_EInputActionOrigin_PS4_Gyro_Yaw", "value":"101" }, + { "name":"k_EInputActionOrigin_PS4_Gyro_Roll", "value":"102" }, + { "name":"k_EInputActionOrigin_PS4_DPad_Move", "value":"103" }, + { "name":"k_EInputActionOrigin_PS4_Reserved1", "value":"104" }, + { "name":"k_EInputActionOrigin_PS4_Reserved2", "value":"105" }, + { "name":"k_EInputActionOrigin_PS4_Reserved3", "value":"106" }, + { "name":"k_EInputActionOrigin_PS4_Reserved4", "value":"107" }, + { "name":"k_EInputActionOrigin_PS4_Reserved5", "value":"108" }, + { "name":"k_EInputActionOrigin_PS4_Reserved6", "value":"109" }, + { "name":"k_EInputActionOrigin_PS4_Reserved7", "value":"110" }, + { "name":"k_EInputActionOrigin_PS4_Reserved8", "value":"111" }, + { "name":"k_EInputActionOrigin_PS4_Reserved9", "value":"112" }, + { "name":"k_EInputActionOrigin_PS4_Reserved10", "value":"113" }, + { "name":"k_EInputActionOrigin_XBoxOne_A", "value":"114" }, + { "name":"k_EInputActionOrigin_XBoxOne_B", "value":"115" }, + { "name":"k_EInputActionOrigin_XBoxOne_X", "value":"116" }, + { "name":"k_EInputActionOrigin_XBoxOne_Y", "value":"117" }, + { "name":"k_EInputActionOrigin_XBoxOne_LeftBumper", "value":"118" }, + { "name":"k_EInputActionOrigin_XBoxOne_RightBumper", "value":"119" }, + { "name":"k_EInputActionOrigin_XBoxOne_Menu", "value":"120" }, + { "name":"k_EInputActionOrigin_XBoxOne_View", "value":"121" }, + { "name":"k_EInputActionOrigin_XBoxOne_LeftTrigger_Pull", "value":"122" }, + { "name":"k_EInputActionOrigin_XBoxOne_LeftTrigger_Click", "value":"123" }, + { "name":"k_EInputActionOrigin_XBoxOne_RightTrigger_Pull", "value":"124" }, + { "name":"k_EInputActionOrigin_XBoxOne_RightTrigger_Click", "value":"125" }, + { "name":"k_EInputActionOrigin_XBoxOne_LeftStick_Move", "value":"126" }, + { "name":"k_EInputActionOrigin_XBoxOne_LeftStick_Click", "value":"127" }, + { "name":"k_EInputActionOrigin_XBoxOne_LeftStick_DPadNorth", "value":"128" }, + { "name":"k_EInputActionOrigin_XBoxOne_LeftStick_DPadSouth", "value":"129" }, + { "name":"k_EInputActionOrigin_XBoxOne_LeftStick_DPadWest", "value":"130" }, + { "name":"k_EInputActionOrigin_XBoxOne_LeftStick_DPadEast", "value":"131" }, + { "name":"k_EInputActionOrigin_XBoxOne_RightStick_Move", "value":"132" }, + { "name":"k_EInputActionOrigin_XBoxOne_RightStick_Click", "value":"133" }, + { "name":"k_EInputActionOrigin_XBoxOne_RightStick_DPadNorth", "value":"134" }, + { "name":"k_EInputActionOrigin_XBoxOne_RightStick_DPadSouth", "value":"135" }, + { "name":"k_EInputActionOrigin_XBoxOne_RightStick_DPadWest", "value":"136" }, + { "name":"k_EInputActionOrigin_XBoxOne_RightStick_DPadEast", "value":"137" }, + { "name":"k_EInputActionOrigin_XBoxOne_DPad_North", "value":"138" }, + { "name":"k_EInputActionOrigin_XBoxOne_DPad_South", "value":"139" }, + { "name":"k_EInputActionOrigin_XBoxOne_DPad_West", "value":"140" }, + { "name":"k_EInputActionOrigin_XBoxOne_DPad_East", "value":"141" }, + { "name":"k_EInputActionOrigin_XBoxOne_DPad_Move", "value":"142" }, + { "name":"k_EInputActionOrigin_XBoxOne_LeftGrip_Lower", "value":"143" }, + { "name":"k_EInputActionOrigin_XBoxOne_LeftGrip_Upper", "value":"144" }, + { "name":"k_EInputActionOrigin_XBoxOne_RightGrip_Lower", "value":"145" }, + { "name":"k_EInputActionOrigin_XBoxOne_RightGrip_Upper", "value":"146" }, + { "name":"k_EInputActionOrigin_XBoxOne_Share", "value":"147" }, + { "name":"k_EInputActionOrigin_XBoxOne_Reserved6", "value":"148" }, + { "name":"k_EInputActionOrigin_XBoxOne_Reserved7", "value":"149" }, + { "name":"k_EInputActionOrigin_XBoxOne_Reserved8", "value":"150" }, + { "name":"k_EInputActionOrigin_XBoxOne_Reserved9", "value":"151" }, + { "name":"k_EInputActionOrigin_XBoxOne_Reserved10", "value":"152" }, + { "name":"k_EInputActionOrigin_XBox360_A", "value":"153" }, + { "name":"k_EInputActionOrigin_XBox360_B", "value":"154" }, + { "name":"k_EInputActionOrigin_XBox360_X", "value":"155" }, + { "name":"k_EInputActionOrigin_XBox360_Y", "value":"156" }, + { "name":"k_EInputActionOrigin_XBox360_LeftBumper", "value":"157" }, + { "name":"k_EInputActionOrigin_XBox360_RightBumper", "value":"158" }, + { "name":"k_EInputActionOrigin_XBox360_Start", "value":"159" }, + { "name":"k_EInputActionOrigin_XBox360_Back", "value":"160" }, + { "name":"k_EInputActionOrigin_XBox360_LeftTrigger_Pull", "value":"161" }, + { "name":"k_EInputActionOrigin_XBox360_LeftTrigger_Click", "value":"162" }, + { "name":"k_EInputActionOrigin_XBox360_RightTrigger_Pull", "value":"163" }, + { "name":"k_EInputActionOrigin_XBox360_RightTrigger_Click", "value":"164" }, + { "name":"k_EInputActionOrigin_XBox360_LeftStick_Move", "value":"165" }, + { "name":"k_EInputActionOrigin_XBox360_LeftStick_Click", "value":"166" }, + { "name":"k_EInputActionOrigin_XBox360_LeftStick_DPadNorth", "value":"167" }, + { "name":"k_EInputActionOrigin_XBox360_LeftStick_DPadSouth", "value":"168" }, + { "name":"k_EInputActionOrigin_XBox360_LeftStick_DPadWest", "value":"169" }, + { "name":"k_EInputActionOrigin_XBox360_LeftStick_DPadEast", "value":"170" }, + { "name":"k_EInputActionOrigin_XBox360_RightStick_Move", "value":"171" }, + { "name":"k_EInputActionOrigin_XBox360_RightStick_Click", "value":"172" }, + { "name":"k_EInputActionOrigin_XBox360_RightStick_DPadNorth", "value":"173" }, + { "name":"k_EInputActionOrigin_XBox360_RightStick_DPadSouth", "value":"174" }, + { "name":"k_EInputActionOrigin_XBox360_RightStick_DPadWest", "value":"175" }, + { "name":"k_EInputActionOrigin_XBox360_RightStick_DPadEast", "value":"176" }, + { "name":"k_EInputActionOrigin_XBox360_DPad_North", "value":"177" }, + { "name":"k_EInputActionOrigin_XBox360_DPad_South", "value":"178" }, + { "name":"k_EInputActionOrigin_XBox360_DPad_West", "value":"179" }, + { "name":"k_EInputActionOrigin_XBox360_DPad_East", "value":"180" }, + { "name":"k_EInputActionOrigin_XBox360_DPad_Move", "value":"181" }, + { "name":"k_EInputActionOrigin_XBox360_Reserved1", "value":"182" }, + { "name":"k_EInputActionOrigin_XBox360_Reserved2", "value":"183" }, + { "name":"k_EInputActionOrigin_XBox360_Reserved3", "value":"184" }, + { "name":"k_EInputActionOrigin_XBox360_Reserved4", "value":"185" }, + { "name":"k_EInputActionOrigin_XBox360_Reserved5", "value":"186" }, + { "name":"k_EInputActionOrigin_XBox360_Reserved6", "value":"187" }, + { "name":"k_EInputActionOrigin_XBox360_Reserved7", "value":"188" }, + { "name":"k_EInputActionOrigin_XBox360_Reserved8", "value":"189" }, + { "name":"k_EInputActionOrigin_XBox360_Reserved9", "value":"190" }, + { "name":"k_EInputActionOrigin_XBox360_Reserved10", "value":"191" }, + { "name":"k_EInputActionOrigin_Switch_A", "value":"192" }, + { "name":"k_EInputActionOrigin_Switch_B", "value":"193" }, + { "name":"k_EInputActionOrigin_Switch_X", "value":"194" }, + { "name":"k_EInputActionOrigin_Switch_Y", "value":"195" }, + { "name":"k_EInputActionOrigin_Switch_LeftBumper", "value":"196" }, + { "name":"k_EInputActionOrigin_Switch_RightBumper", "value":"197" }, + { "name":"k_EInputActionOrigin_Switch_Plus", "value":"198" }, + { "name":"k_EInputActionOrigin_Switch_Minus", "value":"199" }, + { "name":"k_EInputActionOrigin_Switch_Capture", "value":"200" }, + { "name":"k_EInputActionOrigin_Switch_LeftTrigger_Pull", "value":"201" }, + { "name":"k_EInputActionOrigin_Switch_LeftTrigger_Click", "value":"202" }, + { "name":"k_EInputActionOrigin_Switch_RightTrigger_Pull", "value":"203" }, + { "name":"k_EInputActionOrigin_Switch_RightTrigger_Click", "value":"204" }, + { "name":"k_EInputActionOrigin_Switch_LeftStick_Move", "value":"205" }, + { "name":"k_EInputActionOrigin_Switch_LeftStick_Click", "value":"206" }, + { "name":"k_EInputActionOrigin_Switch_LeftStick_DPadNorth", "value":"207" }, + { "name":"k_EInputActionOrigin_Switch_LeftStick_DPadSouth", "value":"208" }, + { "name":"k_EInputActionOrigin_Switch_LeftStick_DPadWest", "value":"209" }, + { "name":"k_EInputActionOrigin_Switch_LeftStick_DPadEast", "value":"210" }, + { "name":"k_EInputActionOrigin_Switch_RightStick_Move", "value":"211" }, + { "name":"k_EInputActionOrigin_Switch_RightStick_Click", "value":"212" }, + { "name":"k_EInputActionOrigin_Switch_RightStick_DPadNorth", "value":"213" }, + { "name":"k_EInputActionOrigin_Switch_RightStick_DPadSouth", "value":"214" }, + { "name":"k_EInputActionOrigin_Switch_RightStick_DPadWest", "value":"215" }, + { "name":"k_EInputActionOrigin_Switch_RightStick_DPadEast", "value":"216" }, + { "name":"k_EInputActionOrigin_Switch_DPad_North", "value":"217" }, + { "name":"k_EInputActionOrigin_Switch_DPad_South", "value":"218" }, + { "name":"k_EInputActionOrigin_Switch_DPad_West", "value":"219" }, + { "name":"k_EInputActionOrigin_Switch_DPad_East", "value":"220" }, + { "name":"k_EInputActionOrigin_Switch_ProGyro_Move", "value":"221" }, + { "name":"k_EInputActionOrigin_Switch_ProGyro_Pitch", "value":"222" }, + { "name":"k_EInputActionOrigin_Switch_ProGyro_Yaw", "value":"223" }, + { "name":"k_EInputActionOrigin_Switch_ProGyro_Roll", "value":"224" }, + { "name":"k_EInputActionOrigin_Switch_DPad_Move", "value":"225" }, + { "name":"k_EInputActionOrigin_Switch_Reserved1", "value":"226" }, + { "name":"k_EInputActionOrigin_Switch_Reserved2", "value":"227" }, + { "name":"k_EInputActionOrigin_Switch_Reserved3", "value":"228" }, + { "name":"k_EInputActionOrigin_Switch_Reserved4", "value":"229" }, + { "name":"k_EInputActionOrigin_Switch_Reserved5", "value":"230" }, + { "name":"k_EInputActionOrigin_Switch_Reserved6", "value":"231" }, + { "name":"k_EInputActionOrigin_Switch_Reserved7", "value":"232" }, + { "name":"k_EInputActionOrigin_Switch_Reserved8", "value":"233" }, + { "name":"k_EInputActionOrigin_Switch_Reserved9", "value":"234" }, + { "name":"k_EInputActionOrigin_Switch_Reserved10", "value":"235" }, + { "name":"k_EInputActionOrigin_Switch_RightGyro_Move", "value":"236" }, + { "name":"k_EInputActionOrigin_Switch_RightGyro_Pitch", "value":"237" }, + { "name":"k_EInputActionOrigin_Switch_RightGyro_Yaw", "value":"238" }, + { "name":"k_EInputActionOrigin_Switch_RightGyro_Roll", "value":"239" }, + { "name":"k_EInputActionOrigin_Switch_LeftGyro_Move", "value":"240" }, + { "name":"k_EInputActionOrigin_Switch_LeftGyro_Pitch", "value":"241" }, + { "name":"k_EInputActionOrigin_Switch_LeftGyro_Yaw", "value":"242" }, + { "name":"k_EInputActionOrigin_Switch_LeftGyro_Roll", "value":"243" }, + { "name":"k_EInputActionOrigin_Switch_LeftGrip_Lower", "value":"244" }, + { "name":"k_EInputActionOrigin_Switch_LeftGrip_Upper", "value":"245" }, + { "name":"k_EInputActionOrigin_Switch_RightGrip_Lower", "value":"246" }, + { "name":"k_EInputActionOrigin_Switch_RightGrip_Upper", "value":"247" }, + { "name":"k_EInputActionOrigin_Switch_JoyConButton_N", "value":"248" }, + { "name":"k_EInputActionOrigin_Switch_JoyConButton_E", "value":"249" }, + { "name":"k_EInputActionOrigin_Switch_JoyConButton_S", "value":"250" }, + { "name":"k_EInputActionOrigin_Switch_JoyConButton_W", "value":"251" }, + { "name":"k_EInputActionOrigin_Switch_Reserved15", "value":"252" }, + { "name":"k_EInputActionOrigin_Switch_Reserved16", "value":"253" }, + { "name":"k_EInputActionOrigin_Switch_Reserved17", "value":"254" }, + { "name":"k_EInputActionOrigin_Switch_Reserved18", "value":"255" }, + { "name":"k_EInputActionOrigin_Switch_Reserved19", "value":"256" }, + { "name":"k_EInputActionOrigin_Switch_Reserved20", "value":"257" }, + { "name":"k_EInputActionOrigin_PS5_X", "value":"258" }, + { "name":"k_EInputActionOrigin_PS5_Circle", "value":"259" }, + { "name":"k_EInputActionOrigin_PS5_Triangle", "value":"260" }, + { "name":"k_EInputActionOrigin_PS5_Square", "value":"261" }, + { "name":"k_EInputActionOrigin_PS5_LeftBumper", "value":"262" }, + { "name":"k_EInputActionOrigin_PS5_RightBumper", "value":"263" }, + { "name":"k_EInputActionOrigin_PS5_Option", "value":"264" }, + { "name":"k_EInputActionOrigin_PS5_Create", "value":"265" }, + { "name":"k_EInputActionOrigin_PS5_Mute", "value":"266" }, + { "name":"k_EInputActionOrigin_PS5_LeftPad_Touch", "value":"267" }, + { "name":"k_EInputActionOrigin_PS5_LeftPad_Swipe", "value":"268" }, + { "name":"k_EInputActionOrigin_PS5_LeftPad_Click", "value":"269" }, + { "name":"k_EInputActionOrigin_PS5_LeftPad_DPadNorth", "value":"270" }, + { "name":"k_EInputActionOrigin_PS5_LeftPad_DPadSouth", "value":"271" }, + { "name":"k_EInputActionOrigin_PS5_LeftPad_DPadWest", "value":"272" }, + { "name":"k_EInputActionOrigin_PS5_LeftPad_DPadEast", "value":"273" }, + { "name":"k_EInputActionOrigin_PS5_RightPad_Touch", "value":"274" }, + { "name":"k_EInputActionOrigin_PS5_RightPad_Swipe", "value":"275" }, + { "name":"k_EInputActionOrigin_PS5_RightPad_Click", "value":"276" }, + { "name":"k_EInputActionOrigin_PS5_RightPad_DPadNorth", "value":"277" }, + { "name":"k_EInputActionOrigin_PS5_RightPad_DPadSouth", "value":"278" }, + { "name":"k_EInputActionOrigin_PS5_RightPad_DPadWest", "value":"279" }, + { "name":"k_EInputActionOrigin_PS5_RightPad_DPadEast", "value":"280" }, + { "name":"k_EInputActionOrigin_PS5_CenterPad_Touch", "value":"281" }, + { "name":"k_EInputActionOrigin_PS5_CenterPad_Swipe", "value":"282" }, + { "name":"k_EInputActionOrigin_PS5_CenterPad_Click", "value":"283" }, + { "name":"k_EInputActionOrigin_PS5_CenterPad_DPadNorth", "value":"284" }, + { "name":"k_EInputActionOrigin_PS5_CenterPad_DPadSouth", "value":"285" }, + { "name":"k_EInputActionOrigin_PS5_CenterPad_DPadWest", "value":"286" }, + { "name":"k_EInputActionOrigin_PS5_CenterPad_DPadEast", "value":"287" }, + { "name":"k_EInputActionOrigin_PS5_LeftTrigger_Pull", "value":"288" }, + { "name":"k_EInputActionOrigin_PS5_LeftTrigger_Click", "value":"289" }, + { "name":"k_EInputActionOrigin_PS5_RightTrigger_Pull", "value":"290" }, + { "name":"k_EInputActionOrigin_PS5_RightTrigger_Click", "value":"291" }, + { "name":"k_EInputActionOrigin_PS5_LeftStick_Move", "value":"292" }, + { "name":"k_EInputActionOrigin_PS5_LeftStick_Click", "value":"293" }, + { "name":"k_EInputActionOrigin_PS5_LeftStick_DPadNorth", "value":"294" }, + { "name":"k_EInputActionOrigin_PS5_LeftStick_DPadSouth", "value":"295" }, + { "name":"k_EInputActionOrigin_PS5_LeftStick_DPadWest", "value":"296" }, + { "name":"k_EInputActionOrigin_PS5_LeftStick_DPadEast", "value":"297" }, + { "name":"k_EInputActionOrigin_PS5_RightStick_Move", "value":"298" }, + { "name":"k_EInputActionOrigin_PS5_RightStick_Click", "value":"299" }, + { "name":"k_EInputActionOrigin_PS5_RightStick_DPadNorth", "value":"300" }, + { "name":"k_EInputActionOrigin_PS5_RightStick_DPadSouth", "value":"301" }, + { "name":"k_EInputActionOrigin_PS5_RightStick_DPadWest", "value":"302" }, + { "name":"k_EInputActionOrigin_PS5_RightStick_DPadEast", "value":"303" }, + { "name":"k_EInputActionOrigin_PS5_DPad_North", "value":"304" }, + { "name":"k_EInputActionOrigin_PS5_DPad_South", "value":"305" }, + { "name":"k_EInputActionOrigin_PS5_DPad_West", "value":"306" }, + { "name":"k_EInputActionOrigin_PS5_DPad_East", "value":"307" }, + { "name":"k_EInputActionOrigin_PS5_Gyro_Move", "value":"308" }, + { "name":"k_EInputActionOrigin_PS5_Gyro_Pitch", "value":"309" }, + { "name":"k_EInputActionOrigin_PS5_Gyro_Yaw", "value":"310" }, + { "name":"k_EInputActionOrigin_PS5_Gyro_Roll", "value":"311" }, + { "name":"k_EInputActionOrigin_PS5_DPad_Move", "value":"312" }, + { "name":"k_EInputActionOrigin_PS5_LeftGrip", "value":"313" }, + { "name":"k_EInputActionOrigin_PS5_RightGrip", "value":"314" }, + { "name":"k_EInputActionOrigin_PS5_LeftFn", "value":"315" }, + { "name":"k_EInputActionOrigin_PS5_RightFn", "value":"316" }, + { "name":"k_EInputActionOrigin_PS5_Reserved5", "value":"317" }, + { "name":"k_EInputActionOrigin_PS5_Reserved6", "value":"318" }, + { "name":"k_EInputActionOrigin_PS5_Reserved7", "value":"319" }, + { "name":"k_EInputActionOrigin_PS5_Reserved8", "value":"320" }, + { "name":"k_EInputActionOrigin_PS5_Reserved9", "value":"321" }, + { "name":"k_EInputActionOrigin_PS5_Reserved10", "value":"322" }, + { "name":"k_EInputActionOrigin_PS5_Reserved11", "value":"323" }, + { "name":"k_EInputActionOrigin_PS5_Reserved12", "value":"324" }, + { "name":"k_EInputActionOrigin_PS5_Reserved13", "value":"325" }, + { "name":"k_EInputActionOrigin_PS5_Reserved14", "value":"326" }, + { "name":"k_EInputActionOrigin_PS5_Reserved15", "value":"327" }, + { "name":"k_EInputActionOrigin_PS5_Reserved16", "value":"328" }, + { "name":"k_EInputActionOrigin_PS5_Reserved17", "value":"329" }, + { "name":"k_EInputActionOrigin_PS5_Reserved18", "value":"330" }, + { "name":"k_EInputActionOrigin_PS5_Reserved19", "value":"331" }, + { "name":"k_EInputActionOrigin_PS5_Reserved20", "value":"332" }, + { "name":"k_EInputActionOrigin_SteamDeck_A", "value":"333" }, + { "name":"k_EInputActionOrigin_SteamDeck_B", "value":"334" }, + { "name":"k_EInputActionOrigin_SteamDeck_X", "value":"335" }, + { "name":"k_EInputActionOrigin_SteamDeck_Y", "value":"336" }, + { "name":"k_EInputActionOrigin_SteamDeck_L1", "value":"337" }, + { "name":"k_EInputActionOrigin_SteamDeck_R1", "value":"338" }, + { "name":"k_EInputActionOrigin_SteamDeck_Menu", "value":"339" }, + { "name":"k_EInputActionOrigin_SteamDeck_View", "value":"340" }, + { "name":"k_EInputActionOrigin_SteamDeck_LeftPad_Touch", "value":"341" }, + { "name":"k_EInputActionOrigin_SteamDeck_LeftPad_Swipe", "value":"342" }, + { "name":"k_EInputActionOrigin_SteamDeck_LeftPad_Click", "value":"343" }, + { "name":"k_EInputActionOrigin_SteamDeck_LeftPad_DPadNorth", "value":"344" }, + { "name":"k_EInputActionOrigin_SteamDeck_LeftPad_DPadSouth", "value":"345" }, + { "name":"k_EInputActionOrigin_SteamDeck_LeftPad_DPadWest", "value":"346" }, + { "name":"k_EInputActionOrigin_SteamDeck_LeftPad_DPadEast", "value":"347" }, + { "name":"k_EInputActionOrigin_SteamDeck_RightPad_Touch", "value":"348" }, + { "name":"k_EInputActionOrigin_SteamDeck_RightPad_Swipe", "value":"349" }, + { "name":"k_EInputActionOrigin_SteamDeck_RightPad_Click", "value":"350" }, + { "name":"k_EInputActionOrigin_SteamDeck_RightPad_DPadNorth", "value":"351" }, + { "name":"k_EInputActionOrigin_SteamDeck_RightPad_DPadSouth", "value":"352" }, + { "name":"k_EInputActionOrigin_SteamDeck_RightPad_DPadWest", "value":"353" }, + { "name":"k_EInputActionOrigin_SteamDeck_RightPad_DPadEast", "value":"354" }, + { "name":"k_EInputActionOrigin_SteamDeck_L2_SoftPull", "value":"355" }, + { "name":"k_EInputActionOrigin_SteamDeck_L2", "value":"356" }, + { "name":"k_EInputActionOrigin_SteamDeck_R2_SoftPull", "value":"357" }, + { "name":"k_EInputActionOrigin_SteamDeck_R2", "value":"358" }, + { "name":"k_EInputActionOrigin_SteamDeck_LeftStick_Move", "value":"359" }, + { "name":"k_EInputActionOrigin_SteamDeck_L3", "value":"360" }, + { "name":"k_EInputActionOrigin_SteamDeck_LeftStick_DPadNorth", "value":"361" }, + { "name":"k_EInputActionOrigin_SteamDeck_LeftStick_DPadSouth", "value":"362" }, + { "name":"k_EInputActionOrigin_SteamDeck_LeftStick_DPadWest", "value":"363" }, + { "name":"k_EInputActionOrigin_SteamDeck_LeftStick_DPadEast", "value":"364" }, + { "name":"k_EInputActionOrigin_SteamDeck_LeftStick_Touch", "value":"365" }, + { "name":"k_EInputActionOrigin_SteamDeck_RightStick_Move", "value":"366" }, + { "name":"k_EInputActionOrigin_SteamDeck_R3", "value":"367" }, + { "name":"k_EInputActionOrigin_SteamDeck_RightStick_DPadNorth", "value":"368" }, + { "name":"k_EInputActionOrigin_SteamDeck_RightStick_DPadSouth", "value":"369" }, + { "name":"k_EInputActionOrigin_SteamDeck_RightStick_DPadWest", "value":"370" }, + { "name":"k_EInputActionOrigin_SteamDeck_RightStick_DPadEast", "value":"371" }, + { "name":"k_EInputActionOrigin_SteamDeck_RightStick_Touch", "value":"372" }, + { "name":"k_EInputActionOrigin_SteamDeck_L4", "value":"373" }, + { "name":"k_EInputActionOrigin_SteamDeck_R4", "value":"374" }, + { "name":"k_EInputActionOrigin_SteamDeck_L5", "value":"375" }, + { "name":"k_EInputActionOrigin_SteamDeck_R5", "value":"376" }, + { "name":"k_EInputActionOrigin_SteamDeck_DPad_Move", "value":"377" }, + { "name":"k_EInputActionOrigin_SteamDeck_DPad_North", "value":"378" }, + { "name":"k_EInputActionOrigin_SteamDeck_DPad_South", "value":"379" }, + { "name":"k_EInputActionOrigin_SteamDeck_DPad_West", "value":"380" }, + { "name":"k_EInputActionOrigin_SteamDeck_DPad_East", "value":"381" }, + { "name":"k_EInputActionOrigin_SteamDeck_Gyro_Move", "value":"382" }, + { "name":"k_EInputActionOrigin_SteamDeck_Gyro_Pitch", "value":"383" }, + { "name":"k_EInputActionOrigin_SteamDeck_Gyro_Yaw", "value":"384" }, + { "name":"k_EInputActionOrigin_SteamDeck_Gyro_Roll", "value":"385" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved1", "value":"386" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved2", "value":"387" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved3", "value":"388" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved4", "value":"389" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved5", "value":"390" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved6", "value":"391" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved7", "value":"392" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved8", "value":"393" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved9", "value":"394" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved10", "value":"395" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved11", "value":"396" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved12", "value":"397" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved13", "value":"398" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved14", "value":"399" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved15", "value":"400" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved16", "value":"401" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved17", "value":"402" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved18", "value":"403" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved19", "value":"404" }, + { "name":"k_EInputActionOrigin_SteamDeck_Reserved20", "value":"405" }, + { "name":"k_EInputActionOrigin_Horipad_M1", "value":"406" }, + { "name":"k_EInputActionOrigin_Horipad_M2", "value":"407" }, + { "name":"k_EInputActionOrigin_Horipad_L4", "value":"408" }, + { "name":"k_EInputActionOrigin_Horipad_R4", "value":"409" }, + { "name":"k_EInputActionOrigin_Count", "value":"410" }, + { "name":"k_EInputActionOrigin_MaximumPossibleValue", "value":"32767" } + ] + }, + { + "enumname": "EXboxOrigin", + "values": [ + { "name":"k_EXboxOrigin_A", "value":"0" }, + { "name":"k_EXboxOrigin_B", "value":"1" }, + { "name":"k_EXboxOrigin_X", "value":"2" }, + { "name":"k_EXboxOrigin_Y", "value":"3" }, + { "name":"k_EXboxOrigin_LeftBumper", "value":"4" }, + { "name":"k_EXboxOrigin_RightBumper", "value":"5" }, + { "name":"k_EXboxOrigin_Menu", "value":"6" }, + { "name":"k_EXboxOrigin_View", "value":"7" }, + { "name":"k_EXboxOrigin_LeftTrigger_Pull", "value":"8" }, + { "name":"k_EXboxOrigin_LeftTrigger_Click", "value":"9" }, + { "name":"k_EXboxOrigin_RightTrigger_Pull", "value":"10" }, + { "name":"k_EXboxOrigin_RightTrigger_Click", "value":"11" }, + { "name":"k_EXboxOrigin_LeftStick_Move", "value":"12" }, + { "name":"k_EXboxOrigin_LeftStick_Click", "value":"13" }, + { "name":"k_EXboxOrigin_LeftStick_DPadNorth", "value":"14" }, + { "name":"k_EXboxOrigin_LeftStick_DPadSouth", "value":"15" }, + { "name":"k_EXboxOrigin_LeftStick_DPadWest", "value":"16" }, + { "name":"k_EXboxOrigin_LeftStick_DPadEast", "value":"17" }, + { "name":"k_EXboxOrigin_RightStick_Move", "value":"18" }, + { "name":"k_EXboxOrigin_RightStick_Click", "value":"19" }, + { "name":"k_EXboxOrigin_RightStick_DPadNorth", "value":"20" }, + { "name":"k_EXboxOrigin_RightStick_DPadSouth", "value":"21" }, + { "name":"k_EXboxOrigin_RightStick_DPadWest", "value":"22" }, + { "name":"k_EXboxOrigin_RightStick_DPadEast", "value":"23" }, + { "name":"k_EXboxOrigin_DPad_North", "value":"24" }, + { "name":"k_EXboxOrigin_DPad_South", "value":"25" }, + { "name":"k_EXboxOrigin_DPad_West", "value":"26" }, + { "name":"k_EXboxOrigin_DPad_East", "value":"27" }, + { "name":"k_EXboxOrigin_Count", "value":"28" } + ] + }, + { + "enumname": "ESteamControllerPad", + "values": [ + { "name":"k_ESteamControllerPad_Left", "value":"0" }, + { "name":"k_ESteamControllerPad_Right", "value":"1" } + ] + }, + { + "enumname": "EControllerHapticLocation", + "values": [ + { "name":"k_EControllerHapticLocation_Left", "value":"1" }, + { "name":"k_EControllerHapticLocation_Right", "value":"2" }, + { "name":"k_EControllerHapticLocation_Both", "value":"3" } + ] + }, + { + "enumname": "EControllerHapticType", + "values": [ + { "name":"k_EControllerHapticType_Off", "value":"0" }, + { "name":"k_EControllerHapticType_Tick", "value":"1" }, + { "name":"k_EControllerHapticType_Click", "value":"2" } + ] + }, + { + "enumname": "ESteamInputType", + "values": [ + { "name":"k_ESteamInputType_Unknown", "value":"0" }, + { "name":"k_ESteamInputType_SteamController", "value":"1" }, + { "name":"k_ESteamInputType_XBox360Controller", "value":"2" }, + { "name":"k_ESteamInputType_XBoxOneController", "value":"3" }, + { "name":"k_ESteamInputType_GenericGamepad", "value":"4" }, + { "name":"k_ESteamInputType_PS4Controller", "value":"5" }, + { "name":"k_ESteamInputType_AppleMFiController", "value":"6" }, + { "name":"k_ESteamInputType_AndroidController", "value":"7" }, + { "name":"k_ESteamInputType_SwitchJoyConPair", "value":"8" }, + { "name":"k_ESteamInputType_SwitchJoyConSingle", "value":"9" }, + { "name":"k_ESteamInputType_SwitchProController", "value":"10" }, + { "name":"k_ESteamInputType_MobileTouch", "value":"11" }, + { "name":"k_ESteamInputType_PS3Controller", "value":"12" }, + { "name":"k_ESteamInputType_PS5Controller", "value":"13" }, + { "name":"k_ESteamInputType_SteamDeckController", "value":"14" }, + { "name":"k_ESteamInputType_Count", "value":"15" }, + { "name":"k_ESteamInputType_MaximumPossibleValue", "value":"255" } + ] + }, + { + "enumname": "ESteamInputConfigurationEnableType", + "values": [ + { "name":"k_ESteamInputConfigurationEnableType_None", "value":"0" }, + { "name":"k_ESteamInputConfigurationEnableType_Playstation", "value":"1" }, + { "name":"k_ESteamInputConfigurationEnableType_Xbox", "value":"2" }, + { "name":"k_ESteamInputConfigurationEnableType_Generic", "value":"4" }, + { "name":"k_ESteamInputConfigurationEnableType_Switch", "value":"8" } + ] + }, + { + "enumname": "ESteamInputLEDFlag", + "values": [ + { "name":"k_ESteamInputLEDFlag_SetColor", "value":"0" }, + { "name":"k_ESteamInputLEDFlag_RestoreUserDefault", "value":"1" } + ] + }, + { + "enumname": "ESteamInputGlyphSize", + "values": [ + { "name":"k_ESteamInputGlyphSize_Small", "value":"0" }, + { "name":"k_ESteamInputGlyphSize_Medium", "value":"1" }, + { "name":"k_ESteamInputGlyphSize_Large", "value":"2" }, + { "name":"k_ESteamInputGlyphSize_Count", "value":"3" } + ] + }, + { + "enumname": "ESteamInputGlyphStyle", + "values": [ + { "name":"ESteamInputGlyphStyle_Knockout", "value":"0" }, + { "name":"ESteamInputGlyphStyle_Light", "value":"1" }, + { "name":"ESteamInputGlyphStyle_Dark", "value":"2" }, + { "name":"ESteamInputGlyphStyle_NeutralColorABXY", "value":"16" }, + { "name":"ESteamInputGlyphStyle_SolidABXY", "value":"32" } + ] + }, + { + "enumname": "ESteamInputActionEventType", + "values": [ + { "name":"ESteamInputActionEventType_DigitalAction", "value":"0" }, + { "name":"ESteamInputActionEventType_AnalogAction", "value":"1" } + ] + }, + { + "enumname": "EControllerActionOrigin", + "values": [ + { "name":"k_EControllerActionOrigin_None", "value":"0" }, + { "name":"k_EControllerActionOrigin_A", "value":"1" }, + { "name":"k_EControllerActionOrigin_B", "value":"2" }, + { "name":"k_EControllerActionOrigin_X", "value":"3" }, + { "name":"k_EControllerActionOrigin_Y", "value":"4" }, + { "name":"k_EControllerActionOrigin_LeftBumper", "value":"5" }, + { "name":"k_EControllerActionOrigin_RightBumper", "value":"6" }, + { "name":"k_EControllerActionOrigin_LeftGrip", "value":"7" }, + { "name":"k_EControllerActionOrigin_RightGrip", "value":"8" }, + { "name":"k_EControllerActionOrigin_Start", "value":"9" }, + { "name":"k_EControllerActionOrigin_Back", "value":"10" }, + { "name":"k_EControllerActionOrigin_LeftPad_Touch", "value":"11" }, + { "name":"k_EControllerActionOrigin_LeftPad_Swipe", "value":"12" }, + { "name":"k_EControllerActionOrigin_LeftPad_Click", "value":"13" }, + { "name":"k_EControllerActionOrigin_LeftPad_DPadNorth", "value":"14" }, + { "name":"k_EControllerActionOrigin_LeftPad_DPadSouth", "value":"15" }, + { "name":"k_EControllerActionOrigin_LeftPad_DPadWest", "value":"16" }, + { "name":"k_EControllerActionOrigin_LeftPad_DPadEast", "value":"17" }, + { "name":"k_EControllerActionOrigin_RightPad_Touch", "value":"18" }, + { "name":"k_EControllerActionOrigin_RightPad_Swipe", "value":"19" }, + { "name":"k_EControllerActionOrigin_RightPad_Click", "value":"20" }, + { "name":"k_EControllerActionOrigin_RightPad_DPadNorth", "value":"21" }, + { "name":"k_EControllerActionOrigin_RightPad_DPadSouth", "value":"22" }, + { "name":"k_EControllerActionOrigin_RightPad_DPadWest", "value":"23" }, + { "name":"k_EControllerActionOrigin_RightPad_DPadEast", "value":"24" }, + { "name":"k_EControllerActionOrigin_LeftTrigger_Pull", "value":"25" }, + { "name":"k_EControllerActionOrigin_LeftTrigger_Click", "value":"26" }, + { "name":"k_EControllerActionOrigin_RightTrigger_Pull", "value":"27" }, + { "name":"k_EControllerActionOrigin_RightTrigger_Click", "value":"28" }, + { "name":"k_EControllerActionOrigin_LeftStick_Move", "value":"29" }, + { "name":"k_EControllerActionOrigin_LeftStick_Click", "value":"30" }, + { "name":"k_EControllerActionOrigin_LeftStick_DPadNorth", "value":"31" }, + { "name":"k_EControllerActionOrigin_LeftStick_DPadSouth", "value":"32" }, + { "name":"k_EControllerActionOrigin_LeftStick_DPadWest", "value":"33" }, + { "name":"k_EControllerActionOrigin_LeftStick_DPadEast", "value":"34" }, + { "name":"k_EControllerActionOrigin_Gyro_Move", "value":"35" }, + { "name":"k_EControllerActionOrigin_Gyro_Pitch", "value":"36" }, + { "name":"k_EControllerActionOrigin_Gyro_Yaw", "value":"37" }, + { "name":"k_EControllerActionOrigin_Gyro_Roll", "value":"38" }, + { "name":"k_EControllerActionOrigin_PS4_X", "value":"39" }, + { "name":"k_EControllerActionOrigin_PS4_Circle", "value":"40" }, + { "name":"k_EControllerActionOrigin_PS4_Triangle", "value":"41" }, + { "name":"k_EControllerActionOrigin_PS4_Square", "value":"42" }, + { "name":"k_EControllerActionOrigin_PS4_LeftBumper", "value":"43" }, + { "name":"k_EControllerActionOrigin_PS4_RightBumper", "value":"44" }, + { "name":"k_EControllerActionOrigin_PS4_Options", "value":"45" }, + { "name":"k_EControllerActionOrigin_PS4_Share", "value":"46" }, + { "name":"k_EControllerActionOrigin_PS4_LeftPad_Touch", "value":"47" }, + { "name":"k_EControllerActionOrigin_PS4_LeftPad_Swipe", "value":"48" }, + { "name":"k_EControllerActionOrigin_PS4_LeftPad_Click", "value":"49" }, + { "name":"k_EControllerActionOrigin_PS4_LeftPad_DPadNorth", "value":"50" }, + { "name":"k_EControllerActionOrigin_PS4_LeftPad_DPadSouth", "value":"51" }, + { "name":"k_EControllerActionOrigin_PS4_LeftPad_DPadWest", "value":"52" }, + { "name":"k_EControllerActionOrigin_PS4_LeftPad_DPadEast", "value":"53" }, + { "name":"k_EControllerActionOrigin_PS4_RightPad_Touch", "value":"54" }, + { "name":"k_EControllerActionOrigin_PS4_RightPad_Swipe", "value":"55" }, + { "name":"k_EControllerActionOrigin_PS4_RightPad_Click", "value":"56" }, + { "name":"k_EControllerActionOrigin_PS4_RightPad_DPadNorth", "value":"57" }, + { "name":"k_EControllerActionOrigin_PS4_RightPad_DPadSouth", "value":"58" }, + { "name":"k_EControllerActionOrigin_PS4_RightPad_DPadWest", "value":"59" }, + { "name":"k_EControllerActionOrigin_PS4_RightPad_DPadEast", "value":"60" }, + { "name":"k_EControllerActionOrigin_PS4_CenterPad_Touch", "value":"61" }, + { "name":"k_EControllerActionOrigin_PS4_CenterPad_Swipe", "value":"62" }, + { "name":"k_EControllerActionOrigin_PS4_CenterPad_Click", "value":"63" }, + { "name":"k_EControllerActionOrigin_PS4_CenterPad_DPadNorth", "value":"64" }, + { "name":"k_EControllerActionOrigin_PS4_CenterPad_DPadSouth", "value":"65" }, + { "name":"k_EControllerActionOrigin_PS4_CenterPad_DPadWest", "value":"66" }, + { "name":"k_EControllerActionOrigin_PS4_CenterPad_DPadEast", "value":"67" }, + { "name":"k_EControllerActionOrigin_PS4_LeftTrigger_Pull", "value":"68" }, + { "name":"k_EControllerActionOrigin_PS4_LeftTrigger_Click", "value":"69" }, + { "name":"k_EControllerActionOrigin_PS4_RightTrigger_Pull", "value":"70" }, + { "name":"k_EControllerActionOrigin_PS4_RightTrigger_Click", "value":"71" }, + { "name":"k_EControllerActionOrigin_PS4_LeftStick_Move", "value":"72" }, + { "name":"k_EControllerActionOrigin_PS4_LeftStick_Click", "value":"73" }, + { "name":"k_EControllerActionOrigin_PS4_LeftStick_DPadNorth", "value":"74" }, + { "name":"k_EControllerActionOrigin_PS4_LeftStick_DPadSouth", "value":"75" }, + { "name":"k_EControllerActionOrigin_PS4_LeftStick_DPadWest", "value":"76" }, + { "name":"k_EControllerActionOrigin_PS4_LeftStick_DPadEast", "value":"77" }, + { "name":"k_EControllerActionOrigin_PS4_RightStick_Move", "value":"78" }, + { "name":"k_EControllerActionOrigin_PS4_RightStick_Click", "value":"79" }, + { "name":"k_EControllerActionOrigin_PS4_RightStick_DPadNorth", "value":"80" }, + { "name":"k_EControllerActionOrigin_PS4_RightStick_DPadSouth", "value":"81" }, + { "name":"k_EControllerActionOrigin_PS4_RightStick_DPadWest", "value":"82" }, + { "name":"k_EControllerActionOrigin_PS4_RightStick_DPadEast", "value":"83" }, + { "name":"k_EControllerActionOrigin_PS4_DPad_North", "value":"84" }, + { "name":"k_EControllerActionOrigin_PS4_DPad_South", "value":"85" }, + { "name":"k_EControllerActionOrigin_PS4_DPad_West", "value":"86" }, + { "name":"k_EControllerActionOrigin_PS4_DPad_East", "value":"87" }, + { "name":"k_EControllerActionOrigin_PS4_Gyro_Move", "value":"88" }, + { "name":"k_EControllerActionOrigin_PS4_Gyro_Pitch", "value":"89" }, + { "name":"k_EControllerActionOrigin_PS4_Gyro_Yaw", "value":"90" }, + { "name":"k_EControllerActionOrigin_PS4_Gyro_Roll", "value":"91" }, + { "name":"k_EControllerActionOrigin_XBoxOne_A", "value":"92" }, + { "name":"k_EControllerActionOrigin_XBoxOne_B", "value":"93" }, + { "name":"k_EControllerActionOrigin_XBoxOne_X", "value":"94" }, + { "name":"k_EControllerActionOrigin_XBoxOne_Y", "value":"95" }, + { "name":"k_EControllerActionOrigin_XBoxOne_LeftBumper", "value":"96" }, + { "name":"k_EControllerActionOrigin_XBoxOne_RightBumper", "value":"97" }, + { "name":"k_EControllerActionOrigin_XBoxOne_Menu", "value":"98" }, + { "name":"k_EControllerActionOrigin_XBoxOne_View", "value":"99" }, + { "name":"k_EControllerActionOrigin_XBoxOne_LeftTrigger_Pull", "value":"100" }, + { "name":"k_EControllerActionOrigin_XBoxOne_LeftTrigger_Click", "value":"101" }, + { "name":"k_EControllerActionOrigin_XBoxOne_RightTrigger_Pull", "value":"102" }, + { "name":"k_EControllerActionOrigin_XBoxOne_RightTrigger_Click", "value":"103" }, + { "name":"k_EControllerActionOrigin_XBoxOne_LeftStick_Move", "value":"104" }, + { "name":"k_EControllerActionOrigin_XBoxOne_LeftStick_Click", "value":"105" }, + { "name":"k_EControllerActionOrigin_XBoxOne_LeftStick_DPadNorth", "value":"106" }, + { "name":"k_EControllerActionOrigin_XBoxOne_LeftStick_DPadSouth", "value":"107" }, + { "name":"k_EControllerActionOrigin_XBoxOne_LeftStick_DPadWest", "value":"108" }, + { "name":"k_EControllerActionOrigin_XBoxOne_LeftStick_DPadEast", "value":"109" }, + { "name":"k_EControllerActionOrigin_XBoxOne_RightStick_Move", "value":"110" }, + { "name":"k_EControllerActionOrigin_XBoxOne_RightStick_Click", "value":"111" }, + { "name":"k_EControllerActionOrigin_XBoxOne_RightStick_DPadNorth", "value":"112" }, + { "name":"k_EControllerActionOrigin_XBoxOne_RightStick_DPadSouth", "value":"113" }, + { "name":"k_EControllerActionOrigin_XBoxOne_RightStick_DPadWest", "value":"114" }, + { "name":"k_EControllerActionOrigin_XBoxOne_RightStick_DPadEast", "value":"115" }, + { "name":"k_EControllerActionOrigin_XBoxOne_DPad_North", "value":"116" }, + { "name":"k_EControllerActionOrigin_XBoxOne_DPad_South", "value":"117" }, + { "name":"k_EControllerActionOrigin_XBoxOne_DPad_West", "value":"118" }, + { "name":"k_EControllerActionOrigin_XBoxOne_DPad_East", "value":"119" }, + { "name":"k_EControllerActionOrigin_XBox360_A", "value":"120" }, + { "name":"k_EControllerActionOrigin_XBox360_B", "value":"121" }, + { "name":"k_EControllerActionOrigin_XBox360_X", "value":"122" }, + { "name":"k_EControllerActionOrigin_XBox360_Y", "value":"123" }, + { "name":"k_EControllerActionOrigin_XBox360_LeftBumper", "value":"124" }, + { "name":"k_EControllerActionOrigin_XBox360_RightBumper", "value":"125" }, + { "name":"k_EControllerActionOrigin_XBox360_Start", "value":"126" }, + { "name":"k_EControllerActionOrigin_XBox360_Back", "value":"127" }, + { "name":"k_EControllerActionOrigin_XBox360_LeftTrigger_Pull", "value":"128" }, + { "name":"k_EControllerActionOrigin_XBox360_LeftTrigger_Click", "value":"129" }, + { "name":"k_EControllerActionOrigin_XBox360_RightTrigger_Pull", "value":"130" }, + { "name":"k_EControllerActionOrigin_XBox360_RightTrigger_Click", "value":"131" }, + { "name":"k_EControllerActionOrigin_XBox360_LeftStick_Move", "value":"132" }, + { "name":"k_EControllerActionOrigin_XBox360_LeftStick_Click", "value":"133" }, + { "name":"k_EControllerActionOrigin_XBox360_LeftStick_DPadNorth", "value":"134" }, + { "name":"k_EControllerActionOrigin_XBox360_LeftStick_DPadSouth", "value":"135" }, + { "name":"k_EControllerActionOrigin_XBox360_LeftStick_DPadWest", "value":"136" }, + { "name":"k_EControllerActionOrigin_XBox360_LeftStick_DPadEast", "value":"137" }, + { "name":"k_EControllerActionOrigin_XBox360_RightStick_Move", "value":"138" }, + { "name":"k_EControllerActionOrigin_XBox360_RightStick_Click", "value":"139" }, + { "name":"k_EControllerActionOrigin_XBox360_RightStick_DPadNorth", "value":"140" }, + { "name":"k_EControllerActionOrigin_XBox360_RightStick_DPadSouth", "value":"141" }, + { "name":"k_EControllerActionOrigin_XBox360_RightStick_DPadWest", "value":"142" }, + { "name":"k_EControllerActionOrigin_XBox360_RightStick_DPadEast", "value":"143" }, + { "name":"k_EControllerActionOrigin_XBox360_DPad_North", "value":"144" }, + { "name":"k_EControllerActionOrigin_XBox360_DPad_South", "value":"145" }, + { "name":"k_EControllerActionOrigin_XBox360_DPad_West", "value":"146" }, + { "name":"k_EControllerActionOrigin_XBox360_DPad_East", "value":"147" }, + { "name":"k_EControllerActionOrigin_SteamV2_A", "value":"148" }, + { "name":"k_EControllerActionOrigin_SteamV2_B", "value":"149" }, + { "name":"k_EControllerActionOrigin_SteamV2_X", "value":"150" }, + { "name":"k_EControllerActionOrigin_SteamV2_Y", "value":"151" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftBumper", "value":"152" }, + { "name":"k_EControllerActionOrigin_SteamV2_RightBumper", "value":"153" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftGrip_Lower", "value":"154" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftGrip_Upper", "value":"155" }, + { "name":"k_EControllerActionOrigin_SteamV2_RightGrip_Lower", "value":"156" }, + { "name":"k_EControllerActionOrigin_SteamV2_RightGrip_Upper", "value":"157" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftBumper_Pressure", "value":"158" }, + { "name":"k_EControllerActionOrigin_SteamV2_RightBumper_Pressure", "value":"159" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftGrip_Pressure", "value":"160" }, + { "name":"k_EControllerActionOrigin_SteamV2_RightGrip_Pressure", "value":"161" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftGrip_Upper_Pressure", "value":"162" }, + { "name":"k_EControllerActionOrigin_SteamV2_RightGrip_Upper_Pressure", "value":"163" }, + { "name":"k_EControllerActionOrigin_SteamV2_Start", "value":"164" }, + { "name":"k_EControllerActionOrigin_SteamV2_Back", "value":"165" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftPad_Touch", "value":"166" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftPad_Swipe", "value":"167" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftPad_Click", "value":"168" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftPad_Pressure", "value":"169" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftPad_DPadNorth", "value":"170" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftPad_DPadSouth", "value":"171" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftPad_DPadWest", "value":"172" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftPad_DPadEast", "value":"173" }, + { "name":"k_EControllerActionOrigin_SteamV2_RightPad_Touch", "value":"174" }, + { "name":"k_EControllerActionOrigin_SteamV2_RightPad_Swipe", "value":"175" }, + { "name":"k_EControllerActionOrigin_SteamV2_RightPad_Click", "value":"176" }, + { "name":"k_EControllerActionOrigin_SteamV2_RightPad_Pressure", "value":"177" }, + { "name":"k_EControllerActionOrigin_SteamV2_RightPad_DPadNorth", "value":"178" }, + { "name":"k_EControllerActionOrigin_SteamV2_RightPad_DPadSouth", "value":"179" }, + { "name":"k_EControllerActionOrigin_SteamV2_RightPad_DPadWest", "value":"180" }, + { "name":"k_EControllerActionOrigin_SteamV2_RightPad_DPadEast", "value":"181" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftTrigger_Pull", "value":"182" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftTrigger_Click", "value":"183" }, + { "name":"k_EControllerActionOrigin_SteamV2_RightTrigger_Pull", "value":"184" }, + { "name":"k_EControllerActionOrigin_SteamV2_RightTrigger_Click", "value":"185" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftStick_Move", "value":"186" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftStick_Click", "value":"187" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftStick_DPadNorth", "value":"188" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftStick_DPadSouth", "value":"189" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftStick_DPadWest", "value":"190" }, + { "name":"k_EControllerActionOrigin_SteamV2_LeftStick_DPadEast", "value":"191" }, + { "name":"k_EControllerActionOrigin_SteamV2_Gyro_Move", "value":"192" }, + { "name":"k_EControllerActionOrigin_SteamV2_Gyro_Pitch", "value":"193" }, + { "name":"k_EControllerActionOrigin_SteamV2_Gyro_Yaw", "value":"194" }, + { "name":"k_EControllerActionOrigin_SteamV2_Gyro_Roll", "value":"195" }, + { "name":"k_EControllerActionOrigin_Switch_A", "value":"196" }, + { "name":"k_EControllerActionOrigin_Switch_B", "value":"197" }, + { "name":"k_EControllerActionOrigin_Switch_X", "value":"198" }, + { "name":"k_EControllerActionOrigin_Switch_Y", "value":"199" }, + { "name":"k_EControllerActionOrigin_Switch_LeftBumper", "value":"200" }, + { "name":"k_EControllerActionOrigin_Switch_RightBumper", "value":"201" }, + { "name":"k_EControllerActionOrigin_Switch_Plus", "value":"202" }, + { "name":"k_EControllerActionOrigin_Switch_Minus", "value":"203" }, + { "name":"k_EControllerActionOrigin_Switch_Capture", "value":"204" }, + { "name":"k_EControllerActionOrigin_Switch_LeftTrigger_Pull", "value":"205" }, + { "name":"k_EControllerActionOrigin_Switch_LeftTrigger_Click", "value":"206" }, + { "name":"k_EControllerActionOrigin_Switch_RightTrigger_Pull", "value":"207" }, + { "name":"k_EControllerActionOrigin_Switch_RightTrigger_Click", "value":"208" }, + { "name":"k_EControllerActionOrigin_Switch_LeftStick_Move", "value":"209" }, + { "name":"k_EControllerActionOrigin_Switch_LeftStick_Click", "value":"210" }, + { "name":"k_EControllerActionOrigin_Switch_LeftStick_DPadNorth", "value":"211" }, + { "name":"k_EControllerActionOrigin_Switch_LeftStick_DPadSouth", "value":"212" }, + { "name":"k_EControllerActionOrigin_Switch_LeftStick_DPadWest", "value":"213" }, + { "name":"k_EControllerActionOrigin_Switch_LeftStick_DPadEast", "value":"214" }, + { "name":"k_EControllerActionOrigin_Switch_RightStick_Move", "value":"215" }, + { "name":"k_EControllerActionOrigin_Switch_RightStick_Click", "value":"216" }, + { "name":"k_EControllerActionOrigin_Switch_RightStick_DPadNorth", "value":"217" }, + { "name":"k_EControllerActionOrigin_Switch_RightStick_DPadSouth", "value":"218" }, + { "name":"k_EControllerActionOrigin_Switch_RightStick_DPadWest", "value":"219" }, + { "name":"k_EControllerActionOrigin_Switch_RightStick_DPadEast", "value":"220" }, + { "name":"k_EControllerActionOrigin_Switch_DPad_North", "value":"221" }, + { "name":"k_EControllerActionOrigin_Switch_DPad_South", "value":"222" }, + { "name":"k_EControllerActionOrigin_Switch_DPad_West", "value":"223" }, + { "name":"k_EControllerActionOrigin_Switch_DPad_East", "value":"224" }, + { "name":"k_EControllerActionOrigin_Switch_ProGyro_Move", "value":"225" }, + { "name":"k_EControllerActionOrigin_Switch_ProGyro_Pitch", "value":"226" }, + { "name":"k_EControllerActionOrigin_Switch_ProGyro_Yaw", "value":"227" }, + { "name":"k_EControllerActionOrigin_Switch_ProGyro_Roll", "value":"228" }, + { "name":"k_EControllerActionOrigin_Switch_RightGyro_Move", "value":"229" }, + { "name":"k_EControllerActionOrigin_Switch_RightGyro_Pitch", "value":"230" }, + { "name":"k_EControllerActionOrigin_Switch_RightGyro_Yaw", "value":"231" }, + { "name":"k_EControllerActionOrigin_Switch_RightGyro_Roll", "value":"232" }, + { "name":"k_EControllerActionOrigin_Switch_LeftGyro_Move", "value":"233" }, + { "name":"k_EControllerActionOrigin_Switch_LeftGyro_Pitch", "value":"234" }, + { "name":"k_EControllerActionOrigin_Switch_LeftGyro_Yaw", "value":"235" }, + { "name":"k_EControllerActionOrigin_Switch_LeftGyro_Roll", "value":"236" }, + { "name":"k_EControllerActionOrigin_Switch_LeftGrip_Lower", "value":"237" }, + { "name":"k_EControllerActionOrigin_Switch_LeftGrip_Upper", "value":"238" }, + { "name":"k_EControllerActionOrigin_Switch_RightGrip_Lower", "value":"239" }, + { "name":"k_EControllerActionOrigin_Switch_RightGrip_Upper", "value":"240" }, + { "name":"k_EControllerActionOrigin_PS4_DPad_Move", "value":"241" }, + { "name":"k_EControllerActionOrigin_XBoxOne_DPad_Move", "value":"242" }, + { "name":"k_EControllerActionOrigin_XBox360_DPad_Move", "value":"243" }, + { "name":"k_EControllerActionOrigin_Switch_DPad_Move", "value":"244" }, + { "name":"k_EControllerActionOrigin_PS5_X", "value":"245" }, + { "name":"k_EControllerActionOrigin_PS5_Circle", "value":"246" }, + { "name":"k_EControllerActionOrigin_PS5_Triangle", "value":"247" }, + { "name":"k_EControllerActionOrigin_PS5_Square", "value":"248" }, + { "name":"k_EControllerActionOrigin_PS5_LeftBumper", "value":"249" }, + { "name":"k_EControllerActionOrigin_PS5_RightBumper", "value":"250" }, + { "name":"k_EControllerActionOrigin_PS5_Option", "value":"251" }, + { "name":"k_EControllerActionOrigin_PS5_Create", "value":"252" }, + { "name":"k_EControllerActionOrigin_PS5_Mute", "value":"253" }, + { "name":"k_EControllerActionOrigin_PS5_LeftPad_Touch", "value":"254" }, + { "name":"k_EControllerActionOrigin_PS5_LeftPad_Swipe", "value":"255" }, + { "name":"k_EControllerActionOrigin_PS5_LeftPad_Click", "value":"256" }, + { "name":"k_EControllerActionOrigin_PS5_LeftPad_DPadNorth", "value":"257" }, + { "name":"k_EControllerActionOrigin_PS5_LeftPad_DPadSouth", "value":"258" }, + { "name":"k_EControllerActionOrigin_PS5_LeftPad_DPadWest", "value":"259" }, + { "name":"k_EControllerActionOrigin_PS5_LeftPad_DPadEast", "value":"260" }, + { "name":"k_EControllerActionOrigin_PS5_RightPad_Touch", "value":"261" }, + { "name":"k_EControllerActionOrigin_PS5_RightPad_Swipe", "value":"262" }, + { "name":"k_EControllerActionOrigin_PS5_RightPad_Click", "value":"263" }, + { "name":"k_EControllerActionOrigin_PS5_RightPad_DPadNorth", "value":"264" }, + { "name":"k_EControllerActionOrigin_PS5_RightPad_DPadSouth", "value":"265" }, + { "name":"k_EControllerActionOrigin_PS5_RightPad_DPadWest", "value":"266" }, + { "name":"k_EControllerActionOrigin_PS5_RightPad_DPadEast", "value":"267" }, + { "name":"k_EControllerActionOrigin_PS5_CenterPad_Touch", "value":"268" }, + { "name":"k_EControllerActionOrigin_PS5_CenterPad_Swipe", "value":"269" }, + { "name":"k_EControllerActionOrigin_PS5_CenterPad_Click", "value":"270" }, + { "name":"k_EControllerActionOrigin_PS5_CenterPad_DPadNorth", "value":"271" }, + { "name":"k_EControllerActionOrigin_PS5_CenterPad_DPadSouth", "value":"272" }, + { "name":"k_EControllerActionOrigin_PS5_CenterPad_DPadWest", "value":"273" }, + { "name":"k_EControllerActionOrigin_PS5_CenterPad_DPadEast", "value":"274" }, + { "name":"k_EControllerActionOrigin_PS5_LeftTrigger_Pull", "value":"275" }, + { "name":"k_EControllerActionOrigin_PS5_LeftTrigger_Click", "value":"276" }, + { "name":"k_EControllerActionOrigin_PS5_RightTrigger_Pull", "value":"277" }, + { "name":"k_EControllerActionOrigin_PS5_RightTrigger_Click", "value":"278" }, + { "name":"k_EControllerActionOrigin_PS5_LeftStick_Move", "value":"279" }, + { "name":"k_EControllerActionOrigin_PS5_LeftStick_Click", "value":"280" }, + { "name":"k_EControllerActionOrigin_PS5_LeftStick_DPadNorth", "value":"281" }, + { "name":"k_EControllerActionOrigin_PS5_LeftStick_DPadSouth", "value":"282" }, + { "name":"k_EControllerActionOrigin_PS5_LeftStick_DPadWest", "value":"283" }, + { "name":"k_EControllerActionOrigin_PS5_LeftStick_DPadEast", "value":"284" }, + { "name":"k_EControllerActionOrigin_PS5_RightStick_Move", "value":"285" }, + { "name":"k_EControllerActionOrigin_PS5_RightStick_Click", "value":"286" }, + { "name":"k_EControllerActionOrigin_PS5_RightStick_DPadNorth", "value":"287" }, + { "name":"k_EControllerActionOrigin_PS5_RightStick_DPadSouth", "value":"288" }, + { "name":"k_EControllerActionOrigin_PS5_RightStick_DPadWest", "value":"289" }, + { "name":"k_EControllerActionOrigin_PS5_RightStick_DPadEast", "value":"290" }, + { "name":"k_EControllerActionOrigin_PS5_DPad_Move", "value":"291" }, + { "name":"k_EControllerActionOrigin_PS5_DPad_North", "value":"292" }, + { "name":"k_EControllerActionOrigin_PS5_DPad_South", "value":"293" }, + { "name":"k_EControllerActionOrigin_PS5_DPad_West", "value":"294" }, + { "name":"k_EControllerActionOrigin_PS5_DPad_East", "value":"295" }, + { "name":"k_EControllerActionOrigin_PS5_Gyro_Move", "value":"296" }, + { "name":"k_EControllerActionOrigin_PS5_Gyro_Pitch", "value":"297" }, + { "name":"k_EControllerActionOrigin_PS5_Gyro_Yaw", "value":"298" }, + { "name":"k_EControllerActionOrigin_PS5_Gyro_Roll", "value":"299" }, + { "name":"k_EControllerActionOrigin_XBoxOne_LeftGrip_Lower", "value":"300" }, + { "name":"k_EControllerActionOrigin_XBoxOne_LeftGrip_Upper", "value":"301" }, + { "name":"k_EControllerActionOrigin_XBoxOne_RightGrip_Lower", "value":"302" }, + { "name":"k_EControllerActionOrigin_XBoxOne_RightGrip_Upper", "value":"303" }, + { "name":"k_EControllerActionOrigin_XBoxOne_Share", "value":"304" }, + { "name":"k_EControllerActionOrigin_SteamDeck_A", "value":"305" }, + { "name":"k_EControllerActionOrigin_SteamDeck_B", "value":"306" }, + { "name":"k_EControllerActionOrigin_SteamDeck_X", "value":"307" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Y", "value":"308" }, + { "name":"k_EControllerActionOrigin_SteamDeck_L1", "value":"309" }, + { "name":"k_EControllerActionOrigin_SteamDeck_R1", "value":"310" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Menu", "value":"311" }, + { "name":"k_EControllerActionOrigin_SteamDeck_View", "value":"312" }, + { "name":"k_EControllerActionOrigin_SteamDeck_LeftPad_Touch", "value":"313" }, + { "name":"k_EControllerActionOrigin_SteamDeck_LeftPad_Swipe", "value":"314" }, + { "name":"k_EControllerActionOrigin_SteamDeck_LeftPad_Click", "value":"315" }, + { "name":"k_EControllerActionOrigin_SteamDeck_LeftPad_DPadNorth", "value":"316" }, + { "name":"k_EControllerActionOrigin_SteamDeck_LeftPad_DPadSouth", "value":"317" }, + { "name":"k_EControllerActionOrigin_SteamDeck_LeftPad_DPadWest", "value":"318" }, + { "name":"k_EControllerActionOrigin_SteamDeck_LeftPad_DPadEast", "value":"319" }, + { "name":"k_EControllerActionOrigin_SteamDeck_RightPad_Touch", "value":"320" }, + { "name":"k_EControllerActionOrigin_SteamDeck_RightPad_Swipe", "value":"321" }, + { "name":"k_EControllerActionOrigin_SteamDeck_RightPad_Click", "value":"322" }, + { "name":"k_EControllerActionOrigin_SteamDeck_RightPad_DPadNorth", "value":"323" }, + { "name":"k_EControllerActionOrigin_SteamDeck_RightPad_DPadSouth", "value":"324" }, + { "name":"k_EControllerActionOrigin_SteamDeck_RightPad_DPadWest", "value":"325" }, + { "name":"k_EControllerActionOrigin_SteamDeck_RightPad_DPadEast", "value":"326" }, + { "name":"k_EControllerActionOrigin_SteamDeck_L2_SoftPull", "value":"327" }, + { "name":"k_EControllerActionOrigin_SteamDeck_L2", "value":"328" }, + { "name":"k_EControllerActionOrigin_SteamDeck_R2_SoftPull", "value":"329" }, + { "name":"k_EControllerActionOrigin_SteamDeck_R2", "value":"330" }, + { "name":"k_EControllerActionOrigin_SteamDeck_LeftStick_Move", "value":"331" }, + { "name":"k_EControllerActionOrigin_SteamDeck_L3", "value":"332" }, + { "name":"k_EControllerActionOrigin_SteamDeck_LeftStick_DPadNorth", "value":"333" }, + { "name":"k_EControllerActionOrigin_SteamDeck_LeftStick_DPadSouth", "value":"334" }, + { "name":"k_EControllerActionOrigin_SteamDeck_LeftStick_DPadWest", "value":"335" }, + { "name":"k_EControllerActionOrigin_SteamDeck_LeftStick_DPadEast", "value":"336" }, + { "name":"k_EControllerActionOrigin_SteamDeck_LeftStick_Touch", "value":"337" }, + { "name":"k_EControllerActionOrigin_SteamDeck_RightStick_Move", "value":"338" }, + { "name":"k_EControllerActionOrigin_SteamDeck_R3", "value":"339" }, + { "name":"k_EControllerActionOrigin_SteamDeck_RightStick_DPadNorth", "value":"340" }, + { "name":"k_EControllerActionOrigin_SteamDeck_RightStick_DPadSouth", "value":"341" }, + { "name":"k_EControllerActionOrigin_SteamDeck_RightStick_DPadWest", "value":"342" }, + { "name":"k_EControllerActionOrigin_SteamDeck_RightStick_DPadEast", "value":"343" }, + { "name":"k_EControllerActionOrigin_SteamDeck_RightStick_Touch", "value":"344" }, + { "name":"k_EControllerActionOrigin_SteamDeck_L4", "value":"345" }, + { "name":"k_EControllerActionOrigin_SteamDeck_R4", "value":"346" }, + { "name":"k_EControllerActionOrigin_SteamDeck_L5", "value":"347" }, + { "name":"k_EControllerActionOrigin_SteamDeck_R5", "value":"348" }, + { "name":"k_EControllerActionOrigin_SteamDeck_DPad_Move", "value":"349" }, + { "name":"k_EControllerActionOrigin_SteamDeck_DPad_North", "value":"350" }, + { "name":"k_EControllerActionOrigin_SteamDeck_DPad_South", "value":"351" }, + { "name":"k_EControllerActionOrigin_SteamDeck_DPad_West", "value":"352" }, + { "name":"k_EControllerActionOrigin_SteamDeck_DPad_East", "value":"353" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Gyro_Move", "value":"354" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Gyro_Pitch", "value":"355" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Gyro_Yaw", "value":"356" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Gyro_Roll", "value":"357" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved1", "value":"358" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved2", "value":"359" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved3", "value":"360" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved4", "value":"361" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved5", "value":"362" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved6", "value":"363" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved7", "value":"364" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved8", "value":"365" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved9", "value":"366" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved10", "value":"367" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved11", "value":"368" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved12", "value":"369" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved13", "value":"370" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved14", "value":"371" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved15", "value":"372" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved16", "value":"373" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved17", "value":"374" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved18", "value":"375" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved19", "value":"376" }, + { "name":"k_EControllerActionOrigin_SteamDeck_Reserved20", "value":"377" }, + { "name":"k_EControllerActionOrigin_Switch_JoyConButton_N", "value":"378" }, + { "name":"k_EControllerActionOrigin_Switch_JoyConButton_E", "value":"379" }, + { "name":"k_EControllerActionOrigin_Switch_JoyConButton_S", "value":"380" }, + { "name":"k_EControllerActionOrigin_Switch_JoyConButton_W", "value":"381" }, + { "name":"k_EControllerActionOrigin_PS5_LeftGrip", "value":"382" }, + { "name":"k_EControllerActionOrigin_PS5_RightGrip", "value":"383" }, + { "name":"k_EControllerActionOrigin_PS5_LeftFn", "value":"384" }, + { "name":"k_EControllerActionOrigin_PS5_RightFn", "value":"385" }, + { "name":"k_EControllerActionOrigin_Horipad_M1", "value":"386" }, + { "name":"k_EControllerActionOrigin_Horipad_M2", "value":"387" }, + { "name":"k_EControllerActionOrigin_Horipad_L4", "value":"388" }, + { "name":"k_EControllerActionOrigin_Horipad_R4", "value":"389" }, + { "name":"k_EControllerActionOrigin_Count", "value":"390" }, + { "name":"k_EControllerActionOrigin_MaximumPossibleValue", "value":"32767" } + ] + }, + { + "enumname": "ESteamControllerLEDFlag", + "values": [ + { "name":"k_ESteamControllerLEDFlag_SetColor", "value":"0" }, + { "name":"k_ESteamControllerLEDFlag_RestoreUserDefault", "value":"1" } + ] + }, + { + "enumname": "EUGCMatchingUGCType", + "values": [ + { "name":"k_EUGCMatchingUGCType_Items", "value":"0" }, + { "name":"k_EUGCMatchingUGCType_Items_Mtx", "value":"1" }, + { "name":"k_EUGCMatchingUGCType_Items_ReadyToUse", "value":"2" }, + { "name":"k_EUGCMatchingUGCType_Collections", "value":"3" }, + { "name":"k_EUGCMatchingUGCType_Artwork", "value":"4" }, + { "name":"k_EUGCMatchingUGCType_Videos", "value":"5" }, + { "name":"k_EUGCMatchingUGCType_Screenshots", "value":"6" }, + { "name":"k_EUGCMatchingUGCType_AllGuides", "value":"7" }, + { "name":"k_EUGCMatchingUGCType_WebGuides", "value":"8" }, + { "name":"k_EUGCMatchingUGCType_IntegratedGuides", "value":"9" }, + { "name":"k_EUGCMatchingUGCType_UsableInGame", "value":"10" }, + { "name":"k_EUGCMatchingUGCType_ControllerBindings", "value":"11" }, + { "name":"k_EUGCMatchingUGCType_GameManagedItems", "value":"12" }, + { "name":"k_EUGCMatchingUGCType_All", "value":"-1" } + ] + }, + { + "enumname": "EUserUGCList", + "values": [ + { "name":"k_EUserUGCList_Published", "value":"0" }, + { "name":"k_EUserUGCList_VotedOn", "value":"1" }, + { "name":"k_EUserUGCList_VotedUp", "value":"2" }, + { "name":"k_EUserUGCList_VotedDown", "value":"3" }, + { "name":"k_EUserUGCList_WillVoteLater", "value":"4" }, + { "name":"k_EUserUGCList_Favorited", "value":"5" }, + { "name":"k_EUserUGCList_Subscribed", "value":"6" }, + { "name":"k_EUserUGCList_UsedOrPlayed", "value":"7" }, + { "name":"k_EUserUGCList_Followed", "value":"8" } + ] + }, + { + "enumname": "EUserUGCListSortOrder", + "values": [ + { "name":"k_EUserUGCListSortOrder_CreationOrderDesc", "value":"0" }, + { "name":"k_EUserUGCListSortOrder_CreationOrderAsc", "value":"1" }, + { "name":"k_EUserUGCListSortOrder_TitleAsc", "value":"2" }, + { "name":"k_EUserUGCListSortOrder_LastUpdatedDesc", "value":"3" }, + { "name":"k_EUserUGCListSortOrder_SubscriptionDateDesc", "value":"4" }, + { "name":"k_EUserUGCListSortOrder_VoteScoreDesc", "value":"5" }, + { "name":"k_EUserUGCListSortOrder_ForModeration", "value":"6" } + ] + }, + { + "enumname": "EUGCQuery", + "values": [ + { "name":"k_EUGCQuery_RankedByVote", "value":"0" }, + { "name":"k_EUGCQuery_RankedByPublicationDate", "value":"1" }, + { "name":"k_EUGCQuery_AcceptedForGameRankedByAcceptanceDate", "value":"2" }, + { "name":"k_EUGCQuery_RankedByTrend", "value":"3" }, + { "name":"k_EUGCQuery_FavoritedByFriendsRankedByPublicationDate", "value":"4" }, + { "name":"k_EUGCQuery_CreatedByFriendsRankedByPublicationDate", "value":"5" }, + { "name":"k_EUGCQuery_RankedByNumTimesReported", "value":"6" }, + { "name":"k_EUGCQuery_CreatedByFollowedUsersRankedByPublicationDate", "value":"7" }, + { "name":"k_EUGCQuery_NotYetRated", "value":"8" }, + { "name":"k_EUGCQuery_RankedByTotalVotesAsc", "value":"9" }, + { "name":"k_EUGCQuery_RankedByVotesUp", "value":"10" }, + { "name":"k_EUGCQuery_RankedByTextSearch", "value":"11" }, + { "name":"k_EUGCQuery_RankedByTotalUniqueSubscriptions", "value":"12" }, + { "name":"k_EUGCQuery_RankedByPlaytimeTrend", "value":"13" }, + { "name":"k_EUGCQuery_RankedByTotalPlaytime", "value":"14" }, + { "name":"k_EUGCQuery_RankedByAveragePlaytimeTrend", "value":"15" }, + { "name":"k_EUGCQuery_RankedByLifetimeAveragePlaytime", "value":"16" }, + { "name":"k_EUGCQuery_RankedByPlaytimeSessionsTrend", "value":"17" }, + { "name":"k_EUGCQuery_RankedByLifetimePlaytimeSessions", "value":"18" }, + { "name":"k_EUGCQuery_RankedByLastUpdatedDate", "value":"19" } + ] + }, + { + "enumname": "EItemUpdateStatus", + "values": [ + { "name":"k_EItemUpdateStatusInvalid", "value":"0" }, + { "name":"k_EItemUpdateStatusPreparingConfig", "value":"1" }, + { "name":"k_EItemUpdateStatusPreparingContent", "value":"2" }, + { "name":"k_EItemUpdateStatusUploadingContent", "value":"3" }, + { "name":"k_EItemUpdateStatusUploadingPreviewFile", "value":"4" }, + { "name":"k_EItemUpdateStatusCommittingChanges", "value":"5" } + ] + }, + { + "enumname": "EItemState", + "values": [ + { "name":"k_EItemStateNone", "value":"0" }, + { "name":"k_EItemStateSubscribed", "value":"1" }, + { "name":"k_EItemStateLegacyItem", "value":"2" }, + { "name":"k_EItemStateInstalled", "value":"4" }, + { "name":"k_EItemStateNeedsUpdate", "value":"8" }, + { "name":"k_EItemStateDownloading", "value":"16" }, + { "name":"k_EItemStateDownloadPending", "value":"32" }, + { "name":"k_EItemStateDisabledLocally", "value":"64" } + ] + }, + { + "enumname": "EItemStatistic", + "values": [ + { "name":"k_EItemStatistic_NumSubscriptions", "value":"0" }, + { "name":"k_EItemStatistic_NumFavorites", "value":"1" }, + { "name":"k_EItemStatistic_NumFollowers", "value":"2" }, + { "name":"k_EItemStatistic_NumUniqueSubscriptions", "value":"3" }, + { "name":"k_EItemStatistic_NumUniqueFavorites", "value":"4" }, + { "name":"k_EItemStatistic_NumUniqueFollowers", "value":"5" }, + { "name":"k_EItemStatistic_NumUniqueWebsiteViews", "value":"6" }, + { "name":"k_EItemStatistic_ReportScore", "value":"7" }, + { "name":"k_EItemStatistic_NumSecondsPlayed", "value":"8" }, + { "name":"k_EItemStatistic_NumPlaytimeSessions", "value":"9" }, + { "name":"k_EItemStatistic_NumComments", "value":"10" }, + { "name":"k_EItemStatistic_NumSecondsPlayedDuringTimePeriod", "value":"11" }, + { "name":"k_EItemStatistic_NumPlaytimeSessionsDuringTimePeriod", "value":"12" } + ] + }, + { + "enumname": "EItemPreviewType", + "values": [ + { "name":"k_EItemPreviewType_Image", "value":"0" }, + { "name":"k_EItemPreviewType_YouTubeVideo", "value":"1" }, + { "name":"k_EItemPreviewType_Sketchfab", "value":"2" }, + { "name":"k_EItemPreviewType_EnvironmentMap_HorizontalCross", "value":"3" }, + { "name":"k_EItemPreviewType_EnvironmentMap_LatLong", "value":"4" }, + { "name":"k_EItemPreviewType_Clip", "value":"5" }, + { "name":"k_EItemPreviewType_ReservedMax", "value":"255" } + ] + }, + { + "enumname": "EUGCContentDescriptorID", + "values": [ + { "name":"k_EUGCContentDescriptor_NudityOrSexualContent", "value":"1" }, + { "name":"k_EUGCContentDescriptor_FrequentViolenceOrGore", "value":"2" }, + { "name":"k_EUGCContentDescriptor_AdultOnlySexualContent", "value":"3" }, + { "name":"k_EUGCContentDescriptor_GratuitousSexualContent", "value":"4" }, + { "name":"k_EUGCContentDescriptor_AnyMatureContent", "value":"5" } + ] + }, + { + "enumname": "ESteamItemFlags", + "values": [ + { "name":"k_ESteamItemNoTrade", "value":"1" }, + { "name":"k_ESteamItemRemoved", "value":"256" }, + { "name":"k_ESteamItemConsumed", "value":"512" } + ] + }, + { + "enumname": "ETimelineGameMode", + "values": [ + { "name":"k_ETimelineGameMode_Invalid", "value":"0" }, + { "name":"k_ETimelineGameMode_Playing", "value":"1" }, + { "name":"k_ETimelineGameMode_Staging", "value":"2" }, + { "name":"k_ETimelineGameMode_Menus", "value":"3" }, + { "name":"k_ETimelineGameMode_LoadingScreen", "value":"4" }, + { "name":"k_ETimelineGameMode_Max", "value":"5" } + ] + }, + { + "enumname": "ETimelineEventClipPriority", + "values": [ + { "name":"k_ETimelineEventClipPriority_Invalid", "value":"0" }, + { "name":"k_ETimelineEventClipPriority_None", "value":"1" }, + { "name":"k_ETimelineEventClipPriority_Standard", "value":"2" }, + { "name":"k_ETimelineEventClipPriority_Featured", "value":"3" } + ] + }, + { + "enumname": "EParentalFeature", + "values": [ + { "name":"k_EFeatureInvalid", "value":"0" }, + { "name":"k_EFeatureStore", "value":"1" }, + { "name":"k_EFeatureCommunity", "value":"2" }, + { "name":"k_EFeatureProfile", "value":"3" }, + { "name":"k_EFeatureFriends", "value":"4" }, + { "name":"k_EFeatureNews", "value":"5" }, + { "name":"k_EFeatureTrading", "value":"6" }, + { "name":"k_EFeatureSettings", "value":"7" }, + { "name":"k_EFeatureConsole", "value":"8" }, + { "name":"k_EFeatureBrowser", "value":"9" }, + { "name":"k_EFeatureParentalSetup", "value":"10" }, + { "name":"k_EFeatureLibrary", "value":"11" }, + { "name":"k_EFeatureTest", "value":"12" }, + { "name":"k_EFeatureSiteLicense", "value":"13" }, + { "name":"k_EFeatureKioskMode_Deprecated", "value":"14" }, + { "name":"k_EFeatureBlockAlways", "value":"15" }, + { "name":"k_EFeatureMax", "value":"16" } + ] + }, + { + "enumname": "ESteamDeviceFormFactor", + "values": [ + { "name":"k_ESteamDeviceFormFactorUnknown", "value":"0" }, + { "name":"k_ESteamDeviceFormFactorPhone", "value":"1" }, + { "name":"k_ESteamDeviceFormFactorTablet", "value":"2" }, + { "name":"k_ESteamDeviceFormFactorComputer", "value":"3" }, + { "name":"k_ESteamDeviceFormFactorTV", "value":"4" }, + { "name":"k_ESteamDeviceFormFactorVRHeadset", "value":"5" } + ] + }, + { + "enumname": "ERemotePlayInputType", + "values": [ + { "name":"k_ERemotePlayInputUnknown", "value":"0" }, + { "name":"k_ERemotePlayInputMouseMotion", "value":"1" }, + { "name":"k_ERemotePlayInputMouseButtonDown", "value":"2" }, + { "name":"k_ERemotePlayInputMouseButtonUp", "value":"3" }, + { "name":"k_ERemotePlayInputMouseWheel", "value":"4" }, + { "name":"k_ERemotePlayInputKeyDown", "value":"5" }, + { "name":"k_ERemotePlayInputKeyUp", "value":"6" } + ] + }, + { + "enumname": "ERemotePlayMouseButton", + "values": [ + { "name":"k_ERemotePlayMouseButtonLeft", "value":"1" }, + { "name":"k_ERemotePlayMouseButtonRight", "value":"2" }, + { "name":"k_ERemotePlayMouseButtonMiddle", "value":"16" }, + { "name":"k_ERemotePlayMouseButtonX1", "value":"32" }, + { "name":"k_ERemotePlayMouseButtonX2", "value":"64" } + ] + }, + { + "enumname": "ERemotePlayMouseWheelDirection", + "values": [ + { "name":"k_ERemotePlayMouseWheelUp", "value":"1" }, + { "name":"k_ERemotePlayMouseWheelDown", "value":"2" }, + { "name":"k_ERemotePlayMouseWheelLeft", "value":"3" }, + { "name":"k_ERemotePlayMouseWheelRight", "value":"4" } + ] + }, + { + "enumname": "ERemotePlayScancode", + "values": [ + { "name":"k_ERemotePlayScancodeUnknown", "value":"0" }, + { "name":"k_ERemotePlayScancodeA", "value":"4" }, + { "name":"k_ERemotePlayScancodeB", "value":"5" }, + { "name":"k_ERemotePlayScancodeC", "value":"6" }, + { "name":"k_ERemotePlayScancodeD", "value":"7" }, + { "name":"k_ERemotePlayScancodeE", "value":"8" }, + { "name":"k_ERemotePlayScancodeF", "value":"9" }, + { "name":"k_ERemotePlayScancodeG", "value":"10" }, + { "name":"k_ERemotePlayScancodeH", "value":"11" }, + { "name":"k_ERemotePlayScancodeI", "value":"12" }, + { "name":"k_ERemotePlayScancodeJ", "value":"13" }, + { "name":"k_ERemotePlayScancodeK", "value":"14" }, + { "name":"k_ERemotePlayScancodeL", "value":"15" }, + { "name":"k_ERemotePlayScancodeM", "value":"16" }, + { "name":"k_ERemotePlayScancodeN", "value":"17" }, + { "name":"k_ERemotePlayScancodeO", "value":"18" }, + { "name":"k_ERemotePlayScancodeP", "value":"19" }, + { "name":"k_ERemotePlayScancodeQ", "value":"20" }, + { "name":"k_ERemotePlayScancodeR", "value":"21" }, + { "name":"k_ERemotePlayScancodeS", "value":"22" }, + { "name":"k_ERemotePlayScancodeT", "value":"23" }, + { "name":"k_ERemotePlayScancodeU", "value":"24" }, + { "name":"k_ERemotePlayScancodeV", "value":"25" }, + { "name":"k_ERemotePlayScancodeW", "value":"26" }, + { "name":"k_ERemotePlayScancodeX", "value":"27" }, + { "name":"k_ERemotePlayScancodeY", "value":"28" }, + { "name":"k_ERemotePlayScancodeZ", "value":"29" }, + { "name":"k_ERemotePlayScancode1", "value":"30" }, + { "name":"k_ERemotePlayScancode2", "value":"31" }, + { "name":"k_ERemotePlayScancode3", "value":"32" }, + { "name":"k_ERemotePlayScancode4", "value":"33" }, + { "name":"k_ERemotePlayScancode5", "value":"34" }, + { "name":"k_ERemotePlayScancode6", "value":"35" }, + { "name":"k_ERemotePlayScancode7", "value":"36" }, + { "name":"k_ERemotePlayScancode8", "value":"37" }, + { "name":"k_ERemotePlayScancode9", "value":"38" }, + { "name":"k_ERemotePlayScancode0", "value":"39" }, + { "name":"k_ERemotePlayScancodeReturn", "value":"40" }, + { "name":"k_ERemotePlayScancodeEscape", "value":"41" }, + { "name":"k_ERemotePlayScancodeBackspace", "value":"42" }, + { "name":"k_ERemotePlayScancodeTab", "value":"43" }, + { "name":"k_ERemotePlayScancodeSpace", "value":"44" }, + { "name":"k_ERemotePlayScancodeMinus", "value":"45" }, + { "name":"k_ERemotePlayScancodeEquals", "value":"46" }, + { "name":"k_ERemotePlayScancodeLeftBracket", "value":"47" }, + { "name":"k_ERemotePlayScancodeRightBracket", "value":"48" }, + { "name":"k_ERemotePlayScancodeBackslash", "value":"49" }, + { "name":"k_ERemotePlayScancodeSemicolon", "value":"51" }, + { "name":"k_ERemotePlayScancodeApostrophe", "value":"52" }, + { "name":"k_ERemotePlayScancodeGrave", "value":"53" }, + { "name":"k_ERemotePlayScancodeComma", "value":"54" }, + { "name":"k_ERemotePlayScancodePeriod", "value":"55" }, + { "name":"k_ERemotePlayScancodeSlash", "value":"56" }, + { "name":"k_ERemotePlayScancodeCapsLock", "value":"57" }, + { "name":"k_ERemotePlayScancodeF1", "value":"58" }, + { "name":"k_ERemotePlayScancodeF2", "value":"59" }, + { "name":"k_ERemotePlayScancodeF3", "value":"60" }, + { "name":"k_ERemotePlayScancodeF4", "value":"61" }, + { "name":"k_ERemotePlayScancodeF5", "value":"62" }, + { "name":"k_ERemotePlayScancodeF6", "value":"63" }, + { "name":"k_ERemotePlayScancodeF7", "value":"64" }, + { "name":"k_ERemotePlayScancodeF8", "value":"65" }, + { "name":"k_ERemotePlayScancodeF9", "value":"66" }, + { "name":"k_ERemotePlayScancodeF10", "value":"67" }, + { "name":"k_ERemotePlayScancodeF11", "value":"68" }, + { "name":"k_ERemotePlayScancodeF12", "value":"69" }, + { "name":"k_ERemotePlayScancodeInsert", "value":"73" }, + { "name":"k_ERemotePlayScancodeHome", "value":"74" }, + { "name":"k_ERemotePlayScancodePageUp", "value":"75" }, + { "name":"k_ERemotePlayScancodeDelete", "value":"76" }, + { "name":"k_ERemotePlayScancodeEnd", "value":"77" }, + { "name":"k_ERemotePlayScancodePageDown", "value":"78" }, + { "name":"k_ERemotePlayScancodeRight", "value":"79" }, + { "name":"k_ERemotePlayScancodeLeft", "value":"80" }, + { "name":"k_ERemotePlayScancodeDown", "value":"81" }, + { "name":"k_ERemotePlayScancodeUp", "value":"82" }, + { "name":"k_ERemotePlayScancodeLeftControl", "value":"224" }, + { "name":"k_ERemotePlayScancodeLeftShift", "value":"225" }, + { "name":"k_ERemotePlayScancodeLeftAlt", "value":"226" }, + { "name":"k_ERemotePlayScancodeLeftGUI", "value":"227" }, + { "name":"k_ERemotePlayScancodeRightControl", "value":"228" }, + { "name":"k_ERemotePlayScancodeRightShift", "value":"229" }, + { "name":"k_ERemotePlayScancodeRightALT", "value":"230" }, + { "name":"k_ERemotePlayScancodeRightGUI", "value":"231" } + ] + }, + { + "enumname": "ERemotePlayKeyModifier", + "values": [ + { "name":"k_ERemotePlayKeyModifierNone", "value":"0" }, + { "name":"k_ERemotePlayKeyModifierLeftShift", "value":"1" }, + { "name":"k_ERemotePlayKeyModifierRightShift", "value":"2" }, + { "name":"k_ERemotePlayKeyModifierLeftControl", "value":"64" }, + { "name":"k_ERemotePlayKeyModifierRightControl", "value":"128" }, + { "name":"k_ERemotePlayKeyModifierLeftAlt", "value":"256" }, + { "name":"k_ERemotePlayKeyModifierRightAlt", "value":"512" }, + { "name":"k_ERemotePlayKeyModifierLeftGUI", "value":"1024" }, + { "name":"k_ERemotePlayKeyModifierRightGUI", "value":"2048" }, + { "name":"k_ERemotePlayKeyModifierNumLock", "value":"4096" }, + { "name":"k_ERemotePlayKeyModifierCapsLock", "value":"8192" }, + { "name":"k_ERemotePlayKeyModifierMask", "value":"65535" } + ] + }, + { + "enumname": "ESteamNetworkingAvailability", + "values": [ + { "name":"k_ESteamNetworkingAvailability_CannotTry", "value":"-102" }, + { "name":"k_ESteamNetworkingAvailability_Failed", "value":"-101" }, + { "name":"k_ESteamNetworkingAvailability_Previously", "value":"-100" }, + { "name":"k_ESteamNetworkingAvailability_Retrying", "value":"-10" }, + { "name":"k_ESteamNetworkingAvailability_NeverTried", "value":"1" }, + { "name":"k_ESteamNetworkingAvailability_Waiting", "value":"2" }, + { "name":"k_ESteamNetworkingAvailability_Attempting", "value":"3" }, + { "name":"k_ESteamNetworkingAvailability_Current", "value":"100" }, + { "name":"k_ESteamNetworkingAvailability_Unknown", "value":"0" }, + { "name":"k_ESteamNetworkingAvailability__Force32bit", "value":"2147483647" } + ] + }, + { + "enumname": "ESteamNetworkingIdentityType", + "values": [ + { "name":"k_ESteamNetworkingIdentityType_Invalid", "value":"0" }, + { "name":"k_ESteamNetworkingIdentityType_SteamID", "value":"16" }, + { "name":"k_ESteamNetworkingIdentityType_XboxPairwiseID", "value":"17" }, + { "name":"k_ESteamNetworkingIdentityType_SonyPSN", "value":"18" }, + { "name":"k_ESteamNetworkingIdentityType_IPAddress", "value":"1" }, + { "name":"k_ESteamNetworkingIdentityType_GenericString", "value":"2" }, + { "name":"k_ESteamNetworkingIdentityType_GenericBytes", "value":"3" }, + { "name":"k_ESteamNetworkingIdentityType_UnknownType", "value":"4" }, + { "name":"k_ESteamNetworkingIdentityType__Force32bit", "value":"2147483647" } + ] + }, + { + "enumname": "ESteamNetworkingFakeIPType", + "values": [ + { "name":"k_ESteamNetworkingFakeIPType_Invalid", "value":"0" }, + { "name":"k_ESteamNetworkingFakeIPType_NotFake", "value":"1" }, + { "name":"k_ESteamNetworkingFakeIPType_GlobalIPv4", "value":"2" }, + { "name":"k_ESteamNetworkingFakeIPType_LocalIPv4", "value":"3" }, + { "name":"k_ESteamNetworkingFakeIPType__Force32Bit", "value":"2147483647" } + ] + }, + { + "enumname": "ESteamNetworkingConnectionState", + "values": [ + { "name":"k_ESteamNetworkingConnectionState_None", "value":"0" }, + { "name":"k_ESteamNetworkingConnectionState_Connecting", "value":"1" }, + { "name":"k_ESteamNetworkingConnectionState_FindingRoute", "value":"2" }, + { "name":"k_ESteamNetworkingConnectionState_Connected", "value":"3" }, + { "name":"k_ESteamNetworkingConnectionState_ClosedByPeer", "value":"4" }, + { "name":"k_ESteamNetworkingConnectionState_ProblemDetectedLocally", "value":"5" }, + { "name":"k_ESteamNetworkingConnectionState_FinWait", "value":"-1" }, + { "name":"k_ESteamNetworkingConnectionState_Linger", "value":"-2" }, + { "name":"k_ESteamNetworkingConnectionState_Dead", "value":"-3" }, + { "name":"k_ESteamNetworkingConnectionState__Force32Bit", "value":"2147483647" } + ] + }, + { + "enumname": "ESteamNetConnectionEnd", + "values": [ + { "name":"k_ESteamNetConnectionEnd_Invalid", "value":"0" }, + { "name":"k_ESteamNetConnectionEnd_App_Min", "value":"1000" }, + { "name":"k_ESteamNetConnectionEnd_App_Generic", "value":"1000" }, + { "name":"k_ESteamNetConnectionEnd_App_Max", "value":"1999" }, + { "name":"k_ESteamNetConnectionEnd_AppException_Min", "value":"2000" }, + { "name":"k_ESteamNetConnectionEnd_AppException_Generic", "value":"2000" }, + { "name":"k_ESteamNetConnectionEnd_AppException_Max", "value":"2999" }, + { "name":"k_ESteamNetConnectionEnd_Local_Min", "value":"3000" }, + { "name":"k_ESteamNetConnectionEnd_Local_OfflineMode", "value":"3001" }, + { "name":"k_ESteamNetConnectionEnd_Local_ManyRelayConnectivity", "value":"3002" }, + { "name":"k_ESteamNetConnectionEnd_Local_HostedServerPrimaryRelay", "value":"3003" }, + { "name":"k_ESteamNetConnectionEnd_Local_NetworkConfig", "value":"3004" }, + { "name":"k_ESteamNetConnectionEnd_Local_Rights", "value":"3005" }, + { "name":"k_ESteamNetConnectionEnd_Local_P2P_ICE_NoPublicAddresses", "value":"3006" }, + { "name":"k_ESteamNetConnectionEnd_Local_Max", "value":"3999" }, + { "name":"k_ESteamNetConnectionEnd_Remote_Min", "value":"4000" }, + { "name":"k_ESteamNetConnectionEnd_Remote_Timeout", "value":"4001" }, + { "name":"k_ESteamNetConnectionEnd_Remote_BadCrypt", "value":"4002" }, + { "name":"k_ESteamNetConnectionEnd_Remote_BadCert", "value":"4003" }, + { "name":"k_ESteamNetConnectionEnd_Remote_BadProtocolVersion", "value":"4006" }, + { "name":"k_ESteamNetConnectionEnd_Remote_P2P_ICE_NoPublicAddresses", "value":"4007" }, + { "name":"k_ESteamNetConnectionEnd_Remote_Max", "value":"4999" }, + { "name":"k_ESteamNetConnectionEnd_Misc_Min", "value":"5000" }, + { "name":"k_ESteamNetConnectionEnd_Misc_Generic", "value":"5001" }, + { "name":"k_ESteamNetConnectionEnd_Misc_InternalError", "value":"5002" }, + { "name":"k_ESteamNetConnectionEnd_Misc_Timeout", "value":"5003" }, + { "name":"k_ESteamNetConnectionEnd_Misc_SteamConnectivity", "value":"5005" }, + { "name":"k_ESteamNetConnectionEnd_Misc_NoRelaySessionsToClient", "value":"5006" }, + { "name":"k_ESteamNetConnectionEnd_Misc_P2P_Rendezvous", "value":"5008" }, + { "name":"k_ESteamNetConnectionEnd_Misc_P2P_NAT_Firewall", "value":"5009" }, + { "name":"k_ESteamNetConnectionEnd_Misc_PeerSentNoConnection", "value":"5010" }, + { "name":"k_ESteamNetConnectionEnd_Misc_Max", "value":"5999" }, + { "name":"k_ESteamNetConnectionEnd__Force32Bit", "value":"2147483647" } + ] + }, + { + "enumname": "ESteamNetworkingConfigScope", + "values": [ + { "name":"k_ESteamNetworkingConfig_Global", "value":"1" }, + { "name":"k_ESteamNetworkingConfig_SocketsInterface", "value":"2" }, + { "name":"k_ESteamNetworkingConfig_ListenSocket", "value":"3" }, + { "name":"k_ESteamNetworkingConfig_Connection", "value":"4" }, + { "name":"k_ESteamNetworkingConfigScope__Force32Bit", "value":"2147483647" } + ] + }, + { + "enumname": "ESteamNetworkingConfigDataType", + "values": [ + { "name":"k_ESteamNetworkingConfig_Int32", "value":"1" }, + { "name":"k_ESteamNetworkingConfig_Int64", "value":"2" }, + { "name":"k_ESteamNetworkingConfig_Float", "value":"3" }, + { "name":"k_ESteamNetworkingConfig_String", "value":"4" }, + { "name":"k_ESteamNetworkingConfig_Ptr", "value":"5" }, + { "name":"k_ESteamNetworkingConfigDataType__Force32Bit", "value":"2147483647" } + ] + }, + { + "enumname": "ESteamNetworkingConfigValue", + "values": [ + { "name":"k_ESteamNetworkingConfig_Invalid", "value":"0" }, + { "name":"k_ESteamNetworkingConfig_TimeoutInitial", "value":"24" }, + { "name":"k_ESteamNetworkingConfig_TimeoutConnected", "value":"25" }, + { "name":"k_ESteamNetworkingConfig_SendBufferSize", "value":"9" }, + { "name":"k_ESteamNetworkingConfig_RecvBufferSize", "value":"47" }, + { "name":"k_ESteamNetworkingConfig_RecvBufferMessages", "value":"48" }, + { "name":"k_ESteamNetworkingConfig_RecvMaxMessageSize", "value":"49" }, + { "name":"k_ESteamNetworkingConfig_RecvMaxSegmentsPerPacket", "value":"50" }, + { "name":"k_ESteamNetworkingConfig_ConnectionUserData", "value":"40" }, + { "name":"k_ESteamNetworkingConfig_SendRateMin", "value":"10" }, + { "name":"k_ESteamNetworkingConfig_SendRateMax", "value":"11" }, + { "name":"k_ESteamNetworkingConfig_NagleTime", "value":"12" }, + { "name":"k_ESteamNetworkingConfig_IP_AllowWithoutAuth", "value":"23" }, + { "name":"k_ESteamNetworkingConfig_IPLocalHost_AllowWithoutAuth", "value":"52" }, + { "name":"k_ESteamNetworkingConfig_MTU_PacketSize", "value":"32" }, + { "name":"k_ESteamNetworkingConfig_MTU_DataSize", "value":"33" }, + { "name":"k_ESteamNetworkingConfig_Unencrypted", "value":"34" }, + { "name":"k_ESteamNetworkingConfig_SymmetricConnect", "value":"37" }, + { "name":"k_ESteamNetworkingConfig_LocalVirtualPort", "value":"38" }, + { "name":"k_ESteamNetworkingConfig_DualWifi_Enable", "value":"39" }, + { "name":"k_ESteamNetworkingConfig_EnableDiagnosticsUI", "value":"46" }, + { "name":"k_ESteamNetworkingConfig_SendTimeSincePreviousPacket", "value":"59" }, + { "name":"k_ESteamNetworkingConfig_FakePacketLoss_Send", "value":"2" }, + { "name":"k_ESteamNetworkingConfig_FakePacketLoss_Recv", "value":"3" }, + { "name":"k_ESteamNetworkingConfig_FakePacketLag_Send", "value":"4" }, + { "name":"k_ESteamNetworkingConfig_FakePacketLag_Recv", "value":"5" }, + { "name":"k_ESteamNetworkingConfig_FakePacketJitter_Send_Avg", "value":"53" }, + { "name":"k_ESteamNetworkingConfig_FakePacketJitter_Send_Max", "value":"54" }, + { "name":"k_ESteamNetworkingConfig_FakePacketJitter_Send_Pct", "value":"55" }, + { "name":"k_ESteamNetworkingConfig_FakePacketJitter_Recv_Avg", "value":"56" }, + { "name":"k_ESteamNetworkingConfig_FakePacketJitter_Recv_Max", "value":"57" }, + { "name":"k_ESteamNetworkingConfig_FakePacketJitter_Recv_Pct", "value":"58" }, + { "name":"k_ESteamNetworkingConfig_FakePacketReorder_Send", "value":"6" }, + { "name":"k_ESteamNetworkingConfig_FakePacketReorder_Recv", "value":"7" }, + { "name":"k_ESteamNetworkingConfig_FakePacketReorder_Time", "value":"8" }, + { "name":"k_ESteamNetworkingConfig_FakePacketDup_Send", "value":"26" }, + { "name":"k_ESteamNetworkingConfig_FakePacketDup_Recv", "value":"27" }, + { "name":"k_ESteamNetworkingConfig_FakePacketDup_TimeMax", "value":"28" }, + { "name":"k_ESteamNetworkingConfig_PacketTraceMaxBytes", "value":"41" }, + { "name":"k_ESteamNetworkingConfig_FakeRateLimit_Send_Rate", "value":"42" }, + { "name":"k_ESteamNetworkingConfig_FakeRateLimit_Send_Burst", "value":"43" }, + { "name":"k_ESteamNetworkingConfig_FakeRateLimit_Recv_Rate", "value":"44" }, + { "name":"k_ESteamNetworkingConfig_FakeRateLimit_Recv_Burst", "value":"45" }, + { "name":"k_ESteamNetworkingConfig_OutOfOrderCorrectionWindowMicroseconds", "value":"51" }, + { "name":"k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged", "value":"201" }, + { "name":"k_ESteamNetworkingConfig_Callback_AuthStatusChanged", "value":"202" }, + { "name":"k_ESteamNetworkingConfig_Callback_RelayNetworkStatusChanged", "value":"203" }, + { "name":"k_ESteamNetworkingConfig_Callback_MessagesSessionRequest", "value":"204" }, + { "name":"k_ESteamNetworkingConfig_Callback_MessagesSessionFailed", "value":"205" }, + { "name":"k_ESteamNetworkingConfig_Callback_CreateConnectionSignaling", "value":"206" }, + { "name":"k_ESteamNetworkingConfig_Callback_FakeIPResult", "value":"207" }, + { "name":"k_ESteamNetworkingConfig_P2P_STUN_ServerList", "value":"103" }, + { "name":"k_ESteamNetworkingConfig_P2P_Transport_ICE_Enable", "value":"104" }, + { "name":"k_ESteamNetworkingConfig_P2P_Transport_ICE_Penalty", "value":"105" }, + { "name":"k_ESteamNetworkingConfig_P2P_Transport_SDR_Penalty", "value":"106" }, + { "name":"k_ESteamNetworkingConfig_P2P_TURN_ServerList", "value":"107" }, + { "name":"k_ESteamNetworkingConfig_P2P_TURN_UserList", "value":"108" }, + { "name":"k_ESteamNetworkingConfig_P2P_TURN_PassList", "value":"109" }, + { "name":"k_ESteamNetworkingConfig_P2P_Transport_ICE_Implementation", "value":"110" }, + { "name":"k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFailInitial", "value":"19" }, + { "name":"k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFail", "value":"20" }, + { "name":"k_ESteamNetworkingConfig_SDRClient_MinPingsBeforePingAccurate", "value":"21" }, + { "name":"k_ESteamNetworkingConfig_SDRClient_SingleSocket", "value":"22" }, + { "name":"k_ESteamNetworkingConfig_SDRClient_ForceRelayCluster", "value":"29" }, + { "name":"k_ESteamNetworkingConfig_SDRClient_DevTicket", "value":"30" }, + { "name":"k_ESteamNetworkingConfig_SDRClient_ForceProxyAddr", "value":"31" }, + { "name":"k_ESteamNetworkingConfig_SDRClient_FakeClusterPing", "value":"36" }, + { "name":"k_ESteamNetworkingConfig_SDRClient_LimitPingProbesToNearestN", "value":"60" }, + { "name":"k_ESteamNetworkingConfig_LogLevel_AckRTT", "value":"13" }, + { "name":"k_ESteamNetworkingConfig_LogLevel_PacketDecode", "value":"14" }, + { "name":"k_ESteamNetworkingConfig_LogLevel_Message", "value":"15" }, + { "name":"k_ESteamNetworkingConfig_LogLevel_PacketGaps", "value":"16" }, + { "name":"k_ESteamNetworkingConfig_LogLevel_P2PRendezvous", "value":"17" }, + { "name":"k_ESteamNetworkingConfig_LogLevel_SDRRelayPings", "value":"18" }, + { "name":"k_ESteamNetworkingConfig_ECN", "value":"999" }, + { "name":"k_ESteamNetworkingConfig_DELETED_EnumerateDevVars", "value":"35" }, + { "name":"k_ESteamNetworkingConfigValue__Force32Bit", "value":"2147483647" } + ] + }, + { + "enumname": "ESteamNetworkingGetConfigValueResult", + "values": [ + { "name":"k_ESteamNetworkingGetConfigValue_BadValue", "value":"-1" }, + { "name":"k_ESteamNetworkingGetConfigValue_BadScopeObj", "value":"-2" }, + { "name":"k_ESteamNetworkingGetConfigValue_BufferTooSmall", "value":"-3" }, + { "name":"k_ESteamNetworkingGetConfigValue_OK", "value":"1" }, + { "name":"k_ESteamNetworkingGetConfigValue_OKInherited", "value":"2" }, + { "name":"k_ESteamNetworkingGetConfigValueResult__Force32Bit", "value":"2147483647" } + ] + }, + { + "enumname": "ESteamNetworkingSocketsDebugOutputType", + "values": [ + { "name":"k_ESteamNetworkingSocketsDebugOutputType_None", "value":"0" }, + { "name":"k_ESteamNetworkingSocketsDebugOutputType_Bug", "value":"1" }, + { "name":"k_ESteamNetworkingSocketsDebugOutputType_Error", "value":"2" }, + { "name":"k_ESteamNetworkingSocketsDebugOutputType_Important", "value":"3" }, + { "name":"k_ESteamNetworkingSocketsDebugOutputType_Warning", "value":"4" }, + { "name":"k_ESteamNetworkingSocketsDebugOutputType_Msg", "value":"5" }, + { "name":"k_ESteamNetworkingSocketsDebugOutputType_Verbose", "value":"6" }, + { "name":"k_ESteamNetworkingSocketsDebugOutputType_Debug", "value":"7" }, + { "name":"k_ESteamNetworkingSocketsDebugOutputType_Everything", "value":"8" }, + { "name":"k_ESteamNetworkingSocketsDebugOutputType__Force32Bit", "value":"2147483647" } + ] + }, + { + "enumname": "ESteamAPIInitResult", + "values": [ + { "name":"k_ESteamAPIInitResult_OK", "value":"0" }, + { "name":"k_ESteamAPIInitResult_FailedGeneric", "value":"1" }, + { "name":"k_ESteamAPIInitResult_NoSteamClient", "value":"2" }, + { "name":"k_ESteamAPIInitResult_VersionMismatch", "value":"3" } + ] + }, + { + "enumname": "EServerMode", + "values": [ + { "name":"eServerModeInvalid", "value":"0" }, + { "name":"eServerModeNoAuthentication", "value":"1" }, + { "name":"eServerModeAuthentication", "value":"2" }, + { "name":"eServerModeAuthenticationAndSecure", "value":"3" } + ] + } + ], + "interfaces": [ + { + "classname": "ISteamClient", + "fields": [], + "methods": [ + { + "methodname": "CreateSteamPipe", + "methodname_flat": "SteamAPI_ISteamClient_CreateSteamPipe", + "params": [], + "returntype": "HSteamPipe" + }, + { + "methodname": "BReleaseSteamPipe", + "methodname_flat": "SteamAPI_ISteamClient_BReleaseSteamPipe", + "params": [ + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" } + ], + "returntype": "bool" + }, + { + "methodname": "ConnectToGlobalUser", + "methodname_flat": "SteamAPI_ISteamClient_ConnectToGlobalUser", + "params": [ + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" } + ], + "returntype": "HSteamUser" + }, + { + "methodname": "CreateLocalUser", + "methodname_flat": "SteamAPI_ISteamClient_CreateLocalUser", + "params": [ + { "paramname":"phSteamPipe", "paramtype":"HSteamPipe *" }, + { "paramname":"eAccountType", "paramtype":"EAccountType" } + ], + "returntype": "HSteamUser" + }, + { + "methodname": "ReleaseUser", + "methodname_flat": "SteamAPI_ISteamClient_ReleaseUser", + "params": [ + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"hUser", "paramtype":"HSteamUser" } + ], + "returntype": "void" + }, + { + "methodname": "GetISteamUser", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamUser", + "params": [ + { "paramname":"hSteamUser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamUser *" + }, + { + "methodname": "GetISteamGameServer", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamGameServer", + "params": [ + { "paramname":"hSteamUser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamGameServer *" + }, + { + "methodname": "SetLocalIPBinding", + "methodname_flat": "SteamAPI_ISteamClient_SetLocalIPBinding", + "params": [ + { "paramname":"unIP", "paramtype":"const SteamIPAddress_t &" }, + { "paramname":"usPort", "paramtype":"uint16" } + ], + "returntype": "void" + }, + { + "methodname": "GetISteamFriends", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamFriends", + "params": [ + { "paramname":"hSteamUser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamFriends *" + }, + { + "methodname": "GetISteamUtils", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamUtils", + "params": [ + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamUtils *" + }, + { + "methodname": "GetISteamMatchmaking", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamMatchmaking", + "params": [ + { "paramname":"hSteamUser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamMatchmaking *" + }, + { + "methodname": "GetISteamMatchmakingServers", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamMatchmakingServers", + "params": [ + { "paramname":"hSteamUser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamMatchmakingServers *" + }, + { + "methodname": "GetISteamGenericInterface", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamGenericInterface", + "params": [ + { "paramname":"hSteamUser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "void *" + }, + { + "methodname": "GetISteamUserStats", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamUserStats", + "params": [ + { "paramname":"hSteamUser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamUserStats *" + }, + { + "methodname": "GetISteamGameServerStats", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamGameServerStats", + "params": [ + { "paramname":"hSteamuser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamGameServerStats *" + }, + { + "methodname": "GetISteamApps", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamApps", + "params": [ + { "paramname":"hSteamUser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamApps *" + }, + { + "methodname": "GetISteamNetworking", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamNetworking", + "params": [ + { "paramname":"hSteamUser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamNetworking *" + }, + { + "methodname": "GetISteamRemoteStorage", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamRemoteStorage", + "params": [ + { "paramname":"hSteamuser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamRemoteStorage *" + }, + { + "methodname": "GetISteamScreenshots", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamScreenshots", + "params": [ + { "paramname":"hSteamuser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamScreenshots *" + }, + { + "methodname": "GetISteamGameSearch", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamGameSearch", + "params": [ + { "paramname":"hSteamuser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamGameSearch *" + }, + { + "methodname": "GetIPCCallCount", + "methodname_flat": "SteamAPI_ISteamClient_GetIPCCallCount", + "params": [], + "returntype": "uint32" + }, + { + "methodname": "SetWarningMessageHook", + "methodname_flat": "SteamAPI_ISteamClient_SetWarningMessageHook", + "params": [ + { "paramname":"pFunction", "paramtype":"SteamAPIWarningMessageHook_t" } + ], + "returntype": "void" + }, + { + "methodname": "BShutdownIfAllPipesClosed", + "methodname_flat": "SteamAPI_ISteamClient_BShutdownIfAllPipesClosed", + "params": [], + "returntype": "bool" + }, + { + "methodname": "GetISteamHTTP", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamHTTP", + "params": [ + { "paramname":"hSteamuser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamHTTP *" + }, + { + "methodname": "GetISteamController", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamController", + "params": [ + { "paramname":"hSteamUser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamController *" + }, + { + "methodname": "GetISteamUGC", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamUGC", + "params": [ + { "paramname":"hSteamUser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamUGC *" + }, + { + "methodname": "GetISteamMusic", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamMusic", + "params": [ + { "paramname":"hSteamuser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamMusic *" + }, + { + "methodname": "GetISteamMusicRemote", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamMusicRemote", + "params": [ + { "paramname":"hSteamuser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamMusicRemote *" + }, + { + "methodname": "GetISteamHTMLSurface", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamHTMLSurface", + "params": [ + { "paramname":"hSteamuser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamHTMLSurface *" + }, + { + "methodname": "GetISteamInventory", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamInventory", + "params": [ + { "paramname":"hSteamuser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamInventory *" + }, + { + "methodname": "GetISteamVideo", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamVideo", + "params": [ + { "paramname":"hSteamuser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamVideo *" + }, + { + "methodname": "GetISteamParentalSettings", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamParentalSettings", + "params": [ + { "paramname":"hSteamuser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamParentalSettings *" + }, + { + "methodname": "GetISteamInput", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamInput", + "params": [ + { "paramname":"hSteamUser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamInput *" + }, + { + "methodname": "GetISteamParties", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamParties", + "params": [ + { "paramname":"hSteamUser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamParties *" + }, + { + "methodname": "GetISteamRemotePlay", + "methodname_flat": "SteamAPI_ISteamClient_GetISteamRemotePlay", + "params": [ + { "paramname":"hSteamUser", "paramtype":"HSteamUser" }, + { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, + { "paramname":"pchVersion", "paramtype":"const char *" } + ], + "returntype": "ISteamRemotePlay *" + } + ] + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamUser", + "name_flat": "SteamAPI_SteamUser_v023" + } + ], + "classname": "ISteamUser", + "fields": [], + "methods": [ + { + "methodname": "GetHSteamUser", + "methodname_flat": "SteamAPI_ISteamUser_GetHSteamUser", + "params": [], + "returntype": "HSteamUser" + }, + { + "methodname": "BLoggedOn", + "methodname_flat": "SteamAPI_ISteamUser_BLoggedOn", + "params": [], + "returntype": "bool" + }, + { + "methodname": "GetSteamID", + "methodname_flat": "SteamAPI_ISteamUser_GetSteamID", + "params": [], + "returntype": "CSteamID", + "returntype_flat": "uint64_steamid" + }, + { + "methodname": "InitiateGameConnection_DEPRECATED", + "methodname_flat": "SteamAPI_ISteamUser_InitiateGameConnection_DEPRECATED", + "params": [ + { "paramname":"pAuthBlob", "paramtype":"void *" }, + { "paramname":"cbMaxAuthBlob", "paramtype":"int" }, + { "paramname":"steamIDGameServer", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"unIPServer", "paramtype":"uint32" }, + { "paramname":"usPortServer", "paramtype":"uint16" }, + { "paramname":"bSecure", "paramtype":"bool" } + ], + "returntype": "int" + }, + { + "methodname": "TerminateGameConnection_DEPRECATED", + "methodname_flat": "SteamAPI_ISteamUser_TerminateGameConnection_DEPRECATED", + "params": [ + { "paramname":"unIPServer", "paramtype":"uint32" }, + { "paramname":"usPortServer", "paramtype":"uint16" } + ], + "returntype": "void" + }, + { + "methodname": "TrackAppUsageEvent", + "methodname_flat": "SteamAPI_ISteamUser_TrackAppUsageEvent", + "params": [ + { "paramname":"gameID", "paramtype":"CGameID", "paramtype_flat":"uint64_gameid" }, + { "paramname":"eAppUsageEvent", "paramtype":"int" }, + { "paramname":"pchExtraInfo", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "GetUserDataFolder", + "methodname_flat": "SteamAPI_ISteamUser_GetUserDataFolder", + "params": [ + { "paramname":"pchBuffer", "paramtype":"char *" }, + { "paramname":"cubBuffer", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "StartVoiceRecording", + "methodname_flat": "SteamAPI_ISteamUser_StartVoiceRecording", + "params": [], + "returntype": "void" + }, + { + "methodname": "StopVoiceRecording", + "methodname_flat": "SteamAPI_ISteamUser_StopVoiceRecording", + "params": [], + "returntype": "void" + }, + { + "methodname": "GetAvailableVoice", + "methodname_flat": "SteamAPI_ISteamUser_GetAvailableVoice", + "params": [ + { "paramname":"pcbCompressed", "paramtype":"uint32 *" }, + { "paramname":"pcbUncompressed_Deprecated", "paramtype":"uint32 *" }, + { "paramname":"nUncompressedVoiceDesiredSampleRate_Deprecated", "paramtype":"uint32" } + ], + "returntype": "EVoiceResult" + }, + { + "methodname": "GetVoice", + "methodname_flat": "SteamAPI_ISteamUser_GetVoice", + "params": [ + { "paramname":"bWantCompressed", "paramtype":"bool" }, + { "paramname":"pDestBuffer", "paramtype":"void *" }, + { "paramname":"cbDestBufferSize", "paramtype":"uint32" }, + { "paramname":"nBytesWritten", "paramtype":"uint32 *" }, + { "paramname":"bWantUncompressed_Deprecated", "paramtype":"bool" }, + { "paramname":"pUncompressedDestBuffer_Deprecated", "paramtype":"void *" }, + { "paramname":"cbUncompressedDestBufferSize_Deprecated", "paramtype":"uint32" }, + { "paramname":"nUncompressBytesWritten_Deprecated", "paramtype":"uint32 *" }, + { "paramname":"nUncompressedVoiceDesiredSampleRate_Deprecated", "paramtype":"uint32" } + ], + "returntype": "EVoiceResult" + }, + { + "methodname": "DecompressVoice", + "methodname_flat": "SteamAPI_ISteamUser_DecompressVoice", + "params": [ + { "paramname":"pCompressed", "paramtype":"const void *" }, + { "paramname":"cbCompressed", "paramtype":"uint32" }, + { "paramname":"pDestBuffer", "paramtype":"void *" }, + { "paramname":"cbDestBufferSize", "paramtype":"uint32" }, + { "paramname":"nBytesWritten", "paramtype":"uint32 *" }, + { "paramname":"nDesiredSampleRate", "paramtype":"uint32" } + ], + "returntype": "EVoiceResult" + }, + { + "methodname": "GetVoiceOptimalSampleRate", + "methodname_flat": "SteamAPI_ISteamUser_GetVoiceOptimalSampleRate", + "params": [], + "returntype": "uint32" + }, + { + "methodname": "GetAuthSessionTicket", + "methodname_flat": "SteamAPI_ISteamUser_GetAuthSessionTicket", + "params": [ + { "paramname":"pTicket", "paramtype":"void *" }, + { "paramname":"cbMaxTicket", "paramtype":"int" }, + { "paramname":"pcbTicket", "paramtype":"uint32 *" }, + { "paramname":"pSteamNetworkingIdentity", "paramtype":"const SteamNetworkingIdentity *" } + ], + "returntype": "HAuthTicket" + }, + { + "methodname": "GetAuthTicketForWebApi", + "methodname_flat": "SteamAPI_ISteamUser_GetAuthTicketForWebApi", + "params": [ + { "paramname":"pchIdentity", "paramtype":"const char *" } + ], + "returntype": "HAuthTicket" + }, + { + "methodname": "BeginAuthSession", + "methodname_flat": "SteamAPI_ISteamUser_BeginAuthSession", + "params": [ + { "paramname":"pAuthTicket", "paramtype":"const void *" }, + { "paramname":"cbAuthTicket", "paramtype":"int" }, + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "EBeginAuthSessionResult" + }, + { + "methodname": "EndAuthSession", + "methodname_flat": "SteamAPI_ISteamUser_EndAuthSession", + "params": [ + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "void" + }, + { + "methodname": "CancelAuthTicket", + "methodname_flat": "SteamAPI_ISteamUser_CancelAuthTicket", + "params": [ + { "paramname":"hAuthTicket", "paramtype":"HAuthTicket" } + ], + "returntype": "void" + }, + { + "methodname": "UserHasLicenseForApp", + "methodname_flat": "SteamAPI_ISteamUser_UserHasLicenseForApp", + "params": [ + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"appID", "paramtype":"AppId_t" } + ], + "returntype": "EUserHasLicenseForAppResult" + }, + { + "methodname": "BIsBehindNAT", + "methodname_flat": "SteamAPI_ISteamUser_BIsBehindNAT", + "params": [], + "returntype": "bool" + }, + { + "methodname": "AdvertiseGame", + "methodname_flat": "SteamAPI_ISteamUser_AdvertiseGame", + "params": [ + { "paramname":"steamIDGameServer", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"unIPServer", "paramtype":"uint32" }, + { "paramname":"usPortServer", "paramtype":"uint16" } + ], + "returntype": "void" + }, + { + "callresult": "EncryptedAppTicketResponse_t", + "methodname": "RequestEncryptedAppTicket", + "methodname_flat": "SteamAPI_ISteamUser_RequestEncryptedAppTicket", + "params": [ + { "paramname":"pDataToInclude", "paramtype":"void *" }, + { "paramname":"cbDataToInclude", "paramtype":"int" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetEncryptedAppTicket", + "methodname_flat": "SteamAPI_ISteamUser_GetEncryptedAppTicket", + "params": [ + { "paramname":"pTicket", "paramtype":"void *" }, + { "paramname":"cbMaxTicket", "paramtype":"int" }, + { "paramname":"pcbTicket", "paramtype":"uint32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetGameBadgeLevel", + "methodname_flat": "SteamAPI_ISteamUser_GetGameBadgeLevel", + "params": [ + { "paramname":"nSeries", "paramtype":"int" }, + { "paramname":"bFoil", "paramtype":"bool" } + ], + "returntype": "int" + }, + { + "methodname": "GetPlayerSteamLevel", + "methodname_flat": "SteamAPI_ISteamUser_GetPlayerSteamLevel", + "params": [], + "returntype": "int" + }, + { + "callresult": "StoreAuthURLResponse_t", + "methodname": "RequestStoreAuthURL", + "methodname_flat": "SteamAPI_ISteamUser_RequestStoreAuthURL", + "params": [ + { "paramname":"pchRedirectURL", "paramtype":"const char *" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "BIsPhoneVerified", + "methodname_flat": "SteamAPI_ISteamUser_BIsPhoneVerified", + "params": [], + "returntype": "bool" + }, + { + "methodname": "BIsTwoFactorEnabled", + "methodname_flat": "SteamAPI_ISteamUser_BIsTwoFactorEnabled", + "params": [], + "returntype": "bool" + }, + { + "methodname": "BIsPhoneIdentifying", + "methodname_flat": "SteamAPI_ISteamUser_BIsPhoneIdentifying", + "params": [], + "returntype": "bool" + }, + { + "methodname": "BIsPhoneRequiringVerification", + "methodname_flat": "SteamAPI_ISteamUser_BIsPhoneRequiringVerification", + "params": [], + "returntype": "bool" + }, + { + "callresult": "MarketEligibilityResponse_t", + "methodname": "GetMarketEligibility", + "methodname_flat": "SteamAPI_ISteamUser_GetMarketEligibility", + "params": [], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "DurationControl_t", + "methodname": "GetDurationControl", + "methodname_flat": "SteamAPI_ISteamUser_GetDurationControl", + "params": [], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "BSetDurationControlOnlineState", + "methodname_flat": "SteamAPI_ISteamUser_BSetDurationControlOnlineState", + "params": [ + { "paramname":"eNewState", "paramtype":"EDurationControlOnlineState" } + ], + "returntype": "bool" + } + ], + "version_string": "SteamUser023" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamFriends", + "name_flat": "SteamAPI_SteamFriends_v018" + } + ], + "classname": "ISteamFriends", + "fields": [], + "methods": [ + { + "methodname": "GetPersonaName", + "methodname_flat": "SteamAPI_ISteamFriends_GetPersonaName", + "params": [], + "returntype": "const char *" + }, + { + "methodname": "GetPersonaState", + "methodname_flat": "SteamAPI_ISteamFriends_GetPersonaState", + "params": [], + "returntype": "EPersonaState" + }, + { + "methodname": "GetFriendCount", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendCount", + "params": [ + { "paramname":"iFriendFlags", "paramtype":"int" } + ], + "returntype": "int" + }, + { + "methodname": "GetFriendByIndex", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendByIndex", + "params": [ + { "paramname":"iFriend", "paramtype":"int" }, + { "paramname":"iFriendFlags", "paramtype":"int" } + ], + "returntype": "CSteamID", + "returntype_flat": "uint64_steamid" + }, + { + "methodname": "GetFriendRelationship", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendRelationship", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "EFriendRelationship" + }, + { + "methodname": "GetFriendPersonaState", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendPersonaState", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "EPersonaState" + }, + { + "methodname": "GetFriendPersonaName", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendPersonaName", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetFriendGamePlayed", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendGamePlayed", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { + "out_struct": "", + "paramname": "pFriendGameInfo", + "paramtype": "FriendGameInfo_t *" + } + ], + "returntype": "bool" + }, + { + "methodname": "GetFriendPersonaNameHistory", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendPersonaNameHistory", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"iPersonaName", "paramtype":"int" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetFriendSteamLevel", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendSteamLevel", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "int" + }, + { + "methodname": "GetPlayerNickname", + "methodname_flat": "SteamAPI_ISteamFriends_GetPlayerNickname", + "params": [ + { "paramname":"steamIDPlayer", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetFriendsGroupCount", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendsGroupCount", + "params": [], + "returntype": "int" + }, + { + "methodname": "GetFriendsGroupIDByIndex", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex", + "params": [ + { "paramname":"iFG", "paramtype":"int" } + ], + "returntype": "FriendsGroupID_t" + }, + { + "methodname": "GetFriendsGroupName", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendsGroupName", + "params": [ + { "paramname":"friendsGroupID", "paramtype":"FriendsGroupID_t" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetFriendsGroupMembersCount", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendsGroupMembersCount", + "params": [ + { "paramname":"friendsGroupID", "paramtype":"FriendsGroupID_t" } + ], + "returntype": "int" + }, + { + "methodname": "GetFriendsGroupMembersList", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendsGroupMembersList", + "params": [ + { "paramname":"friendsGroupID", "paramtype":"FriendsGroupID_t" }, + { + "out_array_call": "nMembersCount,GetFriendsGroupMembersCount,friendsGroupID", + "paramname": "pOutSteamIDMembers", + "paramtype": "CSteamID *" + }, + { "paramname":"nMembersCount", "paramtype":"int" } + ], + "returntype": "void" + }, + { + "methodname": "HasFriend", + "methodname_flat": "SteamAPI_ISteamFriends_HasFriend", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"iFriendFlags", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "GetClanCount", + "methodname_flat": "SteamAPI_ISteamFriends_GetClanCount", + "params": [], + "returntype": "int" + }, + { + "methodname": "GetClanByIndex", + "methodname_flat": "SteamAPI_ISteamFriends_GetClanByIndex", + "params": [ + { "paramname":"iClan", "paramtype":"int" } + ], + "returntype": "CSteamID", + "returntype_flat": "uint64_steamid" + }, + { + "methodname": "GetClanName", + "methodname_flat": "SteamAPI_ISteamFriends_GetClanName", + "params": [ + { "paramname":"steamIDClan", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetClanTag", + "methodname_flat": "SteamAPI_ISteamFriends_GetClanTag", + "params": [ + { "paramname":"steamIDClan", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetClanActivityCounts", + "methodname_flat": "SteamAPI_ISteamFriends_GetClanActivityCounts", + "params": [ + { "paramname":"steamIDClan", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pnOnline", "paramtype":"int *" }, + { "paramname":"pnInGame", "paramtype":"int *" }, + { "paramname":"pnChatting", "paramtype":"int *" } + ], + "returntype": "bool" + }, + { + "callresult": "DownloadClanActivityCountsResult_t", + "methodname": "DownloadClanActivityCounts", + "methodname_flat": "SteamAPI_ISteamFriends_DownloadClanActivityCounts", + "params": [ + { + "array_count": "cClansToRequest", + "paramname": "psteamIDClans", + "paramtype": "CSteamID *" + }, + { "paramname":"cClansToRequest", "paramtype":"int" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetFriendCountFromSource", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendCountFromSource", + "params": [ + { "paramname":"steamIDSource", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "int" + }, + { + "methodname": "GetFriendFromSourceByIndex", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendFromSourceByIndex", + "params": [ + { "paramname":"steamIDSource", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"iFriend", "paramtype":"int" } + ], + "returntype": "CSteamID", + "returntype_flat": "uint64_steamid" + }, + { + "methodname": "IsUserInSource", + "methodname_flat": "SteamAPI_ISteamFriends_IsUserInSource", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"steamIDSource", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + }, + { + "methodname": "SetInGameVoiceSpeaking", + "methodname_flat": "SteamAPI_ISteamFriends_SetInGameVoiceSpeaking", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"bSpeaking", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "ActivateGameOverlay", + "methodname_flat": "SteamAPI_ISteamFriends_ActivateGameOverlay", + "params": [ + { "paramname":"pchDialog", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "ActivateGameOverlayToUser", + "methodname_flat": "SteamAPI_ISteamFriends_ActivateGameOverlayToUser", + "params": [ + { "paramname":"pchDialog", "paramtype":"const char *" }, + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "void" + }, + { + "methodname": "ActivateGameOverlayToWebPage", + "methodname_flat": "SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage", + "params": [ + { "paramname":"pchURL", "paramtype":"const char *" }, + { "paramname":"eMode", "paramtype":"EActivateGameOverlayToWebPageMode" } + ], + "returntype": "void" + }, + { + "methodname": "ActivateGameOverlayToStore", + "methodname_flat": "SteamAPI_ISteamFriends_ActivateGameOverlayToStore", + "params": [ + { "paramname":"nAppID", "paramtype":"AppId_t" }, + { "paramname":"eFlag", "paramtype":"EOverlayToStoreFlag" } + ], + "returntype": "void" + }, + { + "methodname": "SetPlayedWith", + "methodname_flat": "SteamAPI_ISteamFriends_SetPlayedWith", + "params": [ + { "paramname":"steamIDUserPlayedWith", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "void" + }, + { + "methodname": "ActivateGameOverlayInviteDialog", + "methodname_flat": "SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "void" + }, + { + "methodname": "GetSmallFriendAvatar", + "methodname_flat": "SteamAPI_ISteamFriends_GetSmallFriendAvatar", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "int" + }, + { + "methodname": "GetMediumFriendAvatar", + "methodname_flat": "SteamAPI_ISteamFriends_GetMediumFriendAvatar", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "int" + }, + { + "methodname": "GetLargeFriendAvatar", + "methodname_flat": "SteamAPI_ISteamFriends_GetLargeFriendAvatar", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "int" + }, + { + "methodname": "RequestUserInformation", + "methodname_flat": "SteamAPI_ISteamFriends_RequestUserInformation", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"bRequireNameOnly", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "callresult": "ClanOfficerListResponse_t", + "methodname": "RequestClanOfficerList", + "methodname_flat": "SteamAPI_ISteamFriends_RequestClanOfficerList", + "params": [ + { "paramname":"steamIDClan", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetClanOwner", + "methodname_flat": "SteamAPI_ISteamFriends_GetClanOwner", + "params": [ + { "paramname":"steamIDClan", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "CSteamID", + "returntype_flat": "uint64_steamid" + }, + { + "methodname": "GetClanOfficerCount", + "methodname_flat": "SteamAPI_ISteamFriends_GetClanOfficerCount", + "params": [ + { "paramname":"steamIDClan", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "int" + }, + { + "methodname": "GetClanOfficerByIndex", + "methodname_flat": "SteamAPI_ISteamFriends_GetClanOfficerByIndex", + "params": [ + { "paramname":"steamIDClan", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"iOfficer", "paramtype":"int" } + ], + "returntype": "CSteamID", + "returntype_flat": "uint64_steamid" + }, + { + "methodname": "SetRichPresence", + "methodname_flat": "SteamAPI_ISteamFriends_SetRichPresence", + "params": [ + { "paramname":"pchKey", "paramtype":"const char *" }, + { "paramname":"pchValue", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "ClearRichPresence", + "methodname_flat": "SteamAPI_ISteamFriends_ClearRichPresence", + "params": [], + "returntype": "void" + }, + { + "methodname": "GetFriendRichPresence", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendRichPresence", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchKey", "paramtype":"const char *" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetFriendRichPresenceKeyCount", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "int" + }, + { + "methodname": "GetFriendRichPresenceKeyByIndex", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"iKey", "paramtype":"int" } + ], + "returntype": "const char *" + }, + { + "methodname": "RequestFriendRichPresence", + "methodname_flat": "SteamAPI_ISteamFriends_RequestFriendRichPresence", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "void" + }, + { + "methodname": "InviteUserToGame", + "methodname_flat": "SteamAPI_ISteamFriends_InviteUserToGame", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchConnectString", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetCoplayFriendCount", + "methodname_flat": "SteamAPI_ISteamFriends_GetCoplayFriendCount", + "params": [], + "returntype": "int" + }, + { + "methodname": "GetCoplayFriend", + "methodname_flat": "SteamAPI_ISteamFriends_GetCoplayFriend", + "params": [ + { "paramname":"iCoplayFriend", "paramtype":"int" } + ], + "returntype": "CSteamID", + "returntype_flat": "uint64_steamid" + }, + { + "methodname": "GetFriendCoplayTime", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendCoplayTime", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "int" + }, + { + "methodname": "GetFriendCoplayGame", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendCoplayGame", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "AppId_t" + }, + { + "callresult": "JoinClanChatRoomCompletionResult_t", + "methodname": "JoinClanChatRoom", + "methodname_flat": "SteamAPI_ISteamFriends_JoinClanChatRoom", + "params": [ + { "paramname":"steamIDClan", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "LeaveClanChatRoom", + "methodname_flat": "SteamAPI_ISteamFriends_LeaveClanChatRoom", + "params": [ + { "paramname":"steamIDClan", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + }, + { + "methodname": "GetClanChatMemberCount", + "methodname_flat": "SteamAPI_ISteamFriends_GetClanChatMemberCount", + "params": [ + { "paramname":"steamIDClan", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "int" + }, + { + "methodname": "GetChatMemberByIndex", + "methodname_flat": "SteamAPI_ISteamFriends_GetChatMemberByIndex", + "params": [ + { "paramname":"steamIDClan", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"iUser", "paramtype":"int" } + ], + "returntype": "CSteamID", + "returntype_flat": "uint64_steamid" + }, + { + "methodname": "SendClanChatMessage", + "methodname_flat": "SteamAPI_ISteamFriends_SendClanChatMessage", + "params": [ + { "paramname":"steamIDClanChat", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchText", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetClanChatMessage", + "methodname_flat": "SteamAPI_ISteamFriends_GetClanChatMessage", + "params": [ + { "paramname":"steamIDClanChat", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"iMessage", "paramtype":"int" }, + { "paramname":"prgchText", "paramtype":"void *" }, + { "paramname":"cchTextMax", "paramtype":"int" }, + { "paramname":"peChatEntryType", "paramtype":"EChatEntryType *" }, + { + "out_struct": "", + "paramname": "psteamidChatter", + "paramtype": "CSteamID *" + } + ], + "returntype": "int" + }, + { + "methodname": "IsClanChatAdmin", + "methodname_flat": "SteamAPI_ISteamFriends_IsClanChatAdmin", + "params": [ + { "paramname":"steamIDClanChat", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + }, + { + "methodname": "IsClanChatWindowOpenInSteam", + "methodname_flat": "SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam", + "params": [ + { "paramname":"steamIDClanChat", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + }, + { + "methodname": "OpenClanChatWindowInSteam", + "methodname_flat": "SteamAPI_ISteamFriends_OpenClanChatWindowInSteam", + "params": [ + { "paramname":"steamIDClanChat", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + }, + { + "methodname": "CloseClanChatWindowInSteam", + "methodname_flat": "SteamAPI_ISteamFriends_CloseClanChatWindowInSteam", + "params": [ + { "paramname":"steamIDClanChat", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + }, + { + "methodname": "SetListenForFriendsMessages", + "methodname_flat": "SteamAPI_ISteamFriends_SetListenForFriendsMessages", + "params": [ + { "paramname":"bInterceptEnabled", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "ReplyToFriendMessage", + "methodname_flat": "SteamAPI_ISteamFriends_ReplyToFriendMessage", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchMsgToSend", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetFriendMessage", + "methodname_flat": "SteamAPI_ISteamFriends_GetFriendMessage", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"iMessageID", "paramtype":"int" }, + { "paramname":"pvData", "paramtype":"void *" }, + { "paramname":"cubData", "paramtype":"int" }, + { "paramname":"peChatEntryType", "paramtype":"EChatEntryType *" } + ], + "returntype": "int" + }, + { + "callresult": "FriendsGetFollowerCount_t", + "methodname": "GetFollowerCount", + "methodname_flat": "SteamAPI_ISteamFriends_GetFollowerCount", + "params": [ + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "FriendsIsFollowing_t", + "methodname": "IsFollowing", + "methodname_flat": "SteamAPI_ISteamFriends_IsFollowing", + "params": [ + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "FriendsEnumerateFollowingList_t", + "methodname": "EnumerateFollowingList", + "methodname_flat": "SteamAPI_ISteamFriends_EnumerateFollowingList", + "params": [ + { "paramname":"unStartIndex", "paramtype":"uint32" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "IsClanPublic", + "methodname_flat": "SteamAPI_ISteamFriends_IsClanPublic", + "params": [ + { "paramname":"steamIDClan", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + }, + { + "methodname": "IsClanOfficialGameGroup", + "methodname_flat": "SteamAPI_ISteamFriends_IsClanOfficialGameGroup", + "params": [ + { "paramname":"steamIDClan", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + }, + { + "methodname": "GetNumChatsWithUnreadPriorityMessages", + "methodname_flat": "SteamAPI_ISteamFriends_GetNumChatsWithUnreadPriorityMessages", + "params": [], + "returntype": "int" + }, + { + "methodname": "ActivateGameOverlayRemotePlayTogetherInviteDialog", + "methodname_flat": "SteamAPI_ISteamFriends_ActivateGameOverlayRemotePlayTogetherInviteDialog", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "void" + }, + { + "methodname": "RegisterProtocolInOverlayBrowser", + "methodname_flat": "SteamAPI_ISteamFriends_RegisterProtocolInOverlayBrowser", + "params": [ + { "paramname":"pchProtocol", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "ActivateGameOverlayInviteDialogConnectString", + "methodname_flat": "SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialogConnectString", + "params": [ + { "paramname":"pchConnectString", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "callresult": "EquippedProfileItems_t", + "methodname": "RequestEquippedProfileItems", + "methodname_flat": "SteamAPI_ISteamFriends_RequestEquippedProfileItems", + "params": [ + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "BHasEquippedProfileItem", + "methodname_flat": "SteamAPI_ISteamFriends_BHasEquippedProfileItem", + "params": [ + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"itemType", "paramtype":"ECommunityProfileItemType" } + ], + "returntype": "bool" + }, + { + "methodname": "GetProfileItemPropertyString", + "methodname_flat": "SteamAPI_ISteamFriends_GetProfileItemPropertyString", + "params": [ + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"itemType", "paramtype":"ECommunityProfileItemType" }, + { "paramname":"prop", "paramtype":"ECommunityProfileItemProperty" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetProfileItemPropertyUint", + "methodname_flat": "SteamAPI_ISteamFriends_GetProfileItemPropertyUint", + "params": [ + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"itemType", "paramtype":"ECommunityProfileItemType" }, + { "paramname":"prop", "paramtype":"ECommunityProfileItemProperty" } + ], + "returntype": "uint32" + } + ], + "version_string": "SteamFriends018" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamUtils", + "name_flat": "SteamAPI_SteamUtils_v010" + }, + { + "kind": "gameserver", + "name": "SteamGameServerUtils", + "name_flat": "SteamAPI_SteamGameServerUtils_v010" + } + ], + "classname": "ISteamUtils", + "fields": [], + "methods": [ + { + "methodname": "GetSecondsSinceAppActive", + "methodname_flat": "SteamAPI_ISteamUtils_GetSecondsSinceAppActive", + "params": [], + "returntype": "uint32" + }, + { + "methodname": "GetSecondsSinceComputerActive", + "methodname_flat": "SteamAPI_ISteamUtils_GetSecondsSinceComputerActive", + "params": [], + "returntype": "uint32" + }, + { + "methodname": "GetConnectedUniverse", + "methodname_flat": "SteamAPI_ISteamUtils_GetConnectedUniverse", + "params": [], + "returntype": "EUniverse" + }, + { + "methodname": "GetServerRealTime", + "methodname_flat": "SteamAPI_ISteamUtils_GetServerRealTime", + "params": [], + "returntype": "uint32" + }, + { + "methodname": "GetIPCountry", + "methodname_flat": "SteamAPI_ISteamUtils_GetIPCountry", + "params": [], + "returntype": "const char *" + }, + { + "methodname": "GetImageSize", + "methodname_flat": "SteamAPI_ISteamUtils_GetImageSize", + "params": [ + { "paramname":"iImage", "paramtype":"int" }, + { "paramname":"pnWidth", "paramtype":"uint32 *" }, + { "paramname":"pnHeight", "paramtype":"uint32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetImageRGBA", + "methodname_flat": "SteamAPI_ISteamUtils_GetImageRGBA", + "params": [ + { "paramname":"iImage", "paramtype":"int" }, + { "paramname":"pubDest", "paramtype":"uint8 *" }, + { "paramname":"nDestBufferSize", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "GetCurrentBatteryPower", + "methodname_flat": "SteamAPI_ISteamUtils_GetCurrentBatteryPower", + "params": [], + "returntype": "uint8" + }, + { + "methodname": "GetAppID", + "methodname_flat": "SteamAPI_ISteamUtils_GetAppID", + "params": [], + "returntype": "uint32" + }, + { + "methodname": "SetOverlayNotificationPosition", + "methodname_flat": "SteamAPI_ISteamUtils_SetOverlayNotificationPosition", + "params": [ + { "paramname":"eNotificationPosition", "paramtype":"ENotificationPosition" } + ], + "returntype": "void" + }, + { + "methodname": "IsAPICallCompleted", + "methodname_flat": "SteamAPI_ISteamUtils_IsAPICallCompleted", + "params": [ + { "paramname":"hSteamAPICall", "paramtype":"SteamAPICall_t" }, + { "paramname":"pbFailed", "paramtype":"bool *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetAPICallFailureReason", + "methodname_flat": "SteamAPI_ISteamUtils_GetAPICallFailureReason", + "params": [ + { "paramname":"hSteamAPICall", "paramtype":"SteamAPICall_t" } + ], + "returntype": "ESteamAPICallFailure" + }, + { + "methodname": "GetAPICallResult", + "methodname_flat": "SteamAPI_ISteamUtils_GetAPICallResult", + "params": [ + { "paramname":"hSteamAPICall", "paramtype":"SteamAPICall_t" }, + { "paramname":"pCallback", "paramtype":"void *" }, + { "paramname":"cubCallback", "paramtype":"int" }, + { "paramname":"iCallbackExpected", "paramtype":"int" }, + { "paramname":"pbFailed", "paramtype":"bool *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetIPCCallCount", + "methodname_flat": "SteamAPI_ISteamUtils_GetIPCCallCount", + "params": [], + "returntype": "uint32" + }, + { + "methodname": "SetWarningMessageHook", + "methodname_flat": "SteamAPI_ISteamUtils_SetWarningMessageHook", + "params": [ + { "paramname":"pFunction", "paramtype":"SteamAPIWarningMessageHook_t" } + ], + "returntype": "void" + }, + { + "methodname": "IsOverlayEnabled", + "methodname_flat": "SteamAPI_ISteamUtils_IsOverlayEnabled", + "params": [], + "returntype": "bool" + }, + { + "methodname": "BOverlayNeedsPresent", + "methodname_flat": "SteamAPI_ISteamUtils_BOverlayNeedsPresent", + "params": [], + "returntype": "bool" + }, + { + "callresult": "CheckFileSignature_t", + "methodname": "CheckFileSignature", + "methodname_flat": "SteamAPI_ISteamUtils_CheckFileSignature", + "params": [ + { "paramname":"szFileName", "paramtype":"const char *" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "ShowGamepadTextInput", + "methodname_flat": "SteamAPI_ISteamUtils_ShowGamepadTextInput", + "params": [ + { "paramname":"eInputMode", "paramtype":"EGamepadTextInputMode" }, + { "paramname":"eLineInputMode", "paramtype":"EGamepadTextInputLineMode" }, + { "paramname":"pchDescription", "paramtype":"const char *" }, + { "paramname":"unCharMax", "paramtype":"uint32" }, + { "paramname":"pchExistingText", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetEnteredGamepadTextLength", + "methodname_flat": "SteamAPI_ISteamUtils_GetEnteredGamepadTextLength", + "params": [], + "returntype": "uint32" + }, + { + "methodname": "GetEnteredGamepadTextInput", + "methodname_flat": "SteamAPI_ISteamUtils_GetEnteredGamepadTextInput", + "params": [ + { "paramname":"pchText", "paramtype":"char *" }, + { "paramname":"cchText", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "GetSteamUILanguage", + "methodname_flat": "SteamAPI_ISteamUtils_GetSteamUILanguage", + "params": [], + "returntype": "const char *" + }, + { + "methodname": "IsSteamRunningInVR", + "methodname_flat": "SteamAPI_ISteamUtils_IsSteamRunningInVR", + "params": [], + "returntype": "bool" + }, + { + "methodname": "SetOverlayNotificationInset", + "methodname_flat": "SteamAPI_ISteamUtils_SetOverlayNotificationInset", + "params": [ + { "paramname":"nHorizontalInset", "paramtype":"int" }, + { "paramname":"nVerticalInset", "paramtype":"int" } + ], + "returntype": "void" + }, + { + "methodname": "IsSteamInBigPictureMode", + "methodname_flat": "SteamAPI_ISteamUtils_IsSteamInBigPictureMode", + "params": [], + "returntype": "bool" + }, + { + "methodname": "StartVRDashboard", + "methodname_flat": "SteamAPI_ISteamUtils_StartVRDashboard", + "params": [], + "returntype": "void" + }, + { + "methodname": "IsVRHeadsetStreamingEnabled", + "methodname_flat": "SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled", + "params": [], + "returntype": "bool" + }, + { + "methodname": "SetVRHeadsetStreamingEnabled", + "methodname_flat": "SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled", + "params": [ + { "paramname":"bEnabled", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "IsSteamChinaLauncher", + "methodname_flat": "SteamAPI_ISteamUtils_IsSteamChinaLauncher", + "params": [], + "returntype": "bool" + }, + { + "methodname": "InitFilterText", + "methodname_flat": "SteamAPI_ISteamUtils_InitFilterText", + "params": [ + { "paramname":"unFilterOptions", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "FilterText", + "methodname_flat": "SteamAPI_ISteamUtils_FilterText", + "params": [ + { "paramname":"eContext", "paramtype":"ETextFilteringContext" }, + { "paramname":"sourceSteamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchInputMessage", "paramtype":"const char *" }, + { "paramname":"pchOutFilteredText", "paramtype":"char *" }, + { "paramname":"nByteSizeOutFilteredText", "paramtype":"uint32" } + ], + "returntype": "int" + }, + { + "methodname": "GetIPv6ConnectivityState", + "methodname_flat": "SteamAPI_ISteamUtils_GetIPv6ConnectivityState", + "params": [ + { "paramname":"eProtocol", "paramtype":"ESteamIPv6ConnectivityProtocol" } + ], + "returntype": "ESteamIPv6ConnectivityState" + }, + { + "methodname": "IsSteamRunningOnSteamDeck", + "methodname_flat": "SteamAPI_ISteamUtils_IsSteamRunningOnSteamDeck", + "params": [], + "returntype": "bool" + }, + { + "methodname": "ShowFloatingGamepadTextInput", + "methodname_flat": "SteamAPI_ISteamUtils_ShowFloatingGamepadTextInput", + "params": [ + { "paramname":"eKeyboardMode", "paramtype":"EFloatingGamepadTextInputMode" }, + { "paramname":"nTextFieldXPosition", "paramtype":"int" }, + { "paramname":"nTextFieldYPosition", "paramtype":"int" }, + { "paramname":"nTextFieldWidth", "paramtype":"int" }, + { "paramname":"nTextFieldHeight", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "SetGameLauncherMode", + "methodname_flat": "SteamAPI_ISteamUtils_SetGameLauncherMode", + "params": [ + { "paramname":"bLauncherMode", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "DismissFloatingGamepadTextInput", + "methodname_flat": "SteamAPI_ISteamUtils_DismissFloatingGamepadTextInput", + "params": [], + "returntype": "bool" + }, + { + "methodname": "DismissGamepadTextInput", + "methodname_flat": "SteamAPI_ISteamUtils_DismissGamepadTextInput", + "params": [], + "returntype": "bool" + } + ], + "version_string": "SteamUtils010" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamMatchmaking", + "name_flat": "SteamAPI_SteamMatchmaking_v009" + } + ], + "classname": "ISteamMatchmaking", + "fields": [], + "methods": [ + { + "methodname": "GetFavoriteGameCount", + "methodname_flat": "SteamAPI_ISteamMatchmaking_GetFavoriteGameCount", + "params": [], + "returntype": "int" + }, + { + "methodname": "GetFavoriteGame", + "methodname_flat": "SteamAPI_ISteamMatchmaking_GetFavoriteGame", + "params": [ + { "paramname":"iGame", "paramtype":"int" }, + { "paramname":"pnAppID", "paramtype":"AppId_t *" }, + { "paramname":"pnIP", "paramtype":"uint32 *" }, + { "paramname":"pnConnPort", "paramtype":"uint16 *" }, + { "paramname":"pnQueryPort", "paramtype":"uint16 *" }, + { "paramname":"punFlags", "paramtype":"uint32 *" }, + { "paramname":"pRTime32LastPlayedOnServer", "paramtype":"uint32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "AddFavoriteGame", + "methodname_flat": "SteamAPI_ISteamMatchmaking_AddFavoriteGame", + "params": [ + { "paramname":"nAppID", "paramtype":"AppId_t" }, + { "paramname":"nIP", "paramtype":"uint32" }, + { "paramname":"nConnPort", "paramtype":"uint16" }, + { "paramname":"nQueryPort", "paramtype":"uint16" }, + { "paramname":"unFlags", "paramtype":"uint32" }, + { "paramname":"rTime32LastPlayedOnServer", "paramtype":"uint32" } + ], + "returntype": "int" + }, + { + "methodname": "RemoveFavoriteGame", + "methodname_flat": "SteamAPI_ISteamMatchmaking_RemoveFavoriteGame", + "params": [ + { "paramname":"nAppID", "paramtype":"AppId_t" }, + { "paramname":"nIP", "paramtype":"uint32" }, + { "paramname":"nConnPort", "paramtype":"uint16" }, + { "paramname":"nQueryPort", "paramtype":"uint16" }, + { "paramname":"unFlags", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "callresult": "LobbyMatchList_t", + "methodname": "RequestLobbyList", + "methodname_flat": "SteamAPI_ISteamMatchmaking_RequestLobbyList", + "params": [], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "AddRequestLobbyListStringFilter", + "methodname_flat": "SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter", + "params": [ + { "paramname":"pchKeyToMatch", "paramtype":"const char *" }, + { "paramname":"pchValueToMatch", "paramtype":"const char *" }, + { "paramname":"eComparisonType", "paramtype":"ELobbyComparison" } + ], + "returntype": "void" + }, + { + "methodname": "AddRequestLobbyListNumericalFilter", + "methodname_flat": "SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter", + "params": [ + { "paramname":"pchKeyToMatch", "paramtype":"const char *" }, + { "paramname":"nValueToMatch", "paramtype":"int" }, + { "paramname":"eComparisonType", "paramtype":"ELobbyComparison" } + ], + "returntype": "void" + }, + { + "methodname": "AddRequestLobbyListNearValueFilter", + "methodname_flat": "SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter", + "params": [ + { "paramname":"pchKeyToMatch", "paramtype":"const char *" }, + { "paramname":"nValueToBeCloseTo", "paramtype":"int" } + ], + "returntype": "void" + }, + { + "methodname": "AddRequestLobbyListFilterSlotsAvailable", + "methodname_flat": "SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable", + "params": [ + { "paramname":"nSlotsAvailable", "paramtype":"int" } + ], + "returntype": "void" + }, + { + "methodname": "AddRequestLobbyListDistanceFilter", + "methodname_flat": "SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter", + "params": [ + { "paramname":"eLobbyDistanceFilter", "paramtype":"ELobbyDistanceFilter" } + ], + "returntype": "void" + }, + { + "methodname": "AddRequestLobbyListResultCountFilter", + "methodname_flat": "SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter", + "params": [ + { "paramname":"cMaxResults", "paramtype":"int" } + ], + "returntype": "void" + }, + { + "methodname": "AddRequestLobbyListCompatibleMembersFilter", + "methodname_flat": "SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "void" + }, + { + "methodname": "GetLobbyByIndex", + "methodname_flat": "SteamAPI_ISteamMatchmaking_GetLobbyByIndex", + "params": [ + { "paramname":"iLobby", "paramtype":"int" } + ], + "returntype": "CSteamID", + "returntype_flat": "uint64_steamid" + }, + { + "callresult": "LobbyCreated_t", + "methodname": "CreateLobby", + "methodname_flat": "SteamAPI_ISteamMatchmaking_CreateLobby", + "params": [ + { "paramname":"eLobbyType", "paramtype":"ELobbyType" }, + { "paramname":"cMaxMembers", "paramtype":"int" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "LobbyEnter_t", + "methodname": "JoinLobby", + "methodname_flat": "SteamAPI_ISteamMatchmaking_JoinLobby", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "LeaveLobby", + "methodname_flat": "SteamAPI_ISteamMatchmaking_LeaveLobby", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "void" + }, + { + "methodname": "InviteUserToLobby", + "methodname_flat": "SteamAPI_ISteamMatchmaking_InviteUserToLobby", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"steamIDInvitee", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + }, + { + "methodname": "GetNumLobbyMembers", + "methodname_flat": "SteamAPI_ISteamMatchmaking_GetNumLobbyMembers", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "int" + }, + { + "methodname": "GetLobbyMemberByIndex", + "methodname_flat": "SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"iMember", "paramtype":"int" } + ], + "returntype": "CSteamID", + "returntype_flat": "uint64_steamid" + }, + { + "methodname": "GetLobbyData", + "methodname_flat": "SteamAPI_ISteamMatchmaking_GetLobbyData", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchKey", "paramtype":"const char *" } + ], + "returntype": "const char *" + }, + { + "methodname": "SetLobbyData", + "methodname_flat": "SteamAPI_ISteamMatchmaking_SetLobbyData", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchKey", "paramtype":"const char *" }, + { "paramname":"pchValue", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetLobbyDataCount", + "methodname_flat": "SteamAPI_ISteamMatchmaking_GetLobbyDataCount", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "int" + }, + { + "methodname": "GetLobbyDataByIndex", + "methodname_flat": "SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"iLobbyData", "paramtype":"int" }, + { "paramname":"pchKey", "paramtype":"char *" }, + { "paramname":"cchKeyBufferSize", "paramtype":"int" }, + { "paramname":"pchValue", "paramtype":"char *" }, + { "paramname":"cchValueBufferSize", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "DeleteLobbyData", + "methodname_flat": "SteamAPI_ISteamMatchmaking_DeleteLobbyData", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchKey", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetLobbyMemberData", + "methodname_flat": "SteamAPI_ISteamMatchmaking_GetLobbyMemberData", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchKey", "paramtype":"const char *" } + ], + "returntype": "const char *" + }, + { + "methodname": "SetLobbyMemberData", + "methodname_flat": "SteamAPI_ISteamMatchmaking_SetLobbyMemberData", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchKey", "paramtype":"const char *" }, + { "paramname":"pchValue", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "SendLobbyChatMsg", + "methodname_flat": "SteamAPI_ISteamMatchmaking_SendLobbyChatMsg", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pvMsgBody", "paramtype":"const void *" }, + { "paramname":"cubMsgBody", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "GetLobbyChatEntry", + "methodname_flat": "SteamAPI_ISteamMatchmaking_GetLobbyChatEntry", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"iChatID", "paramtype":"int" }, + { + "out_struct": "", + "paramname": "pSteamIDUser", + "paramtype": "CSteamID *" + }, + { "paramname":"pvData", "paramtype":"void *" }, + { "paramname":"cubData", "paramtype":"int" }, + { "paramname":"peChatEntryType", "paramtype":"EChatEntryType *" } + ], + "returntype": "int" + }, + { + "methodname": "RequestLobbyData", + "methodname_flat": "SteamAPI_ISteamMatchmaking_RequestLobbyData", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + }, + { + "methodname": "SetLobbyGameServer", + "methodname_flat": "SteamAPI_ISteamMatchmaking_SetLobbyGameServer", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"unGameServerIP", "paramtype":"uint32" }, + { "paramname":"unGameServerPort", "paramtype":"uint16" }, + { "paramname":"steamIDGameServer", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "void" + }, + { + "methodname": "GetLobbyGameServer", + "methodname_flat": "SteamAPI_ISteamMatchmaking_GetLobbyGameServer", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"punGameServerIP", "paramtype":"uint32 *" }, + { "paramname":"punGameServerPort", "paramtype":"uint16 *" }, + { + "out_struct": "", + "paramname": "psteamIDGameServer", + "paramtype": "CSteamID *" + } + ], + "returntype": "bool" + }, + { + "methodname": "SetLobbyMemberLimit", + "methodname_flat": "SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"cMaxMembers", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "GetLobbyMemberLimit", + "methodname_flat": "SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "int" + }, + { + "methodname": "SetLobbyType", + "methodname_flat": "SteamAPI_ISteamMatchmaking_SetLobbyType", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"eLobbyType", "paramtype":"ELobbyType" } + ], + "returntype": "bool" + }, + { + "methodname": "SetLobbyJoinable", + "methodname_flat": "SteamAPI_ISteamMatchmaking_SetLobbyJoinable", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"bLobbyJoinable", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "GetLobbyOwner", + "methodname_flat": "SteamAPI_ISteamMatchmaking_GetLobbyOwner", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "CSteamID", + "returntype_flat": "uint64_steamid" + }, + { + "methodname": "SetLobbyOwner", + "methodname_flat": "SteamAPI_ISteamMatchmaking_SetLobbyOwner", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"steamIDNewOwner", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + }, + { + "methodname": "SetLinkedLobby", + "methodname_flat": "SteamAPI_ISteamMatchmaking_SetLinkedLobby", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"steamIDLobbyDependent", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + } + ], + "version_string": "SteamMatchMaking009" + }, + { + "classname": "ISteamMatchmakingServerListResponse", + "fields": [], + "methods": [ + { + "methodname": "ServerResponded", + "methodname_flat": "SteamAPI_ISteamMatchmakingServerListResponse_ServerResponded", + "params": [ + { "paramname":"hRequest", "paramtype":"HServerListRequest" }, + { "paramname":"iServer", "paramtype":"int" } + ], + "returntype": "void" + }, + { + "methodname": "ServerFailedToRespond", + "methodname_flat": "SteamAPI_ISteamMatchmakingServerListResponse_ServerFailedToRespond", + "params": [ + { "paramname":"hRequest", "paramtype":"HServerListRequest" }, + { "paramname":"iServer", "paramtype":"int" } + ], + "returntype": "void" + }, + { + "methodname": "RefreshComplete", + "methodname_flat": "SteamAPI_ISteamMatchmakingServerListResponse_RefreshComplete", + "params": [ + { "paramname":"hRequest", "paramtype":"HServerListRequest" }, + { "paramname":"response", "paramtype":"EMatchMakingServerResponse" } + ], + "returntype": "void" + } + ] + }, + { + "classname": "ISteamMatchmakingPingResponse", + "fields": [], + "methods": [ + { + "methodname": "ServerResponded", + "methodname_flat": "SteamAPI_ISteamMatchmakingPingResponse_ServerResponded", + "params": [ + { "paramname":"server", "paramtype":"gameserveritem_t &" } + ], + "returntype": "void" + }, + { + "methodname": "ServerFailedToRespond", + "methodname_flat": "SteamAPI_ISteamMatchmakingPingResponse_ServerFailedToRespond", + "params": [], + "returntype": "void" + } + ] + }, + { + "classname": "ISteamMatchmakingPlayersResponse", + "fields": [], + "methods": [ + { + "methodname": "AddPlayerToList", + "methodname_flat": "SteamAPI_ISteamMatchmakingPlayersResponse_AddPlayerToList", + "params": [ + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"nScore", "paramtype":"int" }, + { "paramname":"flTimePlayed", "paramtype":"float" } + ], + "returntype": "void" + }, + { + "methodname": "PlayersFailedToRespond", + "methodname_flat": "SteamAPI_ISteamMatchmakingPlayersResponse_PlayersFailedToRespond", + "params": [], + "returntype": "void" + }, + { + "methodname": "PlayersRefreshComplete", + "methodname_flat": "SteamAPI_ISteamMatchmakingPlayersResponse_PlayersRefreshComplete", + "params": [], + "returntype": "void" + } + ] + }, + { + "classname": "ISteamMatchmakingRulesResponse", + "fields": [], + "methods": [ + { + "methodname": "RulesResponded", + "methodname_flat": "SteamAPI_ISteamMatchmakingRulesResponse_RulesResponded", + "params": [ + { "paramname":"pchRule", "paramtype":"const char *" }, + { "paramname":"pchValue", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "RulesFailedToRespond", + "methodname_flat": "SteamAPI_ISteamMatchmakingRulesResponse_RulesFailedToRespond", + "params": [], + "returntype": "void" + }, + { + "methodname": "RulesRefreshComplete", + "methodname_flat": "SteamAPI_ISteamMatchmakingRulesResponse_RulesRefreshComplete", + "params": [], + "returntype": "void" + } + ] + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamMatchmakingServers", + "name_flat": "SteamAPI_SteamMatchmakingServers_v002" + } + ], + "classname": "ISteamMatchmakingServers", + "fields": [], + "methods": [ + { + "methodname": "RequestInternetServerList", + "methodname_flat": "SteamAPI_ISteamMatchmakingServers_RequestInternetServerList", + "params": [ + { "paramname":"iApp", "paramtype":"AppId_t" }, + { + "array_count": "nFilters", + "paramname": "ppchFilters", + "paramtype": "MatchMakingKeyValuePair_t **" + }, + { "paramname":"nFilters", "paramtype":"uint32" }, + { "paramname":"pRequestServersResponse", "paramtype":"ISteamMatchmakingServerListResponse *" } + ], + "returntype": "HServerListRequest" + }, + { + "methodname": "RequestLANServerList", + "methodname_flat": "SteamAPI_ISteamMatchmakingServers_RequestLANServerList", + "params": [ + { "paramname":"iApp", "paramtype":"AppId_t" }, + { "paramname":"pRequestServersResponse", "paramtype":"ISteamMatchmakingServerListResponse *" } + ], + "returntype": "HServerListRequest" + }, + { + "methodname": "RequestFriendsServerList", + "methodname_flat": "SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList", + "params": [ + { "paramname":"iApp", "paramtype":"AppId_t" }, + { + "array_count": "nFilters", + "paramname": "ppchFilters", + "paramtype": "MatchMakingKeyValuePair_t **" + }, + { "paramname":"nFilters", "paramtype":"uint32" }, + { "paramname":"pRequestServersResponse", "paramtype":"ISteamMatchmakingServerListResponse *" } + ], + "returntype": "HServerListRequest" + }, + { + "methodname": "RequestFavoritesServerList", + "methodname_flat": "SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList", + "params": [ + { "paramname":"iApp", "paramtype":"AppId_t" }, + { + "array_count": "nFilters", + "paramname": "ppchFilters", + "paramtype": "MatchMakingKeyValuePair_t **" + }, + { "paramname":"nFilters", "paramtype":"uint32" }, + { "paramname":"pRequestServersResponse", "paramtype":"ISteamMatchmakingServerListResponse *" } + ], + "returntype": "HServerListRequest" + }, + { + "methodname": "RequestHistoryServerList", + "methodname_flat": "SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList", + "params": [ + { "paramname":"iApp", "paramtype":"AppId_t" }, + { + "array_count": "nFilters", + "paramname": "ppchFilters", + "paramtype": "MatchMakingKeyValuePair_t **" + }, + { "paramname":"nFilters", "paramtype":"uint32" }, + { "paramname":"pRequestServersResponse", "paramtype":"ISteamMatchmakingServerListResponse *" } + ], + "returntype": "HServerListRequest" + }, + { + "methodname": "RequestSpectatorServerList", + "methodname_flat": "SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList", + "params": [ + { "paramname":"iApp", "paramtype":"AppId_t" }, + { + "array_count": "nFilters", + "paramname": "ppchFilters", + "paramtype": "MatchMakingKeyValuePair_t **" + }, + { "paramname":"nFilters", "paramtype":"uint32" }, + { "paramname":"pRequestServersResponse", "paramtype":"ISteamMatchmakingServerListResponse *" } + ], + "returntype": "HServerListRequest" + }, + { + "methodname": "ReleaseRequest", + "methodname_flat": "SteamAPI_ISteamMatchmakingServers_ReleaseRequest", + "params": [ + { "paramname":"hServerListRequest", "paramtype":"HServerListRequest" } + ], + "returntype": "void" + }, + { + "methodname": "GetServerDetails", + "methodname_flat": "SteamAPI_ISteamMatchmakingServers_GetServerDetails", + "params": [ + { "paramname":"hRequest", "paramtype":"HServerListRequest" }, + { "paramname":"iServer", "paramtype":"int" } + ], + "returntype": "gameserveritem_t *" + }, + { + "methodname": "CancelQuery", + "methodname_flat": "SteamAPI_ISteamMatchmakingServers_CancelQuery", + "params": [ + { "paramname":"hRequest", "paramtype":"HServerListRequest" } + ], + "returntype": "void" + }, + { + "methodname": "RefreshQuery", + "methodname_flat": "SteamAPI_ISteamMatchmakingServers_RefreshQuery", + "params": [ + { "paramname":"hRequest", "paramtype":"HServerListRequest" } + ], + "returntype": "void" + }, + { + "methodname": "IsRefreshing", + "methodname_flat": "SteamAPI_ISteamMatchmakingServers_IsRefreshing", + "params": [ + { "paramname":"hRequest", "paramtype":"HServerListRequest" } + ], + "returntype": "bool" + }, + { + "methodname": "GetServerCount", + "methodname_flat": "SteamAPI_ISteamMatchmakingServers_GetServerCount", + "params": [ + { "paramname":"hRequest", "paramtype":"HServerListRequest" } + ], + "returntype": "int" + }, + { + "methodname": "RefreshServer", + "methodname_flat": "SteamAPI_ISteamMatchmakingServers_RefreshServer", + "params": [ + { "paramname":"hRequest", "paramtype":"HServerListRequest" }, + { "paramname":"iServer", "paramtype":"int" } + ], + "returntype": "void" + }, + { + "methodname": "PingServer", + "methodname_flat": "SteamAPI_ISteamMatchmakingServers_PingServer", + "params": [ + { "paramname":"unIP", "paramtype":"uint32" }, + { "paramname":"usPort", "paramtype":"uint16" }, + { "paramname":"pRequestServersResponse", "paramtype":"ISteamMatchmakingPingResponse *" } + ], + "returntype": "HServerQuery" + }, + { + "methodname": "PlayerDetails", + "methodname_flat": "SteamAPI_ISteamMatchmakingServers_PlayerDetails", + "params": [ + { "paramname":"unIP", "paramtype":"uint32" }, + { "paramname":"usPort", "paramtype":"uint16" }, + { "paramname":"pRequestServersResponse", "paramtype":"ISteamMatchmakingPlayersResponse *" } + ], + "returntype": "HServerQuery" + }, + { + "methodname": "ServerRules", + "methodname_flat": "SteamAPI_ISteamMatchmakingServers_ServerRules", + "params": [ + { "paramname":"unIP", "paramtype":"uint32" }, + { "paramname":"usPort", "paramtype":"uint16" }, + { "paramname":"pRequestServersResponse", "paramtype":"ISteamMatchmakingRulesResponse *" } + ], + "returntype": "HServerQuery" + }, + { + "methodname": "CancelServerQuery", + "methodname_flat": "SteamAPI_ISteamMatchmakingServers_CancelServerQuery", + "params": [ + { "paramname":"hServerQuery", "paramtype":"HServerQuery" } + ], + "returntype": "void" + } + ], + "version_string": "SteamMatchMakingServers002" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamGameSearch", + "name_flat": "SteamAPI_SteamGameSearch_v001" + } + ], + "classname": "ISteamGameSearch", + "fields": [], + "methods": [ + { + "methodname": "AddGameSearchParams", + "methodname_flat": "SteamAPI_ISteamGameSearch_AddGameSearchParams", + "params": [ + { "paramname":"pchKeyToFind", "paramtype":"const char *" }, + { "paramname":"pchValuesToFind", "paramtype":"const char *" } + ], + "returntype": "EGameSearchErrorCode_t" + }, + { + "methodname": "SearchForGameWithLobby", + "methodname_flat": "SteamAPI_ISteamGameSearch_SearchForGameWithLobby", + "params": [ + { "paramname":"steamIDLobby", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"nPlayerMin", "paramtype":"int" }, + { "paramname":"nPlayerMax", "paramtype":"int" } + ], + "returntype": "EGameSearchErrorCode_t" + }, + { + "methodname": "SearchForGameSolo", + "methodname_flat": "SteamAPI_ISteamGameSearch_SearchForGameSolo", + "params": [ + { "paramname":"nPlayerMin", "paramtype":"int" }, + { "paramname":"nPlayerMax", "paramtype":"int" } + ], + "returntype": "EGameSearchErrorCode_t" + }, + { + "methodname": "AcceptGame", + "methodname_flat": "SteamAPI_ISteamGameSearch_AcceptGame", + "params": [], + "returntype": "EGameSearchErrorCode_t" + }, + { + "methodname": "DeclineGame", + "methodname_flat": "SteamAPI_ISteamGameSearch_DeclineGame", + "params": [], + "returntype": "EGameSearchErrorCode_t" + }, + { + "methodname": "RetrieveConnectionDetails", + "methodname_flat": "SteamAPI_ISteamGameSearch_RetrieveConnectionDetails", + "params": [ + { "paramname":"steamIDHost", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchConnectionDetails", "paramtype":"char *" }, + { "paramname":"cubConnectionDetails", "paramtype":"int" } + ], + "returntype": "EGameSearchErrorCode_t" + }, + { + "methodname": "EndGameSearch", + "methodname_flat": "SteamAPI_ISteamGameSearch_EndGameSearch", + "params": [], + "returntype": "EGameSearchErrorCode_t" + }, + { + "methodname": "SetGameHostParams", + "methodname_flat": "SteamAPI_ISteamGameSearch_SetGameHostParams", + "params": [ + { "paramname":"pchKey", "paramtype":"const char *" }, + { "paramname":"pchValue", "paramtype":"const char *" } + ], + "returntype": "EGameSearchErrorCode_t" + }, + { + "methodname": "SetConnectionDetails", + "methodname_flat": "SteamAPI_ISteamGameSearch_SetConnectionDetails", + "params": [ + { "paramname":"pchConnectionDetails", "paramtype":"const char *" }, + { "paramname":"cubConnectionDetails", "paramtype":"int" } + ], + "returntype": "EGameSearchErrorCode_t" + }, + { + "methodname": "RequestPlayersForGame", + "methodname_flat": "SteamAPI_ISteamGameSearch_RequestPlayersForGame", + "params": [ + { "paramname":"nPlayerMin", "paramtype":"int" }, + { "paramname":"nPlayerMax", "paramtype":"int" }, + { "paramname":"nMaxTeamSize", "paramtype":"int" } + ], + "returntype": "EGameSearchErrorCode_t" + }, + { + "methodname": "HostConfirmGameStart", + "methodname_flat": "SteamAPI_ISteamGameSearch_HostConfirmGameStart", + "params": [ + { "paramname":"ullUniqueGameID", "paramtype":"uint64" } + ], + "returntype": "EGameSearchErrorCode_t" + }, + { + "methodname": "CancelRequestPlayersForGame", + "methodname_flat": "SteamAPI_ISteamGameSearch_CancelRequestPlayersForGame", + "params": [], + "returntype": "EGameSearchErrorCode_t" + }, + { + "methodname": "SubmitPlayerResult", + "methodname_flat": "SteamAPI_ISteamGameSearch_SubmitPlayerResult", + "params": [ + { "paramname":"ullUniqueGameID", "paramtype":"uint64" }, + { "paramname":"steamIDPlayer", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"EPlayerResult", "paramtype":"EPlayerResult_t" } + ], + "returntype": "EGameSearchErrorCode_t" + }, + { + "methodname": "EndGame", + "methodname_flat": "SteamAPI_ISteamGameSearch_EndGame", + "params": [ + { "paramname":"ullUniqueGameID", "paramtype":"uint64" } + ], + "returntype": "EGameSearchErrorCode_t" + } + ], + "version_string": "SteamMatchGameSearch001" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamParties", + "name_flat": "SteamAPI_SteamParties_v002" + } + ], + "classname": "ISteamParties", + "fields": [], + "methods": [ + { + "methodname": "GetNumActiveBeacons", + "methodname_flat": "SteamAPI_ISteamParties_GetNumActiveBeacons", + "params": [], + "returntype": "uint32" + }, + { + "methodname": "GetBeaconByIndex", + "methodname_flat": "SteamAPI_ISteamParties_GetBeaconByIndex", + "params": [ + { "paramname":"unIndex", "paramtype":"uint32" } + ], + "returntype": "PartyBeaconID_t" + }, + { + "methodname": "GetBeaconDetails", + "methodname_flat": "SteamAPI_ISteamParties_GetBeaconDetails", + "params": [ + { "paramname":"ulBeaconID", "paramtype":"PartyBeaconID_t" }, + { "paramname":"pSteamIDBeaconOwner", "paramtype":"CSteamID *" }, + { + "out_struct": "", + "paramname": "pLocation", + "paramtype": "SteamPartyBeaconLocation_t *" + }, + { + "out_string_count": "cchMetadata", + "paramname": "pchMetadata", + "paramtype": "char *" + }, + { "paramname":"cchMetadata", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "callresult": "JoinPartyCallback_t", + "methodname": "JoinParty", + "methodname_flat": "SteamAPI_ISteamParties_JoinParty", + "params": [ + { "paramname":"ulBeaconID", "paramtype":"PartyBeaconID_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetNumAvailableBeaconLocations", + "methodname_flat": "SteamAPI_ISteamParties_GetNumAvailableBeaconLocations", + "params": [ + { "paramname":"puNumLocations", "paramtype":"uint32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetAvailableBeaconLocations", + "methodname_flat": "SteamAPI_ISteamParties_GetAvailableBeaconLocations", + "params": [ + { "paramname":"pLocationList", "paramtype":"SteamPartyBeaconLocation_t *" }, + { "paramname":"uMaxNumLocations", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "callresult": "CreateBeaconCallback_t", + "methodname": "CreateBeacon", + "methodname_flat": "SteamAPI_ISteamParties_CreateBeacon", + "params": [ + { "paramname":"unOpenSlots", "paramtype":"uint32" }, + { "paramname":"pBeaconLocation", "paramtype":"SteamPartyBeaconLocation_t *" }, + { "paramname":"pchConnectString", "paramtype":"const char *" }, + { "paramname":"pchMetadata", "paramtype":"const char *" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "OnReservationCompleted", + "methodname_flat": "SteamAPI_ISteamParties_OnReservationCompleted", + "params": [ + { "paramname":"ulBeacon", "paramtype":"PartyBeaconID_t" }, + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "void" + }, + { + "methodname": "CancelReservation", + "methodname_flat": "SteamAPI_ISteamParties_CancelReservation", + "params": [ + { "paramname":"ulBeacon", "paramtype":"PartyBeaconID_t" }, + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "void" + }, + { + "callresult": "ChangeNumOpenSlotsCallback_t", + "methodname": "ChangeNumOpenSlots", + "methodname_flat": "SteamAPI_ISteamParties_ChangeNumOpenSlots", + "params": [ + { "paramname":"ulBeacon", "paramtype":"PartyBeaconID_t" }, + { "paramname":"unOpenSlots", "paramtype":"uint32" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "DestroyBeacon", + "methodname_flat": "SteamAPI_ISteamParties_DestroyBeacon", + "params": [ + { "paramname":"ulBeacon", "paramtype":"PartyBeaconID_t" } + ], + "returntype": "bool" + }, + { + "methodname": "GetBeaconLocationData", + "methodname_flat": "SteamAPI_ISteamParties_GetBeaconLocationData", + "params": [ + { "paramname":"BeaconLocation", "paramtype":"SteamPartyBeaconLocation_t" }, + { "paramname":"eData", "paramtype":"ESteamPartyBeaconLocationData" }, + { + "out_string_count": "cchDataStringOut", + "paramname": "pchDataStringOut", + "paramtype": "char *" + }, + { "paramname":"cchDataStringOut", "paramtype":"int" } + ], + "returntype": "bool" + } + ], + "version_string": "SteamParties002" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamRemoteStorage", + "name_flat": "SteamAPI_SteamRemoteStorage_v016" + } + ], + "classname": "ISteamRemoteStorage", + "fields": [], + "methods": [ + { + "methodname": "FileWrite", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_FileWrite", + "params": [ + { "paramname":"pchFile", "paramtype":"const char *" }, + { "paramname":"pvData", "paramtype":"const void *" }, + { "paramname":"cubData", "paramtype":"int32" } + ], + "returntype": "bool" + }, + { + "methodname": "FileRead", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_FileRead", + "params": [ + { "paramname":"pchFile", "paramtype":"const char *" }, + { "paramname":"pvData", "paramtype":"void *" }, + { "paramname":"cubDataToRead", "paramtype":"int32" } + ], + "returntype": "int32" + }, + { + "callresult": "RemoteStorageFileWriteAsyncComplete_t", + "methodname": "FileWriteAsync", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_FileWriteAsync", + "params": [ + { "paramname":"pchFile", "paramtype":"const char *" }, + { "paramname":"pvData", "paramtype":"const void *" }, + { "paramname":"cubData", "paramtype":"uint32" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoteStorageFileReadAsyncComplete_t", + "methodname": "FileReadAsync", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_FileReadAsync", + "params": [ + { "paramname":"pchFile", "paramtype":"const char *" }, + { "paramname":"nOffset", "paramtype":"uint32" }, + { "paramname":"cubToRead", "paramtype":"uint32" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "FileReadAsyncComplete", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete", + "params": [ + { "paramname":"hReadCall", "paramtype":"SteamAPICall_t" }, + { "paramname":"pvBuffer", "paramtype":"void *" }, + { "paramname":"cubToRead", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "FileForget", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_FileForget", + "params": [ + { "paramname":"pchFile", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "FileDelete", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_FileDelete", + "params": [ + { "paramname":"pchFile", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "callresult": "RemoteStorageFileShareResult_t", + "methodname": "FileShare", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_FileShare", + "params": [ + { "paramname":"pchFile", "paramtype":"const char *" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "SetSyncPlatforms", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_SetSyncPlatforms", + "params": [ + { "paramname":"pchFile", "paramtype":"const char *" }, + { "paramname":"eRemoteStoragePlatform", "paramtype":"ERemoteStoragePlatform" } + ], + "returntype": "bool" + }, + { + "methodname": "FileWriteStreamOpen", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen", + "params": [ + { "paramname":"pchFile", "paramtype":"const char *" } + ], + "returntype": "UGCFileWriteStreamHandle_t" + }, + { + "methodname": "FileWriteStreamWriteChunk", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk", + "params": [ + { "paramname":"writeHandle", "paramtype":"UGCFileWriteStreamHandle_t" }, + { "paramname":"pvData", "paramtype":"const void *" }, + { "paramname":"cubData", "paramtype":"int32" } + ], + "returntype": "bool" + }, + { + "methodname": "FileWriteStreamClose", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_FileWriteStreamClose", + "params": [ + { "paramname":"writeHandle", "paramtype":"UGCFileWriteStreamHandle_t" } + ], + "returntype": "bool" + }, + { + "methodname": "FileWriteStreamCancel", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel", + "params": [ + { "paramname":"writeHandle", "paramtype":"UGCFileWriteStreamHandle_t" } + ], + "returntype": "bool" + }, + { + "methodname": "FileExists", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_FileExists", + "params": [ + { "paramname":"pchFile", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "FilePersisted", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_FilePersisted", + "params": [ + { "paramname":"pchFile", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetFileSize", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_GetFileSize", + "params": [ + { "paramname":"pchFile", "paramtype":"const char *" } + ], + "returntype": "int32" + }, + { + "methodname": "GetFileTimestamp", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_GetFileTimestamp", + "params": [ + { "paramname":"pchFile", "paramtype":"const char *" } + ], + "returntype": "int64" + }, + { + "methodname": "GetSyncPlatforms", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_GetSyncPlatforms", + "params": [ + { "paramname":"pchFile", "paramtype":"const char *" } + ], + "returntype": "ERemoteStoragePlatform" + }, + { + "methodname": "GetFileCount", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_GetFileCount", + "params": [], + "returntype": "int32" + }, + { + "methodname": "GetFileNameAndSize", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_GetFileNameAndSize", + "params": [ + { "paramname":"iFile", "paramtype":"int" }, + { "paramname":"pnFileSizeInBytes", "paramtype":"int32 *" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetQuota", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_GetQuota", + "params": [ + { "paramname":"pnTotalBytes", "paramtype":"uint64 *" }, + { "paramname":"puAvailableBytes", "paramtype":"uint64 *" } + ], + "returntype": "bool" + }, + { + "methodname": "IsCloudEnabledForAccount", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount", + "params": [], + "returntype": "bool" + }, + { + "methodname": "IsCloudEnabledForApp", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp", + "params": [], + "returntype": "bool" + }, + { + "methodname": "SetCloudEnabledForApp", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp", + "params": [ + { "paramname":"bEnabled", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "callresult": "RemoteStorageDownloadUGCResult_t", + "methodname": "UGCDownload", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_UGCDownload", + "params": [ + { "paramname":"hContent", "paramtype":"UGCHandle_t" }, + { "paramname":"unPriority", "paramtype":"uint32" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetUGCDownloadProgress", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress", + "params": [ + { "paramname":"hContent", "paramtype":"UGCHandle_t" }, + { "paramname":"pnBytesDownloaded", "paramtype":"int32 *" }, + { "paramname":"pnBytesExpected", "paramtype":"int32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetUGCDetails", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_GetUGCDetails", + "params": [ + { "paramname":"hContent", "paramtype":"UGCHandle_t" }, + { "paramname":"pnAppID", "paramtype":"AppId_t *" }, + { + "out_string": "", + "paramname": "ppchName", + "paramtype": "char **" + }, + { "paramname":"pnFileSizeInBytes", "paramtype":"int32 *" }, + { + "out_struct": "", + "paramname": "pSteamIDOwner", + "paramtype": "CSteamID *" + } + ], + "returntype": "bool" + }, + { + "methodname": "UGCRead", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_UGCRead", + "params": [ + { "paramname":"hContent", "paramtype":"UGCHandle_t" }, + { "paramname":"pvData", "paramtype":"void *" }, + { "paramname":"cubDataToRead", "paramtype":"int32" }, + { "paramname":"cOffset", "paramtype":"uint32" }, + { "paramname":"eAction", "paramtype":"EUGCReadAction" } + ], + "returntype": "int32" + }, + { + "methodname": "GetCachedUGCCount", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_GetCachedUGCCount", + "params": [], + "returntype": "int32" + }, + { + "methodname": "GetCachedUGCHandle", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle", + "params": [ + { "paramname":"iCachedContent", "paramtype":"int32" } + ], + "returntype": "UGCHandle_t" + }, + { + "callresult": "RemoteStoragePublishFileProgress_t", + "methodname": "PublishWorkshopFile", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_PublishWorkshopFile", + "params": [ + { "paramname":"pchFile", "paramtype":"const char *" }, + { "paramname":"pchPreviewFile", "paramtype":"const char *" }, + { "paramname":"nConsumerAppId", "paramtype":"AppId_t" }, + { "paramname":"pchTitle", "paramtype":"const char *" }, + { "paramname":"pchDescription", "paramtype":"const char *" }, + { "paramname":"eVisibility", "paramtype":"ERemoteStoragePublishedFileVisibility" }, + { "paramname":"pTags", "paramtype":"SteamParamStringArray_t *" }, + { "paramname":"eWorkshopFileType", "paramtype":"EWorkshopFileType" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "CreatePublishedFileUpdateRequest", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest", + "params": [ + { "paramname":"unPublishedFileId", "paramtype":"PublishedFileId_t" } + ], + "returntype": "PublishedFileUpdateHandle_t" + }, + { + "methodname": "UpdatePublishedFileFile", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile", + "params": [ + { "paramname":"updateHandle", "paramtype":"PublishedFileUpdateHandle_t" }, + { "paramname":"pchFile", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "UpdatePublishedFilePreviewFile", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile", + "params": [ + { "paramname":"updateHandle", "paramtype":"PublishedFileUpdateHandle_t" }, + { "paramname":"pchPreviewFile", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "UpdatePublishedFileTitle", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle", + "params": [ + { "paramname":"updateHandle", "paramtype":"PublishedFileUpdateHandle_t" }, + { "paramname":"pchTitle", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "UpdatePublishedFileDescription", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription", + "params": [ + { "paramname":"updateHandle", "paramtype":"PublishedFileUpdateHandle_t" }, + { "paramname":"pchDescription", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "UpdatePublishedFileVisibility", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility", + "params": [ + { "paramname":"updateHandle", "paramtype":"PublishedFileUpdateHandle_t" }, + { "paramname":"eVisibility", "paramtype":"ERemoteStoragePublishedFileVisibility" } + ], + "returntype": "bool" + }, + { + "methodname": "UpdatePublishedFileTags", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags", + "params": [ + { "paramname":"updateHandle", "paramtype":"PublishedFileUpdateHandle_t" }, + { "paramname":"pTags", "paramtype":"SteamParamStringArray_t *" } + ], + "returntype": "bool" + }, + { + "callresult": "RemoteStorageUpdatePublishedFileResult_t", + "methodname": "CommitPublishedFileUpdate", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate", + "params": [ + { "paramname":"updateHandle", "paramtype":"PublishedFileUpdateHandle_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoteStorageGetPublishedFileDetailsResult_t", + "methodname": "GetPublishedFileDetails", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails", + "params": [ + { "paramname":"unPublishedFileId", "paramtype":"PublishedFileId_t" }, + { "paramname":"unMaxSecondsOld", "paramtype":"uint32" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoteStorageDeletePublishedFileResult_t", + "methodname": "DeletePublishedFile", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_DeletePublishedFile", + "params": [ + { "paramname":"unPublishedFileId", "paramtype":"PublishedFileId_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoteStorageEnumerateUserPublishedFilesResult_t", + "methodname": "EnumerateUserPublishedFiles", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles", + "params": [ + { "paramname":"unStartIndex", "paramtype":"uint32" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoteStorageSubscribePublishedFileResult_t", + "methodname": "SubscribePublishedFile", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_SubscribePublishedFile", + "params": [ + { "paramname":"unPublishedFileId", "paramtype":"PublishedFileId_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoteStorageEnumerateUserSubscribedFilesResult_t", + "methodname": "EnumerateUserSubscribedFiles", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles", + "params": [ + { "paramname":"unStartIndex", "paramtype":"uint32" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoteStorageUnsubscribePublishedFileResult_t", + "methodname": "UnsubscribePublishedFile", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile", + "params": [ + { "paramname":"unPublishedFileId", "paramtype":"PublishedFileId_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "UpdatePublishedFileSetChangeDescription", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription", + "params": [ + { "paramname":"updateHandle", "paramtype":"PublishedFileUpdateHandle_t" }, + { "paramname":"pchChangeDescription", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "callresult": "RemoteStorageGetPublishedItemVoteDetailsResult_t", + "methodname": "GetPublishedItemVoteDetails", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails", + "params": [ + { "paramname":"unPublishedFileId", "paramtype":"PublishedFileId_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoteStorageUpdateUserPublishedItemVoteResult_t", + "methodname": "UpdateUserPublishedItemVote", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote", + "params": [ + { "paramname":"unPublishedFileId", "paramtype":"PublishedFileId_t" }, + { "paramname":"bVoteUp", "paramtype":"bool" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoteStorageGetPublishedItemVoteDetailsResult_t", + "methodname": "GetUserPublishedItemVoteDetails", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails", + "params": [ + { "paramname":"unPublishedFileId", "paramtype":"PublishedFileId_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoteStorageEnumerateUserPublishedFilesResult_t", + "methodname": "EnumerateUserSharedWorkshopFiles", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles", + "params": [ + { "paramname":"steamId", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"unStartIndex", "paramtype":"uint32" }, + { "paramname":"pRequiredTags", "paramtype":"SteamParamStringArray_t *" }, + { "paramname":"pExcludedTags", "paramtype":"SteamParamStringArray_t *" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoteStoragePublishFileProgress_t", + "methodname": "PublishVideo", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_PublishVideo", + "params": [ + { "paramname":"eVideoProvider", "paramtype":"EWorkshopVideoProvider" }, + { "paramname":"pchVideoAccount", "paramtype":"const char *" }, + { "paramname":"pchVideoIdentifier", "paramtype":"const char *" }, + { "paramname":"pchPreviewFile", "paramtype":"const char *" }, + { "paramname":"nConsumerAppId", "paramtype":"AppId_t" }, + { "paramname":"pchTitle", "paramtype":"const char *" }, + { "paramname":"pchDescription", "paramtype":"const char *" }, + { "paramname":"eVisibility", "paramtype":"ERemoteStoragePublishedFileVisibility" }, + { "paramname":"pTags", "paramtype":"SteamParamStringArray_t *" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoteStorageSetUserPublishedFileActionResult_t", + "methodname": "SetUserPublishedFileAction", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction", + "params": [ + { "paramname":"unPublishedFileId", "paramtype":"PublishedFileId_t" }, + { "paramname":"eAction", "paramtype":"EWorkshopFileAction" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoteStorageEnumeratePublishedFilesByUserActionResult_t", + "methodname": "EnumeratePublishedFilesByUserAction", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction", + "params": [ + { "paramname":"eAction", "paramtype":"EWorkshopFileAction" }, + { "paramname":"unStartIndex", "paramtype":"uint32" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoteStorageEnumerateWorkshopFilesResult_t", + "methodname": "EnumeratePublishedWorkshopFiles", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles", + "params": [ + { "paramname":"eEnumerationType", "paramtype":"EWorkshopEnumerationType" }, + { "paramname":"unStartIndex", "paramtype":"uint32" }, + { "paramname":"unCount", "paramtype":"uint32" }, + { "paramname":"unDays", "paramtype":"uint32" }, + { "paramname":"pTags", "paramtype":"SteamParamStringArray_t *" }, + { "paramname":"pUserTags", "paramtype":"SteamParamStringArray_t *" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoteStorageDownloadUGCResult_t", + "methodname": "UGCDownloadToLocation", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation", + "params": [ + { "paramname":"hContent", "paramtype":"UGCHandle_t" }, + { "paramname":"pchLocation", "paramtype":"const char *" }, + { "paramname":"unPriority", "paramtype":"uint32" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetLocalFileChangeCount", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_GetLocalFileChangeCount", + "params": [], + "returntype": "int32" + }, + { + "methodname": "GetLocalFileChange", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_GetLocalFileChange", + "params": [ + { "paramname":"iFile", "paramtype":"int" }, + { "paramname":"pEChangeType", "paramtype":"ERemoteStorageLocalFileChange *" }, + { "paramname":"pEFilePathType", "paramtype":"ERemoteStorageFilePathType *" } + ], + "returntype": "const char *" + }, + { + "methodname": "BeginFileWriteBatch", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_BeginFileWriteBatch", + "params": [], + "returntype": "bool" + }, + { + "methodname": "EndFileWriteBatch", + "methodname_flat": "SteamAPI_ISteamRemoteStorage_EndFileWriteBatch", + "params": [], + "returntype": "bool" + } + ], + "version_string": "STEAMREMOTESTORAGE_INTERFACE_VERSION016" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamUserStats", + "name_flat": "SteamAPI_SteamUserStats_v013" + } + ], + "classname": "ISteamUserStats", + "fields": [], + "methods": [ + { + "methodname": "GetStat", + "methodname_flat": "SteamAPI_ISteamUserStats_GetStatInt32", + "params": [ + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"pData", "paramtype":"int32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetStat", + "methodname_flat": "SteamAPI_ISteamUserStats_GetStatFloat", + "params": [ + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"pData", "paramtype":"float *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetStat", + "methodname_flat": "SteamAPI_ISteamUserStats_SetStatInt32", + "params": [ + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"nData", "paramtype":"int32" } + ], + "returntype": "bool" + }, + { + "methodname": "SetStat", + "methodname_flat": "SteamAPI_ISteamUserStats_SetStatFloat", + "params": [ + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"fData", "paramtype":"float" } + ], + "returntype": "bool" + }, + { + "methodname": "UpdateAvgRateStat", + "methodname_flat": "SteamAPI_ISteamUserStats_UpdateAvgRateStat", + "params": [ + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"flCountThisSession", "paramtype":"float" }, + { "paramname":"dSessionLength", "paramtype":"double" } + ], + "returntype": "bool" + }, + { + "methodname": "GetAchievement", + "methodname_flat": "SteamAPI_ISteamUserStats_GetAchievement", + "params": [ + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"pbAchieved", "paramtype":"bool *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetAchievement", + "methodname_flat": "SteamAPI_ISteamUserStats_SetAchievement", + "params": [ + { "paramname":"pchName", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "ClearAchievement", + "methodname_flat": "SteamAPI_ISteamUserStats_ClearAchievement", + "params": [ + { "paramname":"pchName", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetAchievementAndUnlockTime", + "methodname_flat": "SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime", + "params": [ + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"pbAchieved", "paramtype":"bool *" }, + { "paramname":"punUnlockTime", "paramtype":"uint32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "StoreStats", + "methodname_flat": "SteamAPI_ISteamUserStats_StoreStats", + "params": [], + "returntype": "bool" + }, + { + "methodname": "GetAchievementIcon", + "methodname_flat": "SteamAPI_ISteamUserStats_GetAchievementIcon", + "params": [ + { "paramname":"pchName", "paramtype":"const char *" } + ], + "returntype": "int" + }, + { + "methodname": "GetAchievementDisplayAttribute", + "methodname_flat": "SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute", + "params": [ + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"pchKey", "paramtype":"const char *" } + ], + "returntype": "const char *" + }, + { + "methodname": "IndicateAchievementProgress", + "methodname_flat": "SteamAPI_ISteamUserStats_IndicateAchievementProgress", + "params": [ + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"nCurProgress", "paramtype":"uint32" }, + { "paramname":"nMaxProgress", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "GetNumAchievements", + "methodname_flat": "SteamAPI_ISteamUserStats_GetNumAchievements", + "params": [], + "returntype": "uint32" + }, + { + "methodname": "GetAchievementName", + "methodname_flat": "SteamAPI_ISteamUserStats_GetAchievementName", + "params": [ + { "paramname":"iAchievement", "paramtype":"uint32" } + ], + "returntype": "const char *" + }, + { + "callresult": "UserStatsReceived_t", + "methodname": "RequestUserStats", + "methodname_flat": "SteamAPI_ISteamUserStats_RequestUserStats", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetUserStat", + "methodname_flat": "SteamAPI_ISteamUserStats_GetUserStatInt32", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"pData", "paramtype":"int32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetUserStat", + "methodname_flat": "SteamAPI_ISteamUserStats_GetUserStatFloat", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"pData", "paramtype":"float *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetUserAchievement", + "methodname_flat": "SteamAPI_ISteamUserStats_GetUserAchievement", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"pbAchieved", "paramtype":"bool *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetUserAchievementAndUnlockTime", + "methodname_flat": "SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"pbAchieved", "paramtype":"bool *" }, + { "paramname":"punUnlockTime", "paramtype":"uint32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "ResetAllStats", + "methodname_flat": "SteamAPI_ISteamUserStats_ResetAllStats", + "params": [ + { "paramname":"bAchievementsToo", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "callresult": "LeaderboardFindResult_t", + "methodname": "FindOrCreateLeaderboard", + "methodname_flat": "SteamAPI_ISteamUserStats_FindOrCreateLeaderboard", + "params": [ + { "paramname":"pchLeaderboardName", "paramtype":"const char *" }, + { "paramname":"eLeaderboardSortMethod", "paramtype":"ELeaderboardSortMethod" }, + { "paramname":"eLeaderboardDisplayType", "paramtype":"ELeaderboardDisplayType" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "LeaderboardFindResult_t", + "methodname": "FindLeaderboard", + "methodname_flat": "SteamAPI_ISteamUserStats_FindLeaderboard", + "params": [ + { "paramname":"pchLeaderboardName", "paramtype":"const char *" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetLeaderboardName", + "methodname_flat": "SteamAPI_ISteamUserStats_GetLeaderboardName", + "params": [ + { "paramname":"hSteamLeaderboard", "paramtype":"SteamLeaderboard_t" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetLeaderboardEntryCount", + "methodname_flat": "SteamAPI_ISteamUserStats_GetLeaderboardEntryCount", + "params": [ + { "paramname":"hSteamLeaderboard", "paramtype":"SteamLeaderboard_t" } + ], + "returntype": "int" + }, + { + "methodname": "GetLeaderboardSortMethod", + "methodname_flat": "SteamAPI_ISteamUserStats_GetLeaderboardSortMethod", + "params": [ + { "paramname":"hSteamLeaderboard", "paramtype":"SteamLeaderboard_t" } + ], + "returntype": "ELeaderboardSortMethod" + }, + { + "methodname": "GetLeaderboardDisplayType", + "methodname_flat": "SteamAPI_ISteamUserStats_GetLeaderboardDisplayType", + "params": [ + { "paramname":"hSteamLeaderboard", "paramtype":"SteamLeaderboard_t" } + ], + "returntype": "ELeaderboardDisplayType" + }, + { + "callresult": "LeaderboardScoresDownloaded_t", + "methodname": "DownloadLeaderboardEntries", + "methodname_flat": "SteamAPI_ISteamUserStats_DownloadLeaderboardEntries", + "params": [ + { "paramname":"hSteamLeaderboard", "paramtype":"SteamLeaderboard_t" }, + { "paramname":"eLeaderboardDataRequest", "paramtype":"ELeaderboardDataRequest" }, + { "paramname":"nRangeStart", "paramtype":"int" }, + { "paramname":"nRangeEnd", "paramtype":"int" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "LeaderboardScoresDownloaded_t", + "methodname": "DownloadLeaderboardEntriesForUsers", + "methodname_flat": "SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers", + "params": [ + { "paramname":"hSteamLeaderboard", "paramtype":"SteamLeaderboard_t" }, + { + "array_count": "cUsers", + "desc": "Array of users to retrieve", + "paramname": "prgUsers", + "paramtype": "CSteamID *" + }, + { "paramname":"cUsers", "paramtype":"int" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetDownloadedLeaderboardEntry", + "methodname_flat": "SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry", + "params": [ + { "paramname":"hSteamLeaderboardEntries", "paramtype":"SteamLeaderboardEntries_t" }, + { "paramname":"index", "paramtype":"int" }, + { "paramname":"pLeaderboardEntry", "paramtype":"LeaderboardEntry_t *" }, + { "paramname":"pDetails", "paramtype":"int32 *" }, + { "paramname":"cDetailsMax", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "callresult": "LeaderboardScoreUploaded_t", + "methodname": "UploadLeaderboardScore", + "methodname_flat": "SteamAPI_ISteamUserStats_UploadLeaderboardScore", + "params": [ + { "paramname":"hSteamLeaderboard", "paramtype":"SteamLeaderboard_t" }, + { "paramname":"eLeaderboardUploadScoreMethod", "paramtype":"ELeaderboardUploadScoreMethod" }, + { "paramname":"nScore", "paramtype":"int32" }, + { "paramname":"pScoreDetails", "paramtype":"const int32 *" }, + { "paramname":"cScoreDetailsCount", "paramtype":"int" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "LeaderboardUGCSet_t", + "methodname": "AttachLeaderboardUGC", + "methodname_flat": "SteamAPI_ISteamUserStats_AttachLeaderboardUGC", + "params": [ + { "paramname":"hSteamLeaderboard", "paramtype":"SteamLeaderboard_t" }, + { "paramname":"hUGC", "paramtype":"UGCHandle_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "NumberOfCurrentPlayers_t", + "methodname": "GetNumberOfCurrentPlayers", + "methodname_flat": "SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers", + "params": [], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "GlobalAchievementPercentagesReady_t", + "methodname": "RequestGlobalAchievementPercentages", + "methodname_flat": "SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages", + "params": [], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetMostAchievedAchievementInfo", + "methodname_flat": "SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo", + "params": [ + { "paramname":"pchName", "paramtype":"char *" }, + { "paramname":"unNameBufLen", "paramtype":"uint32" }, + { "paramname":"pflPercent", "paramtype":"float *" }, + { "paramname":"pbAchieved", "paramtype":"bool *" } + ], + "returntype": "int" + }, + { + "methodname": "GetNextMostAchievedAchievementInfo", + "methodname_flat": "SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo", + "params": [ + { "paramname":"iIteratorPrevious", "paramtype":"int" }, + { "paramname":"pchName", "paramtype":"char *" }, + { "paramname":"unNameBufLen", "paramtype":"uint32" }, + { "paramname":"pflPercent", "paramtype":"float *" }, + { "paramname":"pbAchieved", "paramtype":"bool *" } + ], + "returntype": "int" + }, + { + "methodname": "GetAchievementAchievedPercent", + "methodname_flat": "SteamAPI_ISteamUserStats_GetAchievementAchievedPercent", + "params": [ + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"pflPercent", "paramtype":"float *" } + ], + "returntype": "bool" + }, + { + "callresult": "GlobalStatsReceived_t", + "methodname": "RequestGlobalStats", + "methodname_flat": "SteamAPI_ISteamUserStats_RequestGlobalStats", + "params": [ + { "paramname":"nHistoryDays", "paramtype":"int" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetGlobalStat", + "methodname_flat": "SteamAPI_ISteamUserStats_GetGlobalStatInt64", + "params": [ + { "paramname":"pchStatName", "paramtype":"const char *" }, + { "paramname":"pData", "paramtype":"int64 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetGlobalStat", + "methodname_flat": "SteamAPI_ISteamUserStats_GetGlobalStatDouble", + "params": [ + { "paramname":"pchStatName", "paramtype":"const char *" }, + { "paramname":"pData", "paramtype":"double *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetGlobalStatHistory", + "methodname_flat": "SteamAPI_ISteamUserStats_GetGlobalStatHistoryInt64", + "params": [ + { "paramname":"pchStatName", "paramtype":"const char *" }, + { + "array_count": "cubData", + "paramname": "pData", + "paramtype": "int64 *" + }, + { "paramname":"cubData", "paramtype":"uint32" } + ], + "returntype": "int32" + }, + { + "methodname": "GetGlobalStatHistory", + "methodname_flat": "SteamAPI_ISteamUserStats_GetGlobalStatHistoryDouble", + "params": [ + { "paramname":"pchStatName", "paramtype":"const char *" }, + { + "array_count": "cubData", + "paramname": "pData", + "paramtype": "double *" + }, + { "paramname":"cubData", "paramtype":"uint32" } + ], + "returntype": "int32" + }, + { + "methodname": "GetAchievementProgressLimits", + "methodname_flat": "SteamAPI_ISteamUserStats_GetAchievementProgressLimitsInt32", + "params": [ + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"pnMinProgress", "paramtype":"int32 *" }, + { "paramname":"pnMaxProgress", "paramtype":"int32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetAchievementProgressLimits", + "methodname_flat": "SteamAPI_ISteamUserStats_GetAchievementProgressLimitsFloat", + "params": [ + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"pfMinProgress", "paramtype":"float *" }, + { "paramname":"pfMaxProgress", "paramtype":"float *" } + ], + "returntype": "bool" + } + ], + "version_string": "STEAMUSERSTATS_INTERFACE_VERSION013" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamApps", + "name_flat": "SteamAPI_SteamApps_v008" + } + ], + "classname": "ISteamApps", + "fields": [], + "methods": [ + { + "methodname": "BIsSubscribed", + "methodname_flat": "SteamAPI_ISteamApps_BIsSubscribed", + "params": [], + "returntype": "bool" + }, + { + "methodname": "BIsLowViolence", + "methodname_flat": "SteamAPI_ISteamApps_BIsLowViolence", + "params": [], + "returntype": "bool" + }, + { + "methodname": "BIsCybercafe", + "methodname_flat": "SteamAPI_ISteamApps_BIsCybercafe", + "params": [], + "returntype": "bool" + }, + { + "methodname": "BIsVACBanned", + "methodname_flat": "SteamAPI_ISteamApps_BIsVACBanned", + "params": [], + "returntype": "bool" + }, + { + "methodname": "GetCurrentGameLanguage", + "methodname_flat": "SteamAPI_ISteamApps_GetCurrentGameLanguage", + "params": [], + "returntype": "const char *" + }, + { + "methodname": "GetAvailableGameLanguages", + "methodname_flat": "SteamAPI_ISteamApps_GetAvailableGameLanguages", + "params": [], + "returntype": "const char *" + }, + { + "methodname": "BIsSubscribedApp", + "methodname_flat": "SteamAPI_ISteamApps_BIsSubscribedApp", + "params": [ + { "paramname":"appID", "paramtype":"AppId_t" } + ], + "returntype": "bool" + }, + { + "methodname": "BIsDlcInstalled", + "methodname_flat": "SteamAPI_ISteamApps_BIsDlcInstalled", + "params": [ + { "paramname":"appID", "paramtype":"AppId_t" } + ], + "returntype": "bool" + }, + { + "methodname": "GetEarliestPurchaseUnixTime", + "methodname_flat": "SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime", + "params": [ + { "paramname":"nAppID", "paramtype":"AppId_t" } + ], + "returntype": "uint32" + }, + { + "methodname": "BIsSubscribedFromFreeWeekend", + "methodname_flat": "SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend", + "params": [], + "returntype": "bool" + }, + { + "methodname": "GetDLCCount", + "methodname_flat": "SteamAPI_ISteamApps_GetDLCCount", + "params": [], + "returntype": "int" + }, + { + "methodname": "BGetDLCDataByIndex", + "methodname_flat": "SteamAPI_ISteamApps_BGetDLCDataByIndex", + "params": [ + { "paramname":"iDLC", "paramtype":"int" }, + { "paramname":"pAppID", "paramtype":"AppId_t *" }, + { "paramname":"pbAvailable", "paramtype":"bool *" }, + { "paramname":"pchName", "paramtype":"char *" }, + { "paramname":"cchNameBufferSize", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "InstallDLC", + "methodname_flat": "SteamAPI_ISteamApps_InstallDLC", + "params": [ + { "paramname":"nAppID", "paramtype":"AppId_t" } + ], + "returntype": "void" + }, + { + "methodname": "UninstallDLC", + "methodname_flat": "SteamAPI_ISteamApps_UninstallDLC", + "params": [ + { "paramname":"nAppID", "paramtype":"AppId_t" } + ], + "returntype": "void" + }, + { + "methodname": "RequestAppProofOfPurchaseKey", + "methodname_flat": "SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey", + "params": [ + { "paramname":"nAppID", "paramtype":"AppId_t" } + ], + "returntype": "void" + }, + { + "methodname": "GetCurrentBetaName", + "methodname_flat": "SteamAPI_ISteamApps_GetCurrentBetaName", + "params": [ + { "paramname":"pchName", "paramtype":"char *" }, + { "paramname":"cchNameBufferSize", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "MarkContentCorrupt", + "methodname_flat": "SteamAPI_ISteamApps_MarkContentCorrupt", + "params": [ + { "paramname":"bMissingFilesOnly", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "GetInstalledDepots", + "methodname_flat": "SteamAPI_ISteamApps_GetInstalledDepots", + "params": [ + { "paramname":"appID", "paramtype":"AppId_t" }, + { "paramname":"pvecDepots", "paramtype":"DepotId_t *" }, + { "paramname":"cMaxDepots", "paramtype":"uint32" } + ], + "returntype": "uint32" + }, + { + "methodname": "GetAppInstallDir", + "methodname_flat": "SteamAPI_ISteamApps_GetAppInstallDir", + "params": [ + { "paramname":"appID", "paramtype":"AppId_t" }, + { "paramname":"pchFolder", "paramtype":"char *" }, + { "paramname":"cchFolderBufferSize", "paramtype":"uint32" } + ], + "returntype": "uint32" + }, + { + "methodname": "BIsAppInstalled", + "methodname_flat": "SteamAPI_ISteamApps_BIsAppInstalled", + "params": [ + { "paramname":"appID", "paramtype":"AppId_t" } + ], + "returntype": "bool" + }, + { + "methodname": "GetAppOwner", + "methodname_flat": "SteamAPI_ISteamApps_GetAppOwner", + "params": [], + "returntype": "CSteamID", + "returntype_flat": "uint64_steamid" + }, + { + "methodname": "GetLaunchQueryParam", + "methodname_flat": "SteamAPI_ISteamApps_GetLaunchQueryParam", + "params": [ + { "paramname":"pchKey", "paramtype":"const char *" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetDlcDownloadProgress", + "methodname_flat": "SteamAPI_ISteamApps_GetDlcDownloadProgress", + "params": [ + { "paramname":"nAppID", "paramtype":"AppId_t" }, + { "paramname":"punBytesDownloaded", "paramtype":"uint64 *" }, + { "paramname":"punBytesTotal", "paramtype":"uint64 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetAppBuildId", + "methodname_flat": "SteamAPI_ISteamApps_GetAppBuildId", + "params": [], + "returntype": "int" + }, + { + "methodname": "RequestAllProofOfPurchaseKeys", + "methodname_flat": "SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys", + "params": [], + "returntype": "void" + }, + { + "callresult": "FileDetailsResult_t", + "methodname": "GetFileDetails", + "methodname_flat": "SteamAPI_ISteamApps_GetFileDetails", + "params": [ + { "paramname":"pszFileName", "paramtype":"const char *" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetLaunchCommandLine", + "methodname_flat": "SteamAPI_ISteamApps_GetLaunchCommandLine", + "params": [ + { "paramname":"pszCommandLine", "paramtype":"char *" }, + { "paramname":"cubCommandLine", "paramtype":"int" } + ], + "returntype": "int" + }, + { + "methodname": "BIsSubscribedFromFamilySharing", + "methodname_flat": "SteamAPI_ISteamApps_BIsSubscribedFromFamilySharing", + "params": [], + "returntype": "bool" + }, + { + "methodname": "BIsTimedTrial", + "methodname_flat": "SteamAPI_ISteamApps_BIsTimedTrial", + "params": [ + { "paramname":"punSecondsAllowed", "paramtype":"uint32 *" }, + { "paramname":"punSecondsPlayed", "paramtype":"uint32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetDlcContext", + "methodname_flat": "SteamAPI_ISteamApps_SetDlcContext", + "params": [ + { "paramname":"nAppID", "paramtype":"AppId_t" } + ], + "returntype": "bool" + }, + { + "methodname": "GetNumBetas", + "methodname_flat": "SteamAPI_ISteamApps_GetNumBetas", + "params": [ + { "paramname":"pnAvailable", "paramtype":"int *" }, + { "paramname":"pnPrivate", "paramtype":"int *" } + ], + "returntype": "int" + }, + { + "methodname": "GetBetaInfo", + "methodname_flat": "SteamAPI_ISteamApps_GetBetaInfo", + "params": [ + { "paramname":"iBetaIndex", "paramtype":"int" }, + { "paramname":"punFlags", "paramtype":"uint32 *" }, + { "paramname":"punBuildID", "paramtype":"uint32 *" }, + { "paramname":"pchBetaName", "paramtype":"char *" }, + { "paramname":"cchBetaName", "paramtype":"int" }, + { "paramname":"pchDescription", "paramtype":"char *" }, + { "paramname":"cchDescription", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "SetActiveBeta", + "methodname_flat": "SteamAPI_ISteamApps_SetActiveBeta", + "params": [ + { "paramname":"pchBetaName", "paramtype":"const char *" } + ], + "returntype": "bool" + } + ], + "version_string": "STEAMAPPS_INTERFACE_VERSION008" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamNetworking", + "name_flat": "SteamAPI_SteamNetworking_v006" + }, + { + "kind": "gameserver", + "name": "SteamGameServerNetworking", + "name_flat": "SteamAPI_SteamGameServerNetworking_v006" + } + ], + "classname": "ISteamNetworking", + "fields": [], + "methods": [ + { + "methodname": "SendP2PPacket", + "methodname_flat": "SteamAPI_ISteamNetworking_SendP2PPacket", + "params": [ + { "paramname":"steamIDRemote", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pubData", "paramtype":"const void *" }, + { "paramname":"cubData", "paramtype":"uint32" }, + { "paramname":"eP2PSendType", "paramtype":"EP2PSend" }, + { "paramname":"nChannel", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "IsP2PPacketAvailable", + "methodname_flat": "SteamAPI_ISteamNetworking_IsP2PPacketAvailable", + "params": [ + { "paramname":"pcubMsgSize", "paramtype":"uint32 *" }, + { "paramname":"nChannel", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "ReadP2PPacket", + "methodname_flat": "SteamAPI_ISteamNetworking_ReadP2PPacket", + "params": [ + { "paramname":"pubDest", "paramtype":"void *" }, + { "paramname":"cubDest", "paramtype":"uint32" }, + { "paramname":"pcubMsgSize", "paramtype":"uint32 *" }, + { "paramname":"psteamIDRemote", "paramtype":"CSteamID *" }, + { "paramname":"nChannel", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "AcceptP2PSessionWithUser", + "methodname_flat": "SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser", + "params": [ + { "paramname":"steamIDRemote", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + }, + { + "methodname": "CloseP2PSessionWithUser", + "methodname_flat": "SteamAPI_ISteamNetworking_CloseP2PSessionWithUser", + "params": [ + { "paramname":"steamIDRemote", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + }, + { + "methodname": "CloseP2PChannelWithUser", + "methodname_flat": "SteamAPI_ISteamNetworking_CloseP2PChannelWithUser", + "params": [ + { "paramname":"steamIDRemote", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"nChannel", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "GetP2PSessionState", + "methodname_flat": "SteamAPI_ISteamNetworking_GetP2PSessionState", + "params": [ + { "paramname":"steamIDRemote", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pConnectionState", "paramtype":"P2PSessionState_t *" } + ], + "returntype": "bool" + }, + { + "methodname": "AllowP2PPacketRelay", + "methodname_flat": "SteamAPI_ISteamNetworking_AllowP2PPacketRelay", + "params": [ + { "paramname":"bAllow", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "CreateListenSocket", + "methodname_flat": "SteamAPI_ISteamNetworking_CreateListenSocket", + "params": [ + { "paramname":"nVirtualP2PPort", "paramtype":"int" }, + { "paramname":"nIP", "paramtype":"SteamIPAddress_t" }, + { "paramname":"nPort", "paramtype":"uint16" }, + { "paramname":"bAllowUseOfPacketRelay", "paramtype":"bool" } + ], + "returntype": "SNetListenSocket_t" + }, + { + "methodname": "CreateP2PConnectionSocket", + "methodname_flat": "SteamAPI_ISteamNetworking_CreateP2PConnectionSocket", + "params": [ + { "paramname":"steamIDTarget", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"nVirtualPort", "paramtype":"int" }, + { "paramname":"nTimeoutSec", "paramtype":"int" }, + { "paramname":"bAllowUseOfPacketRelay", "paramtype":"bool" } + ], + "returntype": "SNetSocket_t" + }, + { + "methodname": "CreateConnectionSocket", + "methodname_flat": "SteamAPI_ISteamNetworking_CreateConnectionSocket", + "params": [ + { "paramname":"nIP", "paramtype":"SteamIPAddress_t" }, + { "paramname":"nPort", "paramtype":"uint16" }, + { "paramname":"nTimeoutSec", "paramtype":"int" } + ], + "returntype": "SNetSocket_t" + }, + { + "methodname": "DestroySocket", + "methodname_flat": "SteamAPI_ISteamNetworking_DestroySocket", + "params": [ + { "paramname":"hSocket", "paramtype":"SNetSocket_t" }, + { "paramname":"bNotifyRemoteEnd", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "DestroyListenSocket", + "methodname_flat": "SteamAPI_ISteamNetworking_DestroyListenSocket", + "params": [ + { "paramname":"hSocket", "paramtype":"SNetListenSocket_t" }, + { "paramname":"bNotifyRemoteEnd", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "SendDataOnSocket", + "methodname_flat": "SteamAPI_ISteamNetworking_SendDataOnSocket", + "params": [ + { "paramname":"hSocket", "paramtype":"SNetSocket_t" }, + { "paramname":"pubData", "paramtype":"void *" }, + { "paramname":"cubData", "paramtype":"uint32" }, + { "paramname":"bReliable", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "IsDataAvailableOnSocket", + "methodname_flat": "SteamAPI_ISteamNetworking_IsDataAvailableOnSocket", + "params": [ + { "paramname":"hSocket", "paramtype":"SNetSocket_t" }, + { "paramname":"pcubMsgSize", "paramtype":"uint32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "RetrieveDataFromSocket", + "methodname_flat": "SteamAPI_ISteamNetworking_RetrieveDataFromSocket", + "params": [ + { "paramname":"hSocket", "paramtype":"SNetSocket_t" }, + { "paramname":"pubDest", "paramtype":"void *" }, + { "paramname":"cubDest", "paramtype":"uint32" }, + { "paramname":"pcubMsgSize", "paramtype":"uint32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "IsDataAvailable", + "methodname_flat": "SteamAPI_ISteamNetworking_IsDataAvailable", + "params": [ + { "paramname":"hListenSocket", "paramtype":"SNetListenSocket_t" }, + { "paramname":"pcubMsgSize", "paramtype":"uint32 *" }, + { "paramname":"phSocket", "paramtype":"SNetSocket_t *" } + ], + "returntype": "bool" + }, + { + "methodname": "RetrieveData", + "methodname_flat": "SteamAPI_ISteamNetworking_RetrieveData", + "params": [ + { "paramname":"hListenSocket", "paramtype":"SNetListenSocket_t" }, + { "paramname":"pubDest", "paramtype":"void *" }, + { "paramname":"cubDest", "paramtype":"uint32" }, + { "paramname":"pcubMsgSize", "paramtype":"uint32 *" }, + { "paramname":"phSocket", "paramtype":"SNetSocket_t *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetSocketInfo", + "methodname_flat": "SteamAPI_ISteamNetworking_GetSocketInfo", + "params": [ + { "paramname":"hSocket", "paramtype":"SNetSocket_t" }, + { "paramname":"pSteamIDRemote", "paramtype":"CSteamID *" }, + { "paramname":"peSocketStatus", "paramtype":"int *" }, + { "paramname":"punIPRemote", "paramtype":"SteamIPAddress_t *" }, + { "paramname":"punPortRemote", "paramtype":"uint16 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetListenSocketInfo", + "methodname_flat": "SteamAPI_ISteamNetworking_GetListenSocketInfo", + "params": [ + { "paramname":"hListenSocket", "paramtype":"SNetListenSocket_t" }, + { "paramname":"pnIP", "paramtype":"SteamIPAddress_t *" }, + { "paramname":"pnPort", "paramtype":"uint16 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetSocketConnectionType", + "methodname_flat": "SteamAPI_ISteamNetworking_GetSocketConnectionType", + "params": [ + { "paramname":"hSocket", "paramtype":"SNetSocket_t" } + ], + "returntype": "ESNetSocketConnectionType" + }, + { + "methodname": "GetMaxPacketSize", + "methodname_flat": "SteamAPI_ISteamNetworking_GetMaxPacketSize", + "params": [ + { "paramname":"hSocket", "paramtype":"SNetSocket_t" } + ], + "returntype": "int" + } + ], + "version_string": "SteamNetworking006" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamScreenshots", + "name_flat": "SteamAPI_SteamScreenshots_v003" + } + ], + "classname": "ISteamScreenshots", + "fields": [], + "methods": [ + { + "methodname": "WriteScreenshot", + "methodname_flat": "SteamAPI_ISteamScreenshots_WriteScreenshot", + "params": [ + { "paramname":"pubRGB", "paramtype":"void *" }, + { "paramname":"cubRGB", "paramtype":"uint32" }, + { "paramname":"nWidth", "paramtype":"int" }, + { "paramname":"nHeight", "paramtype":"int" } + ], + "returntype": "ScreenshotHandle" + }, + { + "methodname": "AddScreenshotToLibrary", + "methodname_flat": "SteamAPI_ISteamScreenshots_AddScreenshotToLibrary", + "params": [ + { "paramname":"pchFilename", "paramtype":"const char *" }, + { "paramname":"pchThumbnailFilename", "paramtype":"const char *" }, + { "paramname":"nWidth", "paramtype":"int" }, + { "paramname":"nHeight", "paramtype":"int" } + ], + "returntype": "ScreenshotHandle" + }, + { + "methodname": "TriggerScreenshot", + "methodname_flat": "SteamAPI_ISteamScreenshots_TriggerScreenshot", + "params": [], + "returntype": "void" + }, + { + "methodname": "HookScreenshots", + "methodname_flat": "SteamAPI_ISteamScreenshots_HookScreenshots", + "params": [ + { "paramname":"bHook", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "SetLocation", + "methodname_flat": "SteamAPI_ISteamScreenshots_SetLocation", + "params": [ + { "paramname":"hScreenshot", "paramtype":"ScreenshotHandle" }, + { "paramname":"pchLocation", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "TagUser", + "methodname_flat": "SteamAPI_ISteamScreenshots_TagUser", + "params": [ + { "paramname":"hScreenshot", "paramtype":"ScreenshotHandle" }, + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + }, + { + "methodname": "TagPublishedFile", + "methodname_flat": "SteamAPI_ISteamScreenshots_TagPublishedFile", + "params": [ + { "paramname":"hScreenshot", "paramtype":"ScreenshotHandle" }, + { "paramname":"unPublishedFileID", "paramtype":"PublishedFileId_t" } + ], + "returntype": "bool" + }, + { + "methodname": "IsScreenshotsHooked", + "methodname_flat": "SteamAPI_ISteamScreenshots_IsScreenshotsHooked", + "params": [], + "returntype": "bool" + }, + { + "methodname": "AddVRScreenshotToLibrary", + "methodname_flat": "SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary", + "params": [ + { "paramname":"eType", "paramtype":"EVRScreenshotType" }, + { "paramname":"pchFilename", "paramtype":"const char *" }, + { "paramname":"pchVRFilename", "paramtype":"const char *" } + ], + "returntype": "ScreenshotHandle" + } + ], + "version_string": "STEAMSCREENSHOTS_INTERFACE_VERSION003" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamMusic", + "name_flat": "SteamAPI_SteamMusic_v001" + } + ], + "classname": "ISteamMusic", + "fields": [], + "methods": [ + { + "methodname": "BIsEnabled", + "methodname_flat": "SteamAPI_ISteamMusic_BIsEnabled", + "params": [], + "returntype": "bool" + }, + { + "methodname": "BIsPlaying", + "methodname_flat": "SteamAPI_ISteamMusic_BIsPlaying", + "params": [], + "returntype": "bool" + }, + { + "methodname": "GetPlaybackStatus", + "methodname_flat": "SteamAPI_ISteamMusic_GetPlaybackStatus", + "params": [], + "returntype": "AudioPlayback_Status" + }, + { + "methodname": "Play", + "methodname_flat": "SteamAPI_ISteamMusic_Play", + "params": [], + "returntype": "void" + }, + { + "methodname": "Pause", + "methodname_flat": "SteamAPI_ISteamMusic_Pause", + "params": [], + "returntype": "void" + }, + { + "methodname": "PlayPrevious", + "methodname_flat": "SteamAPI_ISteamMusic_PlayPrevious", + "params": [], + "returntype": "void" + }, + { + "methodname": "PlayNext", + "methodname_flat": "SteamAPI_ISteamMusic_PlayNext", + "params": [], + "returntype": "void" + }, + { + "methodname": "SetVolume", + "methodname_flat": "SteamAPI_ISteamMusic_SetVolume", + "params": [ + { "paramname":"flVolume", "paramtype":"float" } + ], + "returntype": "void" + }, + { + "methodname": "GetVolume", + "methodname_flat": "SteamAPI_ISteamMusic_GetVolume", + "params": [], + "returntype": "float" + } + ], + "version_string": "STEAMMUSIC_INTERFACE_VERSION001" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamMusicRemote", + "name_flat": "SteamAPI_SteamMusicRemote_v001" + } + ], + "classname": "ISteamMusicRemote", + "fields": [], + "methods": [ + { + "methodname": "RegisterSteamMusicRemote", + "methodname_flat": "SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote", + "params": [ + { "paramname":"pchName", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "DeregisterSteamMusicRemote", + "methodname_flat": "SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote", + "params": [], + "returntype": "bool" + }, + { + "methodname": "BIsCurrentMusicRemote", + "methodname_flat": "SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote", + "params": [], + "returntype": "bool" + }, + { + "methodname": "BActivationSuccess", + "methodname_flat": "SteamAPI_ISteamMusicRemote_BActivationSuccess", + "params": [ + { "paramname":"bValue", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "SetDisplayName", + "methodname_flat": "SteamAPI_ISteamMusicRemote_SetDisplayName", + "params": [ + { "paramname":"pchDisplayName", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetPNGIcon_64x64", + "methodname_flat": "SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64", + "params": [ + { "paramname":"pvBuffer", "paramtype":"void *" }, + { "paramname":"cbBufferLength", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "EnablePlayPrevious", + "methodname_flat": "SteamAPI_ISteamMusicRemote_EnablePlayPrevious", + "params": [ + { "paramname":"bValue", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "EnablePlayNext", + "methodname_flat": "SteamAPI_ISteamMusicRemote_EnablePlayNext", + "params": [ + { "paramname":"bValue", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "EnableShuffled", + "methodname_flat": "SteamAPI_ISteamMusicRemote_EnableShuffled", + "params": [ + { "paramname":"bValue", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "EnableLooped", + "methodname_flat": "SteamAPI_ISteamMusicRemote_EnableLooped", + "params": [ + { "paramname":"bValue", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "EnableQueue", + "methodname_flat": "SteamAPI_ISteamMusicRemote_EnableQueue", + "params": [ + { "paramname":"bValue", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "EnablePlaylists", + "methodname_flat": "SteamAPI_ISteamMusicRemote_EnablePlaylists", + "params": [ + { "paramname":"bValue", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "UpdatePlaybackStatus", + "methodname_flat": "SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus", + "params": [ + { "paramname":"nStatus", "paramtype":"AudioPlayback_Status" } + ], + "returntype": "bool" + }, + { + "methodname": "UpdateShuffled", + "methodname_flat": "SteamAPI_ISteamMusicRemote_UpdateShuffled", + "params": [ + { "paramname":"bValue", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "UpdateLooped", + "methodname_flat": "SteamAPI_ISteamMusicRemote_UpdateLooped", + "params": [ + { "paramname":"bValue", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "UpdateVolume", + "methodname_flat": "SteamAPI_ISteamMusicRemote_UpdateVolume", + "params": [ + { "paramname":"flValue", "paramtype":"float" } + ], + "returntype": "bool" + }, + { + "methodname": "CurrentEntryWillChange", + "methodname_flat": "SteamAPI_ISteamMusicRemote_CurrentEntryWillChange", + "params": [], + "returntype": "bool" + }, + { + "methodname": "CurrentEntryIsAvailable", + "methodname_flat": "SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable", + "params": [ + { "paramname":"bAvailable", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "UpdateCurrentEntryText", + "methodname_flat": "SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText", + "params": [ + { "paramname":"pchText", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "UpdateCurrentEntryElapsedSeconds", + "methodname_flat": "SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds", + "params": [ + { "paramname":"nValue", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "UpdateCurrentEntryCoverArt", + "methodname_flat": "SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt", + "params": [ + { "paramname":"pvBuffer", "paramtype":"void *" }, + { "paramname":"cbBufferLength", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "CurrentEntryDidChange", + "methodname_flat": "SteamAPI_ISteamMusicRemote_CurrentEntryDidChange", + "params": [], + "returntype": "bool" + }, + { + "methodname": "QueueWillChange", + "methodname_flat": "SteamAPI_ISteamMusicRemote_QueueWillChange", + "params": [], + "returntype": "bool" + }, + { + "methodname": "ResetQueueEntries", + "methodname_flat": "SteamAPI_ISteamMusicRemote_ResetQueueEntries", + "params": [], + "returntype": "bool" + }, + { + "methodname": "SetQueueEntry", + "methodname_flat": "SteamAPI_ISteamMusicRemote_SetQueueEntry", + "params": [ + { "paramname":"nID", "paramtype":"int" }, + { "paramname":"nPosition", "paramtype":"int" }, + { "paramname":"pchEntryText", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetCurrentQueueEntry", + "methodname_flat": "SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry", + "params": [ + { "paramname":"nID", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "QueueDidChange", + "methodname_flat": "SteamAPI_ISteamMusicRemote_QueueDidChange", + "params": [], + "returntype": "bool" + }, + { + "methodname": "PlaylistWillChange", + "methodname_flat": "SteamAPI_ISteamMusicRemote_PlaylistWillChange", + "params": [], + "returntype": "bool" + }, + { + "methodname": "ResetPlaylistEntries", + "methodname_flat": "SteamAPI_ISteamMusicRemote_ResetPlaylistEntries", + "params": [], + "returntype": "bool" + }, + { + "methodname": "SetPlaylistEntry", + "methodname_flat": "SteamAPI_ISteamMusicRemote_SetPlaylistEntry", + "params": [ + { "paramname":"nID", "paramtype":"int" }, + { "paramname":"nPosition", "paramtype":"int" }, + { "paramname":"pchEntryText", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetCurrentPlaylistEntry", + "methodname_flat": "SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry", + "params": [ + { "paramname":"nID", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "PlaylistDidChange", + "methodname_flat": "SteamAPI_ISteamMusicRemote_PlaylistDidChange", + "params": [], + "returntype": "bool" + } + ], + "version_string": "STEAMMUSICREMOTE_INTERFACE_VERSION001" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamHTTP", + "name_flat": "SteamAPI_SteamHTTP_v003" + }, + { + "kind": "gameserver", + "name": "SteamGameServerHTTP", + "name_flat": "SteamAPI_SteamGameServerHTTP_v003" + } + ], + "classname": "ISteamHTTP", + "fields": [], + "methods": [ + { + "methodname": "CreateHTTPRequest", + "methodname_flat": "SteamAPI_ISteamHTTP_CreateHTTPRequest", + "params": [ + { "paramname":"eHTTPRequestMethod", "paramtype":"EHTTPMethod" }, + { "paramname":"pchAbsoluteURL", "paramtype":"const char *" } + ], + "returntype": "HTTPRequestHandle" + }, + { + "methodname": "SetHTTPRequestContextValue", + "methodname_flat": "SteamAPI_ISteamHTTP_SetHTTPRequestContextValue", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"ulContextValue", "paramtype":"uint64" } + ], + "returntype": "bool" + }, + { + "methodname": "SetHTTPRequestNetworkActivityTimeout", + "methodname_flat": "SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"unTimeoutSeconds", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "SetHTTPRequestHeaderValue", + "methodname_flat": "SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"pchHeaderName", "paramtype":"const char *" }, + { "paramname":"pchHeaderValue", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetHTTPRequestGetOrPostParameter", + "methodname_flat": "SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"pchParamName", "paramtype":"const char *" }, + { "paramname":"pchParamValue", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SendHTTPRequest", + "methodname_flat": "SteamAPI_ISteamHTTP_SendHTTPRequest", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"pCallHandle", "paramtype":"SteamAPICall_t *" } + ], + "returntype": "bool" + }, + { + "methodname": "SendHTTPRequestAndStreamResponse", + "methodname_flat": "SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"pCallHandle", "paramtype":"SteamAPICall_t *" } + ], + "returntype": "bool" + }, + { + "methodname": "DeferHTTPRequest", + "methodname_flat": "SteamAPI_ISteamHTTP_DeferHTTPRequest", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" } + ], + "returntype": "bool" + }, + { + "methodname": "PrioritizeHTTPRequest", + "methodname_flat": "SteamAPI_ISteamHTTP_PrioritizeHTTPRequest", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" } + ], + "returntype": "bool" + }, + { + "methodname": "GetHTTPResponseHeaderSize", + "methodname_flat": "SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"pchHeaderName", "paramtype":"const char *" }, + { "paramname":"unResponseHeaderSize", "paramtype":"uint32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetHTTPResponseHeaderValue", + "methodname_flat": "SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"pchHeaderName", "paramtype":"const char *" }, + { "paramname":"pHeaderValueBuffer", "paramtype":"uint8 *" }, + { "paramname":"unBufferSize", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "GetHTTPResponseBodySize", + "methodname_flat": "SteamAPI_ISteamHTTP_GetHTTPResponseBodySize", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"unBodySize", "paramtype":"uint32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetHTTPResponseBodyData", + "methodname_flat": "SteamAPI_ISteamHTTP_GetHTTPResponseBodyData", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"pBodyDataBuffer", "paramtype":"uint8 *" }, + { "paramname":"unBufferSize", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "GetHTTPStreamingResponseBodyData", + "methodname_flat": "SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"cOffset", "paramtype":"uint32" }, + { "paramname":"pBodyDataBuffer", "paramtype":"uint8 *" }, + { "paramname":"unBufferSize", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "ReleaseHTTPRequest", + "methodname_flat": "SteamAPI_ISteamHTTP_ReleaseHTTPRequest", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" } + ], + "returntype": "bool" + }, + { + "methodname": "GetHTTPDownloadProgressPct", + "methodname_flat": "SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"pflPercentOut", "paramtype":"float *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetHTTPRequestRawPostBody", + "methodname_flat": "SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"pchContentType", "paramtype":"const char *" }, + { "paramname":"pubBody", "paramtype":"uint8 *" }, + { "paramname":"unBodyLen", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "CreateCookieContainer", + "methodname_flat": "SteamAPI_ISteamHTTP_CreateCookieContainer", + "params": [ + { "paramname":"bAllowResponsesToModify", "paramtype":"bool" } + ], + "returntype": "HTTPCookieContainerHandle" + }, + { + "methodname": "ReleaseCookieContainer", + "methodname_flat": "SteamAPI_ISteamHTTP_ReleaseCookieContainer", + "params": [ + { "paramname":"hCookieContainer", "paramtype":"HTTPCookieContainerHandle" } + ], + "returntype": "bool" + }, + { + "methodname": "SetCookie", + "methodname_flat": "SteamAPI_ISteamHTTP_SetCookie", + "params": [ + { "paramname":"hCookieContainer", "paramtype":"HTTPCookieContainerHandle" }, + { "paramname":"pchHost", "paramtype":"const char *" }, + { "paramname":"pchUrl", "paramtype":"const char *" }, + { "paramname":"pchCookie", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetHTTPRequestCookieContainer", + "methodname_flat": "SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"hCookieContainer", "paramtype":"HTTPCookieContainerHandle" } + ], + "returntype": "bool" + }, + { + "methodname": "SetHTTPRequestUserAgentInfo", + "methodname_flat": "SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"pchUserAgentInfo", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetHTTPRequestRequiresVerifiedCertificate", + "methodname_flat": "SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"bRequireVerifiedCertificate", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "SetHTTPRequestAbsoluteTimeoutMS", + "methodname_flat": "SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"unMilliseconds", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "GetHTTPRequestWasTimedOut", + "methodname_flat": "SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut", + "params": [ + { "paramname":"hRequest", "paramtype":"HTTPRequestHandle" }, + { "paramname":"pbWasTimedOut", "paramtype":"bool *" } + ], + "returntype": "bool" + } + ], + "version_string": "STEAMHTTP_INTERFACE_VERSION003" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamInput", + "name_flat": "SteamAPI_SteamInput_v006" + } + ], + "classname": "ISteamInput", + "fields": [], + "methods": [ + { + "methodname": "Init", + "methodname_flat": "SteamAPI_ISteamInput_Init", + "params": [ + { "paramname":"bExplicitlyCallRunFrame", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "Shutdown", + "methodname_flat": "SteamAPI_ISteamInput_Shutdown", + "params": [], + "returntype": "bool" + }, + { + "methodname": "SetInputActionManifestFilePath", + "methodname_flat": "SteamAPI_ISteamInput_SetInputActionManifestFilePath", + "params": [ + { "paramname":"pchInputActionManifestAbsolutePath", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "RunFrame", + "methodname_flat": "SteamAPI_ISteamInput_RunFrame", + "params": [ + { "paramname":"bReservedValue", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "BWaitForData", + "methodname_flat": "SteamAPI_ISteamInput_BWaitForData", + "params": [ + { "paramname":"bWaitForever", "paramtype":"bool" }, + { "paramname":"unTimeout", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "BNewDataAvailable", + "methodname_flat": "SteamAPI_ISteamInput_BNewDataAvailable", + "params": [], + "returntype": "bool" + }, + { + "methodname": "GetConnectedControllers", + "methodname_flat": "SteamAPI_ISteamInput_GetConnectedControllers", + "params": [ + { + "desc": "Receives list of connected controllers", + "out_array_count": "STEAM_INPUT_MAX_COUNT", + "paramname": "handlesOut", + "paramtype": "InputHandle_t *" + } + ], + "returntype": "int" + }, + { + "callback": "SteamInputConfigurationLoaded_t", + "methodname": "EnableDeviceCallbacks", + "methodname_flat": "SteamAPI_ISteamInput_EnableDeviceCallbacks", + "params": [], + "returntype": "void" + }, + { + "callback": "SteamInputGamepadSlotChange_t", + "methodname": "EnableActionEventCallbacks", + "methodname_flat": "SteamAPI_ISteamInput_EnableActionEventCallbacks", + "params": [ + { "paramname":"pCallback", "paramtype":"SteamInputActionEventCallbackPointer" } + ], + "returntype": "void" + }, + { + "methodname": "GetActionSetHandle", + "methodname_flat": "SteamAPI_ISteamInput_GetActionSetHandle", + "params": [ + { "paramname":"pszActionSetName", "paramtype":"const char *" } + ], + "returntype": "InputActionSetHandle_t" + }, + { + "methodname": "ActivateActionSet", + "methodname_flat": "SteamAPI_ISteamInput_ActivateActionSet", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"actionSetHandle", "paramtype":"InputActionSetHandle_t" } + ], + "returntype": "void" + }, + { + "methodname": "GetCurrentActionSet", + "methodname_flat": "SteamAPI_ISteamInput_GetCurrentActionSet", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" } + ], + "returntype": "InputActionSetHandle_t" + }, + { + "methodname": "ActivateActionSetLayer", + "methodname_flat": "SteamAPI_ISteamInput_ActivateActionSetLayer", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"actionSetLayerHandle", "paramtype":"InputActionSetHandle_t" } + ], + "returntype": "void" + }, + { + "methodname": "DeactivateActionSetLayer", + "methodname_flat": "SteamAPI_ISteamInput_DeactivateActionSetLayer", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"actionSetLayerHandle", "paramtype":"InputActionSetHandle_t" } + ], + "returntype": "void" + }, + { + "methodname": "DeactivateAllActionSetLayers", + "methodname_flat": "SteamAPI_ISteamInput_DeactivateAllActionSetLayers", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" } + ], + "returntype": "void" + }, + { + "methodname": "GetActiveActionSetLayers", + "methodname_flat": "SteamAPI_ISteamInput_GetActiveActionSetLayers", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { + "desc": "Receives list of active layers", + "out_array_count": "STEAM_INPUT_MAX_ACTIVE_LAYERS", + "paramname": "handlesOut", + "paramtype": "InputActionSetHandle_t *" + } + ], + "returntype": "int" + }, + { + "methodname": "GetDigitalActionHandle", + "methodname_flat": "SteamAPI_ISteamInput_GetDigitalActionHandle", + "params": [ + { "paramname":"pszActionName", "paramtype":"const char *" } + ], + "returntype": "InputDigitalActionHandle_t" + }, + { + "methodname": "GetDigitalActionData", + "methodname_flat": "SteamAPI_ISteamInput_GetDigitalActionData", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"digitalActionHandle", "paramtype":"InputDigitalActionHandle_t" } + ], + "returntype": "InputDigitalActionData_t" + }, + { + "methodname": "GetDigitalActionOrigins", + "methodname_flat": "SteamAPI_ISteamInput_GetDigitalActionOrigins", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"actionSetHandle", "paramtype":"InputActionSetHandle_t" }, + { "paramname":"digitalActionHandle", "paramtype":"InputDigitalActionHandle_t" }, + { + "desc": "Receives list of action origins", + "out_array_count": "STEAM_INPUT_MAX_ORIGINS", + "paramname": "originsOut", + "paramtype": "EInputActionOrigin *" + } + ], + "returntype": "int" + }, + { + "methodname": "GetStringForDigitalActionName", + "methodname_flat": "SteamAPI_ISteamInput_GetStringForDigitalActionName", + "params": [ + { "paramname":"eActionHandle", "paramtype":"InputDigitalActionHandle_t" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetAnalogActionHandle", + "methodname_flat": "SteamAPI_ISteamInput_GetAnalogActionHandle", + "params": [ + { "paramname":"pszActionName", "paramtype":"const char *" } + ], + "returntype": "InputAnalogActionHandle_t" + }, + { + "methodname": "GetAnalogActionData", + "methodname_flat": "SteamAPI_ISteamInput_GetAnalogActionData", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"analogActionHandle", "paramtype":"InputAnalogActionHandle_t" } + ], + "returntype": "InputAnalogActionData_t" + }, + { + "methodname": "GetAnalogActionOrigins", + "methodname_flat": "SteamAPI_ISteamInput_GetAnalogActionOrigins", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"actionSetHandle", "paramtype":"InputActionSetHandle_t" }, + { "paramname":"analogActionHandle", "paramtype":"InputAnalogActionHandle_t" }, + { + "desc": "Receives list of action origins", + "out_array_count": "STEAM_INPUT_MAX_ORIGINS", + "paramname": "originsOut", + "paramtype": "EInputActionOrigin *" + } + ], + "returntype": "int" + }, + { + "methodname": "GetGlyphPNGForActionOrigin", + "methodname_flat": "SteamAPI_ISteamInput_GetGlyphPNGForActionOrigin", + "params": [ + { "paramname":"eOrigin", "paramtype":"EInputActionOrigin" }, + { "paramname":"eSize", "paramtype":"ESteamInputGlyphSize" }, + { "paramname":"unFlags", "paramtype":"uint32" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetGlyphSVGForActionOrigin", + "methodname_flat": "SteamAPI_ISteamInput_GetGlyphSVGForActionOrigin", + "params": [ + { "paramname":"eOrigin", "paramtype":"EInputActionOrigin" }, + { "paramname":"unFlags", "paramtype":"uint32" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetGlyphForActionOrigin_Legacy", + "methodname_flat": "SteamAPI_ISteamInput_GetGlyphForActionOrigin_Legacy", + "params": [ + { "paramname":"eOrigin", "paramtype":"EInputActionOrigin" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetStringForActionOrigin", + "methodname_flat": "SteamAPI_ISteamInput_GetStringForActionOrigin", + "params": [ + { "paramname":"eOrigin", "paramtype":"EInputActionOrigin" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetStringForAnalogActionName", + "methodname_flat": "SteamAPI_ISteamInput_GetStringForAnalogActionName", + "params": [ + { "paramname":"eActionHandle", "paramtype":"InputAnalogActionHandle_t" } + ], + "returntype": "const char *" + }, + { + "methodname": "StopAnalogActionMomentum", + "methodname_flat": "SteamAPI_ISteamInput_StopAnalogActionMomentum", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"eAction", "paramtype":"InputAnalogActionHandle_t" } + ], + "returntype": "void" + }, + { + "methodname": "GetMotionData", + "methodname_flat": "SteamAPI_ISteamInput_GetMotionData", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" } + ], + "returntype": "InputMotionData_t" + }, + { + "methodname": "TriggerVibration", + "methodname_flat": "SteamAPI_ISteamInput_TriggerVibration", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"usLeftSpeed", "paramtype":"unsigned short" }, + { "paramname":"usRightSpeed", "paramtype":"unsigned short" } + ], + "returntype": "void" + }, + { + "methodname": "TriggerVibrationExtended", + "methodname_flat": "SteamAPI_ISteamInput_TriggerVibrationExtended", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"usLeftSpeed", "paramtype":"unsigned short" }, + { "paramname":"usRightSpeed", "paramtype":"unsigned short" }, + { "paramname":"usLeftTriggerSpeed", "paramtype":"unsigned short" }, + { "paramname":"usRightTriggerSpeed", "paramtype":"unsigned short" } + ], + "returntype": "void" + }, + { + "methodname": "TriggerSimpleHapticEvent", + "methodname_flat": "SteamAPI_ISteamInput_TriggerSimpleHapticEvent", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"eHapticLocation", "paramtype":"EControllerHapticLocation" }, + { "paramname":"nIntensity", "paramtype":"uint8" }, + { "paramname":"nGainDB", "paramtype":"char" }, + { "paramname":"nOtherIntensity", "paramtype":"uint8" }, + { "paramname":"nOtherGainDB", "paramtype":"char" } + ], + "returntype": "void" + }, + { + "methodname": "SetLEDColor", + "methodname_flat": "SteamAPI_ISteamInput_SetLEDColor", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"nColorR", "paramtype":"uint8" }, + { "paramname":"nColorG", "paramtype":"uint8" }, + { "paramname":"nColorB", "paramtype":"uint8" }, + { "paramname":"nFlags", "paramtype":"unsigned int" } + ], + "returntype": "void" + }, + { + "methodname": "Legacy_TriggerHapticPulse", + "methodname_flat": "SteamAPI_ISteamInput_Legacy_TriggerHapticPulse", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"eTargetPad", "paramtype":"ESteamControllerPad" }, + { "paramname":"usDurationMicroSec", "paramtype":"unsigned short" } + ], + "returntype": "void" + }, + { + "methodname": "Legacy_TriggerRepeatedHapticPulse", + "methodname_flat": "SteamAPI_ISteamInput_Legacy_TriggerRepeatedHapticPulse", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"eTargetPad", "paramtype":"ESteamControllerPad" }, + { "paramname":"usDurationMicroSec", "paramtype":"unsigned short" }, + { "paramname":"usOffMicroSec", "paramtype":"unsigned short" }, + { "paramname":"unRepeat", "paramtype":"unsigned short" }, + { "paramname":"nFlags", "paramtype":"unsigned int" } + ], + "returntype": "void" + }, + { + "methodname": "ShowBindingPanel", + "methodname_flat": "SteamAPI_ISteamInput_ShowBindingPanel", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" } + ], + "returntype": "bool" + }, + { + "methodname": "GetInputTypeForHandle", + "methodname_flat": "SteamAPI_ISteamInput_GetInputTypeForHandle", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" } + ], + "returntype": "ESteamInputType" + }, + { + "methodname": "GetControllerForGamepadIndex", + "methodname_flat": "SteamAPI_ISteamInput_GetControllerForGamepadIndex", + "params": [ + { "paramname":"nIndex", "paramtype":"int" } + ], + "returntype": "InputHandle_t" + }, + { + "methodname": "GetGamepadIndexForController", + "methodname_flat": "SteamAPI_ISteamInput_GetGamepadIndexForController", + "params": [ + { "paramname":"ulinputHandle", "paramtype":"InputHandle_t" } + ], + "returntype": "int" + }, + { + "methodname": "GetStringForXboxOrigin", + "methodname_flat": "SteamAPI_ISteamInput_GetStringForXboxOrigin", + "params": [ + { "paramname":"eOrigin", "paramtype":"EXboxOrigin" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetGlyphForXboxOrigin", + "methodname_flat": "SteamAPI_ISteamInput_GetGlyphForXboxOrigin", + "params": [ + { "paramname":"eOrigin", "paramtype":"EXboxOrigin" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetActionOriginFromXboxOrigin", + "methodname_flat": "SteamAPI_ISteamInput_GetActionOriginFromXboxOrigin", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"eOrigin", "paramtype":"EXboxOrigin" } + ], + "returntype": "EInputActionOrigin" + }, + { + "methodname": "TranslateActionOrigin", + "methodname_flat": "SteamAPI_ISteamInput_TranslateActionOrigin", + "params": [ + { "paramname":"eDestinationInputType", "paramtype":"ESteamInputType" }, + { "paramname":"eSourceOrigin", "paramtype":"EInputActionOrigin" } + ], + "returntype": "EInputActionOrigin" + }, + { + "methodname": "GetDeviceBindingRevision", + "methodname_flat": "SteamAPI_ISteamInput_GetDeviceBindingRevision", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"pMajor", "paramtype":"int *" }, + { "paramname":"pMinor", "paramtype":"int *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetRemotePlaySessionID", + "methodname_flat": "SteamAPI_ISteamInput_GetRemotePlaySessionID", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" } + ], + "returntype": "uint32" + }, + { + "methodname": "GetSessionInputConfigurationSettings", + "methodname_flat": "SteamAPI_ISteamInput_GetSessionInputConfigurationSettings", + "params": [], + "returntype": "uint16" + }, + { + "methodname": "SetDualSenseTriggerEffect", + "methodname_flat": "SteamAPI_ISteamInput_SetDualSenseTriggerEffect", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"pParam", "paramtype":"const ScePadTriggerEffectParam *" } + ], + "returntype": "void" + } + ], + "version_string": "SteamInput006" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamController", + "name_flat": "SteamAPI_SteamController_v008" + } + ], + "classname": "ISteamController", + "fields": [], + "methods": [ + { + "methodname": "Init", + "methodname_flat": "SteamAPI_ISteamController_Init", + "params": [], + "returntype": "bool" + }, + { + "methodname": "Shutdown", + "methodname_flat": "SteamAPI_ISteamController_Shutdown", + "params": [], + "returntype": "bool" + }, + { + "methodname": "RunFrame", + "methodname_flat": "SteamAPI_ISteamController_RunFrame", + "params": [], + "returntype": "void" + }, + { + "methodname": "GetConnectedControllers", + "methodname_flat": "SteamAPI_ISteamController_GetConnectedControllers", + "params": [ + { + "desc": "Receives list of connected controllers", + "out_array_count": "STEAM_CONTROLLER_MAX_COUNT", + "paramname": "handlesOut", + "paramtype": "ControllerHandle_t *" + } + ], + "returntype": "int" + }, + { + "methodname": "GetActionSetHandle", + "methodname_flat": "SteamAPI_ISteamController_GetActionSetHandle", + "params": [ + { "paramname":"pszActionSetName", "paramtype":"const char *" } + ], + "returntype": "ControllerActionSetHandle_t" + }, + { + "methodname": "ActivateActionSet", + "methodname_flat": "SteamAPI_ISteamController_ActivateActionSet", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" }, + { "paramname":"actionSetHandle", "paramtype":"ControllerActionSetHandle_t" } + ], + "returntype": "void" + }, + { + "methodname": "GetCurrentActionSet", + "methodname_flat": "SteamAPI_ISteamController_GetCurrentActionSet", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" } + ], + "returntype": "ControllerActionSetHandle_t" + }, + { + "methodname": "ActivateActionSetLayer", + "methodname_flat": "SteamAPI_ISteamController_ActivateActionSetLayer", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" }, + { "paramname":"actionSetLayerHandle", "paramtype":"ControllerActionSetHandle_t" } + ], + "returntype": "void" + }, + { + "methodname": "DeactivateActionSetLayer", + "methodname_flat": "SteamAPI_ISteamController_DeactivateActionSetLayer", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" }, + { "paramname":"actionSetLayerHandle", "paramtype":"ControllerActionSetHandle_t" } + ], + "returntype": "void" + }, + { + "methodname": "DeactivateAllActionSetLayers", + "methodname_flat": "SteamAPI_ISteamController_DeactivateAllActionSetLayers", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" } + ], + "returntype": "void" + }, + { + "methodname": "GetActiveActionSetLayers", + "methodname_flat": "SteamAPI_ISteamController_GetActiveActionSetLayers", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" }, + { + "desc": "Receives list of active layers", + "out_array_count": "STEAM_CONTROLLER_MAX_ACTIVE_LAYERS", + "paramname": "handlesOut", + "paramtype": "ControllerActionSetHandle_t *" + } + ], + "returntype": "int" + }, + { + "methodname": "GetDigitalActionHandle", + "methodname_flat": "SteamAPI_ISteamController_GetDigitalActionHandle", + "params": [ + { "paramname":"pszActionName", "paramtype":"const char *" } + ], + "returntype": "ControllerDigitalActionHandle_t" + }, + { + "methodname": "GetDigitalActionData", + "methodname_flat": "SteamAPI_ISteamController_GetDigitalActionData", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" }, + { "paramname":"digitalActionHandle", "paramtype":"ControllerDigitalActionHandle_t" } + ], + "returntype": "InputDigitalActionData_t" + }, + { + "methodname": "GetDigitalActionOrigins", + "methodname_flat": "SteamAPI_ISteamController_GetDigitalActionOrigins", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" }, + { "paramname":"actionSetHandle", "paramtype":"ControllerActionSetHandle_t" }, + { "paramname":"digitalActionHandle", "paramtype":"ControllerDigitalActionHandle_t" }, + { + "desc": "Receives list of aciton origins", + "out_array_count": "STEAM_CONTROLLER_MAX_ORIGINS", + "paramname": "originsOut", + "paramtype": "EControllerActionOrigin *" + } + ], + "returntype": "int" + }, + { + "methodname": "GetAnalogActionHandle", + "methodname_flat": "SteamAPI_ISteamController_GetAnalogActionHandle", + "params": [ + { "paramname":"pszActionName", "paramtype":"const char *" } + ], + "returntype": "ControllerAnalogActionHandle_t" + }, + { + "methodname": "GetAnalogActionData", + "methodname_flat": "SteamAPI_ISteamController_GetAnalogActionData", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" }, + { "paramname":"analogActionHandle", "paramtype":"ControllerAnalogActionHandle_t" } + ], + "returntype": "InputAnalogActionData_t" + }, + { + "methodname": "GetAnalogActionOrigins", + "methodname_flat": "SteamAPI_ISteamController_GetAnalogActionOrigins", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" }, + { "paramname":"actionSetHandle", "paramtype":"ControllerActionSetHandle_t" }, + { "paramname":"analogActionHandle", "paramtype":"ControllerAnalogActionHandle_t" }, + { + "desc": "Receives list of action origins", + "out_array_count": "STEAM_CONTROLLER_MAX_ORIGINS", + "paramname": "originsOut", + "paramtype": "EControllerActionOrigin *" + } + ], + "returntype": "int" + }, + { + "methodname": "GetGlyphForActionOrigin", + "methodname_flat": "SteamAPI_ISteamController_GetGlyphForActionOrigin", + "params": [ + { "paramname":"eOrigin", "paramtype":"EControllerActionOrigin" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetStringForActionOrigin", + "methodname_flat": "SteamAPI_ISteamController_GetStringForActionOrigin", + "params": [ + { "paramname":"eOrigin", "paramtype":"EControllerActionOrigin" } + ], + "returntype": "const char *" + }, + { + "methodname": "StopAnalogActionMomentum", + "methodname_flat": "SteamAPI_ISteamController_StopAnalogActionMomentum", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" }, + { "paramname":"eAction", "paramtype":"ControllerAnalogActionHandle_t" } + ], + "returntype": "void" + }, + { + "methodname": "GetMotionData", + "methodname_flat": "SteamAPI_ISteamController_GetMotionData", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" } + ], + "returntype": "InputMotionData_t" + }, + { + "methodname": "TriggerHapticPulse", + "methodname_flat": "SteamAPI_ISteamController_TriggerHapticPulse", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" }, + { "paramname":"eTargetPad", "paramtype":"ESteamControllerPad" }, + { "paramname":"usDurationMicroSec", "paramtype":"unsigned short" } + ], + "returntype": "void" + }, + { + "methodname": "TriggerRepeatedHapticPulse", + "methodname_flat": "SteamAPI_ISteamController_TriggerRepeatedHapticPulse", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" }, + { "paramname":"eTargetPad", "paramtype":"ESteamControllerPad" }, + { "paramname":"usDurationMicroSec", "paramtype":"unsigned short" }, + { "paramname":"usOffMicroSec", "paramtype":"unsigned short" }, + { "paramname":"unRepeat", "paramtype":"unsigned short" }, + { "paramname":"nFlags", "paramtype":"unsigned int" } + ], + "returntype": "void" + }, + { + "methodname": "TriggerVibration", + "methodname_flat": "SteamAPI_ISteamController_TriggerVibration", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" }, + { "paramname":"usLeftSpeed", "paramtype":"unsigned short" }, + { "paramname":"usRightSpeed", "paramtype":"unsigned short" } + ], + "returntype": "void" + }, + { + "methodname": "SetLEDColor", + "methodname_flat": "SteamAPI_ISteamController_SetLEDColor", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" }, + { "paramname":"nColorR", "paramtype":"uint8" }, + { "paramname":"nColorG", "paramtype":"uint8" }, + { "paramname":"nColorB", "paramtype":"uint8" }, + { "paramname":"nFlags", "paramtype":"unsigned int" } + ], + "returntype": "void" + }, + { + "methodname": "ShowBindingPanel", + "methodname_flat": "SteamAPI_ISteamController_ShowBindingPanel", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" } + ], + "returntype": "bool" + }, + { + "methodname": "GetInputTypeForHandle", + "methodname_flat": "SteamAPI_ISteamController_GetInputTypeForHandle", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" } + ], + "returntype": "ESteamInputType" + }, + { + "methodname": "GetControllerForGamepadIndex", + "methodname_flat": "SteamAPI_ISteamController_GetControllerForGamepadIndex", + "params": [ + { "paramname":"nIndex", "paramtype":"int" } + ], + "returntype": "ControllerHandle_t" + }, + { + "methodname": "GetGamepadIndexForController", + "methodname_flat": "SteamAPI_ISteamController_GetGamepadIndexForController", + "params": [ + { "paramname":"ulControllerHandle", "paramtype":"ControllerHandle_t" } + ], + "returntype": "int" + }, + { + "methodname": "GetStringForXboxOrigin", + "methodname_flat": "SteamAPI_ISteamController_GetStringForXboxOrigin", + "params": [ + { "paramname":"eOrigin", "paramtype":"EXboxOrigin" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetGlyphForXboxOrigin", + "methodname_flat": "SteamAPI_ISteamController_GetGlyphForXboxOrigin", + "params": [ + { "paramname":"eOrigin", "paramtype":"EXboxOrigin" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetActionOriginFromXboxOrigin", + "methodname_flat": "SteamAPI_ISteamController_GetActionOriginFromXboxOrigin", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" }, + { "paramname":"eOrigin", "paramtype":"EXboxOrigin" } + ], + "returntype": "EControllerActionOrigin" + }, + { + "methodname": "TranslateActionOrigin", + "methodname_flat": "SteamAPI_ISteamController_TranslateActionOrigin", + "params": [ + { "paramname":"eDestinationInputType", "paramtype":"ESteamInputType" }, + { "paramname":"eSourceOrigin", "paramtype":"EControllerActionOrigin" } + ], + "returntype": "EControllerActionOrigin" + }, + { + "methodname": "GetControllerBindingRevision", + "methodname_flat": "SteamAPI_ISteamController_GetControllerBindingRevision", + "params": [ + { "paramname":"controllerHandle", "paramtype":"ControllerHandle_t" }, + { "paramname":"pMajor", "paramtype":"int *" }, + { "paramname":"pMinor", "paramtype":"int *" } + ], + "returntype": "bool" + } + ], + "version_string": "SteamController008" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamUGC", + "name_flat": "SteamAPI_SteamUGC_v021" + }, + { + "kind": "gameserver", + "name": "SteamGameServerUGC", + "name_flat": "SteamAPI_SteamGameServerUGC_v021" + } + ], + "classname": "ISteamUGC", + "fields": [], + "methods": [ + { + "methodname": "CreateQueryUserUGCRequest", + "methodname_flat": "SteamAPI_ISteamUGC_CreateQueryUserUGCRequest", + "params": [ + { "paramname":"unAccountID", "paramtype":"AccountID_t" }, + { "paramname":"eListType", "paramtype":"EUserUGCList" }, + { "paramname":"eMatchingUGCType", "paramtype":"EUGCMatchingUGCType" }, + { "paramname":"eSortOrder", "paramtype":"EUserUGCListSortOrder" }, + { "paramname":"nCreatorAppID", "paramtype":"AppId_t" }, + { "paramname":"nConsumerAppID", "paramtype":"AppId_t" }, + { "paramname":"unPage", "paramtype":"uint32" } + ], + "returntype": "UGCQueryHandle_t" + }, + { + "methodname": "CreateQueryAllUGCRequest", + "methodname_flat": "SteamAPI_ISteamUGC_CreateQueryAllUGCRequestPage", + "params": [ + { "paramname":"eQueryType", "paramtype":"EUGCQuery" }, + { "paramname":"eMatchingeMatchingUGCTypeFileType", "paramtype":"EUGCMatchingUGCType" }, + { "paramname":"nCreatorAppID", "paramtype":"AppId_t" }, + { "paramname":"nConsumerAppID", "paramtype":"AppId_t" }, + { "paramname":"unPage", "paramtype":"uint32" } + ], + "returntype": "UGCQueryHandle_t" + }, + { + "methodname": "CreateQueryAllUGCRequest", + "methodname_flat": "SteamAPI_ISteamUGC_CreateQueryAllUGCRequestCursor", + "params": [ + { "paramname":"eQueryType", "paramtype":"EUGCQuery" }, + { "paramname":"eMatchingeMatchingUGCTypeFileType", "paramtype":"EUGCMatchingUGCType" }, + { "paramname":"nCreatorAppID", "paramtype":"AppId_t" }, + { "paramname":"nConsumerAppID", "paramtype":"AppId_t" }, + { "paramname":"pchCursor", "paramtype":"const char *" } + ], + "returntype": "UGCQueryHandle_t" + }, + { + "methodname": "CreateQueryUGCDetailsRequest", + "methodname_flat": "SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest", + "params": [ + { "paramname":"pvecPublishedFileID", "paramtype":"PublishedFileId_t *" }, + { "paramname":"unNumPublishedFileIDs", "paramtype":"uint32" } + ], + "returntype": "UGCQueryHandle_t" + }, + { + "callresult": "SteamUGCQueryCompleted_t", + "methodname": "SendQueryUGCRequest", + "methodname_flat": "SteamAPI_ISteamUGC_SendQueryUGCRequest", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetQueryUGCResult", + "methodname_flat": "SteamAPI_ISteamUGC_GetQueryUGCResult", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"index", "paramtype":"uint32" }, + { "paramname":"pDetails", "paramtype":"SteamUGCDetails_t *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetQueryUGCNumTags", + "methodname_flat": "SteamAPI_ISteamUGC_GetQueryUGCNumTags", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"index", "paramtype":"uint32" } + ], + "returntype": "uint32" + }, + { + "methodname": "GetQueryUGCTag", + "methodname_flat": "SteamAPI_ISteamUGC_GetQueryUGCTag", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"index", "paramtype":"uint32" }, + { "paramname":"indexTag", "paramtype":"uint32" }, + { + "out_string_count": "cchValueSize", + "paramname": "pchValue", + "paramtype": "char *" + }, + { "paramname":"cchValueSize", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "GetQueryUGCTagDisplayName", + "methodname_flat": "SteamAPI_ISteamUGC_GetQueryUGCTagDisplayName", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"index", "paramtype":"uint32" }, + { "paramname":"indexTag", "paramtype":"uint32" }, + { + "out_string_count": "cchValueSize", + "paramname": "pchValue", + "paramtype": "char *" + }, + { "paramname":"cchValueSize", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "GetQueryUGCPreviewURL", + "methodname_flat": "SteamAPI_ISteamUGC_GetQueryUGCPreviewURL", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"index", "paramtype":"uint32" }, + { + "out_string_count": "cchURLSize", + "paramname": "pchURL", + "paramtype": "char *" + }, + { "paramname":"cchURLSize", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "GetQueryUGCMetadata", + "methodname_flat": "SteamAPI_ISteamUGC_GetQueryUGCMetadata", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"index", "paramtype":"uint32" }, + { + "out_string_count": "cchMetadatasize", + "paramname": "pchMetadata", + "paramtype": "char *" + }, + { "paramname":"cchMetadatasize", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "GetQueryUGCChildren", + "methodname_flat": "SteamAPI_ISteamUGC_GetQueryUGCChildren", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"index", "paramtype":"uint32" }, + { "paramname":"pvecPublishedFileID", "paramtype":"PublishedFileId_t *" }, + { "paramname":"cMaxEntries", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "GetQueryUGCStatistic", + "methodname_flat": "SteamAPI_ISteamUGC_GetQueryUGCStatistic", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"index", "paramtype":"uint32" }, + { "paramname":"eStatType", "paramtype":"EItemStatistic" }, + { "paramname":"pStatValue", "paramtype":"uint64 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetQueryUGCNumAdditionalPreviews", + "methodname_flat": "SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"index", "paramtype":"uint32" } + ], + "returntype": "uint32" + }, + { + "methodname": "GetQueryUGCAdditionalPreview", + "methodname_flat": "SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"index", "paramtype":"uint32" }, + { "paramname":"previewIndex", "paramtype":"uint32" }, + { + "out_string_count": "cchURLSize", + "paramname": "pchURLOrVideoID", + "paramtype": "char *" + }, + { "paramname":"cchURLSize", "paramtype":"uint32" }, + { + "out_string_count": "cchOriginalFileNameSize", + "paramname": "pchOriginalFileName", + "paramtype": "char *" + }, + { "paramname":"cchOriginalFileNameSize", "paramtype":"uint32" }, + { "paramname":"pPreviewType", "paramtype":"EItemPreviewType *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetQueryUGCNumKeyValueTags", + "methodname_flat": "SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"index", "paramtype":"uint32" } + ], + "returntype": "uint32" + }, + { + "methodname": "GetQueryUGCKeyValueTag", + "methodname_flat": "SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"index", "paramtype":"uint32" }, + { "paramname":"keyValueTagIndex", "paramtype":"uint32" }, + { + "out_string_count": "cchKeySize", + "paramname": "pchKey", + "paramtype": "char *" + }, + { "paramname":"cchKeySize", "paramtype":"uint32" }, + { + "out_string_count": "cchValueSize", + "paramname": "pchValue", + "paramtype": "char *" + }, + { "paramname":"cchValueSize", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "GetQueryUGCKeyValueTag", + "methodname_flat": "SteamAPI_ISteamUGC_GetQueryFirstUGCKeyValueTag", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"index", "paramtype":"uint32" }, + { "paramname":"pchKey", "paramtype":"const char *" }, + { + "out_string_count": "cchValueSize", + "paramname": "pchValue", + "paramtype": "char *" + }, + { "paramname":"cchValueSize", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "GetNumSupportedGameVersions", + "methodname_flat": "SteamAPI_ISteamUGC_GetNumSupportedGameVersions", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"index", "paramtype":"uint32" } + ], + "returntype": "uint32" + }, + { + "methodname": "GetSupportedGameVersionData", + "methodname_flat": "SteamAPI_ISteamUGC_GetSupportedGameVersionData", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"index", "paramtype":"uint32" }, + { "paramname":"versionIndex", "paramtype":"uint32" }, + { + "out_string_count": "cchGameBranchSize", + "paramname": "pchGameBranchMin", + "paramtype": "char *" + }, + { + "out_string_count": "cchGameBranchSize", + "paramname": "pchGameBranchMax", + "paramtype": "char *" + }, + { "paramname":"cchGameBranchSize", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "GetQueryUGCContentDescriptors", + "methodname_flat": "SteamAPI_ISteamUGC_GetQueryUGCContentDescriptors", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"index", "paramtype":"uint32" }, + { "paramname":"pvecDescriptors", "paramtype":"EUGCContentDescriptorID *" }, + { "paramname":"cMaxEntries", "paramtype":"uint32" } + ], + "returntype": "uint32" + }, + { + "methodname": "ReleaseQueryUGCRequest", + "methodname_flat": "SteamAPI_ISteamUGC_ReleaseQueryUGCRequest", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" } + ], + "returntype": "bool" + }, + { + "methodname": "AddRequiredTag", + "methodname_flat": "SteamAPI_ISteamUGC_AddRequiredTag", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"pTagName", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "AddRequiredTagGroup", + "methodname_flat": "SteamAPI_ISteamUGC_AddRequiredTagGroup", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"pTagGroups", "paramtype":"const SteamParamStringArray_t *" } + ], + "returntype": "bool" + }, + { + "methodname": "AddExcludedTag", + "methodname_flat": "SteamAPI_ISteamUGC_AddExcludedTag", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"pTagName", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetReturnOnlyIDs", + "methodname_flat": "SteamAPI_ISteamUGC_SetReturnOnlyIDs", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"bReturnOnlyIDs", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "SetReturnKeyValueTags", + "methodname_flat": "SteamAPI_ISteamUGC_SetReturnKeyValueTags", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"bReturnKeyValueTags", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "SetReturnLongDescription", + "methodname_flat": "SteamAPI_ISteamUGC_SetReturnLongDescription", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"bReturnLongDescription", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "SetReturnMetadata", + "methodname_flat": "SteamAPI_ISteamUGC_SetReturnMetadata", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"bReturnMetadata", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "SetReturnChildren", + "methodname_flat": "SteamAPI_ISteamUGC_SetReturnChildren", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"bReturnChildren", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "SetReturnAdditionalPreviews", + "methodname_flat": "SteamAPI_ISteamUGC_SetReturnAdditionalPreviews", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"bReturnAdditionalPreviews", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "SetReturnTotalOnly", + "methodname_flat": "SteamAPI_ISteamUGC_SetReturnTotalOnly", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"bReturnTotalOnly", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "SetReturnPlaytimeStats", + "methodname_flat": "SteamAPI_ISteamUGC_SetReturnPlaytimeStats", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"unDays", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "SetLanguage", + "methodname_flat": "SteamAPI_ISteamUGC_SetLanguage", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"pchLanguage", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetAllowCachedResponse", + "methodname_flat": "SteamAPI_ISteamUGC_SetAllowCachedResponse", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"unMaxAgeSeconds", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "SetAdminQuery", + "methodname_flat": "SteamAPI_ISteamUGC_SetAdminQuery", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"bAdminQuery", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "SetCloudFileNameFilter", + "methodname_flat": "SteamAPI_ISteamUGC_SetCloudFileNameFilter", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"pMatchCloudFileName", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetMatchAnyTag", + "methodname_flat": "SteamAPI_ISteamUGC_SetMatchAnyTag", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"bMatchAnyTag", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "SetSearchText", + "methodname_flat": "SteamAPI_ISteamUGC_SetSearchText", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"pSearchText", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetRankedByTrendDays", + "methodname_flat": "SteamAPI_ISteamUGC_SetRankedByTrendDays", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"unDays", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "SetTimeCreatedDateRange", + "methodname_flat": "SteamAPI_ISteamUGC_SetTimeCreatedDateRange", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"rtStart", "paramtype":"RTime32" }, + { "paramname":"rtEnd", "paramtype":"RTime32" } + ], + "returntype": "bool" + }, + { + "methodname": "SetTimeUpdatedDateRange", + "methodname_flat": "SteamAPI_ISteamUGC_SetTimeUpdatedDateRange", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"rtStart", "paramtype":"RTime32" }, + { "paramname":"rtEnd", "paramtype":"RTime32" } + ], + "returntype": "bool" + }, + { + "methodname": "AddRequiredKeyValueTag", + "methodname_flat": "SteamAPI_ISteamUGC_AddRequiredKeyValueTag", + "params": [ + { "paramname":"handle", "paramtype":"UGCQueryHandle_t" }, + { "paramname":"pKey", "paramtype":"const char *" }, + { "paramname":"pValue", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "callresult": "SteamUGCRequestUGCDetailsResult_t", + "methodname": "RequestUGCDetails", + "methodname_flat": "SteamAPI_ISteamUGC_RequestUGCDetails", + "params": [ + { "paramname":"nPublishedFileID", "paramtype":"PublishedFileId_t" }, + { "paramname":"unMaxAgeSeconds", "paramtype":"uint32" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "CreateItemResult_t", + "methodname": "CreateItem", + "methodname_flat": "SteamAPI_ISteamUGC_CreateItem", + "params": [ + { "paramname":"nConsumerAppId", "paramtype":"AppId_t" }, + { "paramname":"eFileType", "paramtype":"EWorkshopFileType" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "StartItemUpdate", + "methodname_flat": "SteamAPI_ISteamUGC_StartItemUpdate", + "params": [ + { "paramname":"nConsumerAppId", "paramtype":"AppId_t" }, + { "paramname":"nPublishedFileID", "paramtype":"PublishedFileId_t" } + ], + "returntype": "UGCUpdateHandle_t" + }, + { + "methodname": "SetItemTitle", + "methodname_flat": "SteamAPI_ISteamUGC_SetItemTitle", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"pchTitle", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetItemDescription", + "methodname_flat": "SteamAPI_ISteamUGC_SetItemDescription", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"pchDescription", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetItemUpdateLanguage", + "methodname_flat": "SteamAPI_ISteamUGC_SetItemUpdateLanguage", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"pchLanguage", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetItemMetadata", + "methodname_flat": "SteamAPI_ISteamUGC_SetItemMetadata", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"pchMetaData", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetItemVisibility", + "methodname_flat": "SteamAPI_ISteamUGC_SetItemVisibility", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"eVisibility", "paramtype":"ERemoteStoragePublishedFileVisibility" } + ], + "returntype": "bool" + }, + { + "methodname": "SetItemTags", + "methodname_flat": "SteamAPI_ISteamUGC_SetItemTags", + "params": [ + { "paramname":"updateHandle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"pTags", "paramtype":"const SteamParamStringArray_t *" }, + { "paramname":"bAllowAdminTags", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "SetItemContent", + "methodname_flat": "SteamAPI_ISteamUGC_SetItemContent", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"pszContentFolder", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetItemPreview", + "methodname_flat": "SteamAPI_ISteamUGC_SetItemPreview", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"pszPreviewFile", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetAllowLegacyUpload", + "methodname_flat": "SteamAPI_ISteamUGC_SetAllowLegacyUpload", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"bAllowLegacyUpload", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "RemoveAllItemKeyValueTags", + "methodname_flat": "SteamAPI_ISteamUGC_RemoveAllItemKeyValueTags", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" } + ], + "returntype": "bool" + }, + { + "methodname": "RemoveItemKeyValueTags", + "methodname_flat": "SteamAPI_ISteamUGC_RemoveItemKeyValueTags", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"pchKey", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "AddItemKeyValueTag", + "methodname_flat": "SteamAPI_ISteamUGC_AddItemKeyValueTag", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"pchKey", "paramtype":"const char *" }, + { "paramname":"pchValue", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "AddItemPreviewFile", + "methodname_flat": "SteamAPI_ISteamUGC_AddItemPreviewFile", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"pszPreviewFile", "paramtype":"const char *" }, + { "paramname":"type", "paramtype":"EItemPreviewType" } + ], + "returntype": "bool" + }, + { + "methodname": "AddItemPreviewVideo", + "methodname_flat": "SteamAPI_ISteamUGC_AddItemPreviewVideo", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"pszVideoID", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "UpdateItemPreviewFile", + "methodname_flat": "SteamAPI_ISteamUGC_UpdateItemPreviewFile", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"index", "paramtype":"uint32" }, + { "paramname":"pszPreviewFile", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "UpdateItemPreviewVideo", + "methodname_flat": "SteamAPI_ISteamUGC_UpdateItemPreviewVideo", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"index", "paramtype":"uint32" }, + { "paramname":"pszVideoID", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "RemoveItemPreview", + "methodname_flat": "SteamAPI_ISteamUGC_RemoveItemPreview", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"index", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "AddContentDescriptor", + "methodname_flat": "SteamAPI_ISteamUGC_AddContentDescriptor", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"descid", "paramtype":"EUGCContentDescriptorID" } + ], + "returntype": "bool" + }, + { + "methodname": "RemoveContentDescriptor", + "methodname_flat": "SteamAPI_ISteamUGC_RemoveContentDescriptor", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"descid", "paramtype":"EUGCContentDescriptorID" } + ], + "returntype": "bool" + }, + { + "methodname": "SetRequiredGameVersions", + "methodname_flat": "SteamAPI_ISteamUGC_SetRequiredGameVersions", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"pszGameBranchMin", "paramtype":"const char *" }, + { "paramname":"pszGameBranchMax", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "callresult": "SubmitItemUpdateResult_t", + "methodname": "SubmitItemUpdate", + "methodname_flat": "SteamAPI_ISteamUGC_SubmitItemUpdate", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"pchChangeNote", "paramtype":"const char *" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetItemUpdateProgress", + "methodname_flat": "SteamAPI_ISteamUGC_GetItemUpdateProgress", + "params": [ + { "paramname":"handle", "paramtype":"UGCUpdateHandle_t" }, + { "paramname":"punBytesProcessed", "paramtype":"uint64 *" }, + { "paramname":"punBytesTotal", "paramtype":"uint64 *" } + ], + "returntype": "EItemUpdateStatus" + }, + { + "callresult": "SetUserItemVoteResult_t", + "methodname": "SetUserItemVote", + "methodname_flat": "SteamAPI_ISteamUGC_SetUserItemVote", + "params": [ + { "paramname":"nPublishedFileID", "paramtype":"PublishedFileId_t" }, + { "paramname":"bVoteUp", "paramtype":"bool" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "GetUserItemVoteResult_t", + "methodname": "GetUserItemVote", + "methodname_flat": "SteamAPI_ISteamUGC_GetUserItemVote", + "params": [ + { "paramname":"nPublishedFileID", "paramtype":"PublishedFileId_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "UserFavoriteItemsListChanged_t", + "methodname": "AddItemToFavorites", + "methodname_flat": "SteamAPI_ISteamUGC_AddItemToFavorites", + "params": [ + { "paramname":"nAppId", "paramtype":"AppId_t" }, + { "paramname":"nPublishedFileID", "paramtype":"PublishedFileId_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "UserFavoriteItemsListChanged_t", + "methodname": "RemoveItemFromFavorites", + "methodname_flat": "SteamAPI_ISteamUGC_RemoveItemFromFavorites", + "params": [ + { "paramname":"nAppId", "paramtype":"AppId_t" }, + { "paramname":"nPublishedFileID", "paramtype":"PublishedFileId_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoteStorageSubscribePublishedFileResult_t", + "methodname": "SubscribeItem", + "methodname_flat": "SteamAPI_ISteamUGC_SubscribeItem", + "params": [ + { "paramname":"nPublishedFileID", "paramtype":"PublishedFileId_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoteStorageUnsubscribePublishedFileResult_t", + "methodname": "UnsubscribeItem", + "methodname_flat": "SteamAPI_ISteamUGC_UnsubscribeItem", + "params": [ + { "paramname":"nPublishedFileID", "paramtype":"PublishedFileId_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetNumSubscribedItems", + "methodname_flat": "SteamAPI_ISteamUGC_GetNumSubscribedItems", + "params": [ + { "paramname":"bIncludeLocallyDisabled", "paramtype":"bool" } + ], + "returntype": "uint32" + }, + { + "methodname": "GetSubscribedItems", + "methodname_flat": "SteamAPI_ISteamUGC_GetSubscribedItems", + "params": [ + { "paramname":"pvecPublishedFileID", "paramtype":"PublishedFileId_t *" }, + { "paramname":"cMaxEntries", "paramtype":"uint32" }, + { "paramname":"bIncludeLocallyDisabled", "paramtype":"bool" } + ], + "returntype": "uint32" + }, + { + "methodname": "GetItemState", + "methodname_flat": "SteamAPI_ISteamUGC_GetItemState", + "params": [ + { "paramname":"nPublishedFileID", "paramtype":"PublishedFileId_t" } + ], + "returntype": "uint32" + }, + { + "methodname": "GetItemInstallInfo", + "methodname_flat": "SteamAPI_ISteamUGC_GetItemInstallInfo", + "params": [ + { "paramname":"nPublishedFileID", "paramtype":"PublishedFileId_t" }, + { "paramname":"punSizeOnDisk", "paramtype":"uint64 *" }, + { + "out_string_count": "cchFolderSize", + "paramname": "pchFolder", + "paramtype": "char *" + }, + { "paramname":"cchFolderSize", "paramtype":"uint32" }, + { "paramname":"punTimeStamp", "paramtype":"uint32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetItemDownloadInfo", + "methodname_flat": "SteamAPI_ISteamUGC_GetItemDownloadInfo", + "params": [ + { "paramname":"nPublishedFileID", "paramtype":"PublishedFileId_t" }, + { "paramname":"punBytesDownloaded", "paramtype":"uint64 *" }, + { "paramname":"punBytesTotal", "paramtype":"uint64 *" } + ], + "returntype": "bool" + }, + { + "methodname": "DownloadItem", + "methodname_flat": "SteamAPI_ISteamUGC_DownloadItem", + "params": [ + { "paramname":"nPublishedFileID", "paramtype":"PublishedFileId_t" }, + { "paramname":"bHighPriority", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "BInitWorkshopForGameServer", + "methodname_flat": "SteamAPI_ISteamUGC_BInitWorkshopForGameServer", + "params": [ + { "paramname":"unWorkshopDepotID", "paramtype":"DepotId_t" }, + { "paramname":"pszFolder", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SuspendDownloads", + "methodname_flat": "SteamAPI_ISteamUGC_SuspendDownloads", + "params": [ + { "paramname":"bSuspend", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "callresult": "StartPlaytimeTrackingResult_t", + "methodname": "StartPlaytimeTracking", + "methodname_flat": "SteamAPI_ISteamUGC_StartPlaytimeTracking", + "params": [ + { "paramname":"pvecPublishedFileID", "paramtype":"PublishedFileId_t *" }, + { "paramname":"unNumPublishedFileIDs", "paramtype":"uint32" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "StopPlaytimeTrackingResult_t", + "methodname": "StopPlaytimeTracking", + "methodname_flat": "SteamAPI_ISteamUGC_StopPlaytimeTracking", + "params": [ + { "paramname":"pvecPublishedFileID", "paramtype":"PublishedFileId_t *" }, + { "paramname":"unNumPublishedFileIDs", "paramtype":"uint32" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "StopPlaytimeTrackingResult_t", + "methodname": "StopPlaytimeTrackingForAllItems", + "methodname_flat": "SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems", + "params": [], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "AddUGCDependencyResult_t", + "methodname": "AddDependency", + "methodname_flat": "SteamAPI_ISteamUGC_AddDependency", + "params": [ + { "paramname":"nParentPublishedFileID", "paramtype":"PublishedFileId_t" }, + { "paramname":"nChildPublishedFileID", "paramtype":"PublishedFileId_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoveUGCDependencyResult_t", + "methodname": "RemoveDependency", + "methodname_flat": "SteamAPI_ISteamUGC_RemoveDependency", + "params": [ + { "paramname":"nParentPublishedFileID", "paramtype":"PublishedFileId_t" }, + { "paramname":"nChildPublishedFileID", "paramtype":"PublishedFileId_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "AddAppDependencyResult_t", + "methodname": "AddAppDependency", + "methodname_flat": "SteamAPI_ISteamUGC_AddAppDependency", + "params": [ + { "paramname":"nPublishedFileID", "paramtype":"PublishedFileId_t" }, + { "paramname":"nAppID", "paramtype":"AppId_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "RemoveAppDependencyResult_t", + "methodname": "RemoveAppDependency", + "methodname_flat": "SteamAPI_ISteamUGC_RemoveAppDependency", + "params": [ + { "paramname":"nPublishedFileID", "paramtype":"PublishedFileId_t" }, + { "paramname":"nAppID", "paramtype":"AppId_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "GetAppDependenciesResult_t", + "methodname": "GetAppDependencies", + "methodname_flat": "SteamAPI_ISteamUGC_GetAppDependencies", + "params": [ + { "paramname":"nPublishedFileID", "paramtype":"PublishedFileId_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "DeleteItemResult_t", + "methodname": "DeleteItem", + "methodname_flat": "SteamAPI_ISteamUGC_DeleteItem", + "params": [ + { "paramname":"nPublishedFileID", "paramtype":"PublishedFileId_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "ShowWorkshopEULA", + "methodname_flat": "SteamAPI_ISteamUGC_ShowWorkshopEULA", + "params": [], + "returntype": "bool" + }, + { + "callresult": "WorkshopEULAStatus_t", + "methodname": "GetWorkshopEULAStatus", + "methodname_flat": "SteamAPI_ISteamUGC_GetWorkshopEULAStatus", + "params": [], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetUserContentDescriptorPreferences", + "methodname_flat": "SteamAPI_ISteamUGC_GetUserContentDescriptorPreferences", + "params": [ + { "paramname":"pvecDescriptors", "paramtype":"EUGCContentDescriptorID *" }, + { "paramname":"cMaxEntries", "paramtype":"uint32" } + ], + "returntype": "uint32" + }, + { + "methodname": "SetItemsDisabledLocally", + "methodname_flat": "SteamAPI_ISteamUGC_SetItemsDisabledLocally", + "params": [ + { "paramname":"pvecPublishedFileIDs", "paramtype":"PublishedFileId_t *" }, + { "paramname":"unNumPublishedFileIDs", "paramtype":"uint32" }, + { "paramname":"bDisabledLocally", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "SetSubscriptionsLoadOrder", + "methodname_flat": "SteamAPI_ISteamUGC_SetSubscriptionsLoadOrder", + "params": [ + { "paramname":"pvecPublishedFileIDs", "paramtype":"PublishedFileId_t *" }, + { "paramname":"unNumPublishedFileIDs", "paramtype":"uint32" } + ], + "returntype": "bool" + } + ], + "version_string": "STEAMUGC_INTERFACE_VERSION021" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamHTMLSurface", + "name_flat": "SteamAPI_SteamHTMLSurface_v005" + } + ], + "classname": "ISteamHTMLSurface", + "enums": [ + { + "enumname": "EHTMLMouseButton", + "fqname": "ISteamHTMLSurface::EHTMLMouseButton", + "values": [ + { "name":"eHTMLMouseButton_Left", "value":"0" }, + { "name":"eHTMLMouseButton_Right", "value":"1" }, + { "name":"eHTMLMouseButton_Middle", "value":"2" } + ] + }, + { + "enumname": "EHTMLMouseCursor", + "fqname": "ISteamHTMLSurface::EHTMLMouseCursor", + "values": [ + { "name":"k_EHTMLMouseCursor_User", "value":"0" }, + { "name":"k_EHTMLMouseCursor_None", "value":"1" }, + { "name":"k_EHTMLMouseCursor_Arrow", "value":"2" }, + { "name":"k_EHTMLMouseCursor_IBeam", "value":"3" }, + { "name":"k_EHTMLMouseCursor_Hourglass", "value":"4" }, + { "name":"k_EHTMLMouseCursor_WaitArrow", "value":"5" }, + { "name":"k_EHTMLMouseCursor_Crosshair", "value":"6" }, + { "name":"k_EHTMLMouseCursor_Up", "value":"7" }, + { "name":"k_EHTMLMouseCursor_SizeNW", "value":"8" }, + { "name":"k_EHTMLMouseCursor_SizeSE", "value":"9" }, + { "name":"k_EHTMLMouseCursor_SizeNE", "value":"10" }, + { "name":"k_EHTMLMouseCursor_SizeSW", "value":"11" }, + { "name":"k_EHTMLMouseCursor_SizeW", "value":"12" }, + { "name":"k_EHTMLMouseCursor_SizeE", "value":"13" }, + { "name":"k_EHTMLMouseCursor_SizeN", "value":"14" }, + { "name":"k_EHTMLMouseCursor_SizeS", "value":"15" }, + { "name":"k_EHTMLMouseCursor_SizeWE", "value":"16" }, + { "name":"k_EHTMLMouseCursor_SizeNS", "value":"17" }, + { "name":"k_EHTMLMouseCursor_SizeAll", "value":"18" }, + { "name":"k_EHTMLMouseCursor_No", "value":"19" }, + { "name":"k_EHTMLMouseCursor_Hand", "value":"20" }, + { "name":"k_EHTMLMouseCursor_Blank", "value":"21" }, + { "name":"k_EHTMLMouseCursor_MiddlePan", "value":"22" }, + { "name":"k_EHTMLMouseCursor_NorthPan", "value":"23" }, + { "name":"k_EHTMLMouseCursor_NorthEastPan", "value":"24" }, + { "name":"k_EHTMLMouseCursor_EastPan", "value":"25" }, + { "name":"k_EHTMLMouseCursor_SouthEastPan", "value":"26" }, + { "name":"k_EHTMLMouseCursor_SouthPan", "value":"27" }, + { "name":"k_EHTMLMouseCursor_SouthWestPan", "value":"28" }, + { "name":"k_EHTMLMouseCursor_WestPan", "value":"29" }, + { "name":"k_EHTMLMouseCursor_NorthWestPan", "value":"30" }, + { "name":"k_EHTMLMouseCursor_Alias", "value":"31" }, + { "name":"k_EHTMLMouseCursor_Cell", "value":"32" }, + { "name":"k_EHTMLMouseCursor_ColResize", "value":"33" }, + { "name":"k_EHTMLMouseCursor_CopyCur", "value":"34" }, + { "name":"k_EHTMLMouseCursor_VerticalText", "value":"35" }, + { "name":"k_EHTMLMouseCursor_RowResize", "value":"36" }, + { "name":"k_EHTMLMouseCursor_ZoomIn", "value":"37" }, + { "name":"k_EHTMLMouseCursor_ZoomOut", "value":"38" }, + { "name":"k_EHTMLMouseCursor_Help", "value":"39" }, + { "name":"k_EHTMLMouseCursor_Custom", "value":"40" }, + { "name":"k_EHTMLMouseCursor_SizeNWSE", "value":"41" }, + { "name":"k_EHTMLMouseCursor_SizeNESW", "value":"42" }, + { "name":"k_EHTMLMouseCursor_last", "value":"43" } + ] + }, + { + "enumname": "EHTMLKeyModifiers", + "fqname": "ISteamHTMLSurface::EHTMLKeyModifiers", + "values": [ + { "name":"k_eHTMLKeyModifier_None", "value":"0" }, + { "name":"k_eHTMLKeyModifier_AltDown", "value":"1" }, + { "name":"k_eHTMLKeyModifier_CtrlDown", "value":"2" }, + { "name":"k_eHTMLKeyModifier_ShiftDown", "value":"4" } + ] + } + ], + "fields": [], + "methods": [ + { + "methodname": "Init", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_Init", + "params": [], + "returntype": "bool" + }, + { + "methodname": "Shutdown", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_Shutdown", + "params": [], + "returntype": "bool" + }, + { + "callresult": "HTML_BrowserReady_t", + "methodname": "CreateBrowser", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_CreateBrowser", + "params": [ + { "paramname":"pchUserAgent", "paramtype":"const char *" }, + { "paramname":"pchUserCSS", "paramtype":"const char *" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "RemoveBrowser", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_RemoveBrowser", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" } + ], + "returntype": "void" + }, + { + "methodname": "LoadURL", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_LoadURL", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"pchURL", "paramtype":"const char *" }, + { "paramname":"pchPostData", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "SetSize", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_SetSize", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"unWidth", "paramtype":"uint32" }, + { "paramname":"unHeight", "paramtype":"uint32" } + ], + "returntype": "void" + }, + { + "methodname": "StopLoad", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_StopLoad", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" } + ], + "returntype": "void" + }, + { + "methodname": "Reload", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_Reload", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" } + ], + "returntype": "void" + }, + { + "methodname": "GoBack", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_GoBack", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" } + ], + "returntype": "void" + }, + { + "methodname": "GoForward", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_GoForward", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" } + ], + "returntype": "void" + }, + { + "methodname": "AddHeader", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_AddHeader", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"pchKey", "paramtype":"const char *" }, + { "paramname":"pchValue", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "ExecuteJavascript", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_ExecuteJavascript", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"pchScript", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "MouseUp", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_MouseUp", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"eMouseButton", "paramtype":"ISteamHTMLSurface::EHTMLMouseButton" } + ], + "returntype": "void" + }, + { + "methodname": "MouseDown", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_MouseDown", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"eMouseButton", "paramtype":"ISteamHTMLSurface::EHTMLMouseButton" } + ], + "returntype": "void" + }, + { + "methodname": "MouseDoubleClick", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_MouseDoubleClick", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"eMouseButton", "paramtype":"ISteamHTMLSurface::EHTMLMouseButton" } + ], + "returntype": "void" + }, + { + "methodname": "MouseMove", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_MouseMove", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"x", "paramtype":"int" }, + { "paramname":"y", "paramtype":"int" } + ], + "returntype": "void" + }, + { + "methodname": "MouseWheel", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_MouseWheel", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"nDelta", "paramtype":"int32" } + ], + "returntype": "void" + }, + { + "methodname": "KeyDown", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_KeyDown", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"nNativeKeyCode", "paramtype":"uint32" }, + { "paramname":"eHTMLKeyModifiers", "paramtype":"ISteamHTMLSurface::EHTMLKeyModifiers" }, + { "paramname":"bIsSystemKey", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "KeyUp", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_KeyUp", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"nNativeKeyCode", "paramtype":"uint32" }, + { "paramname":"eHTMLKeyModifiers", "paramtype":"ISteamHTMLSurface::EHTMLKeyModifiers" } + ], + "returntype": "void" + }, + { + "methodname": "KeyChar", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_KeyChar", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"cUnicodeChar", "paramtype":"uint32" }, + { "paramname":"eHTMLKeyModifiers", "paramtype":"ISteamHTMLSurface::EHTMLKeyModifiers" } + ], + "returntype": "void" + }, + { + "methodname": "SetHorizontalScroll", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_SetHorizontalScroll", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"nAbsolutePixelScroll", "paramtype":"uint32" } + ], + "returntype": "void" + }, + { + "methodname": "SetVerticalScroll", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_SetVerticalScroll", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"nAbsolutePixelScroll", "paramtype":"uint32" } + ], + "returntype": "void" + }, + { + "methodname": "SetKeyFocus", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_SetKeyFocus", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"bHasKeyFocus", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "ViewSource", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_ViewSource", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" } + ], + "returntype": "void" + }, + { + "methodname": "CopyToClipboard", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_CopyToClipboard", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" } + ], + "returntype": "void" + }, + { + "methodname": "PasteFromClipboard", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_PasteFromClipboard", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" } + ], + "returntype": "void" + }, + { + "methodname": "Find", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_Find", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"pchSearchStr", "paramtype":"const char *" }, + { "paramname":"bCurrentlyInFind", "paramtype":"bool" }, + { "paramname":"bReverse", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "StopFind", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_StopFind", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" } + ], + "returntype": "void" + }, + { + "methodname": "GetLinkAtPosition", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_GetLinkAtPosition", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"x", "paramtype":"int" }, + { "paramname":"y", "paramtype":"int" } + ], + "returntype": "void" + }, + { + "methodname": "SetCookie", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_SetCookie", + "params": [ + { "paramname":"pchHostname", "paramtype":"const char *" }, + { "paramname":"pchKey", "paramtype":"const char *" }, + { "paramname":"pchValue", "paramtype":"const char *" }, + { "paramname":"pchPath", "paramtype":"const char *" }, + { "paramname":"nExpires", "paramtype":"RTime32" }, + { "paramname":"bSecure", "paramtype":"bool" }, + { "paramname":"bHTTPOnly", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "SetPageScaleFactor", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_SetPageScaleFactor", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"flZoom", "paramtype":"float" }, + { "paramname":"nPointX", "paramtype":"int" }, + { "paramname":"nPointY", "paramtype":"int" } + ], + "returntype": "void" + }, + { + "methodname": "SetBackgroundMode", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_SetBackgroundMode", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"bBackgroundMode", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "SetDPIScalingFactor", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"flDPIScaling", "paramtype":"float" } + ], + "returntype": "void" + }, + { + "methodname": "OpenDeveloperTools", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_OpenDeveloperTools", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" } + ], + "returntype": "void" + }, + { + "methodname": "AllowStartRequest", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_AllowStartRequest", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"bAllowed", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "JSDialogResponse", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_JSDialogResponse", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"bResult", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "FileLoadDialogResponse", + "methodname_flat": "SteamAPI_ISteamHTMLSurface_FileLoadDialogResponse", + "params": [ + { "paramname":"unBrowserHandle", "paramtype":"HHTMLBrowser" }, + { "paramname":"pchSelectedFiles", "paramtype":"const char **" } + ], + "returntype": "void" + } + ], + "version_string": "STEAMHTMLSURFACE_INTERFACE_VERSION_005" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamInventory", + "name_flat": "SteamAPI_SteamInventory_v003" + }, + { + "kind": "gameserver", + "name": "SteamGameServerInventory", + "name_flat": "SteamAPI_SteamGameServerInventory_v003" + } + ], + "classname": "ISteamInventory", + "fields": [], + "methods": [ + { + "methodname": "GetResultStatus", + "methodname_flat": "SteamAPI_ISteamInventory_GetResultStatus", + "params": [ + { "paramname":"resultHandle", "paramtype":"SteamInventoryResult_t" } + ], + "returntype": "EResult" + }, + { + "methodname": "GetResultItems", + "methodname_flat": "SteamAPI_ISteamInventory_GetResultItems", + "params": [ + { "paramname":"resultHandle", "paramtype":"SteamInventoryResult_t" }, + { + "desc": "Output array", + "out_array_count": "punOutItemsArraySize", + "paramname": "pOutItemsArray", + "paramtype": "SteamItemDetails_t *" + }, + { "paramname":"punOutItemsArraySize", "paramtype":"uint32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetResultItemProperty", + "methodname_flat": "SteamAPI_ISteamInventory_GetResultItemProperty", + "params": [ + { "paramname":"resultHandle", "paramtype":"SteamInventoryResult_t" }, + { "paramname":"unItemIndex", "paramtype":"uint32" }, + { "paramname":"pchPropertyName", "paramtype":"const char *" }, + { + "out_string_count": "punValueBufferSizeOut", + "paramname": "pchValueBuffer", + "paramtype": "char *" + }, + { "paramname":"punValueBufferSizeOut", "paramtype":"uint32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetResultTimestamp", + "methodname_flat": "SteamAPI_ISteamInventory_GetResultTimestamp", + "params": [ + { "paramname":"resultHandle", "paramtype":"SteamInventoryResult_t" } + ], + "returntype": "uint32" + }, + { + "methodname": "CheckResultSteamID", + "methodname_flat": "SteamAPI_ISteamInventory_CheckResultSteamID", + "params": [ + { "paramname":"resultHandle", "paramtype":"SteamInventoryResult_t" }, + { "paramname":"steamIDExpected", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + }, + { + "methodname": "DestroyResult", + "methodname_flat": "SteamAPI_ISteamInventory_DestroyResult", + "params": [ + { "paramname":"resultHandle", "paramtype":"SteamInventoryResult_t" } + ], + "returntype": "void" + }, + { + "methodname": "GetAllItems", + "methodname_flat": "SteamAPI_ISteamInventory_GetAllItems", + "params": [ + { "paramname":"pResultHandle", "paramtype":"SteamInventoryResult_t *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetItemsByID", + "methodname_flat": "SteamAPI_ISteamInventory_GetItemsByID", + "params": [ + { "paramname":"pResultHandle", "paramtype":"SteamInventoryResult_t *" }, + { + "array_count": "unCountInstanceIDs", + "paramname": "pInstanceIDs", + "paramtype": "const SteamItemInstanceID_t *" + }, + { "paramname":"unCountInstanceIDs", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "SerializeResult", + "methodname_flat": "SteamAPI_ISteamInventory_SerializeResult", + "params": [ + { "paramname":"resultHandle", "paramtype":"SteamInventoryResult_t" }, + { + "out_buffer_count": "punOutBufferSize", + "paramname": "pOutBuffer", + "paramtype": "void *" + }, + { "paramname":"punOutBufferSize", "paramtype":"uint32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "DeserializeResult", + "methodname_flat": "SteamAPI_ISteamInventory_DeserializeResult", + "params": [ + { "paramname":"pOutResultHandle", "paramtype":"SteamInventoryResult_t *" }, + { + "buffer_count": "punOutBufferSize", + "paramname": "pBuffer", + "paramtype": "const void *" + }, + { "paramname":"unBufferSize", "paramtype":"uint32" }, + { "paramname":"bRESERVED_MUST_BE_FALSE", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "GenerateItems", + "methodname_flat": "SteamAPI_ISteamInventory_GenerateItems", + "params": [ + { "paramname":"pResultHandle", "paramtype":"SteamInventoryResult_t *" }, + { + "array_count": "unArrayLength", + "paramname": "pArrayItemDefs", + "paramtype": "const SteamItemDef_t *" + }, + { + "array_count": "unArrayLength", + "paramname": "punArrayQuantity", + "paramtype": "const uint32 *" + }, + { "paramname":"unArrayLength", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "GrantPromoItems", + "methodname_flat": "SteamAPI_ISteamInventory_GrantPromoItems", + "params": [ + { "paramname":"pResultHandle", "paramtype":"SteamInventoryResult_t *" } + ], + "returntype": "bool" + }, + { + "methodname": "AddPromoItem", + "methodname_flat": "SteamAPI_ISteamInventory_AddPromoItem", + "params": [ + { "paramname":"pResultHandle", "paramtype":"SteamInventoryResult_t *" }, + { "paramname":"itemDef", "paramtype":"SteamItemDef_t" } + ], + "returntype": "bool" + }, + { + "methodname": "AddPromoItems", + "methodname_flat": "SteamAPI_ISteamInventory_AddPromoItems", + "params": [ + { "paramname":"pResultHandle", "paramtype":"SteamInventoryResult_t *" }, + { + "array_count": "unArrayLength", + "paramname": "pArrayItemDefs", + "paramtype": "const SteamItemDef_t *" + }, + { "paramname":"unArrayLength", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "ConsumeItem", + "methodname_flat": "SteamAPI_ISteamInventory_ConsumeItem", + "params": [ + { "paramname":"pResultHandle", "paramtype":"SteamInventoryResult_t *" }, + { "paramname":"itemConsume", "paramtype":"SteamItemInstanceID_t" }, + { "paramname":"unQuantity", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "ExchangeItems", + "methodname_flat": "SteamAPI_ISteamInventory_ExchangeItems", + "params": [ + { "paramname":"pResultHandle", "paramtype":"SteamInventoryResult_t *" }, + { + "array_count": "unArrayGenerateLength", + "paramname": "pArrayGenerate", + "paramtype": "const SteamItemDef_t *" + }, + { + "array_count": "unArrayGenerateLength", + "paramname": "punArrayGenerateQuantity", + "paramtype": "const uint32 *" + }, + { "paramname":"unArrayGenerateLength", "paramtype":"uint32" }, + { + "array_count": "unArrayDestroyLength", + "paramname": "pArrayDestroy", + "paramtype": "const SteamItemInstanceID_t *" + }, + { + "array_count": "unArrayDestroyLength", + "paramname": "punArrayDestroyQuantity", + "paramtype": "const uint32 *" + }, + { "paramname":"unArrayDestroyLength", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "TransferItemQuantity", + "methodname_flat": "SteamAPI_ISteamInventory_TransferItemQuantity", + "params": [ + { "paramname":"pResultHandle", "paramtype":"SteamInventoryResult_t *" }, + { "paramname":"itemIdSource", "paramtype":"SteamItemInstanceID_t" }, + { "paramname":"unQuantity", "paramtype":"uint32" }, + { "paramname":"itemIdDest", "paramtype":"SteamItemInstanceID_t" } + ], + "returntype": "bool" + }, + { + "methodname": "SendItemDropHeartbeat", + "methodname_flat": "SteamAPI_ISteamInventory_SendItemDropHeartbeat", + "params": [], + "returntype": "void" + }, + { + "methodname": "TriggerItemDrop", + "methodname_flat": "SteamAPI_ISteamInventory_TriggerItemDrop", + "params": [ + { "paramname":"pResultHandle", "paramtype":"SteamInventoryResult_t *" }, + { "paramname":"dropListDefinition", "paramtype":"SteamItemDef_t" } + ], + "returntype": "bool" + }, + { + "methodname": "TradeItems", + "methodname_flat": "SteamAPI_ISteamInventory_TradeItems", + "params": [ + { "paramname":"pResultHandle", "paramtype":"SteamInventoryResult_t *" }, + { "paramname":"steamIDTradePartner", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { + "array_count": "nArrayGiveLength", + "paramname": "pArrayGive", + "paramtype": "const SteamItemInstanceID_t *" + }, + { + "array_count": "nArrayGiveLength", + "paramname": "pArrayGiveQuantity", + "paramtype": "const uint32 *" + }, + { "paramname":"nArrayGiveLength", "paramtype":"uint32" }, + { + "array_count": "nArrayGetLength", + "paramname": "pArrayGet", + "paramtype": "const SteamItemInstanceID_t *" + }, + { + "array_count": "nArrayGetLength", + "paramname": "pArrayGetQuantity", + "paramtype": "const uint32 *" + }, + { "paramname":"nArrayGetLength", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "LoadItemDefinitions", + "methodname_flat": "SteamAPI_ISteamInventory_LoadItemDefinitions", + "params": [], + "returntype": "bool" + }, + { + "methodname": "GetItemDefinitionIDs", + "methodname_flat": "SteamAPI_ISteamInventory_GetItemDefinitionIDs", + "params": [ + { + "desc": "List of item definition IDs", + "out_array_count": "punItemDefIDsArraySize", + "paramname": "pItemDefIDs", + "paramtype": "SteamItemDef_t *" + }, + { + "desc": "Size of array is passed in and actual size used is returned in this param", + "paramname": "punItemDefIDsArraySize", + "paramtype": "uint32 *" + } + ], + "returntype": "bool" + }, + { + "methodname": "GetItemDefinitionProperty", + "methodname_flat": "SteamAPI_ISteamInventory_GetItemDefinitionProperty", + "params": [ + { "paramname":"iDefinition", "paramtype":"SteamItemDef_t" }, + { "paramname":"pchPropertyName", "paramtype":"const char *" }, + { + "out_string_count": "punValueBufferSizeOut", + "paramname": "pchValueBuffer", + "paramtype": "char *" + }, + { "paramname":"punValueBufferSizeOut", "paramtype":"uint32 *" } + ], + "returntype": "bool" + }, + { + "callresult": "SteamInventoryEligiblePromoItemDefIDs_t", + "methodname": "RequestEligiblePromoItemDefinitionsIDs", + "methodname_flat": "SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs", + "params": [ + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetEligiblePromoItemDefinitionIDs", + "methodname_flat": "SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs", + "params": [ + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { + "desc": "List of item definition IDs", + "out_array_count": "punItemDefIDsArraySize", + "paramname": "pItemDefIDs", + "paramtype": "SteamItemDef_t *" + }, + { + "desc": "Size of array is passed in and actual size used is returned in this param", + "paramname": "punItemDefIDsArraySize", + "paramtype": "uint32 *" + } + ], + "returntype": "bool" + }, + { + "callresult": "SteamInventoryStartPurchaseResult_t", + "methodname": "StartPurchase", + "methodname_flat": "SteamAPI_ISteamInventory_StartPurchase", + "params": [ + { + "array_count": "unArrayLength", + "paramname": "pArrayItemDefs", + "paramtype": "const SteamItemDef_t *" + }, + { + "array_count": "unArrayLength", + "paramname": "punArrayQuantity", + "paramtype": "const uint32 *" + }, + { "paramname":"unArrayLength", "paramtype":"uint32" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "SteamInventoryRequestPricesResult_t", + "methodname": "RequestPrices", + "methodname_flat": "SteamAPI_ISteamInventory_RequestPrices", + "params": [], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetNumItemsWithPrices", + "methodname_flat": "SteamAPI_ISteamInventory_GetNumItemsWithPrices", + "params": [], + "returntype": "uint32" + }, + { + "methodname": "GetItemsWithPrices", + "methodname_flat": "SteamAPI_ISteamInventory_GetItemsWithPrices", + "params": [ + { + "array_count": "unArrayLength", + "desc": "Items with prices", + "out_array_count": "pArrayItemDefs", + "paramname": "pArrayItemDefs", + "paramtype": "SteamItemDef_t *" + }, + { + "array_count": "unArrayLength", + "desc": "List of prices for the given item defs", + "out_array_count": "pPrices", + "paramname": "pCurrentPrices", + "paramtype": "uint64 *" + }, + { + "array_count": "unArrayLength", + "desc": "List of prices for the given item defs", + "out_array_count": "pPrices", + "paramname": "pBasePrices", + "paramtype": "uint64 *" + }, + { "paramname":"unArrayLength", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "GetItemPrice", + "methodname_flat": "SteamAPI_ISteamInventory_GetItemPrice", + "params": [ + { "paramname":"iDefinition", "paramtype":"SteamItemDef_t" }, + { "paramname":"pCurrentPrice", "paramtype":"uint64 *" }, + { "paramname":"pBasePrice", "paramtype":"uint64 *" } + ], + "returntype": "bool" + }, + { + "methodname": "StartUpdateProperties", + "methodname_flat": "SteamAPI_ISteamInventory_StartUpdateProperties", + "params": [], + "returntype": "SteamInventoryUpdateHandle_t" + }, + { + "methodname": "RemoveProperty", + "methodname_flat": "SteamAPI_ISteamInventory_RemoveProperty", + "params": [ + { "paramname":"handle", "paramtype":"SteamInventoryUpdateHandle_t" }, + { "paramname":"nItemID", "paramtype":"SteamItemInstanceID_t" }, + { "paramname":"pchPropertyName", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetProperty", + "methodname_flat": "SteamAPI_ISteamInventory_SetPropertyString", + "params": [ + { "paramname":"handle", "paramtype":"SteamInventoryUpdateHandle_t" }, + { "paramname":"nItemID", "paramtype":"SteamItemInstanceID_t" }, + { "paramname":"pchPropertyName", "paramtype":"const char *" }, + { "paramname":"pchPropertyValue", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetProperty", + "methodname_flat": "SteamAPI_ISteamInventory_SetPropertyBool", + "params": [ + { "paramname":"handle", "paramtype":"SteamInventoryUpdateHandle_t" }, + { "paramname":"nItemID", "paramtype":"SteamItemInstanceID_t" }, + { "paramname":"pchPropertyName", "paramtype":"const char *" }, + { "paramname":"bValue", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "SetProperty", + "methodname_flat": "SteamAPI_ISteamInventory_SetPropertyInt64", + "params": [ + { "paramname":"handle", "paramtype":"SteamInventoryUpdateHandle_t" }, + { "paramname":"nItemID", "paramtype":"SteamItemInstanceID_t" }, + { "paramname":"pchPropertyName", "paramtype":"const char *" }, + { "paramname":"nValue", "paramtype":"int64" } + ], + "returntype": "bool" + }, + { + "methodname": "SetProperty", + "methodname_flat": "SteamAPI_ISteamInventory_SetPropertyFloat", + "params": [ + { "paramname":"handle", "paramtype":"SteamInventoryUpdateHandle_t" }, + { "paramname":"nItemID", "paramtype":"SteamItemInstanceID_t" }, + { "paramname":"pchPropertyName", "paramtype":"const char *" }, + { "paramname":"flValue", "paramtype":"float" } + ], + "returntype": "bool" + }, + { + "methodname": "SubmitUpdateProperties", + "methodname_flat": "SteamAPI_ISteamInventory_SubmitUpdateProperties", + "params": [ + { "paramname":"handle", "paramtype":"SteamInventoryUpdateHandle_t" }, + { "paramname":"pResultHandle", "paramtype":"SteamInventoryResult_t *" } + ], + "returntype": "bool" + }, + { + "methodname": "InspectItem", + "methodname_flat": "SteamAPI_ISteamInventory_InspectItem", + "params": [ + { "paramname":"pResultHandle", "paramtype":"SteamInventoryResult_t *" }, + { "paramname":"pchItemToken", "paramtype":"const char *" } + ], + "returntype": "bool" + } + ], + "version_string": "STEAMINVENTORY_INTERFACE_V003" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamTimeline", + "name_flat": "SteamAPI_SteamTimeline_v004" + } + ], + "classname": "ISteamTimeline", + "fields": [], + "methods": [ + { + "methodname": "SetTimelineTooltip", + "methodname_flat": "SteamAPI_ISteamTimeline_SetTimelineTooltip", + "params": [ + { "paramname":"pchDescription", "paramtype":"const char *" }, + { "paramname":"flTimeDelta", "paramtype":"float" } + ], + "returntype": "void" + }, + { + "methodname": "ClearTimelineTooltip", + "methodname_flat": "SteamAPI_ISteamTimeline_ClearTimelineTooltip", + "params": [ + { "paramname":"flTimeDelta", "paramtype":"float" } + ], + "returntype": "void" + }, + { + "methodname": "SetTimelineGameMode", + "methodname_flat": "SteamAPI_ISteamTimeline_SetTimelineGameMode", + "params": [ + { "paramname":"eMode", "paramtype":"ETimelineGameMode" } + ], + "returntype": "void" + }, + { + "methodname": "AddInstantaneousTimelineEvent", + "methodname_flat": "SteamAPI_ISteamTimeline_AddInstantaneousTimelineEvent", + "params": [ + { "paramname":"pchTitle", "paramtype":"const char *" }, + { "paramname":"pchDescription", "paramtype":"const char *" }, + { "paramname":"pchIcon", "paramtype":"const char *" }, + { "paramname":"unIconPriority", "paramtype":"uint32" }, + { "paramname":"flStartOffsetSeconds", "paramtype":"float" }, + { "paramname":"ePossibleClip", "paramtype":"ETimelineEventClipPriority" } + ], + "returntype": "TimelineEventHandle_t" + }, + { + "methodname": "AddRangeTimelineEvent", + "methodname_flat": "SteamAPI_ISteamTimeline_AddRangeTimelineEvent", + "params": [ + { "paramname":"pchTitle", "paramtype":"const char *" }, + { "paramname":"pchDescription", "paramtype":"const char *" }, + { "paramname":"pchIcon", "paramtype":"const char *" }, + { "paramname":"unIconPriority", "paramtype":"uint32" }, + { "paramname":"flStartOffsetSeconds", "paramtype":"float" }, + { "paramname":"flDuration", "paramtype":"float" }, + { "paramname":"ePossibleClip", "paramtype":"ETimelineEventClipPriority" } + ], + "returntype": "TimelineEventHandle_t" + }, + { + "methodname": "StartRangeTimelineEvent", + "methodname_flat": "SteamAPI_ISteamTimeline_StartRangeTimelineEvent", + "params": [ + { "paramname":"pchTitle", "paramtype":"const char *" }, + { "paramname":"pchDescription", "paramtype":"const char *" }, + { "paramname":"pchIcon", "paramtype":"const char *" }, + { "paramname":"unPriority", "paramtype":"uint32" }, + { "paramname":"flStartOffsetSeconds", "paramtype":"float" }, + { "paramname":"ePossibleClip", "paramtype":"ETimelineEventClipPriority" } + ], + "returntype": "TimelineEventHandle_t" + }, + { + "methodname": "UpdateRangeTimelineEvent", + "methodname_flat": "SteamAPI_ISteamTimeline_UpdateRangeTimelineEvent", + "params": [ + { "paramname":"ulEvent", "paramtype":"TimelineEventHandle_t" }, + { "paramname":"pchTitle", "paramtype":"const char *" }, + { "paramname":"pchDescription", "paramtype":"const char *" }, + { "paramname":"pchIcon", "paramtype":"const char *" }, + { "paramname":"unPriority", "paramtype":"uint32" }, + { "paramname":"ePossibleClip", "paramtype":"ETimelineEventClipPriority" } + ], + "returntype": "void" + }, + { + "methodname": "EndRangeTimelineEvent", + "methodname_flat": "SteamAPI_ISteamTimeline_EndRangeTimelineEvent", + "params": [ + { "paramname":"ulEvent", "paramtype":"TimelineEventHandle_t" }, + { "paramname":"flEndOffsetSeconds", "paramtype":"float" } + ], + "returntype": "void" + }, + { + "methodname": "RemoveTimelineEvent", + "methodname_flat": "SteamAPI_ISteamTimeline_RemoveTimelineEvent", + "params": [ + { "paramname":"ulEvent", "paramtype":"TimelineEventHandle_t" } + ], + "returntype": "void" + }, + { + "callresult": "SteamTimelineEventRecordingExists_t", + "methodname": "DoesEventRecordingExist", + "methodname_flat": "SteamAPI_ISteamTimeline_DoesEventRecordingExist", + "params": [ + { "paramname":"ulEvent", "paramtype":"TimelineEventHandle_t" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "StartGamePhase", + "methodname_flat": "SteamAPI_ISteamTimeline_StartGamePhase", + "params": [], + "returntype": "void" + }, + { + "methodname": "EndGamePhase", + "methodname_flat": "SteamAPI_ISteamTimeline_EndGamePhase", + "params": [], + "returntype": "void" + }, + { + "methodname": "SetGamePhaseID", + "methodname_flat": "SteamAPI_ISteamTimeline_SetGamePhaseID", + "params": [ + { "paramname":"pchPhaseID", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "callresult": "SteamTimelineGamePhaseRecordingExists_t", + "methodname": "DoesGamePhaseRecordingExist", + "methodname_flat": "SteamAPI_ISteamTimeline_DoesGamePhaseRecordingExist", + "params": [ + { "paramname":"pchPhaseID", "paramtype":"const char *" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "AddGamePhaseTag", + "methodname_flat": "SteamAPI_ISteamTimeline_AddGamePhaseTag", + "params": [ + { "paramname":"pchTagName", "paramtype":"const char *" }, + { "paramname":"pchTagIcon", "paramtype":"const char *" }, + { "paramname":"pchTagGroup", "paramtype":"const char *" }, + { "paramname":"unPriority", "paramtype":"uint32" } + ], + "returntype": "void" + }, + { + "methodname": "SetGamePhaseAttribute", + "methodname_flat": "SteamAPI_ISteamTimeline_SetGamePhaseAttribute", + "params": [ + { "paramname":"pchAttributeGroup", "paramtype":"const char *" }, + { "paramname":"pchAttributeValue", "paramtype":"const char *" }, + { "paramname":"unPriority", "paramtype":"uint32" } + ], + "returntype": "void" + }, + { + "methodname": "OpenOverlayToGamePhase", + "methodname_flat": "SteamAPI_ISteamTimeline_OpenOverlayToGamePhase", + "params": [ + { "paramname":"pchPhaseID", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "OpenOverlayToTimelineEvent", + "methodname_flat": "SteamAPI_ISteamTimeline_OpenOverlayToTimelineEvent", + "params": [ + { "paramname":"ulEvent", "paramtype":"const TimelineEventHandle_t" } + ], + "returntype": "void" + } + ], + "version_string": "STEAMTIMELINE_INTERFACE_V004" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamVideo", + "name_flat": "SteamAPI_SteamVideo_v007" + } + ], + "classname": "ISteamVideo", + "fields": [], + "methods": [ + { + "methodname": "GetVideoURL", + "methodname_flat": "SteamAPI_ISteamVideo_GetVideoURL", + "params": [ + { "paramname":"unVideoAppID", "paramtype":"AppId_t" } + ], + "returntype": "void" + }, + { + "methodname": "IsBroadcasting", + "methodname_flat": "SteamAPI_ISteamVideo_IsBroadcasting", + "params": [ + { "paramname":"pnNumViewers", "paramtype":"int *" } + ], + "returntype": "bool" + }, + { + "callback": "GetOPFSettingsResult_t", + "methodname": "GetOPFSettings", + "methodname_flat": "SteamAPI_ISteamVideo_GetOPFSettings", + "params": [ + { "paramname":"unVideoAppID", "paramtype":"AppId_t" } + ], + "returntype": "void" + }, + { + "methodname": "GetOPFStringForApp", + "methodname_flat": "SteamAPI_ISteamVideo_GetOPFStringForApp", + "params": [ + { "paramname":"unVideoAppID", "paramtype":"AppId_t" }, + { "paramname":"pchBuffer", "paramtype":"char *" }, + { "paramname":"pnBufferSize", "paramtype":"int32 *" } + ], + "returntype": "bool" + } + ], + "version_string": "STEAMVIDEO_INTERFACE_V007" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamParentalSettings", + "name_flat": "SteamAPI_SteamParentalSettings_v001" + } + ], + "classname": "ISteamParentalSettings", + "fields": [], + "methods": [ + { + "methodname": "BIsParentalLockEnabled", + "methodname_flat": "SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled", + "params": [], + "returntype": "bool" + }, + { + "methodname": "BIsParentalLockLocked", + "methodname_flat": "SteamAPI_ISteamParentalSettings_BIsParentalLockLocked", + "params": [], + "returntype": "bool" + }, + { + "methodname": "BIsAppBlocked", + "methodname_flat": "SteamAPI_ISteamParentalSettings_BIsAppBlocked", + "params": [ + { "paramname":"nAppID", "paramtype":"AppId_t" } + ], + "returntype": "bool" + }, + { + "methodname": "BIsAppInBlockList", + "methodname_flat": "SteamAPI_ISteamParentalSettings_BIsAppInBlockList", + "params": [ + { "paramname":"nAppID", "paramtype":"AppId_t" } + ], + "returntype": "bool" + }, + { + "methodname": "BIsFeatureBlocked", + "methodname_flat": "SteamAPI_ISteamParentalSettings_BIsFeatureBlocked", + "params": [ + { "paramname":"eFeature", "paramtype":"EParentalFeature" } + ], + "returntype": "bool" + }, + { + "methodname": "BIsFeatureInBlockList", + "methodname_flat": "SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList", + "params": [ + { "paramname":"eFeature", "paramtype":"EParentalFeature" } + ], + "returntype": "bool" + } + ], + "version_string": "STEAMPARENTALSETTINGS_INTERFACE_VERSION001" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamRemotePlay", + "name_flat": "SteamAPI_SteamRemotePlay_v003" + } + ], + "classname": "ISteamRemotePlay", + "fields": [], + "methods": [ + { + "methodname": "GetSessionCount", + "methodname_flat": "SteamAPI_ISteamRemotePlay_GetSessionCount", + "params": [], + "returntype": "uint32" + }, + { + "methodname": "GetSessionID", + "methodname_flat": "SteamAPI_ISteamRemotePlay_GetSessionID", + "params": [ + { "paramname":"iSessionIndex", "paramtype":"int" } + ], + "returntype": "RemotePlaySessionID_t" + }, + { + "methodname": "GetSessionSteamID", + "methodname_flat": "SteamAPI_ISteamRemotePlay_GetSessionSteamID", + "params": [ + { "paramname":"unSessionID", "paramtype":"RemotePlaySessionID_t" } + ], + "returntype": "CSteamID", + "returntype_flat": "uint64_steamid" + }, + { + "methodname": "GetSessionClientName", + "methodname_flat": "SteamAPI_ISteamRemotePlay_GetSessionClientName", + "params": [ + { "paramname":"unSessionID", "paramtype":"RemotePlaySessionID_t" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetSessionClientFormFactor", + "methodname_flat": "SteamAPI_ISteamRemotePlay_GetSessionClientFormFactor", + "params": [ + { "paramname":"unSessionID", "paramtype":"RemotePlaySessionID_t" } + ], + "returntype": "ESteamDeviceFormFactor" + }, + { + "methodname": "BGetSessionClientResolution", + "methodname_flat": "SteamAPI_ISteamRemotePlay_BGetSessionClientResolution", + "params": [ + { "paramname":"unSessionID", "paramtype":"RemotePlaySessionID_t" }, + { "paramname":"pnResolutionX", "paramtype":"int *" }, + { "paramname":"pnResolutionY", "paramtype":"int *" } + ], + "returntype": "bool" + }, + { + "methodname": "ShowRemotePlayTogetherUI", + "methodname_flat": "SteamAPI_ISteamRemotePlay_ShowRemotePlayTogetherUI", + "params": [], + "returntype": "bool" + }, + { + "methodname": "BSendRemotePlayTogetherInvite", + "methodname_flat": "SteamAPI_ISteamRemotePlay_BSendRemotePlayTogetherInvite", + "params": [ + { "paramname":"steamIDFriend", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + }, + { + "methodname": "BEnableRemotePlayTogetherDirectInput", + "methodname_flat": "SteamAPI_ISteamRemotePlay_BEnableRemotePlayTogetherDirectInput", + "params": [], + "returntype": "bool" + }, + { + "methodname": "DisableRemotePlayTogetherDirectInput", + "methodname_flat": "SteamAPI_ISteamRemotePlay_DisableRemotePlayTogetherDirectInput", + "params": [], + "returntype": "void" + }, + { + "methodname": "GetInput", + "methodname_flat": "SteamAPI_ISteamRemotePlay_GetInput", + "params": [ + { "paramname":"pInput", "paramtype":"RemotePlayInput_t *" }, + { "paramname":"unMaxEvents", "paramtype":"uint32" } + ], + "returntype": "uint32" + }, + { + "methodname": "SetMouseVisibility", + "methodname_flat": "SteamAPI_ISteamRemotePlay_SetMouseVisibility", + "params": [ + { "paramname":"unSessionID", "paramtype":"RemotePlaySessionID_t" }, + { "paramname":"bVisible", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "SetMousePosition", + "methodname_flat": "SteamAPI_ISteamRemotePlay_SetMousePosition", + "params": [ + { "paramname":"unSessionID", "paramtype":"RemotePlaySessionID_t" }, + { "paramname":"flNormalizedX", "paramtype":"float" }, + { "paramname":"flNormalizedY", "paramtype":"float" } + ], + "returntype": "void" + }, + { + "methodname": "CreateMouseCursor", + "methodname_flat": "SteamAPI_ISteamRemotePlay_CreateMouseCursor", + "params": [ + { "paramname":"nWidth", "paramtype":"int" }, + { "paramname":"nHeight", "paramtype":"int" }, + { "paramname":"nHotX", "paramtype":"int" }, + { "paramname":"nHotY", "paramtype":"int" }, + { "paramname":"pBGRA", "paramtype":"const void *" }, + { "paramname":"nPitch", "paramtype":"int" } + ], + "returntype": "RemotePlayCursorID_t" + }, + { + "methodname": "SetMouseCursor", + "methodname_flat": "SteamAPI_ISteamRemotePlay_SetMouseCursor", + "params": [ + { "paramname":"unSessionID", "paramtype":"RemotePlaySessionID_t" }, + { "paramname":"unCursorID", "paramtype":"RemotePlayCursorID_t" } + ], + "returntype": "void" + } + ], + "version_string": "STEAMREMOTEPLAY_INTERFACE_VERSION003" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamNetworkingMessages_SteamAPI", + "name_flat": "SteamAPI_SteamNetworkingMessages_SteamAPI_v002" + }, + { + "kind": "gameserver", + "name": "SteamGameServerNetworkingMessages_SteamAPI", + "name_flat": "SteamAPI_SteamGameServerNetworkingMessages_SteamAPI_v002" + } + ], + "classname": "ISteamNetworkingMessages", + "fields": [], + "methods": [ + { + "methodname": "SendMessageToUser", + "methodname_flat": "SteamAPI_ISteamNetworkingMessages_SendMessageToUser", + "params": [ + { "paramname":"identityRemote", "paramtype":"const SteamNetworkingIdentity &" }, + { "paramname":"pubData", "paramtype":"const void *" }, + { "paramname":"cubData", "paramtype":"uint32" }, + { "paramname":"nSendFlags", "paramtype":"int" }, + { "paramname":"nRemoteChannel", "paramtype":"int" } + ], + "returntype": "EResult" + }, + { + "methodname": "ReceiveMessagesOnChannel", + "methodname_flat": "SteamAPI_ISteamNetworkingMessages_ReceiveMessagesOnChannel", + "params": [ + { "paramname":"nLocalChannel", "paramtype":"int" }, + { "paramname":"ppOutMessages", "paramtype":"SteamNetworkingMessage_t **" }, + { "paramname":"nMaxMessages", "paramtype":"int" } + ], + "returntype": "int" + }, + { + "methodname": "AcceptSessionWithUser", + "methodname_flat": "SteamAPI_ISteamNetworkingMessages_AcceptSessionWithUser", + "params": [ + { "paramname":"identityRemote", "paramtype":"const SteamNetworkingIdentity &" } + ], + "returntype": "bool" + }, + { + "methodname": "CloseSessionWithUser", + "methodname_flat": "SteamAPI_ISteamNetworkingMessages_CloseSessionWithUser", + "params": [ + { "paramname":"identityRemote", "paramtype":"const SteamNetworkingIdentity &" } + ], + "returntype": "bool" + }, + { + "methodname": "CloseChannelWithUser", + "methodname_flat": "SteamAPI_ISteamNetworkingMessages_CloseChannelWithUser", + "params": [ + { "paramname":"identityRemote", "paramtype":"const SteamNetworkingIdentity &" }, + { "paramname":"nLocalChannel", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "GetSessionConnectionInfo", + "methodname_flat": "SteamAPI_ISteamNetworkingMessages_GetSessionConnectionInfo", + "params": [ + { "paramname":"identityRemote", "paramtype":"const SteamNetworkingIdentity &" }, + { "paramname":"pConnectionInfo", "paramtype":"SteamNetConnectionInfo_t *" }, + { "paramname":"pQuickStatus", "paramtype":"SteamNetConnectionRealTimeStatus_t *" } + ], + "returntype": "ESteamNetworkingConnectionState" + } + ], + "version_string": "SteamNetworkingMessages002" + }, + { + "accessors": [ + { + "kind": "user", + "name": "SteamNetworkingSockets_SteamAPI", + "name_flat": "SteamAPI_SteamNetworkingSockets_SteamAPI_v012" + }, + { + "kind": "gameserver", + "name": "SteamGameServerNetworkingSockets_SteamAPI", + "name_flat": "SteamAPI_SteamGameServerNetworkingSockets_SteamAPI_v012" + } + ], + "classname": "ISteamNetworkingSockets", + "fields": [], + "methods": [ + { + "methodname": "CreateListenSocketIP", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_CreateListenSocketIP", + "params": [ + { "paramname":"localAddress", "paramtype":"const SteamNetworkingIPAddr &" }, + { "paramname":"nOptions", "paramtype":"int" }, + { "paramname":"pOptions", "paramtype":"const SteamNetworkingConfigValue_t *" } + ], + "returntype": "HSteamListenSocket" + }, + { + "methodname": "ConnectByIPAddress", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_ConnectByIPAddress", + "params": [ + { "paramname":"address", "paramtype":"const SteamNetworkingIPAddr &" }, + { "paramname":"nOptions", "paramtype":"int" }, + { "paramname":"pOptions", "paramtype":"const SteamNetworkingConfigValue_t *" } + ], + "returntype": "HSteamNetConnection" + }, + { + "methodname": "CreateListenSocketP2P", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_CreateListenSocketP2P", + "params": [ + { "paramname":"nLocalVirtualPort", "paramtype":"int" }, + { "paramname":"nOptions", "paramtype":"int" }, + { "paramname":"pOptions", "paramtype":"const SteamNetworkingConfigValue_t *" } + ], + "returntype": "HSteamListenSocket" + }, + { + "methodname": "ConnectP2P", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_ConnectP2P", + "params": [ + { "paramname":"identityRemote", "paramtype":"const SteamNetworkingIdentity &" }, + { "paramname":"nRemoteVirtualPort", "paramtype":"int" }, + { "paramname":"nOptions", "paramtype":"int" }, + { "paramname":"pOptions", "paramtype":"const SteamNetworkingConfigValue_t *" } + ], + "returntype": "HSteamNetConnection" + }, + { + "methodname": "AcceptConnection", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_AcceptConnection", + "params": [ + { "paramname":"hConn", "paramtype":"HSteamNetConnection" } + ], + "returntype": "EResult" + }, + { + "methodname": "CloseConnection", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_CloseConnection", + "params": [ + { "paramname":"hPeer", "paramtype":"HSteamNetConnection" }, + { "paramname":"nReason", "paramtype":"int" }, + { "paramname":"pszDebug", "paramtype":"const char *" }, + { "paramname":"bEnableLinger", "paramtype":"bool" } + ], + "returntype": "bool" + }, + { + "methodname": "CloseListenSocket", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_CloseListenSocket", + "params": [ + { "paramname":"hSocket", "paramtype":"HSteamListenSocket" } + ], + "returntype": "bool" + }, + { + "methodname": "SetConnectionUserData", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_SetConnectionUserData", + "params": [ + { "paramname":"hPeer", "paramtype":"HSteamNetConnection" }, + { "paramname":"nUserData", "paramtype":"int64" } + ], + "returntype": "bool" + }, + { + "methodname": "GetConnectionUserData", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_GetConnectionUserData", + "params": [ + { "paramname":"hPeer", "paramtype":"HSteamNetConnection" } + ], + "returntype": "int64" + }, + { + "methodname": "SetConnectionName", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_SetConnectionName", + "params": [ + { "paramname":"hPeer", "paramtype":"HSteamNetConnection" }, + { "paramname":"pszName", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "GetConnectionName", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_GetConnectionName", + "params": [ + { "paramname":"hPeer", "paramtype":"HSteamNetConnection" }, + { "paramname":"pszName", "paramtype":"char *" }, + { "paramname":"nMaxLen", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "SendMessageToConnection", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_SendMessageToConnection", + "params": [ + { "paramname":"hConn", "paramtype":"HSteamNetConnection" }, + { "paramname":"pData", "paramtype":"const void *" }, + { "paramname":"cbData", "paramtype":"uint32" }, + { "paramname":"nSendFlags", "paramtype":"int" }, + { "paramname":"pOutMessageNumber", "paramtype":"int64 *" } + ], + "returntype": "EResult" + }, + { + "methodname": "SendMessages", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_SendMessages", + "params": [ + { "paramname":"nMessages", "paramtype":"int" }, + { "paramname":"pMessages", "paramtype":"SteamNetworkingMessage_t *const *" }, + { "paramname":"pOutMessageNumberOrResult", "paramtype":"int64 *" } + ], + "returntype": "void" + }, + { + "methodname": "FlushMessagesOnConnection", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_FlushMessagesOnConnection", + "params": [ + { "paramname":"hConn", "paramtype":"HSteamNetConnection" } + ], + "returntype": "EResult" + }, + { + "methodname": "ReceiveMessagesOnConnection", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_ReceiveMessagesOnConnection", + "params": [ + { "paramname":"hConn", "paramtype":"HSteamNetConnection" }, + { "paramname":"ppOutMessages", "paramtype":"SteamNetworkingMessage_t **" }, + { "paramname":"nMaxMessages", "paramtype":"int" } + ], + "returntype": "int" + }, + { + "methodname": "GetConnectionInfo", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_GetConnectionInfo", + "params": [ + { "paramname":"hConn", "paramtype":"HSteamNetConnection" }, + { "paramname":"pInfo", "paramtype":"SteamNetConnectionInfo_t *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetConnectionRealTimeStatus", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_GetConnectionRealTimeStatus", + "params": [ + { "paramname":"hConn", "paramtype":"HSteamNetConnection" }, + { "paramname":"pStatus", "paramtype":"SteamNetConnectionRealTimeStatus_t *" }, + { "paramname":"nLanes", "paramtype":"int" }, + { "paramname":"pLanes", "paramtype":"SteamNetConnectionRealTimeLaneStatus_t *" } + ], + "returntype": "EResult" + }, + { + "methodname": "GetDetailedConnectionStatus", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_GetDetailedConnectionStatus", + "params": [ + { "paramname":"hConn", "paramtype":"HSteamNetConnection" }, + { "paramname":"pszBuf", "paramtype":"char *" }, + { "paramname":"cbBuf", "paramtype":"int" } + ], + "returntype": "int" + }, + { + "methodname": "GetListenSocketAddress", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_GetListenSocketAddress", + "params": [ + { "paramname":"hSocket", "paramtype":"HSteamListenSocket" }, + { "paramname":"address", "paramtype":"SteamNetworkingIPAddr *" } + ], + "returntype": "bool" + }, + { + "methodname": "CreateSocketPair", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_CreateSocketPair", + "params": [ + { "paramname":"pOutConnection1", "paramtype":"HSteamNetConnection *" }, + { "paramname":"pOutConnection2", "paramtype":"HSteamNetConnection *" }, + { "paramname":"bUseNetworkLoopback", "paramtype":"bool" }, + { "paramname":"pIdentity1", "paramtype":"const SteamNetworkingIdentity *" }, + { "paramname":"pIdentity2", "paramtype":"const SteamNetworkingIdentity *" } + ], + "returntype": "bool" + }, + { + "methodname": "ConfigureConnectionLanes", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_ConfigureConnectionLanes", + "params": [ + { "paramname":"hConn", "paramtype":"HSteamNetConnection" }, + { "paramname":"nNumLanes", "paramtype":"int" }, + { "paramname":"pLanePriorities", "paramtype":"const int *" }, + { "paramname":"pLaneWeights", "paramtype":"const uint16 *" } + ], + "returntype": "EResult" + }, + { + "methodname": "GetIdentity", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_GetIdentity", + "params": [ + { "paramname":"pIdentity", "paramtype":"SteamNetworkingIdentity *" } + ], + "returntype": "bool" + }, + { + "methodname": "InitAuthentication", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_InitAuthentication", + "params": [], + "returntype": "ESteamNetworkingAvailability" + }, + { + "methodname": "GetAuthenticationStatus", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_GetAuthenticationStatus", + "params": [ + { "paramname":"pDetails", "paramtype":"SteamNetAuthenticationStatus_t *" } + ], + "returntype": "ESteamNetworkingAvailability" + }, + { + "methodname": "CreatePollGroup", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_CreatePollGroup", + "params": [], + "returntype": "HSteamNetPollGroup" + }, + { + "methodname": "DestroyPollGroup", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_DestroyPollGroup", + "params": [ + { "paramname":"hPollGroup", "paramtype":"HSteamNetPollGroup" } + ], + "returntype": "bool" + }, + { + "methodname": "SetConnectionPollGroup", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_SetConnectionPollGroup", + "params": [ + { "paramname":"hConn", "paramtype":"HSteamNetConnection" }, + { "paramname":"hPollGroup", "paramtype":"HSteamNetPollGroup" } + ], + "returntype": "bool" + }, + { + "methodname": "ReceiveMessagesOnPollGroup", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_ReceiveMessagesOnPollGroup", + "params": [ + { "paramname":"hPollGroup", "paramtype":"HSteamNetPollGroup" }, + { "paramname":"ppOutMessages", "paramtype":"SteamNetworkingMessage_t **" }, + { "paramname":"nMaxMessages", "paramtype":"int" } + ], + "returntype": "int" + }, + { + "methodname": "ReceivedRelayAuthTicket", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_ReceivedRelayAuthTicket", + "params": [ + { "paramname":"pvTicket", "paramtype":"const void *" }, + { "paramname":"cbTicket", "paramtype":"int" }, + { "paramname":"pOutParsedTicket", "paramtype":"SteamDatagramRelayAuthTicket *" } + ], + "returntype": "bool" + }, + { + "methodname": "FindRelayAuthTicketForServer", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_FindRelayAuthTicketForServer", + "params": [ + { "paramname":"identityGameServer", "paramtype":"const SteamNetworkingIdentity &" }, + { "paramname":"nRemoteVirtualPort", "paramtype":"int" }, + { "paramname":"pOutParsedTicket", "paramtype":"SteamDatagramRelayAuthTicket *" } + ], + "returntype": "int" + }, + { + "methodname": "ConnectToHostedDedicatedServer", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_ConnectToHostedDedicatedServer", + "params": [ + { "paramname":"identityTarget", "paramtype":"const SteamNetworkingIdentity &" }, + { "paramname":"nRemoteVirtualPort", "paramtype":"int" }, + { "paramname":"nOptions", "paramtype":"int" }, + { "paramname":"pOptions", "paramtype":"const SteamNetworkingConfigValue_t *" } + ], + "returntype": "HSteamNetConnection" + }, + { + "methodname": "GetHostedDedicatedServerPort", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_GetHostedDedicatedServerPort", + "params": [], + "returntype": "uint16" + }, + { + "methodname": "GetHostedDedicatedServerPOPID", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_GetHostedDedicatedServerPOPID", + "params": [], + "returntype": "SteamNetworkingPOPID" + }, + { + "methodname": "GetHostedDedicatedServerAddress", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_GetHostedDedicatedServerAddress", + "params": [ + { "paramname":"pRouting", "paramtype":"SteamDatagramHostedAddress *" } + ], + "returntype": "EResult" + }, + { + "methodname": "CreateHostedDedicatedServerListenSocket", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_CreateHostedDedicatedServerListenSocket", + "params": [ + { "paramname":"nLocalVirtualPort", "paramtype":"int" }, + { "paramname":"nOptions", "paramtype":"int" }, + { "paramname":"pOptions", "paramtype":"const SteamNetworkingConfigValue_t *" } + ], + "returntype": "HSteamListenSocket" + }, + { + "methodname": "GetGameCoordinatorServerLogin", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_GetGameCoordinatorServerLogin", + "params": [ + { "paramname":"pLoginInfo", "paramtype":"SteamDatagramGameCoordinatorServerLogin *" }, + { "paramname":"pcbSignedBlob", "paramtype":"int *" }, + { "paramname":"pBlob", "paramtype":"void *" } + ], + "returntype": "EResult" + }, + { + "methodname": "ConnectP2PCustomSignaling", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_ConnectP2PCustomSignaling", + "params": [ + { "paramname":"pSignaling", "paramtype":"ISteamNetworkingConnectionSignaling *" }, + { "paramname":"pPeerIdentity", "paramtype":"const SteamNetworkingIdentity *" }, + { "paramname":"nRemoteVirtualPort", "paramtype":"int" }, + { "paramname":"nOptions", "paramtype":"int" }, + { "paramname":"pOptions", "paramtype":"const SteamNetworkingConfigValue_t *" } + ], + "returntype": "HSteamNetConnection" + }, + { + "methodname": "ReceivedP2PCustomSignal", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_ReceivedP2PCustomSignal", + "params": [ + { "paramname":"pMsg", "paramtype":"const void *" }, + { "paramname":"cbMsg", "paramtype":"int" }, + { "paramname":"pContext", "paramtype":"ISteamNetworkingSignalingRecvContext *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetCertificateRequest", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_GetCertificateRequest", + "params": [ + { "paramname":"pcbBlob", "paramtype":"int *" }, + { "paramname":"pBlob", "paramtype":"void *" }, + { "paramname":"errMsg", "paramtype":"SteamNetworkingErrMsg &" } + ], + "returntype": "bool" + }, + { + "methodname": "SetCertificate", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_SetCertificate", + "params": [ + { "paramname":"pCertificate", "paramtype":"const void *" }, + { "paramname":"cbCertificate", "paramtype":"int" }, + { "paramname":"errMsg", "paramtype":"SteamNetworkingErrMsg &" } + ], + "returntype": "bool" + }, + { + "methodname": "ResetIdentity", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_ResetIdentity", + "params": [ + { "paramname":"pIdentity", "paramtype":"const SteamNetworkingIdentity *" } + ], + "returntype": "void" + }, + { + "methodname": "RunCallbacks", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_RunCallbacks", + "params": [], + "returntype": "void" + }, + { + "methodname": "BeginAsyncRequestFakeIP", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_BeginAsyncRequestFakeIP", + "params": [ + { "paramname":"nNumPorts", "paramtype":"int" } + ], + "returntype": "bool" + }, + { + "methodname": "GetFakeIP", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_GetFakeIP", + "params": [ + { "paramname":"idxFirstPort", "paramtype":"int" }, + { "paramname":"pInfo", "paramtype":"SteamNetworkingFakeIPResult_t *" } + ], + "returntype": "void" + }, + { + "methodname": "CreateListenSocketP2PFakeIP", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_CreateListenSocketP2PFakeIP", + "params": [ + { "paramname":"idxFakePort", "paramtype":"int" }, + { "paramname":"nOptions", "paramtype":"int" }, + { "paramname":"pOptions", "paramtype":"const SteamNetworkingConfigValue_t *" } + ], + "returntype": "HSteamListenSocket" + }, + { + "methodname": "GetRemoteFakeIPForConnection", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_GetRemoteFakeIPForConnection", + "params": [ + { "paramname":"hConn", "paramtype":"HSteamNetConnection" }, + { "paramname":"pOutAddr", "paramtype":"SteamNetworkingIPAddr *" } + ], + "returntype": "EResult" + }, + { + "methodname": "CreateFakeUDPPort", + "methodname_flat": "SteamAPI_ISteamNetworkingSockets_CreateFakeUDPPort", + "params": [ + { "paramname":"idxFakeServerPort", "paramtype":"int" } + ], + "returntype": "ISteamNetworkingFakeUDPPort *" + } + ], + "version_string": "SteamNetworkingSockets012" + }, + { + "accessors": [ + { + "kind": "global", + "name": "SteamNetworkingUtils_SteamAPI", + "name_flat": "SteamAPI_SteamNetworkingUtils_SteamAPI_v004" + } + ], + "classname": "ISteamNetworkingUtils", + "fields": [], + "methods": [ + { + "methodname": "AllocateMessage", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_AllocateMessage", + "params": [ + { "paramname":"cbAllocateBuffer", "paramtype":"int" } + ], + "returntype": "SteamNetworkingMessage_t *" + }, + { + "methodname": "InitRelayNetworkAccess", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_InitRelayNetworkAccess", + "params": [], + "returntype": "void" + }, + { + "methodname": "GetRelayNetworkStatus", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_GetRelayNetworkStatus", + "params": [ + { "paramname":"pDetails", "paramtype":"SteamRelayNetworkStatus_t *" } + ], + "returntype": "ESteamNetworkingAvailability" + }, + { + "methodname": "GetLocalPingLocation", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_GetLocalPingLocation", + "params": [ + { "paramname":"result", "paramtype":"SteamNetworkPingLocation_t &" } + ], + "returntype": "float" + }, + { + "methodname": "EstimatePingTimeBetweenTwoLocations", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_EstimatePingTimeBetweenTwoLocations", + "params": [ + { "paramname":"location1", "paramtype":"const SteamNetworkPingLocation_t &" }, + { "paramname":"location2", "paramtype":"const SteamNetworkPingLocation_t &" } + ], + "returntype": "int" + }, + { + "methodname": "EstimatePingTimeFromLocalHost", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_EstimatePingTimeFromLocalHost", + "params": [ + { "paramname":"remoteLocation", "paramtype":"const SteamNetworkPingLocation_t &" } + ], + "returntype": "int" + }, + { + "methodname": "ConvertPingLocationToString", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_ConvertPingLocationToString", + "params": [ + { "paramname":"location", "paramtype":"const SteamNetworkPingLocation_t &" }, + { "paramname":"pszBuf", "paramtype":"char *" }, + { "paramname":"cchBufSize", "paramtype":"int" } + ], + "returntype": "void" + }, + { + "methodname": "ParsePingLocationString", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_ParsePingLocationString", + "params": [ + { "paramname":"pszString", "paramtype":"const char *" }, + { "paramname":"result", "paramtype":"SteamNetworkPingLocation_t &" } + ], + "returntype": "bool" + }, + { + "methodname": "CheckPingDataUpToDate", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_CheckPingDataUpToDate", + "params": [ + { "paramname":"flMaxAgeSeconds", "paramtype":"float" } + ], + "returntype": "bool" + }, + { + "methodname": "GetPingToDataCenter", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_GetPingToDataCenter", + "params": [ + { "paramname":"popID", "paramtype":"SteamNetworkingPOPID" }, + { "paramname":"pViaRelayPoP", "paramtype":"SteamNetworkingPOPID *" } + ], + "returntype": "int" + }, + { + "methodname": "GetDirectPingToPOP", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_GetDirectPingToPOP", + "params": [ + { "paramname":"popID", "paramtype":"SteamNetworkingPOPID" } + ], + "returntype": "int" + }, + { + "methodname": "GetPOPCount", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_GetPOPCount", + "params": [], + "returntype": "int" + }, + { + "methodname": "GetPOPList", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_GetPOPList", + "params": [ + { "paramname":"list", "paramtype":"SteamNetworkingPOPID *" }, + { "paramname":"nListSz", "paramtype":"int" } + ], + "returntype": "int" + }, + { + "methodname": "GetLocalTimestamp", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_GetLocalTimestamp", + "params": [], + "returntype": "SteamNetworkingMicroseconds" + }, + { + "methodname": "SetDebugOutputFunction", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SetDebugOutputFunction", + "params": [ + { "paramname":"eDetailLevel", "paramtype":"ESteamNetworkingSocketsDebugOutputType" }, + { "paramname":"pfnFunc", "paramtype":"FSteamNetworkingSocketsDebugOutput" } + ], + "returntype": "void" + }, + { + "methodname": "IsFakeIPv4", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_IsFakeIPv4", + "params": [ + { "paramname":"nIPv4", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "GetIPv4FakeIPType", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_GetIPv4FakeIPType", + "params": [ + { "paramname":"nIPv4", "paramtype":"uint32" } + ], + "returntype": "ESteamNetworkingFakeIPType" + }, + { + "methodname": "GetRealIdentityForFakeIP", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_GetRealIdentityForFakeIP", + "params": [ + { "paramname":"fakeIP", "paramtype":"const SteamNetworkingIPAddr &" }, + { "paramname":"pOutRealIdentity", "paramtype":"SteamNetworkingIdentity *" } + ], + "returntype": "EResult" + }, + { + "methodname": "SetGlobalConfigValueInt32", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueInt32", + "params": [ + { "paramname":"eValue", "paramtype":"ESteamNetworkingConfigValue" }, + { "paramname":"val", "paramtype":"int32" } + ], + "returntype": "bool" + }, + { + "methodname": "SetGlobalConfigValueFloat", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueFloat", + "params": [ + { "paramname":"eValue", "paramtype":"ESteamNetworkingConfigValue" }, + { "paramname":"val", "paramtype":"float" } + ], + "returntype": "bool" + }, + { + "methodname": "SetGlobalConfigValueString", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueString", + "params": [ + { "paramname":"eValue", "paramtype":"ESteamNetworkingConfigValue" }, + { "paramname":"val", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetGlobalConfigValuePtr", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValuePtr", + "params": [ + { "paramname":"eValue", "paramtype":"ESteamNetworkingConfigValue" }, + { "paramname":"val", "paramtype":"void *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetConnectionConfigValueInt32", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SetConnectionConfigValueInt32", + "params": [ + { "paramname":"hConn", "paramtype":"HSteamNetConnection" }, + { "paramname":"eValue", "paramtype":"ESteamNetworkingConfigValue" }, + { "paramname":"val", "paramtype":"int32" } + ], + "returntype": "bool" + }, + { + "methodname": "SetConnectionConfigValueFloat", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SetConnectionConfigValueFloat", + "params": [ + { "paramname":"hConn", "paramtype":"HSteamNetConnection" }, + { "paramname":"eValue", "paramtype":"ESteamNetworkingConfigValue" }, + { "paramname":"val", "paramtype":"float" } + ], + "returntype": "bool" + }, + { + "methodname": "SetConnectionConfigValueString", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SetConnectionConfigValueString", + "params": [ + { "paramname":"hConn", "paramtype":"HSteamNetConnection" }, + { "paramname":"eValue", "paramtype":"ESteamNetworkingConfigValue" }, + { "paramname":"val", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetGlobalCallback_SteamNetConnectionStatusChanged", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_SteamNetConnectionStatusChanged", + "params": [ + { "paramname":"fnCallback", "paramtype":"FnSteamNetConnectionStatusChanged" } + ], + "returntype": "bool" + }, + { + "methodname": "SetGlobalCallback_SteamNetAuthenticationStatusChanged", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_SteamNetAuthenticationStatusChanged", + "params": [ + { "paramname":"fnCallback", "paramtype":"FnSteamNetAuthenticationStatusChanged" } + ], + "returntype": "bool" + }, + { + "methodname": "SetGlobalCallback_SteamRelayNetworkStatusChanged", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_SteamRelayNetworkStatusChanged", + "params": [ + { "paramname":"fnCallback", "paramtype":"FnSteamRelayNetworkStatusChanged" } + ], + "returntype": "bool" + }, + { + "methodname": "SetGlobalCallback_FakeIPResult", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_FakeIPResult", + "params": [ + { "paramname":"fnCallback", "paramtype":"FnSteamNetworkingFakeIPResult" } + ], + "returntype": "bool" + }, + { + "methodname": "SetGlobalCallback_MessagesSessionRequest", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_MessagesSessionRequest", + "params": [ + { "paramname":"fnCallback", "paramtype":"FnSteamNetworkingMessagesSessionRequest" } + ], + "returntype": "bool" + }, + { + "methodname": "SetGlobalCallback_MessagesSessionFailed", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_MessagesSessionFailed", + "params": [ + { "paramname":"fnCallback", "paramtype":"FnSteamNetworkingMessagesSessionFailed" } + ], + "returntype": "bool" + }, + { + "methodname": "SetConfigValue", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SetConfigValue", + "params": [ + { "paramname":"eValue", "paramtype":"ESteamNetworkingConfigValue" }, + { "paramname":"eScopeType", "paramtype":"ESteamNetworkingConfigScope" }, + { "paramname":"scopeObj", "paramtype":"intptr_t" }, + { "paramname":"eDataType", "paramtype":"ESteamNetworkingConfigDataType" }, + { "paramname":"pArg", "paramtype":"const void *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetConfigValueStruct", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SetConfigValueStruct", + "params": [ + { "paramname":"opt", "paramtype":"const SteamNetworkingConfigValue_t &" }, + { "paramname":"eScopeType", "paramtype":"ESteamNetworkingConfigScope" }, + { "paramname":"scopeObj", "paramtype":"intptr_t" } + ], + "returntype": "bool" + }, + { + "methodname": "GetConfigValue", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_GetConfigValue", + "params": [ + { "paramname":"eValue", "paramtype":"ESteamNetworkingConfigValue" }, + { "paramname":"eScopeType", "paramtype":"ESteamNetworkingConfigScope" }, + { "paramname":"scopeObj", "paramtype":"intptr_t" }, + { "paramname":"pOutDataType", "paramtype":"ESteamNetworkingConfigDataType *" }, + { "paramname":"pResult", "paramtype":"void *" }, + { "paramname":"cbResult", "paramtype":"size_t *" } + ], + "returntype": "ESteamNetworkingGetConfigValueResult" + }, + { + "methodname": "GetConfigValueInfo", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_GetConfigValueInfo", + "params": [ + { "paramname":"eValue", "paramtype":"ESteamNetworkingConfigValue" }, + { "paramname":"pOutDataType", "paramtype":"ESteamNetworkingConfigDataType *" }, + { "paramname":"pOutScope", "paramtype":"ESteamNetworkingConfigScope *" } + ], + "returntype": "const char *" + }, + { + "methodname": "IterateGenericEditableConfigValues", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_IterateGenericEditableConfigValues", + "params": [ + { "paramname":"eCurrent", "paramtype":"ESteamNetworkingConfigValue" }, + { "paramname":"bEnumerateDevVars", "paramtype":"bool" } + ], + "returntype": "ESteamNetworkingConfigValue" + }, + { + "methodname": "SteamNetworkingIPAddr_ToString", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_ToString", + "params": [ + { "paramname":"addr", "paramtype":"const SteamNetworkingIPAddr &" }, + { "paramname":"buf", "paramtype":"char *" }, + { "paramname":"cbBuf", "paramtype":"uint32" }, + { "paramname":"bWithPort", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "SteamNetworkingIPAddr_ParseString", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_ParseString", + "params": [ + { "paramname":"pAddr", "paramtype":"SteamNetworkingIPAddr *" }, + { "paramname":"pszStr", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "SteamNetworkingIPAddr_GetFakeIPType", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_GetFakeIPType", + "params": [ + { "paramname":"addr", "paramtype":"const SteamNetworkingIPAddr &" } + ], + "returntype": "ESteamNetworkingFakeIPType" + }, + { + "methodname": "SteamNetworkingIdentity_ToString", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SteamNetworkingIdentity_ToString", + "params": [ + { "paramname":"identity", "paramtype":"const SteamNetworkingIdentity &" }, + { "paramname":"buf", "paramtype":"char *" }, + { "paramname":"cbBuf", "paramtype":"uint32" } + ], + "returntype": "void" + }, + { + "methodname": "SteamNetworkingIdentity_ParseString", + "methodname_flat": "SteamAPI_ISteamNetworkingUtils_SteamNetworkingIdentity_ParseString", + "params": [ + { "paramname":"pIdentity", "paramtype":"SteamNetworkingIdentity *" }, + { "paramname":"pszStr", "paramtype":"const char *" } + ], + "returntype": "bool" + } + ], + "version_string": "SteamNetworkingUtils004" + }, + { + "accessors": [ + { + "kind": "gameserver", + "name": "SteamGameServer", + "name_flat": "SteamAPI_SteamGameServer_v015" + } + ], + "classname": "ISteamGameServer", + "fields": [], + "methods": [ + { + "methodname": "SetProduct", + "methodname_flat": "SteamAPI_ISteamGameServer_SetProduct", + "params": [ + { "paramname":"pszProduct", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "SetGameDescription", + "methodname_flat": "SteamAPI_ISteamGameServer_SetGameDescription", + "params": [ + { "paramname":"pszGameDescription", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "SetModDir", + "methodname_flat": "SteamAPI_ISteamGameServer_SetModDir", + "params": [ + { "paramname":"pszModDir", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "SetDedicatedServer", + "methodname_flat": "SteamAPI_ISteamGameServer_SetDedicatedServer", + "params": [ + { "paramname":"bDedicated", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "LogOn", + "methodname_flat": "SteamAPI_ISteamGameServer_LogOn", + "params": [ + { "paramname":"pszToken", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "LogOnAnonymous", + "methodname_flat": "SteamAPI_ISteamGameServer_LogOnAnonymous", + "params": [], + "returntype": "void" + }, + { + "methodname": "LogOff", + "methodname_flat": "SteamAPI_ISteamGameServer_LogOff", + "params": [], + "returntype": "void" + }, + { + "methodname": "BLoggedOn", + "methodname_flat": "SteamAPI_ISteamGameServer_BLoggedOn", + "params": [], + "returntype": "bool" + }, + { + "methodname": "BSecure", + "methodname_flat": "SteamAPI_ISteamGameServer_BSecure", + "params": [], + "returntype": "bool" + }, + { + "methodname": "GetSteamID", + "methodname_flat": "SteamAPI_ISteamGameServer_GetSteamID", + "params": [], + "returntype": "CSteamID", + "returntype_flat": "uint64_steamid" + }, + { + "methodname": "WasRestartRequested", + "methodname_flat": "SteamAPI_ISteamGameServer_WasRestartRequested", + "params": [], + "returntype": "bool" + }, + { + "methodname": "SetMaxPlayerCount", + "methodname_flat": "SteamAPI_ISteamGameServer_SetMaxPlayerCount", + "params": [ + { "paramname":"cPlayersMax", "paramtype":"int" } + ], + "returntype": "void" + }, + { + "methodname": "SetBotPlayerCount", + "methodname_flat": "SteamAPI_ISteamGameServer_SetBotPlayerCount", + "params": [ + { "paramname":"cBotplayers", "paramtype":"int" } + ], + "returntype": "void" + }, + { + "methodname": "SetServerName", + "methodname_flat": "SteamAPI_ISteamGameServer_SetServerName", + "params": [ + { "paramname":"pszServerName", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "SetMapName", + "methodname_flat": "SteamAPI_ISteamGameServer_SetMapName", + "params": [ + { "paramname":"pszMapName", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "SetPasswordProtected", + "methodname_flat": "SteamAPI_ISteamGameServer_SetPasswordProtected", + "params": [ + { "paramname":"bPasswordProtected", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "SetSpectatorPort", + "methodname_flat": "SteamAPI_ISteamGameServer_SetSpectatorPort", + "params": [ + { "paramname":"unSpectatorPort", "paramtype":"uint16" } + ], + "returntype": "void" + }, + { + "methodname": "SetSpectatorServerName", + "methodname_flat": "SteamAPI_ISteamGameServer_SetSpectatorServerName", + "params": [ + { "paramname":"pszSpectatorServerName", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "ClearAllKeyValues", + "methodname_flat": "SteamAPI_ISteamGameServer_ClearAllKeyValues", + "params": [], + "returntype": "void" + }, + { + "methodname": "SetKeyValue", + "methodname_flat": "SteamAPI_ISteamGameServer_SetKeyValue", + "params": [ + { "paramname":"pKey", "paramtype":"const char *" }, + { "paramname":"pValue", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "SetGameTags", + "methodname_flat": "SteamAPI_ISteamGameServer_SetGameTags", + "params": [ + { "paramname":"pchGameTags", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "SetGameData", + "methodname_flat": "SteamAPI_ISteamGameServer_SetGameData", + "params": [ + { "paramname":"pchGameData", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "SetRegion", + "methodname_flat": "SteamAPI_ISteamGameServer_SetRegion", + "params": [ + { "paramname":"pszRegion", "paramtype":"const char *" } + ], + "returntype": "void" + }, + { + "methodname": "SetAdvertiseServerActive", + "methodname_flat": "SteamAPI_ISteamGameServer_SetAdvertiseServerActive", + "params": [ + { "paramname":"bActive", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "GetAuthSessionTicket", + "methodname_flat": "SteamAPI_ISteamGameServer_GetAuthSessionTicket", + "params": [ + { "paramname":"pTicket", "paramtype":"void *" }, + { "paramname":"cbMaxTicket", "paramtype":"int" }, + { "paramname":"pcbTicket", "paramtype":"uint32 *" }, + { "paramname":"pSnid", "paramtype":"const SteamNetworkingIdentity *" } + ], + "returntype": "HAuthTicket" + }, + { + "methodname": "BeginAuthSession", + "methodname_flat": "SteamAPI_ISteamGameServer_BeginAuthSession", + "params": [ + { "paramname":"pAuthTicket", "paramtype":"const void *" }, + { "paramname":"cbAuthTicket", "paramtype":"int" }, + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "EBeginAuthSessionResult" + }, + { + "methodname": "EndAuthSession", + "methodname_flat": "SteamAPI_ISteamGameServer_EndAuthSession", + "params": [ + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "void" + }, + { + "methodname": "CancelAuthTicket", + "methodname_flat": "SteamAPI_ISteamGameServer_CancelAuthTicket", + "params": [ + { "paramname":"hAuthTicket", "paramtype":"HAuthTicket" } + ], + "returntype": "void" + }, + { + "methodname": "UserHasLicenseForApp", + "methodname_flat": "SteamAPI_ISteamGameServer_UserHasLicenseForApp", + "params": [ + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"appID", "paramtype":"AppId_t" } + ], + "returntype": "EUserHasLicenseForAppResult" + }, + { + "methodname": "RequestUserGroupStatus", + "methodname_flat": "SteamAPI_ISteamGameServer_RequestUserGroupStatus", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"steamIDGroup", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "bool" + }, + { + "methodname": "GetGameplayStats", + "methodname_flat": "SteamAPI_ISteamGameServer_GetGameplayStats", + "params": [], + "returntype": "void" + }, + { + "callresult": "GSReputation_t", + "methodname": "GetServerReputation", + "methodname_flat": "SteamAPI_ISteamGameServer_GetServerReputation", + "params": [], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetPublicIP", + "methodname_flat": "SteamAPI_ISteamGameServer_GetPublicIP", + "params": [], + "returntype": "SteamIPAddress_t" + }, + { + "methodname": "HandleIncomingPacket", + "methodname_flat": "SteamAPI_ISteamGameServer_HandleIncomingPacket", + "params": [ + { "paramname":"pData", "paramtype":"const void *" }, + { "paramname":"cbData", "paramtype":"int" }, + { "paramname":"srcIP", "paramtype":"uint32" }, + { "paramname":"srcPort", "paramtype":"uint16" } + ], + "returntype": "bool" + }, + { + "methodname": "GetNextOutgoingPacket", + "methodname_flat": "SteamAPI_ISteamGameServer_GetNextOutgoingPacket", + "params": [ + { "paramname":"pOut", "paramtype":"void *" }, + { "paramname":"cbMaxOut", "paramtype":"int" }, + { "paramname":"pNetAdr", "paramtype":"uint32 *" }, + { "paramname":"pPort", "paramtype":"uint16 *" } + ], + "returntype": "int" + }, + { + "callresult": "AssociateWithClanResult_t", + "methodname": "AssociateWithClan", + "methodname_flat": "SteamAPI_ISteamGameServer_AssociateWithClan", + "params": [ + { "paramname":"steamIDClan", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "SteamAPICall_t" + }, + { + "callresult": "ComputeNewPlayerCompatibilityResult_t", + "methodname": "ComputeNewPlayerCompatibility", + "methodname_flat": "SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility", + "params": [ + { "paramname":"steamIDNewPlayer", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "SendUserConnectAndAuthenticate_DEPRECATED", + "methodname_flat": "SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate_DEPRECATED", + "params": [ + { "paramname":"unIPClient", "paramtype":"uint32" }, + { "paramname":"pvAuthBlob", "paramtype":"const void *" }, + { "paramname":"cubAuthBlobSize", "paramtype":"uint32" }, + { "paramname":"pSteamIDUser", "paramtype":"CSteamID *" } + ], + "returntype": "bool" + }, + { + "methodname": "CreateUnauthenticatedUserConnection", + "methodname_flat": "SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection", + "params": [], + "returntype": "CSteamID", + "returntype_flat": "uint64_steamid" + }, + { + "methodname": "SendUserDisconnect_DEPRECATED", + "methodname_flat": "SteamAPI_ISteamGameServer_SendUserDisconnect_DEPRECATED", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "void" + }, + { + "methodname": "BUpdateUserData", + "methodname_flat": "SteamAPI_ISteamGameServer_BUpdateUserData", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchPlayerName", "paramtype":"const char *" }, + { "paramname":"uScore", "paramtype":"uint32" } + ], + "returntype": "bool" + } + ], + "version_string": "SteamGameServer015" + }, + { + "accessors": [ + { + "kind": "gameserver", + "name": "SteamGameServerStats", + "name_flat": "SteamAPI_SteamGameServerStats_v001" + } + ], + "classname": "ISteamGameServerStats", + "fields": [], + "methods": [ + { + "callresult": "GSStatsReceived_t", + "methodname": "RequestUserStats", + "methodname_flat": "SteamAPI_ISteamGameServerStats_RequestUserStats", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "GetUserStat", + "methodname_flat": "SteamAPI_ISteamGameServerStats_GetUserStatInt32", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"pData", "paramtype":"int32 *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetUserStat", + "methodname_flat": "SteamAPI_ISteamGameServerStats_GetUserStatFloat", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"pData", "paramtype":"float *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetUserAchievement", + "methodname_flat": "SteamAPI_ISteamGameServerStats_GetUserAchievement", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"pbAchieved", "paramtype":"bool *" } + ], + "returntype": "bool" + }, + { + "methodname": "SetUserStat", + "methodname_flat": "SteamAPI_ISteamGameServerStats_SetUserStatInt32", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"nData", "paramtype":"int32" } + ], + "returntype": "bool" + }, + { + "methodname": "SetUserStat", + "methodname_flat": "SteamAPI_ISteamGameServerStats_SetUserStatFloat", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"fData", "paramtype":"float" } + ], + "returntype": "bool" + }, + { + "methodname": "UpdateUserAvgRateStat", + "methodname_flat": "SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchName", "paramtype":"const char *" }, + { "paramname":"flCountThisSession", "paramtype":"float" }, + { "paramname":"dSessionLength", "paramtype":"double" } + ], + "returntype": "bool" + }, + { + "methodname": "SetUserAchievement", + "methodname_flat": "SteamAPI_ISteamGameServerStats_SetUserAchievement", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchName", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "ClearUserAchievement", + "methodname_flat": "SteamAPI_ISteamGameServerStats_ClearUserAchievement", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"pchName", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "callresult": "GSStatsStored_t", + "methodname": "StoreUserStats", + "methodname_flat": "SteamAPI_ISteamGameServerStats_StoreUserStats", + "params": [ + { "paramname":"steamIDUser", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "SteamAPICall_t" + } + ], + "version_string": "SteamGameServerStats001" + }, + { + "classname": "ISteamNetworkingFakeUDPPort", + "fields": [], + "methods": [ + { + "methodname": "DestroyFakeUDPPort", + "methodname_flat": "SteamAPI_ISteamNetworkingFakeUDPPort_DestroyFakeUDPPort", + "params": [], + "returntype": "void" + }, + { + "methodname": "SendMessageToFakeIP", + "methodname_flat": "SteamAPI_ISteamNetworkingFakeUDPPort_SendMessageToFakeIP", + "params": [ + { "paramname":"remoteAddress", "paramtype":"const SteamNetworkingIPAddr &" }, + { "paramname":"pData", "paramtype":"const void *" }, + { "paramname":"cbData", "paramtype":"uint32" }, + { "paramname":"nSendFlags", "paramtype":"int" } + ], + "returntype": "EResult" + }, + { + "methodname": "ReceiveMessages", + "methodname_flat": "SteamAPI_ISteamNetworkingFakeUDPPort_ReceiveMessages", + "params": [ + { "paramname":"ppOutMessages", "paramtype":"SteamNetworkingMessage_t **" }, + { "paramname":"nMaxMessages", "paramtype":"int" } + ], + "returntype": "int" + }, + { + "methodname": "ScheduleCleanup", + "methodname_flat": "SteamAPI_ISteamNetworkingFakeUDPPort_ScheduleCleanup", + "params": [ + { "paramname":"remoteAddress", "paramtype":"const SteamNetworkingIPAddr &" } + ], + "returntype": "void" + } + ] + } + ], + "structs": [ + { + "fields": [ + { "fieldname":"m_rgubIPv6", "fieldtype":"uint8 [16]" }, + { "fieldname":"m_eType", "fieldtype":"ESteamIPType" } + ], + "methods": [ + { + "methodname": "IsSet", + "methodname_flat": "SteamAPI_SteamIPAddress_t_IsSet", + "params": [], + "returntype": "bool" + } + ], + "struct": "SteamIPAddress_t" + }, + { + "fields": [ + { "fieldname":"m_gameID", "fieldtype":"CGameID" }, + { "fieldname":"m_unGameIP", "fieldtype":"uint32" }, + { "fieldname":"m_usGamePort", "fieldtype":"uint16" }, + { "fieldname":"m_usQueryPort", "fieldtype":"uint16" }, + { "fieldname":"m_steamIDLobby", "fieldtype":"CSteamID" } + ], + "struct": "FriendGameInfo_t" + }, + { + "fields": [ + { "fieldname":"m_szKey", "fieldtype":"char [256]" }, + { "fieldname":"m_szValue", "fieldtype":"char [256]" } + ], + "methods": [ + { + "methodname": "Construct", + "methodname_flat": "SteamAPI_MatchMakingKeyValuePair_t_Construct", + "params": [], + "returntype": "void" + } + ], + "struct": "MatchMakingKeyValuePair_t" + }, + { + "fields": [ + { + "fieldname": "m_usConnectionPort", + "fieldtype": "uint16", + "private": true + }, + { + "fieldname": "m_usQueryPort", + "fieldtype": "uint16", + "private": true + }, + { + "fieldname": "m_unIP", + "fieldtype": "uint32", + "private": true + } + ], + "methods": [ + { + "methodname": "Construct", + "methodname_flat": "SteamAPI_servernetadr_t_Construct", + "params": [], + "returntype": "void" + }, + { + "methodname": "Init", + "methodname_flat": "SteamAPI_servernetadr_t_Init", + "params": [ + { "paramname":"ip", "paramtype":"unsigned int" }, + { "paramname":"usQueryPort", "paramtype":"uint16" }, + { "paramname":"usConnectionPort", "paramtype":"uint16" } + ], + "returntype": "void" + }, + { + "methodname": "GetQueryPort", + "methodname_flat": "SteamAPI_servernetadr_t_GetQueryPort", + "params": [], + "returntype": "uint16" + }, + { + "methodname": "SetQueryPort", + "methodname_flat": "SteamAPI_servernetadr_t_SetQueryPort", + "params": [ + { "paramname":"usPort", "paramtype":"uint16" } + ], + "returntype": "void" + }, + { + "methodname": "GetConnectionPort", + "methodname_flat": "SteamAPI_servernetadr_t_GetConnectionPort", + "params": [], + "returntype": "uint16" + }, + { + "methodname": "SetConnectionPort", + "methodname_flat": "SteamAPI_servernetadr_t_SetConnectionPort", + "params": [ + { "paramname":"usPort", "paramtype":"uint16" } + ], + "returntype": "void" + }, + { + "methodname": "GetIP", + "methodname_flat": "SteamAPI_servernetadr_t_GetIP", + "params": [], + "returntype": "uint32" + }, + { + "methodname": "SetIP", + "methodname_flat": "SteamAPI_servernetadr_t_SetIP", + "params": [ + { "paramname":"unIP", "paramtype":"uint32" } + ], + "returntype": "void" + }, + { + "methodname": "GetConnectionAddressString", + "methodname_flat": "SteamAPI_servernetadr_t_GetConnectionAddressString", + "params": [], + "returntype": "const char *" + }, + { + "methodname": "GetQueryAddressString", + "methodname_flat": "SteamAPI_servernetadr_t_GetQueryAddressString", + "params": [], + "returntype": "const char *" + }, + { + "methodname": "operator<", + "methodname_flat": "SteamAPI_servernetadr_t_IsLessThan", + "params": [ + { "paramname":"netadr", "paramtype":"const servernetadr_t &" } + ], + "returntype": "bool" + }, + { + "methodname": "operator=", + "methodname_flat": "SteamAPI_servernetadr_t_Assign", + "params": [ + { "paramname":"that", "paramtype":"const servernetadr_t &" } + ], + "returntype": "void" + } + ], + "struct": "servernetadr_t" + }, + { + "fields": [ + { "fieldname":"m_NetAdr", "fieldtype":"servernetadr_t" }, + { "fieldname":"m_nPing", "fieldtype":"int" }, + { "fieldname":"m_bHadSuccessfulResponse", "fieldtype":"bool" }, + { "fieldname":"m_bDoNotRefresh", "fieldtype":"bool" }, + { "fieldname":"m_szGameDir", "fieldtype":"char [32]" }, + { "fieldname":"m_szMap", "fieldtype":"char [32]" }, + { "fieldname":"m_szGameDescription", "fieldtype":"char [64]" }, + { "fieldname":"m_nAppID", "fieldtype":"uint32" }, + { "fieldname":"m_nPlayers", "fieldtype":"int" }, + { "fieldname":"m_nMaxPlayers", "fieldtype":"int" }, + { "fieldname":"m_nBotPlayers", "fieldtype":"int" }, + { "fieldname":"m_bPassword", "fieldtype":"bool" }, + { "fieldname":"m_bSecure", "fieldtype":"bool" }, + { "fieldname":"m_ulTimeLastPlayed", "fieldtype":"uint32" }, + { "fieldname":"m_nServerVersion", "fieldtype":"int" }, + { + "fieldname": "m_szServerName", + "fieldtype": "char [64]", + "private": true + }, + { "fieldname":"m_szGameTags", "fieldtype":"char [128]" }, + { "fieldname":"m_steamID", "fieldtype":"CSteamID" } + ], + "methods": [ + { + "methodname": "Construct", + "methodname_flat": "SteamAPI_gameserveritem_t_Construct", + "params": [], + "returntype": "void" + }, + { + "methodname": "GetName", + "methodname_flat": "SteamAPI_gameserveritem_t_GetName", + "params": [], + "returntype": "const char *" + }, + { + "methodname": "SetName", + "methodname_flat": "SteamAPI_gameserveritem_t_SetName", + "params": [ + { "paramname":"pName", "paramtype":"const char *" } + ], + "returntype": "void" + } + ], + "struct": "gameserveritem_t" + }, + { + "fields": [ + { "fieldname":"m_eType", "fieldtype":"ESteamPartyBeaconLocationType" }, + { "fieldname":"m_ulLocationID", "fieldtype":"uint64" } + ], + "struct": "SteamPartyBeaconLocation_t" + }, + { + "fields": [ + { "fieldname":"m_ppStrings", "fieldtype":"const char **" }, + { "fieldname":"m_nNumStrings", "fieldtype":"int32" } + ], + "struct": "SteamParamStringArray_t" + }, + { + "fields": [ + { "fieldname":"m_steamIDUser", "fieldtype":"CSteamID" }, + { "fieldname":"m_nGlobalRank", "fieldtype":"int32" }, + { "fieldname":"m_nScore", "fieldtype":"int32" }, + { "fieldname":"m_cDetails", "fieldtype":"int32" }, + { "fieldname":"m_hUGC", "fieldtype":"UGCHandle_t" } + ], + "struct": "LeaderboardEntry_t" + }, + { + "fields": [ + { "fieldname":"m_bConnectionActive", "fieldtype":"uint8" }, + { "fieldname":"m_bConnecting", "fieldtype":"uint8" }, + { "fieldname":"m_eP2PSessionError", "fieldtype":"uint8" }, + { "fieldname":"m_bUsingRelay", "fieldtype":"uint8" }, + { "fieldname":"m_nBytesQueuedForSend", "fieldtype":"int32" }, + { "fieldname":"m_nPacketsQueuedForSend", "fieldtype":"int32" }, + { "fieldname":"m_nRemoteIP", "fieldtype":"uint32" }, + { "fieldname":"m_nRemotePort", "fieldtype":"uint16" } + ], + "struct": "P2PSessionState_t" + }, + { + "fields": [ + { "fieldname":"eMode", "fieldtype":"EInputSourceMode" }, + { "fieldname":"x", "fieldtype":"float" }, + { "fieldname":"y", "fieldtype":"float" }, + { "fieldname":"bActive", "fieldtype":"bool" } + ], + "struct": "InputAnalogActionData_t" + }, + { + "fields": [ + { "fieldname":"bState", "fieldtype":"bool" }, + { "fieldname":"bActive", "fieldtype":"bool" } + ], + "struct": "InputDigitalActionData_t" + }, + { + "fields": [ + { "fieldname":"rotQuatX", "fieldtype":"float" }, + { "fieldname":"rotQuatY", "fieldtype":"float" }, + { "fieldname":"rotQuatZ", "fieldtype":"float" }, + { "fieldname":"rotQuatW", "fieldtype":"float" }, + { "fieldname":"posAccelX", "fieldtype":"float" }, + { "fieldname":"posAccelY", "fieldtype":"float" }, + { "fieldname":"posAccelZ", "fieldtype":"float" }, + { "fieldname":"rotVelX", "fieldtype":"float" }, + { "fieldname":"rotVelY", "fieldtype":"float" }, + { "fieldname":"rotVelZ", "fieldtype":"float" } + ], + "struct": "InputMotionData_t" + }, + { + "fields": [ + { "fieldname":"controllerHandle", "fieldtype":"InputHandle_t" }, + { "fieldname":"eEventType", "fieldtype":"ESteamInputActionEventType" }, + { "fieldname":"analogAction", "fieldtype":"SteamInputActionEvent_t::AnalogAction_t" } + ], + "struct": "SteamInputActionEvent_t" + }, + { + "fields": [ + { "fieldname":"m_nPublishedFileId", "fieldtype":"PublishedFileId_t" }, + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_eFileType", "fieldtype":"EWorkshopFileType" }, + { "fieldname":"m_nCreatorAppID", "fieldtype":"AppId_t" }, + { "fieldname":"m_nConsumerAppID", "fieldtype":"AppId_t" }, + { "fieldname":"m_rgchTitle", "fieldtype":"char [129]" }, + { "fieldname":"m_rgchDescription", "fieldtype":"char [8000]" }, + { "fieldname":"m_ulSteamIDOwner", "fieldtype":"uint64" }, + { "fieldname":"m_rtimeCreated", "fieldtype":"uint32" }, + { "fieldname":"m_rtimeUpdated", "fieldtype":"uint32" }, + { "fieldname":"m_rtimeAddedToUserList", "fieldtype":"uint32" }, + { "fieldname":"m_eVisibility", "fieldtype":"ERemoteStoragePublishedFileVisibility" }, + { "fieldname":"m_bBanned", "fieldtype":"bool" }, + { "fieldname":"m_bAcceptedForUse", "fieldtype":"bool" }, + { "fieldname":"m_bTagsTruncated", "fieldtype":"bool" }, + { "fieldname":"m_rgchTags", "fieldtype":"char [1025]" }, + { "fieldname":"m_hFile", "fieldtype":"UGCHandle_t" }, + { "fieldname":"m_hPreviewFile", "fieldtype":"UGCHandle_t" }, + { "fieldname":"m_pchFileName", "fieldtype":"char [260]" }, + { "fieldname":"m_nFileSize", "fieldtype":"int32" }, + { "fieldname":"m_nPreviewFileSize", "fieldtype":"int32" }, + { "fieldname":"m_rgchURL", "fieldtype":"char [256]" }, + { "fieldname":"m_unVotesUp", "fieldtype":"uint32" }, + { "fieldname":"m_unVotesDown", "fieldtype":"uint32" }, + { "fieldname":"m_flScore", "fieldtype":"float" }, + { "fieldname":"m_unNumChildren", "fieldtype":"uint32" }, + { "fieldname":"m_ulTotalFilesSize", "fieldtype":"uint64" } + ], + "struct": "SteamUGCDetails_t" + }, + { + "fields": [ + { "fieldname":"m_itemId", "fieldtype":"SteamItemInstanceID_t" }, + { "fieldname":"m_iDefinition", "fieldtype":"SteamItemDef_t" }, + { "fieldname":"m_unQuantity", "fieldtype":"uint16" }, + { "fieldname":"m_unFlags", "fieldtype":"uint16" } + ], + "struct": "SteamItemDetails_t" + }, + { + "fields": [ + { "fieldname":"m_bAbsolute", "fieldtype":"bool" }, + { "fieldname":"m_flNormalizedX", "fieldtype":"float" }, + { "fieldname":"m_flNormalizedY", "fieldtype":"float" }, + { "fieldname":"m_nDeltaX", "fieldtype":"int" }, + { "fieldname":"m_nDeltaY", "fieldtype":"int" } + ], + "struct": "RemotePlayInputMouseMotion_t" + }, + { + "fields": [ + { "fieldname":"m_eDirection", "fieldtype":"ERemotePlayMouseWheelDirection" }, + { "fieldname":"m_flAmount", "fieldtype":"float" } + ], + "struct": "RemotePlayInputMouseWheel_t" + }, + { + "fields": [ + { "fieldname":"m_eScancode", "fieldtype":"int" }, + { "fieldname":"m_unModifiers", "fieldtype":"uint32" }, + { "fieldname":"m_unKeycode", "fieldtype":"uint32" } + ], + "struct": "RemotePlayInputKey_t" + }, + { + "fields": [ + { "fieldname":"m_unSessionID", "fieldtype":"RemotePlaySessionID_t" }, + { "fieldname":"m_eType", "fieldtype":"ERemotePlayInputType" }, + { "fieldname":"padding", "fieldtype":"char [56]" } + ], + "struct": "RemotePlayInput_t" + }, + { + "consts": [ + { "constname":"k_cchMaxString", "consttype":"int", "constval":"48" } + ], + "fields": [ + { "fieldname":"m_ipv6", "fieldtype":"uint8 [16]" }, + { "fieldname":"m_port", "fieldtype":"uint16" } + ], + "methods": [ + { + "methodname": "Clear", + "methodname_flat": "SteamAPI_SteamNetworkingIPAddr_Clear", + "params": [], + "returntype": "void" + }, + { + "methodname": "IsIPv6AllZeros", + "methodname_flat": "SteamAPI_SteamNetworkingIPAddr_IsIPv6AllZeros", + "params": [], + "returntype": "bool" + }, + { + "methodname": "SetIPv6", + "methodname_flat": "SteamAPI_SteamNetworkingIPAddr_SetIPv6", + "params": [ + { "paramname":"ipv6", "paramtype":"const uint8 *" }, + { "paramname":"nPort", "paramtype":"uint16" } + ], + "returntype": "void" + }, + { + "methodname": "SetIPv4", + "methodname_flat": "SteamAPI_SteamNetworkingIPAddr_SetIPv4", + "params": [ + { "paramname":"nIP", "paramtype":"uint32" }, + { "paramname":"nPort", "paramtype":"uint16" } + ], + "returntype": "void" + }, + { + "methodname": "IsIPv4", + "methodname_flat": "SteamAPI_SteamNetworkingIPAddr_IsIPv4", + "params": [], + "returntype": "bool" + }, + { + "methodname": "GetIPv4", + "methodname_flat": "SteamAPI_SteamNetworkingIPAddr_GetIPv4", + "params": [], + "returntype": "uint32" + }, + { + "methodname": "SetIPv6LocalHost", + "methodname_flat": "SteamAPI_SteamNetworkingIPAddr_SetIPv6LocalHost", + "params": [ + { "paramname":"nPort", "paramtype":"uint16" } + ], + "returntype": "void" + }, + { + "methodname": "IsLocalHost", + "methodname_flat": "SteamAPI_SteamNetworkingIPAddr_IsLocalHost", + "params": [], + "returntype": "bool" + }, + { + "methodname": "ToString", + "methodname_flat": "SteamAPI_SteamNetworkingIPAddr_ToString", + "params": [ + { "paramname":"buf", "paramtype":"char *" }, + { "paramname":"cbBuf", "paramtype":"uint32" }, + { "paramname":"bWithPort", "paramtype":"bool" } + ], + "returntype": "void" + }, + { + "methodname": "ParseString", + "methodname_flat": "SteamAPI_SteamNetworkingIPAddr_ParseString", + "params": [ + { "paramname":"pszStr", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "operator==", + "methodname_flat": "SteamAPI_SteamNetworkingIPAddr_IsEqualTo", + "params": [ + { "paramname":"x", "paramtype":"const SteamNetworkingIPAddr &" } + ], + "returntype": "bool" + }, + { + "methodname": "GetFakeIPType", + "methodname_flat": "SteamAPI_SteamNetworkingIPAddr_GetFakeIPType", + "params": [], + "returntype": "ESteamNetworkingFakeIPType" + }, + { + "methodname": "IsFakeIP", + "methodname_flat": "SteamAPI_SteamNetworkingIPAddr_IsFakeIP", + "params": [], + "returntype": "bool" + } + ], + "struct": "SteamNetworkingIPAddr" + }, + { + "consts": [ + { "constname":"k_cchMaxString", "consttype":"int", "constval":"128" }, + { "constname":"k_cchMaxGenericString", "consttype":"int", "constval":"32" }, + { "constname":"k_cchMaxXboxPairwiseID", "consttype":"int", "constval":"33" }, + { "constname":"k_cbMaxGenericBytes", "consttype":"int", "constval":"32" } + ], + "fields": [ + { "fieldname":"m_eType", "fieldtype":"ESteamNetworkingIdentityType" }, + { "fieldname":"m_cbSize", "fieldtype":"int" }, + { "fieldname":"m_szUnknownRawString", "fieldtype":"char [128]" } + ], + "methods": [ + { + "methodname": "Clear", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_Clear", + "params": [], + "returntype": "void" + }, + { + "methodname": "IsInvalid", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_IsInvalid", + "params": [], + "returntype": "bool" + }, + { + "methodname": "SetSteamID", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_SetSteamID", + "params": [ + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "void" + }, + { + "methodname": "GetSteamID", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_GetSteamID", + "params": [], + "returntype": "CSteamID", + "returntype_flat": "uint64_steamid" + }, + { + "methodname": "SetSteamID64", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_SetSteamID64", + "params": [ + { "paramname":"steamID", "paramtype":"uint64" } + ], + "returntype": "void" + }, + { + "methodname": "GetSteamID64", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_GetSteamID64", + "params": [], + "returntype": "uint64" + }, + { + "methodname": "SetXboxPairwiseID", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_SetXboxPairwiseID", + "params": [ + { "paramname":"pszString", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetXboxPairwiseID", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_GetXboxPairwiseID", + "params": [], + "returntype": "const char *" + }, + { + "methodname": "SetPSNID", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_SetPSNID", + "params": [ + { "paramname":"id", "paramtype":"uint64" } + ], + "returntype": "void" + }, + { + "methodname": "GetPSNID", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_GetPSNID", + "params": [], + "returntype": "uint64" + }, + { + "methodname": "SetIPAddr", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_SetIPAddr", + "params": [ + { "paramname":"addr", "paramtype":"const SteamNetworkingIPAddr &" } + ], + "returntype": "void" + }, + { + "methodname": "GetIPAddr", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_GetIPAddr", + "params": [], + "returntype": "const SteamNetworkingIPAddr *" + }, + { + "methodname": "SetIPv4Addr", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_SetIPv4Addr", + "params": [ + { "paramname":"nIPv4", "paramtype":"uint32" }, + { "paramname":"nPort", "paramtype":"uint16" } + ], + "returntype": "void" + }, + { + "methodname": "GetIPv4", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_GetIPv4", + "params": [], + "returntype": "uint32" + }, + { + "methodname": "GetFakeIPType", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_GetFakeIPType", + "params": [], + "returntype": "ESteamNetworkingFakeIPType" + }, + { + "methodname": "IsFakeIP", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_IsFakeIP", + "params": [], + "returntype": "bool" + }, + { + "methodname": "SetLocalHost", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_SetLocalHost", + "params": [], + "returntype": "void" + }, + { + "methodname": "IsLocalHost", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_IsLocalHost", + "params": [], + "returntype": "bool" + }, + { + "methodname": "SetGenericString", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_SetGenericString", + "params": [ + { "paramname":"pszString", "paramtype":"const char *" } + ], + "returntype": "bool" + }, + { + "methodname": "GetGenericString", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_GetGenericString", + "params": [], + "returntype": "const char *" + }, + { + "methodname": "SetGenericBytes", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_SetGenericBytes", + "params": [ + { "paramname":"data", "paramtype":"const void *" }, + { "paramname":"cbLen", "paramtype":"uint32" } + ], + "returntype": "bool" + }, + { + "methodname": "GetGenericBytes", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_GetGenericBytes", + "params": [ + { "paramname":"cbLen", "paramtype":"int &" } + ], + "returntype": "const uint8 *" + }, + { + "methodname": "operator==", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_IsEqualTo", + "params": [ + { "paramname":"x", "paramtype":"const SteamNetworkingIdentity &" } + ], + "returntype": "bool" + }, + { + "methodname": "ToString", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_ToString", + "params": [ + { "paramname":"buf", "paramtype":"char *" }, + { "paramname":"cbBuf", "paramtype":"uint32" } + ], + "returntype": "void" + }, + { + "methodname": "ParseString", + "methodname_flat": "SteamAPI_SteamNetworkingIdentity_ParseString", + "params": [ + { "paramname":"pszStr", "paramtype":"const char *" } + ], + "returntype": "bool" + } + ], + "struct": "SteamNetworkingIdentity" + }, + { + "fields": [ + { "fieldname":"m_identityRemote", "fieldtype":"SteamNetworkingIdentity" }, + { "fieldname":"m_nUserData", "fieldtype":"int64" }, + { "fieldname":"m_hListenSocket", "fieldtype":"HSteamListenSocket" }, + { "fieldname":"m_addrRemote", "fieldtype":"SteamNetworkingIPAddr" }, + { "fieldname":"m__pad1", "fieldtype":"uint16" }, + { "fieldname":"m_idPOPRemote", "fieldtype":"SteamNetworkingPOPID" }, + { "fieldname":"m_idPOPRelay", "fieldtype":"SteamNetworkingPOPID" }, + { "fieldname":"m_eState", "fieldtype":"ESteamNetworkingConnectionState" }, + { "fieldname":"m_eEndReason", "fieldtype":"int" }, + { "fieldname":"m_szEndDebug", "fieldtype":"char [128]" }, + { "fieldname":"m_szConnectionDescription", "fieldtype":"char [128]" }, + { "fieldname":"m_nFlags", "fieldtype":"int" }, + { "fieldname":"reserved", "fieldtype":"uint32 [63]" } + ], + "struct": "SteamNetConnectionInfo_t" + }, + { + "fields": [ + { "fieldname":"m_eState", "fieldtype":"ESteamNetworkingConnectionState" }, + { "fieldname":"m_nPing", "fieldtype":"int" }, + { "fieldname":"m_flConnectionQualityLocal", "fieldtype":"float" }, + { "fieldname":"m_flConnectionQualityRemote", "fieldtype":"float" }, + { "fieldname":"m_flOutPacketsPerSec", "fieldtype":"float" }, + { "fieldname":"m_flOutBytesPerSec", "fieldtype":"float" }, + { "fieldname":"m_flInPacketsPerSec", "fieldtype":"float" }, + { "fieldname":"m_flInBytesPerSec", "fieldtype":"float" }, + { "fieldname":"m_nSendRateBytesPerSecond", "fieldtype":"int" }, + { "fieldname":"m_cbPendingUnreliable", "fieldtype":"int" }, + { "fieldname":"m_cbPendingReliable", "fieldtype":"int" }, + { "fieldname":"m_cbSentUnackedReliable", "fieldtype":"int" }, + { "fieldname":"m_usecQueueTime", "fieldtype":"SteamNetworkingMicroseconds" }, + { "fieldname":"reserved", "fieldtype":"uint32 [16]" } + ], + "struct": "SteamNetConnectionRealTimeStatus_t" + }, + { + "fields": [ + { "fieldname":"m_cbPendingUnreliable", "fieldtype":"int" }, + { "fieldname":"m_cbPendingReliable", "fieldtype":"int" }, + { "fieldname":"m_cbSentUnackedReliable", "fieldtype":"int" }, + { "fieldname":"_reservePad1", "fieldtype":"int" }, + { "fieldname":"m_usecQueueTime", "fieldtype":"SteamNetworkingMicroseconds" }, + { "fieldname":"reserved", "fieldtype":"uint32 [10]" } + ], + "struct": "SteamNetConnectionRealTimeLaneStatus_t" + }, + { + "fields": [ + { "fieldname":"m_pData", "fieldtype":"void *" }, + { "fieldname":"m_cbSize", "fieldtype":"int" }, + { "fieldname":"m_conn", "fieldtype":"HSteamNetConnection" }, + { "fieldname":"m_identityPeer", "fieldtype":"SteamNetworkingIdentity" }, + { "fieldname":"m_nConnUserData", "fieldtype":"int64" }, + { "fieldname":"m_usecTimeReceived", "fieldtype":"SteamNetworkingMicroseconds" }, + { "fieldname":"m_nMessageNumber", "fieldtype":"int64" }, + { "fieldname":"m_pfnFreeData", "fieldtype":"void (*)(SteamNetworkingMessage_t *)" }, + { "fieldname":"m_pfnRelease", "fieldtype":"void (*)(SteamNetworkingMessage_t *)" }, + { "fieldname":"m_nChannel", "fieldtype":"int" }, + { "fieldname":"m_nFlags", "fieldtype":"int" }, + { "fieldname":"m_nUserData", "fieldtype":"int64" }, + { "fieldname":"m_idxLane", "fieldtype":"uint16" }, + { "fieldname":"_pad1__", "fieldtype":"uint16" } + ], + "methods": [ + { + "methodname": "Release", + "methodname_flat": "SteamAPI_SteamNetworkingMessage_t_Release", + "params": [], + "returntype": "void" + } + ], + "struct": "SteamNetworkingMessage_t" + }, + { + "fields": [ + { "fieldname":"m_data", "fieldtype":"uint8 [512]" } + ], + "struct": "SteamNetworkPingLocation_t" + }, + { + "fields": [ + { "fieldname":"m_eValue", "fieldtype":"ESteamNetworkingConfigValue" }, + { "fieldname":"m_eDataType", "fieldtype":"ESteamNetworkingConfigDataType" }, + { "fieldname":"m_int64", "fieldtype":"int64_t" } + ], + "methods": [ + { + "methodname": "SetInt32", + "methodname_flat": "SteamAPI_SteamNetworkingConfigValue_t_SetInt32", + "params": [ + { "paramname":"eVal", "paramtype":"ESteamNetworkingConfigValue" }, + { "paramname":"data", "paramtype":"int32_t" } + ], + "returntype": "void" + }, + { + "methodname": "SetInt64", + "methodname_flat": "SteamAPI_SteamNetworkingConfigValue_t_SetInt64", + "params": [ + { "paramname":"eVal", "paramtype":"ESteamNetworkingConfigValue" }, + { "paramname":"data", "paramtype":"int64_t" } + ], + "returntype": "void" + }, + { + "methodname": "SetFloat", + "methodname_flat": "SteamAPI_SteamNetworkingConfigValue_t_SetFloat", + "params": [ + { "paramname":"eVal", "paramtype":"ESteamNetworkingConfigValue" }, + { "paramname":"data", "paramtype":"float" } + ], + "returntype": "void" + }, + { + "methodname": "SetPtr", + "methodname_flat": "SteamAPI_SteamNetworkingConfigValue_t_SetPtr", + "params": [ + { "paramname":"eVal", "paramtype":"ESteamNetworkingConfigValue" }, + { "paramname":"data", "paramtype":"void *" } + ], + "returntype": "void" + }, + { + "methodname": "SetString", + "methodname_flat": "SteamAPI_SteamNetworkingConfigValue_t_SetString", + "params": [ + { "paramname":"eVal", "paramtype":"ESteamNetworkingConfigValue" }, + { "paramname":"data", "paramtype":"const char *" } + ], + "returntype": "void" + } + ], + "struct": "SteamNetworkingConfigValue_t" + }, + { + "fields": [ + { "fieldname":"m_cbSize", "fieldtype":"int" }, + { "fieldname":"m_data", "fieldtype":"char [128]" } + ], + "methods": [ + { + "methodname": "Clear", + "methodname_flat": "SteamAPI_SteamDatagramHostedAddress_Clear", + "params": [], + "returntype": "void" + }, + { + "methodname": "GetPopID", + "methodname_flat": "SteamAPI_SteamDatagramHostedAddress_GetPopID", + "params": [], + "returntype": "SteamNetworkingPOPID" + }, + { + "methodname": "SetDevAddress", + "methodname_flat": "SteamAPI_SteamDatagramHostedAddress_SetDevAddress", + "params": [ + { "paramname":"nIP", "paramtype":"uint32" }, + { "paramname":"nPort", "paramtype":"uint16" }, + { "paramname":"popid", "paramtype":"SteamNetworkingPOPID" } + ], + "returntype": "void" + } + ], + "struct": "SteamDatagramHostedAddress" + }, + { + "fields": [ + { "fieldname":"m_identity", "fieldtype":"SteamNetworkingIdentity" }, + { "fieldname":"m_routing", "fieldtype":"SteamDatagramHostedAddress" }, + { "fieldname":"m_nAppID", "fieldtype":"AppId_t" }, + { "fieldname":"m_rtime", "fieldtype":"RTime32" }, + { "fieldname":"m_cbAppData", "fieldtype":"int" }, + { "fieldname":"m_appData", "fieldtype":"char [2048]" } + ], + "struct": "SteamDatagramGameCoordinatorServerLogin" + } + ], + "typedefs": [ + { "typedef":"uint8", "type":"unsigned char" }, + { "typedef":"int8", "type":"signed char" }, + { "typedef":"int16", "type":"short" }, + { "typedef":"uint16", "type":"unsigned short" }, + { "typedef":"int32", "type":"int" }, + { "typedef":"uint32", "type":"unsigned int" }, + { "typedef":"int64", "type":"long long" }, + { "typedef":"uint64", "type":"unsigned long long" }, + { "typedef":"lint64", "type":"long long" }, + { "typedef":"ulint64", "type":"unsigned long long" }, + { "typedef":"intp", "type":"long long" }, + { "typedef":"uintp", "type":"unsigned long long" }, + { "typedef":"AppId_t", "type":"unsigned int" }, + { "typedef":"DepotId_t", "type":"unsigned int" }, + { "typedef":"RTime32", "type":"unsigned int" }, + { "typedef":"SteamAPICall_t", "type":"unsigned long long" }, + { "typedef":"AccountID_t", "type":"unsigned int" }, + { "typedef":"PartyBeaconID_t", "type":"unsigned long long" }, + { "typedef":"HAuthTicket", "type":"unsigned int" }, + { "typedef":"PFNPreMinidumpCallback", "type":"void (*)(void *)" }, + { "typedef":"HSteamPipe", "type":"int" }, + { "typedef":"HSteamUser", "type":"int" }, + { "typedef":"SteamErrMsg", "type":"char [1024]" }, + { "typedef":"FriendsGroupID_t", "type":"short" }, + { "typedef":"HServerListRequest", "type":"void *" }, + { "typedef":"HServerQuery", "type":"int" }, + { "typedef":"UGCHandle_t", "type":"unsigned long long" }, + { "typedef":"PublishedFileUpdateHandle_t", "type":"unsigned long long" }, + { "typedef":"PublishedFileId_t", "type":"unsigned long long" }, + { "typedef":"UGCFileWriteStreamHandle_t", "type":"unsigned long long" }, + { "typedef":"SteamLeaderboard_t", "type":"unsigned long long" }, + { "typedef":"SteamLeaderboardEntries_t", "type":"unsigned long long" }, + { "typedef":"SNetSocket_t", "type":"unsigned int" }, + { "typedef":"SNetListenSocket_t", "type":"unsigned int" }, + { "typedef":"ScreenshotHandle", "type":"unsigned int" }, + { "typedef":"HTTPRequestHandle", "type":"unsigned int" }, + { "typedef":"HTTPCookieContainerHandle", "type":"unsigned int" }, + { "typedef":"InputHandle_t", "type":"unsigned long long" }, + { "typedef":"InputActionSetHandle_t", "type":"unsigned long long" }, + { "typedef":"InputDigitalActionHandle_t", "type":"unsigned long long" }, + { "typedef":"InputAnalogActionHandle_t", "type":"unsigned long long" }, + { "typedef":"SteamInputActionEventCallbackPointer", "type":"void (*)(SteamInputActionEvent_t *)" }, + { "typedef":"ControllerHandle_t", "type":"unsigned long long" }, + { "typedef":"ControllerActionSetHandle_t", "type":"unsigned long long" }, + { "typedef":"ControllerDigitalActionHandle_t", "type":"unsigned long long" }, + { "typedef":"ControllerAnalogActionHandle_t", "type":"unsigned long long" }, + { "typedef":"UGCQueryHandle_t", "type":"unsigned long long" }, + { "typedef":"UGCUpdateHandle_t", "type":"unsigned long long" }, + { "typedef":"HHTMLBrowser", "type":"unsigned int" }, + { "typedef":"SteamItemInstanceID_t", "type":"unsigned long long" }, + { "typedef":"SteamItemDef_t", "type":"int" }, + { "typedef":"SteamInventoryResult_t", "type":"int" }, + { "typedef":"SteamInventoryUpdateHandle_t", "type":"unsigned long long" }, + { "typedef":"TimelineEventHandle_t", "type":"unsigned long long" }, + { "typedef":"RemotePlaySessionID_t", "type":"unsigned int" }, + { "typedef":"RemotePlayCursorID_t", "type":"unsigned int" }, + { "typedef":"FnSteamNetConnectionStatusChanged", "type":"void (*)(SteamNetConnectionStatusChangedCallback_t *)" }, + { "typedef":"FnSteamNetAuthenticationStatusChanged", "type":"void (*)(SteamNetAuthenticationStatus_t *)" }, + { "typedef":"FnSteamRelayNetworkStatusChanged", "type":"void (*)(SteamRelayNetworkStatus_t *)" }, + { "typedef":"FnSteamNetworkingMessagesSessionRequest", "type":"void (*)(SteamNetworkingMessagesSessionRequest_t *)" }, + { "typedef":"FnSteamNetworkingMessagesSessionFailed", "type":"void (*)(SteamNetworkingMessagesSessionFailed_t *)" }, + { "typedef":"FnSteamNetworkingFakeIPResult", "type":"void (*)(SteamNetworkingFakeIPResult_t *)" }, + { "typedef":"HSteamNetConnection", "type":"unsigned int" }, + { "typedef":"HSteamListenSocket", "type":"unsigned int" }, + { "typedef":"HSteamNetPollGroup", "type":"unsigned int" }, + { "typedef":"SteamNetworkingErrMsg", "type":"char [1024]" }, + { "typedef":"SteamNetworkingPOPID", "type":"unsigned int" }, + { "typedef":"SteamNetworkingMicroseconds", "type":"long long" }, + { "typedef":"FSteamNetworkingSocketsDebugOutput", "type":"void (*)(ESteamNetworkingSocketsDebugOutputType, const char *)" } + ] +} diff --git a/external/steamworks/public/steam/steam_api_common.h b/external/steamworks/public/steam/steam_api_common.h new file mode 100644 index 0000000..f71a39c --- /dev/null +++ b/external/steamworks/public/steam/steam_api_common.h @@ -0,0 +1,249 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Steamworks SDK minimal include +// +// Defines the minimal set of things we need to use any single interface +// or register for any callback. +// +//============================================================================= + +#ifndef STEAM_API_COMMON_H +#define STEAM_API_COMMON_H + +#include "steamtypes.h" +#include "steamclientpublic.h" + +// S_API defines the linkage and calling conventions for steam_api.dll exports +#if defined( _WIN32 ) && !defined( _X360 ) + #if defined( STEAM_API_EXPORTS ) + #define S_API extern "C" __declspec( dllexport ) + #elif defined( STEAM_API_NODLL ) + #define S_API extern "C" + #else + #define S_API extern "C" __declspec( dllimport ) + #endif // STEAM_API_EXPORTS +#elif defined( __GNUC__ ) + #if defined( STEAM_API_EXPORTS ) + #define S_API extern "C" __attribute__ ((visibility("default"))) + #else + #define S_API extern "C" + #endif // STEAM_API_EXPORTS +#else // !WIN32 + #if defined( STEAM_API_EXPORTS ) + #define S_API extern "C" + #else + #define S_API extern "C" + #endif // STEAM_API_EXPORTS +#endif + +#if defined( __cplusplus ) && ( __cplusplus >= 201103L ) + #define S_OVERRIDE override +#else + #define S_OVERRIDE +#endif + +#if ( defined(STEAM_API_EXPORTS) || defined(STEAM_API_NODLL) ) && !defined(API_GEN) +#define STEAM_PRIVATE_API( ... ) __VA_ARGS__ +#elif defined(STEAM_API_EXPORTS) && defined(API_GEN) +#define STEAM_PRIVATE_API( ... ) +#else +#define STEAM_PRIVATE_API( ... ) protected: __VA_ARGS__ public: +#endif + +// handle to a communication pipe to the Steam client +typedef int32 HSteamPipe; +// handle to single instance of a steam user +typedef int32 HSteamUser; + +// A fixed size buffer to receive an error message that is returned by some API +// calls. +const int k_cchMaxSteamErrMsg = 1024; +typedef char SteamErrMsg[ k_cchMaxSteamErrMsg ]; + +// #define away __cdecl on posix. +// This is really, really bad. We're sorry. But it's been this way for +// a long time now and it's scary to change it, as there may be others that +// depend on it. +#ifndef _WIN32 + #define __cdecl +#endif + +// function prototype +extern "C" typedef void ( S_CALLTYPE *SteamAPIWarningMessageHook_t )( int, const char * ); +extern "C" typedef uint32 ( S_CALLTYPE *SteamAPI_CheckCallbackRegistered_t )( int iCallbackNum ); +#if defined( __SNC__ ) + #pragma diag_suppress=1700 // warning 1700: class "%s" has virtual functions but non-virtual destructor +#endif + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// steam callback and call-result helpers +// +// The following macros and classes are used to register your application for +// callbacks and call-results, which are delivered in a predictable manner. +// +// STEAM_CALLBACK macros are meant for use inside of a C++ class definition. +// They map a Steam notification callback directly to a class member function +// which is automatically prototyped as "void func( callback_type *pParam )". +// +// CCallResult is used with specific Steam APIs that return "result handles". +// The handle can be passed to a CCallResult object's Set function, along with +// an object pointer and member-function pointer. The member function will +// be executed once the results of the Steam API call are available. +// +// CCallback and CCallbackManual classes can be used instead of STEAM_CALLBACK +// macros if you require finer control over registration and unregistration. +// +// Callbacks and call-results are queued automatically and are only +// delivered/executed when your application calls SteamAPI_RunCallbacks(). +// +// Note that there is an alternative, lower level callback dispatch mechanism. +// See SteamAPI_ManualDispatch_Init +//----------------------------------------------------------------------------------------------------------------------------------------------------------// + +// Dispatch all queued Steamworks callbacks. +// +// This is safe to call from multiple threads simultaneously, +// but if you choose to do this, callback code could be executed on any thread. +// One alternative is to call SteamAPI_RunCallbacks from the main thread only, +// and call SteamAPI_ReleaseCurrentThreadMemory regularly on other threads. +S_API void S_CALLTYPE SteamAPI_RunCallbacks(); + +// Declares a callback member function plus a helper member variable which +// registers the callback on object creation and unregisters on destruction. +// The optional fourth 'var' param exists only for backwards-compatibility +// and can be ignored. +#define STEAM_CALLBACK( thisclass, func, .../*callback_type, [deprecated] var*/ ) \ + _STEAM_CALLBACK_SELECT( ( __VA_ARGS__, 4, 3 ), ( /**/, thisclass, func, __VA_ARGS__ ) ) + +// Declares a callback function and a named CCallbackManual variable which +// has Register and Unregister functions instead of automatic registration. +#define STEAM_CALLBACK_MANUAL( thisclass, func, callback_type, var ) \ + CCallbackManual< thisclass, callback_type > var; void func( callback_type *pParam ) + +// Dispatch callbacks relevant to the gameserver client and interfaces. +// To register for these, you need to use STEAM_GAMESERVER_CALLBACK. +// (Or call SetGameserverFlag on your CCallbackBase object.) +S_API void S_CALLTYPE SteamGameServer_RunCallbacks(); + +// Same as STEAM_CALLBACK, but for callbacks on the gameserver interface. +// These will be dispatched during SteamGameServer_RunCallbacks +#define STEAM_GAMESERVER_CALLBACK( thisclass, func, /*callback_type, [deprecated] var*/... ) \ + _STEAM_CALLBACK_SELECT( ( __VA_ARGS__, GS, 3 ), ( this->SetGameserverFlag();, thisclass, func, __VA_ARGS__ ) ) +#define STEAM_GAMESERVER_CALLBACK_MANUAL( thisclass, func, callback_type, var ) \ + CCallbackManual< thisclass, callback_type, true > var; void func( callback_type *pParam ) + +//----------------------------------------------------------------------------- +// Purpose: base for callbacks and call results - internal implementation detail +//----------------------------------------------------------------------------- +class CCallbackBase +{ +public: + CCallbackBase() { m_nCallbackFlags = 0; m_iCallback = 0; } + // don't add a virtual destructor because we export this binary interface across dll's + virtual void Run( void *pvParam ) = 0; + virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ) = 0; + int GetICallback() { return m_iCallback; } + virtual int GetCallbackSizeBytes() = 0; + +protected: + enum { k_ECallbackFlagsRegistered = 0x01, k_ECallbackFlagsGameServer = 0x02 }; + uint8 m_nCallbackFlags; + int m_iCallback; + friend class CCallbackMgr; + +private: + CCallbackBase( const CCallbackBase& ); + CCallbackBase& operator=( const CCallbackBase& ); +}; + +//----------------------------------------------------------------------------- +// Purpose: templated base for callbacks - internal implementation detail +//----------------------------------------------------------------------------- +template< int sizeof_P > +class CCallbackImpl : protected CCallbackBase +{ +public: + virtual ~CCallbackImpl() { if ( m_nCallbackFlags & k_ECallbackFlagsRegistered ) SteamAPI_UnregisterCallback( this ); } + void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; } + +protected: + friend class CCallbackMgr; + virtual void Run( void *pvParam ) S_OVERRIDE = 0; + virtual void Run( void *pvParam, bool /*bIOFailure*/, SteamAPICall_t /*hSteamAPICall*/ ) S_OVERRIDE { Run( pvParam ); } + virtual int GetCallbackSizeBytes() S_OVERRIDE { return sizeof_P; } +}; + + +//----------------------------------------------------------------------------- +// Purpose: maps a steam async call result to a class member function +// template params: T = local class, P = parameter struct +//----------------------------------------------------------------------------- +template< class T, class P > +class CCallResult : private CCallbackBase +{ +public: + typedef void (T::*func_t)( P*, bool ); + + CCallResult(); + ~CCallResult(); + + void Set( SteamAPICall_t hAPICall, T *p, func_t func ); + bool IsActive() const; + void Cancel(); + + void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; } +private: + virtual void Run( void *pvParam ) S_OVERRIDE; + virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ) S_OVERRIDE; + virtual int GetCallbackSizeBytes() S_OVERRIDE { return sizeof( P ); } + + SteamAPICall_t m_hAPICall; + T *m_pObj; + func_t m_Func; +}; + + + +//----------------------------------------------------------------------------- +// Purpose: maps a steam callback to a class member function +// template params: T = local class, P = parameter struct, +// bGameserver = listen for gameserver callbacks instead of client callbacks +//----------------------------------------------------------------------------- +template< class T, class P, bool bGameserver = false > +class CCallback : public CCallbackImpl< sizeof( P ) > +{ +public: + typedef void (T::*func_t)(P*); + + // NOTE: If you can't provide the correct parameters at construction time, you should + // use the CCallbackManual callback object (STEAM_CALLBACK_MANUAL macro) instead. + CCallback( T *pObj, func_t func ); + + void Register( T *pObj, func_t func ); + void Unregister(); + +protected: + virtual void Run( void *pvParam ) S_OVERRIDE; + + T *m_pObj; + func_t m_Func; +}; + + +//----------------------------------------------------------------------------- +// Purpose: subclass of CCallback which allows default-construction in +// an unregistered state; you must call Register manually +//----------------------------------------------------------------------------- +template< class T, class P, bool bGameServer = false > +class CCallbackManual : public CCallback< T, P, bGameServer > +{ +public: + CCallbackManual() : CCallback< T, P, bGameServer >( nullptr, nullptr ) {} + + // Inherits public Register and Unregister functions from base class +}; + +// Internal implementation details for all of the above +#include "steam_api_internal.h" + +#endif // STEAM_API_COMMON_H diff --git a/external/steamworks/public/steam/steam_api_flat.h b/external/steamworks/public/steam/steam_api_flat.h new file mode 100644 index 0000000..a95e1ed --- /dev/null +++ b/external/steamworks/public/steam/steam_api_flat.h @@ -0,0 +1,1304 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Purpose: Header for "flat" SteamAPI. Use this for binding to other languages. +// This file is auto-generated, do not edit it. +// +//============================================================================= + +#ifndef STEAMAPIFLAT_H +#define STEAMAPIFLAT_H + +#include "steam/steam_api.h" +#include "steam/isteamgameserver.h" +#include "steam/isteamgameserverstats.h" + +typedef uint64 uint64_steamid; // Used when passing or returning CSteamID +typedef uint64 uint64_gameid; // Used when passing or return CGameID + + + +// ISteamClient +S_API HSteamPipe SteamAPI_ISteamClient_CreateSteamPipe( ISteamClient* self ); +S_API bool SteamAPI_ISteamClient_BReleaseSteamPipe( ISteamClient* self, HSteamPipe hSteamPipe ); +S_API HSteamUser SteamAPI_ISteamClient_ConnectToGlobalUser( ISteamClient* self, HSteamPipe hSteamPipe ); +S_API HSteamUser SteamAPI_ISteamClient_CreateLocalUser( ISteamClient* self, HSteamPipe * phSteamPipe, EAccountType eAccountType ); +S_API void SteamAPI_ISteamClient_ReleaseUser( ISteamClient* self, HSteamPipe hSteamPipe, HSteamUser hUser ); +S_API ISteamUser * SteamAPI_ISteamClient_GetISteamUser( ISteamClient* self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamGameServer * SteamAPI_ISteamClient_GetISteamGameServer( ISteamClient* self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API void SteamAPI_ISteamClient_SetLocalIPBinding( ISteamClient* self, const SteamIPAddress_t & unIP, uint16 usPort ); +S_API ISteamFriends * SteamAPI_ISteamClient_GetISteamFriends( ISteamClient* self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamUtils * SteamAPI_ISteamClient_GetISteamUtils( ISteamClient* self, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamMatchmaking * SteamAPI_ISteamClient_GetISteamMatchmaking( ISteamClient* self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamMatchmakingServers * SteamAPI_ISteamClient_GetISteamMatchmakingServers( ISteamClient* self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API void * SteamAPI_ISteamClient_GetISteamGenericInterface( ISteamClient* self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamUserStats * SteamAPI_ISteamClient_GetISteamUserStats( ISteamClient* self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamGameServerStats * SteamAPI_ISteamClient_GetISteamGameServerStats( ISteamClient* self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamApps * SteamAPI_ISteamClient_GetISteamApps( ISteamClient* self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamNetworking * SteamAPI_ISteamClient_GetISteamNetworking( ISteamClient* self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamRemoteStorage * SteamAPI_ISteamClient_GetISteamRemoteStorage( ISteamClient* self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamScreenshots * SteamAPI_ISteamClient_GetISteamScreenshots( ISteamClient* self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamGameSearch * SteamAPI_ISteamClient_GetISteamGameSearch( ISteamClient* self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API uint32 SteamAPI_ISteamClient_GetIPCCallCount( ISteamClient* self ); +S_API void SteamAPI_ISteamClient_SetWarningMessageHook( ISteamClient* self, SteamAPIWarningMessageHook_t pFunction ); +S_API bool SteamAPI_ISteamClient_BShutdownIfAllPipesClosed( ISteamClient* self ); +S_API ISteamHTTP * SteamAPI_ISteamClient_GetISteamHTTP( ISteamClient* self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamController * SteamAPI_ISteamClient_GetISteamController( ISteamClient* self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamUGC * SteamAPI_ISteamClient_GetISteamUGC( ISteamClient* self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamMusic * SteamAPI_ISteamClient_GetISteamMusic( ISteamClient* self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamMusicRemote * SteamAPI_ISteamClient_GetISteamMusicRemote( ISteamClient* self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamHTMLSurface * SteamAPI_ISteamClient_GetISteamHTMLSurface( ISteamClient* self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamInventory * SteamAPI_ISteamClient_GetISteamInventory( ISteamClient* self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamVideo * SteamAPI_ISteamClient_GetISteamVideo( ISteamClient* self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamParentalSettings * SteamAPI_ISteamClient_GetISteamParentalSettings( ISteamClient* self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamInput * SteamAPI_ISteamClient_GetISteamInput( ISteamClient* self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamParties * SteamAPI_ISteamClient_GetISteamParties( ISteamClient* self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion ); +S_API ISteamRemotePlay * SteamAPI_ISteamClient_GetISteamRemotePlay( ISteamClient* self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion ); + +// ISteamUser + +// A versioned accessor is exported by the library +S_API ISteamUser *SteamAPI_SteamUser_v023(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamUser(), but using this ensures that you are using a matching library. +inline ISteamUser *SteamAPI_SteamUser() { return SteamAPI_SteamUser_v023(); } +S_API HSteamUser SteamAPI_ISteamUser_GetHSteamUser( ISteamUser* self ); +S_API bool SteamAPI_ISteamUser_BLoggedOn( ISteamUser* self ); +S_API uint64_steamid SteamAPI_ISteamUser_GetSteamID( ISteamUser* self ); +S_API int SteamAPI_ISteamUser_InitiateGameConnection_DEPRECATED( ISteamUser* self, void * pAuthBlob, int cbMaxAuthBlob, uint64_steamid steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure ); +S_API void SteamAPI_ISteamUser_TerminateGameConnection_DEPRECATED( ISteamUser* self, uint32 unIPServer, uint16 usPortServer ); +S_API void SteamAPI_ISteamUser_TrackAppUsageEvent( ISteamUser* self, uint64_gameid gameID, int eAppUsageEvent, const char * pchExtraInfo ); +S_API bool SteamAPI_ISteamUser_GetUserDataFolder( ISteamUser* self, char * pchBuffer, int cubBuffer ); +S_API void SteamAPI_ISteamUser_StartVoiceRecording( ISteamUser* self ); +S_API void SteamAPI_ISteamUser_StopVoiceRecording( ISteamUser* self ); +S_API EVoiceResult SteamAPI_ISteamUser_GetAvailableVoice( ISteamUser* self, uint32 * pcbCompressed, uint32 * pcbUncompressed_Deprecated, uint32 nUncompressedVoiceDesiredSampleRate_Deprecated ); +S_API EVoiceResult SteamAPI_ISteamUser_GetVoice( ISteamUser* self, bool bWantCompressed, void * pDestBuffer, uint32 cbDestBufferSize, uint32 * nBytesWritten, bool bWantUncompressed_Deprecated, void * pUncompressedDestBuffer_Deprecated, uint32 cbUncompressedDestBufferSize_Deprecated, uint32 * nUncompressBytesWritten_Deprecated, uint32 nUncompressedVoiceDesiredSampleRate_Deprecated ); +S_API EVoiceResult SteamAPI_ISteamUser_DecompressVoice( ISteamUser* self, const void * pCompressed, uint32 cbCompressed, void * pDestBuffer, uint32 cbDestBufferSize, uint32 * nBytesWritten, uint32 nDesiredSampleRate ); +S_API uint32 SteamAPI_ISteamUser_GetVoiceOptimalSampleRate( ISteamUser* self ); +S_API HAuthTicket SteamAPI_ISteamUser_GetAuthSessionTicket( ISteamUser* self, void * pTicket, int cbMaxTicket, uint32 * pcbTicket, const SteamNetworkingIdentity * pSteamNetworkingIdentity ); +S_API HAuthTicket SteamAPI_ISteamUser_GetAuthTicketForWebApi( ISteamUser* self, const char * pchIdentity ); +S_API EBeginAuthSessionResult SteamAPI_ISteamUser_BeginAuthSession( ISteamUser* self, const void * pAuthTicket, int cbAuthTicket, uint64_steamid steamID ); +S_API void SteamAPI_ISteamUser_EndAuthSession( ISteamUser* self, uint64_steamid steamID ); +S_API void SteamAPI_ISteamUser_CancelAuthTicket( ISteamUser* self, HAuthTicket hAuthTicket ); +S_API EUserHasLicenseForAppResult SteamAPI_ISteamUser_UserHasLicenseForApp( ISteamUser* self, uint64_steamid steamID, AppId_t appID ); +S_API bool SteamAPI_ISteamUser_BIsBehindNAT( ISteamUser* self ); +S_API void SteamAPI_ISteamUser_AdvertiseGame( ISteamUser* self, uint64_steamid steamIDGameServer, uint32 unIPServer, uint16 usPortServer ); +S_API SteamAPICall_t SteamAPI_ISteamUser_RequestEncryptedAppTicket( ISteamUser* self, void * pDataToInclude, int cbDataToInclude ); +S_API bool SteamAPI_ISteamUser_GetEncryptedAppTicket( ISteamUser* self, void * pTicket, int cbMaxTicket, uint32 * pcbTicket ); +S_API int SteamAPI_ISteamUser_GetGameBadgeLevel( ISteamUser* self, int nSeries, bool bFoil ); +S_API int SteamAPI_ISteamUser_GetPlayerSteamLevel( ISteamUser* self ); +S_API SteamAPICall_t SteamAPI_ISteamUser_RequestStoreAuthURL( ISteamUser* self, const char * pchRedirectURL ); +S_API bool SteamAPI_ISteamUser_BIsPhoneVerified( ISteamUser* self ); +S_API bool SteamAPI_ISteamUser_BIsTwoFactorEnabled( ISteamUser* self ); +S_API bool SteamAPI_ISteamUser_BIsPhoneIdentifying( ISteamUser* self ); +S_API bool SteamAPI_ISteamUser_BIsPhoneRequiringVerification( ISteamUser* self ); +S_API SteamAPICall_t SteamAPI_ISteamUser_GetMarketEligibility( ISteamUser* self ); +S_API SteamAPICall_t SteamAPI_ISteamUser_GetDurationControl( ISteamUser* self ); +S_API bool SteamAPI_ISteamUser_BSetDurationControlOnlineState( ISteamUser* self, EDurationControlOnlineState eNewState ); + +// ISteamFriends + +// A versioned accessor is exported by the library +S_API ISteamFriends *SteamAPI_SteamFriends_v018(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamFriends(), but using this ensures that you are using a matching library. +inline ISteamFriends *SteamAPI_SteamFriends() { return SteamAPI_SteamFriends_v018(); } +S_API const char * SteamAPI_ISteamFriends_GetPersonaName( ISteamFriends* self ); +S_API EPersonaState SteamAPI_ISteamFriends_GetPersonaState( ISteamFriends* self ); +S_API int SteamAPI_ISteamFriends_GetFriendCount( ISteamFriends* self, int iFriendFlags ); +S_API uint64_steamid SteamAPI_ISteamFriends_GetFriendByIndex( ISteamFriends* self, int iFriend, int iFriendFlags ); +S_API EFriendRelationship SteamAPI_ISteamFriends_GetFriendRelationship( ISteamFriends* self, uint64_steamid steamIDFriend ); +S_API EPersonaState SteamAPI_ISteamFriends_GetFriendPersonaState( ISteamFriends* self, uint64_steamid steamIDFriend ); +S_API const char * SteamAPI_ISteamFriends_GetFriendPersonaName( ISteamFriends* self, uint64_steamid steamIDFriend ); +S_API bool SteamAPI_ISteamFriends_GetFriendGamePlayed( ISteamFriends* self, uint64_steamid steamIDFriend, FriendGameInfo_t * pFriendGameInfo ); +S_API const char * SteamAPI_ISteamFriends_GetFriendPersonaNameHistory( ISteamFriends* self, uint64_steamid steamIDFriend, int iPersonaName ); +S_API int SteamAPI_ISteamFriends_GetFriendSteamLevel( ISteamFriends* self, uint64_steamid steamIDFriend ); +S_API const char * SteamAPI_ISteamFriends_GetPlayerNickname( ISteamFriends* self, uint64_steamid steamIDPlayer ); +S_API int SteamAPI_ISteamFriends_GetFriendsGroupCount( ISteamFriends* self ); +S_API FriendsGroupID_t SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex( ISteamFriends* self, int iFG ); +S_API const char * SteamAPI_ISteamFriends_GetFriendsGroupName( ISteamFriends* self, FriendsGroupID_t friendsGroupID ); +S_API int SteamAPI_ISteamFriends_GetFriendsGroupMembersCount( ISteamFriends* self, FriendsGroupID_t friendsGroupID ); +S_API void SteamAPI_ISteamFriends_GetFriendsGroupMembersList( ISteamFriends* self, FriendsGroupID_t friendsGroupID, CSteamID * pOutSteamIDMembers, int nMembersCount ); +S_API bool SteamAPI_ISteamFriends_HasFriend( ISteamFriends* self, uint64_steamid steamIDFriend, int iFriendFlags ); +S_API int SteamAPI_ISteamFriends_GetClanCount( ISteamFriends* self ); +S_API uint64_steamid SteamAPI_ISteamFriends_GetClanByIndex( ISteamFriends* self, int iClan ); +S_API const char * SteamAPI_ISteamFriends_GetClanName( ISteamFriends* self, uint64_steamid steamIDClan ); +S_API const char * SteamAPI_ISteamFriends_GetClanTag( ISteamFriends* self, uint64_steamid steamIDClan ); +S_API bool SteamAPI_ISteamFriends_GetClanActivityCounts( ISteamFriends* self, uint64_steamid steamIDClan, int * pnOnline, int * pnInGame, int * pnChatting ); +S_API SteamAPICall_t SteamAPI_ISteamFriends_DownloadClanActivityCounts( ISteamFriends* self, CSteamID * psteamIDClans, int cClansToRequest ); +S_API int SteamAPI_ISteamFriends_GetFriendCountFromSource( ISteamFriends* self, uint64_steamid steamIDSource ); +S_API uint64_steamid SteamAPI_ISteamFriends_GetFriendFromSourceByIndex( ISteamFriends* self, uint64_steamid steamIDSource, int iFriend ); +S_API bool SteamAPI_ISteamFriends_IsUserInSource( ISteamFriends* self, uint64_steamid steamIDUser, uint64_steamid steamIDSource ); +S_API void SteamAPI_ISteamFriends_SetInGameVoiceSpeaking( ISteamFriends* self, uint64_steamid steamIDUser, bool bSpeaking ); +S_API void SteamAPI_ISteamFriends_ActivateGameOverlay( ISteamFriends* self, const char * pchDialog ); +S_API void SteamAPI_ISteamFriends_ActivateGameOverlayToUser( ISteamFriends* self, const char * pchDialog, uint64_steamid steamID ); +S_API void SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage( ISteamFriends* self, const char * pchURL, EActivateGameOverlayToWebPageMode eMode ); +S_API void SteamAPI_ISteamFriends_ActivateGameOverlayToStore( ISteamFriends* self, AppId_t nAppID, EOverlayToStoreFlag eFlag ); +S_API void SteamAPI_ISteamFriends_SetPlayedWith( ISteamFriends* self, uint64_steamid steamIDUserPlayedWith ); +S_API void SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog( ISteamFriends* self, uint64_steamid steamIDLobby ); +S_API int SteamAPI_ISteamFriends_GetSmallFriendAvatar( ISteamFriends* self, uint64_steamid steamIDFriend ); +S_API int SteamAPI_ISteamFriends_GetMediumFriendAvatar( ISteamFriends* self, uint64_steamid steamIDFriend ); +S_API int SteamAPI_ISteamFriends_GetLargeFriendAvatar( ISteamFriends* self, uint64_steamid steamIDFriend ); +S_API bool SteamAPI_ISteamFriends_RequestUserInformation( ISteamFriends* self, uint64_steamid steamIDUser, bool bRequireNameOnly ); +S_API SteamAPICall_t SteamAPI_ISteamFriends_RequestClanOfficerList( ISteamFriends* self, uint64_steamid steamIDClan ); +S_API uint64_steamid SteamAPI_ISteamFriends_GetClanOwner( ISteamFriends* self, uint64_steamid steamIDClan ); +S_API int SteamAPI_ISteamFriends_GetClanOfficerCount( ISteamFriends* self, uint64_steamid steamIDClan ); +S_API uint64_steamid SteamAPI_ISteamFriends_GetClanOfficerByIndex( ISteamFriends* self, uint64_steamid steamIDClan, int iOfficer ); +S_API bool SteamAPI_ISteamFriends_SetRichPresence( ISteamFriends* self, const char * pchKey, const char * pchValue ); +S_API void SteamAPI_ISteamFriends_ClearRichPresence( ISteamFriends* self ); +S_API const char * SteamAPI_ISteamFriends_GetFriendRichPresence( ISteamFriends* self, uint64_steamid steamIDFriend, const char * pchKey ); +S_API int SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount( ISteamFriends* self, uint64_steamid steamIDFriend ); +S_API const char * SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex( ISteamFriends* self, uint64_steamid steamIDFriend, int iKey ); +S_API void SteamAPI_ISteamFriends_RequestFriendRichPresence( ISteamFriends* self, uint64_steamid steamIDFriend ); +S_API bool SteamAPI_ISteamFriends_InviteUserToGame( ISteamFriends* self, uint64_steamid steamIDFriend, const char * pchConnectString ); +S_API int SteamAPI_ISteamFriends_GetCoplayFriendCount( ISteamFriends* self ); +S_API uint64_steamid SteamAPI_ISteamFriends_GetCoplayFriend( ISteamFriends* self, int iCoplayFriend ); +S_API int SteamAPI_ISteamFriends_GetFriendCoplayTime( ISteamFriends* self, uint64_steamid steamIDFriend ); +S_API AppId_t SteamAPI_ISteamFriends_GetFriendCoplayGame( ISteamFriends* self, uint64_steamid steamIDFriend ); +S_API SteamAPICall_t SteamAPI_ISteamFriends_JoinClanChatRoom( ISteamFriends* self, uint64_steamid steamIDClan ); +S_API bool SteamAPI_ISteamFriends_LeaveClanChatRoom( ISteamFriends* self, uint64_steamid steamIDClan ); +S_API int SteamAPI_ISteamFriends_GetClanChatMemberCount( ISteamFriends* self, uint64_steamid steamIDClan ); +S_API uint64_steamid SteamAPI_ISteamFriends_GetChatMemberByIndex( ISteamFriends* self, uint64_steamid steamIDClan, int iUser ); +S_API bool SteamAPI_ISteamFriends_SendClanChatMessage( ISteamFriends* self, uint64_steamid steamIDClanChat, const char * pchText ); +S_API int SteamAPI_ISteamFriends_GetClanChatMessage( ISteamFriends* self, uint64_steamid steamIDClanChat, int iMessage, void * prgchText, int cchTextMax, EChatEntryType * peChatEntryType, CSteamID * psteamidChatter ); +S_API bool SteamAPI_ISteamFriends_IsClanChatAdmin( ISteamFriends* self, uint64_steamid steamIDClanChat, uint64_steamid steamIDUser ); +S_API bool SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam( ISteamFriends* self, uint64_steamid steamIDClanChat ); +S_API bool SteamAPI_ISteamFriends_OpenClanChatWindowInSteam( ISteamFriends* self, uint64_steamid steamIDClanChat ); +S_API bool SteamAPI_ISteamFriends_CloseClanChatWindowInSteam( ISteamFriends* self, uint64_steamid steamIDClanChat ); +S_API bool SteamAPI_ISteamFriends_SetListenForFriendsMessages( ISteamFriends* self, bool bInterceptEnabled ); +S_API bool SteamAPI_ISteamFriends_ReplyToFriendMessage( ISteamFriends* self, uint64_steamid steamIDFriend, const char * pchMsgToSend ); +S_API int SteamAPI_ISteamFriends_GetFriendMessage( ISteamFriends* self, uint64_steamid steamIDFriend, int iMessageID, void * pvData, int cubData, EChatEntryType * peChatEntryType ); +S_API SteamAPICall_t SteamAPI_ISteamFriends_GetFollowerCount( ISteamFriends* self, uint64_steamid steamID ); +S_API SteamAPICall_t SteamAPI_ISteamFriends_IsFollowing( ISteamFriends* self, uint64_steamid steamID ); +S_API SteamAPICall_t SteamAPI_ISteamFriends_EnumerateFollowingList( ISteamFriends* self, uint32 unStartIndex ); +S_API bool SteamAPI_ISteamFriends_IsClanPublic( ISteamFriends* self, uint64_steamid steamIDClan ); +S_API bool SteamAPI_ISteamFriends_IsClanOfficialGameGroup( ISteamFriends* self, uint64_steamid steamIDClan ); +S_API int SteamAPI_ISteamFriends_GetNumChatsWithUnreadPriorityMessages( ISteamFriends* self ); +S_API void SteamAPI_ISteamFriends_ActivateGameOverlayRemotePlayTogetherInviteDialog( ISteamFriends* self, uint64_steamid steamIDLobby ); +S_API bool SteamAPI_ISteamFriends_RegisterProtocolInOverlayBrowser( ISteamFriends* self, const char * pchProtocol ); +S_API void SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialogConnectString( ISteamFriends* self, const char * pchConnectString ); +S_API SteamAPICall_t SteamAPI_ISteamFriends_RequestEquippedProfileItems( ISteamFriends* self, uint64_steamid steamID ); +S_API bool SteamAPI_ISteamFriends_BHasEquippedProfileItem( ISteamFriends* self, uint64_steamid steamID, ECommunityProfileItemType itemType ); +S_API const char * SteamAPI_ISteamFriends_GetProfileItemPropertyString( ISteamFriends* self, uint64_steamid steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop ); +S_API uint32 SteamAPI_ISteamFriends_GetProfileItemPropertyUint( ISteamFriends* self, uint64_steamid steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop ); + +// ISteamUtils + +// A versioned accessor is exported by the library +S_API ISteamUtils *SteamAPI_SteamUtils_v010(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamUtils(), but using this ensures that you are using a matching library. +inline ISteamUtils *SteamAPI_SteamUtils() { return SteamAPI_SteamUtils_v010(); } + +// A versioned accessor is exported by the library +S_API ISteamUtils *SteamAPI_SteamGameServerUtils_v010(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamGameServerUtils(), but using this ensures that you are using a matching library. +inline ISteamUtils *SteamAPI_SteamGameServerUtils() { return SteamAPI_SteamGameServerUtils_v010(); } +S_API uint32 SteamAPI_ISteamUtils_GetSecondsSinceAppActive( ISteamUtils* self ); +S_API uint32 SteamAPI_ISteamUtils_GetSecondsSinceComputerActive( ISteamUtils* self ); +S_API EUniverse SteamAPI_ISteamUtils_GetConnectedUniverse( ISteamUtils* self ); +S_API uint32 SteamAPI_ISteamUtils_GetServerRealTime( ISteamUtils* self ); +S_API const char * SteamAPI_ISteamUtils_GetIPCountry( ISteamUtils* self ); +S_API bool SteamAPI_ISteamUtils_GetImageSize( ISteamUtils* self, int iImage, uint32 * pnWidth, uint32 * pnHeight ); +S_API bool SteamAPI_ISteamUtils_GetImageRGBA( ISteamUtils* self, int iImage, uint8 * pubDest, int nDestBufferSize ); +S_API uint8 SteamAPI_ISteamUtils_GetCurrentBatteryPower( ISteamUtils* self ); +S_API uint32 SteamAPI_ISteamUtils_GetAppID( ISteamUtils* self ); +S_API void SteamAPI_ISteamUtils_SetOverlayNotificationPosition( ISteamUtils* self, ENotificationPosition eNotificationPosition ); +S_API bool SteamAPI_ISteamUtils_IsAPICallCompleted( ISteamUtils* self, SteamAPICall_t hSteamAPICall, bool * pbFailed ); +S_API ESteamAPICallFailure SteamAPI_ISteamUtils_GetAPICallFailureReason( ISteamUtils* self, SteamAPICall_t hSteamAPICall ); +S_API bool SteamAPI_ISteamUtils_GetAPICallResult( ISteamUtils* self, SteamAPICall_t hSteamAPICall, void * pCallback, int cubCallback, int iCallbackExpected, bool * pbFailed ); +S_API uint32 SteamAPI_ISteamUtils_GetIPCCallCount( ISteamUtils* self ); +S_API void SteamAPI_ISteamUtils_SetWarningMessageHook( ISteamUtils* self, SteamAPIWarningMessageHook_t pFunction ); +S_API bool SteamAPI_ISteamUtils_IsOverlayEnabled( ISteamUtils* self ); +S_API bool SteamAPI_ISteamUtils_BOverlayNeedsPresent( ISteamUtils* self ); +S_API SteamAPICall_t SteamAPI_ISteamUtils_CheckFileSignature( ISteamUtils* self, const char * szFileName ); +S_API bool SteamAPI_ISteamUtils_ShowGamepadTextInput( ISteamUtils* self, EGamepadTextInputMode eInputMode, EGamepadTextInputLineMode eLineInputMode, const char * pchDescription, uint32 unCharMax, const char * pchExistingText ); +S_API uint32 SteamAPI_ISteamUtils_GetEnteredGamepadTextLength( ISteamUtils* self ); +S_API bool SteamAPI_ISteamUtils_GetEnteredGamepadTextInput( ISteamUtils* self, char * pchText, uint32 cchText ); +S_API const char * SteamAPI_ISteamUtils_GetSteamUILanguage( ISteamUtils* self ); +S_API bool SteamAPI_ISteamUtils_IsSteamRunningInVR( ISteamUtils* self ); +S_API void SteamAPI_ISteamUtils_SetOverlayNotificationInset( ISteamUtils* self, int nHorizontalInset, int nVerticalInset ); +S_API bool SteamAPI_ISteamUtils_IsSteamInBigPictureMode( ISteamUtils* self ); +S_API void SteamAPI_ISteamUtils_StartVRDashboard( ISteamUtils* self ); +S_API bool SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled( ISteamUtils* self ); +S_API void SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled( ISteamUtils* self, bool bEnabled ); +S_API bool SteamAPI_ISteamUtils_IsSteamChinaLauncher( ISteamUtils* self ); +S_API bool SteamAPI_ISteamUtils_InitFilterText( ISteamUtils* self, uint32 unFilterOptions ); +S_API int SteamAPI_ISteamUtils_FilterText( ISteamUtils* self, ETextFilteringContext eContext, uint64_steamid sourceSteamID, const char * pchInputMessage, char * pchOutFilteredText, uint32 nByteSizeOutFilteredText ); +S_API ESteamIPv6ConnectivityState SteamAPI_ISteamUtils_GetIPv6ConnectivityState( ISteamUtils* self, ESteamIPv6ConnectivityProtocol eProtocol ); +S_API bool SteamAPI_ISteamUtils_IsSteamRunningOnSteamDeck( ISteamUtils* self ); +S_API bool SteamAPI_ISteamUtils_ShowFloatingGamepadTextInput( ISteamUtils* self, EFloatingGamepadTextInputMode eKeyboardMode, int nTextFieldXPosition, int nTextFieldYPosition, int nTextFieldWidth, int nTextFieldHeight ); +S_API void SteamAPI_ISteamUtils_SetGameLauncherMode( ISteamUtils* self, bool bLauncherMode ); +S_API bool SteamAPI_ISteamUtils_DismissFloatingGamepadTextInput( ISteamUtils* self ); +S_API bool SteamAPI_ISteamUtils_DismissGamepadTextInput( ISteamUtils* self ); + +// ISteamMatchmaking + +// A versioned accessor is exported by the library +S_API ISteamMatchmaking *SteamAPI_SteamMatchmaking_v009(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamMatchmaking(), but using this ensures that you are using a matching library. +inline ISteamMatchmaking *SteamAPI_SteamMatchmaking() { return SteamAPI_SteamMatchmaking_v009(); } +S_API int SteamAPI_ISteamMatchmaking_GetFavoriteGameCount( ISteamMatchmaking* self ); +S_API bool SteamAPI_ISteamMatchmaking_GetFavoriteGame( ISteamMatchmaking* self, int iGame, AppId_t * pnAppID, uint32 * pnIP, uint16 * pnConnPort, uint16 * pnQueryPort, uint32 * punFlags, uint32 * pRTime32LastPlayedOnServer ); +S_API int SteamAPI_ISteamMatchmaking_AddFavoriteGame( ISteamMatchmaking* self, AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ); +S_API bool SteamAPI_ISteamMatchmaking_RemoveFavoriteGame( ISteamMatchmaking* self, AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ); +S_API SteamAPICall_t SteamAPI_ISteamMatchmaking_RequestLobbyList( ISteamMatchmaking* self ); +S_API void SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter( ISteamMatchmaking* self, const char * pchKeyToMatch, const char * pchValueToMatch, ELobbyComparison eComparisonType ); +S_API void SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter( ISteamMatchmaking* self, const char * pchKeyToMatch, int nValueToMatch, ELobbyComparison eComparisonType ); +S_API void SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter( ISteamMatchmaking* self, const char * pchKeyToMatch, int nValueToBeCloseTo ); +S_API void SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( ISteamMatchmaking* self, int nSlotsAvailable ); +S_API void SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter( ISteamMatchmaking* self, ELobbyDistanceFilter eLobbyDistanceFilter ); +S_API void SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter( ISteamMatchmaking* self, int cMaxResults ); +S_API void SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( ISteamMatchmaking* self, uint64_steamid steamIDLobby ); +S_API uint64_steamid SteamAPI_ISteamMatchmaking_GetLobbyByIndex( ISteamMatchmaking* self, int iLobby ); +S_API SteamAPICall_t SteamAPI_ISteamMatchmaking_CreateLobby( ISteamMatchmaking* self, ELobbyType eLobbyType, int cMaxMembers ); +S_API SteamAPICall_t SteamAPI_ISteamMatchmaking_JoinLobby( ISteamMatchmaking* self, uint64_steamid steamIDLobby ); +S_API void SteamAPI_ISteamMatchmaking_LeaveLobby( ISteamMatchmaking* self, uint64_steamid steamIDLobby ); +S_API bool SteamAPI_ISteamMatchmaking_InviteUserToLobby( ISteamMatchmaking* self, uint64_steamid steamIDLobby, uint64_steamid steamIDInvitee ); +S_API int SteamAPI_ISteamMatchmaking_GetNumLobbyMembers( ISteamMatchmaking* self, uint64_steamid steamIDLobby ); +S_API uint64_steamid SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex( ISteamMatchmaking* self, uint64_steamid steamIDLobby, int iMember ); +S_API const char * SteamAPI_ISteamMatchmaking_GetLobbyData( ISteamMatchmaking* self, uint64_steamid steamIDLobby, const char * pchKey ); +S_API bool SteamAPI_ISteamMatchmaking_SetLobbyData( ISteamMatchmaking* self, uint64_steamid steamIDLobby, const char * pchKey, const char * pchValue ); +S_API int SteamAPI_ISteamMatchmaking_GetLobbyDataCount( ISteamMatchmaking* self, uint64_steamid steamIDLobby ); +S_API bool SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex( ISteamMatchmaking* self, uint64_steamid steamIDLobby, int iLobbyData, char * pchKey, int cchKeyBufferSize, char * pchValue, int cchValueBufferSize ); +S_API bool SteamAPI_ISteamMatchmaking_DeleteLobbyData( ISteamMatchmaking* self, uint64_steamid steamIDLobby, const char * pchKey ); +S_API const char * SteamAPI_ISteamMatchmaking_GetLobbyMemberData( ISteamMatchmaking* self, uint64_steamid steamIDLobby, uint64_steamid steamIDUser, const char * pchKey ); +S_API void SteamAPI_ISteamMatchmaking_SetLobbyMemberData( ISteamMatchmaking* self, uint64_steamid steamIDLobby, const char * pchKey, const char * pchValue ); +S_API bool SteamAPI_ISteamMatchmaking_SendLobbyChatMsg( ISteamMatchmaking* self, uint64_steamid steamIDLobby, const void * pvMsgBody, int cubMsgBody ); +S_API int SteamAPI_ISteamMatchmaking_GetLobbyChatEntry( ISteamMatchmaking* self, uint64_steamid steamIDLobby, int iChatID, CSteamID * pSteamIDUser, void * pvData, int cubData, EChatEntryType * peChatEntryType ); +S_API bool SteamAPI_ISteamMatchmaking_RequestLobbyData( ISteamMatchmaking* self, uint64_steamid steamIDLobby ); +S_API void SteamAPI_ISteamMatchmaking_SetLobbyGameServer( ISteamMatchmaking* self, uint64_steamid steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, uint64_steamid steamIDGameServer ); +S_API bool SteamAPI_ISteamMatchmaking_GetLobbyGameServer( ISteamMatchmaking* self, uint64_steamid steamIDLobby, uint32 * punGameServerIP, uint16 * punGameServerPort, CSteamID * psteamIDGameServer ); +S_API bool SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit( ISteamMatchmaking* self, uint64_steamid steamIDLobby, int cMaxMembers ); +S_API int SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit( ISteamMatchmaking* self, uint64_steamid steamIDLobby ); +S_API bool SteamAPI_ISteamMatchmaking_SetLobbyType( ISteamMatchmaking* self, uint64_steamid steamIDLobby, ELobbyType eLobbyType ); +S_API bool SteamAPI_ISteamMatchmaking_SetLobbyJoinable( ISteamMatchmaking* self, uint64_steamid steamIDLobby, bool bLobbyJoinable ); +S_API uint64_steamid SteamAPI_ISteamMatchmaking_GetLobbyOwner( ISteamMatchmaking* self, uint64_steamid steamIDLobby ); +S_API bool SteamAPI_ISteamMatchmaking_SetLobbyOwner( ISteamMatchmaking* self, uint64_steamid steamIDLobby, uint64_steamid steamIDNewOwner ); +S_API bool SteamAPI_ISteamMatchmaking_SetLinkedLobby( ISteamMatchmaking* self, uint64_steamid steamIDLobby, uint64_steamid steamIDLobbyDependent ); + +// ISteamMatchmakingServerListResponse +S_API void SteamAPI_ISteamMatchmakingServerListResponse_ServerResponded( ISteamMatchmakingServerListResponse* self, HServerListRequest hRequest, int iServer ); +S_API void SteamAPI_ISteamMatchmakingServerListResponse_ServerFailedToRespond( ISteamMatchmakingServerListResponse* self, HServerListRequest hRequest, int iServer ); +S_API void SteamAPI_ISteamMatchmakingServerListResponse_RefreshComplete( ISteamMatchmakingServerListResponse* self, HServerListRequest hRequest, EMatchMakingServerResponse response ); + +// ISteamMatchmakingPingResponse +S_API void SteamAPI_ISteamMatchmakingPingResponse_ServerResponded( ISteamMatchmakingPingResponse* self, gameserveritem_t & server ); +S_API void SteamAPI_ISteamMatchmakingPingResponse_ServerFailedToRespond( ISteamMatchmakingPingResponse* self ); + +// ISteamMatchmakingPlayersResponse +S_API void SteamAPI_ISteamMatchmakingPlayersResponse_AddPlayerToList( ISteamMatchmakingPlayersResponse* self, const char * pchName, int nScore, float flTimePlayed ); +S_API void SteamAPI_ISteamMatchmakingPlayersResponse_PlayersFailedToRespond( ISteamMatchmakingPlayersResponse* self ); +S_API void SteamAPI_ISteamMatchmakingPlayersResponse_PlayersRefreshComplete( ISteamMatchmakingPlayersResponse* self ); + +// ISteamMatchmakingRulesResponse +S_API void SteamAPI_ISteamMatchmakingRulesResponse_RulesResponded( ISteamMatchmakingRulesResponse* self, const char * pchRule, const char * pchValue ); +S_API void SteamAPI_ISteamMatchmakingRulesResponse_RulesFailedToRespond( ISteamMatchmakingRulesResponse* self ); +S_API void SteamAPI_ISteamMatchmakingRulesResponse_RulesRefreshComplete( ISteamMatchmakingRulesResponse* self ); + +// ISteamMatchmakingServers + +// A versioned accessor is exported by the library +S_API ISteamMatchmakingServers *SteamAPI_SteamMatchmakingServers_v002(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamMatchmakingServers(), but using this ensures that you are using a matching library. +inline ISteamMatchmakingServers *SteamAPI_SteamMatchmakingServers() { return SteamAPI_SteamMatchmakingServers_v002(); } +S_API HServerListRequest SteamAPI_ISteamMatchmakingServers_RequestInternetServerList( ISteamMatchmakingServers* self, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse ); +S_API HServerListRequest SteamAPI_ISteamMatchmakingServers_RequestLANServerList( ISteamMatchmakingServers* self, AppId_t iApp, ISteamMatchmakingServerListResponse * pRequestServersResponse ); +S_API HServerListRequest SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList( ISteamMatchmakingServers* self, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse ); +S_API HServerListRequest SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList( ISteamMatchmakingServers* self, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse ); +S_API HServerListRequest SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList( ISteamMatchmakingServers* self, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse ); +S_API HServerListRequest SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList( ISteamMatchmakingServers* self, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse ); +S_API void SteamAPI_ISteamMatchmakingServers_ReleaseRequest( ISteamMatchmakingServers* self, HServerListRequest hServerListRequest ); +S_API gameserveritem_t * SteamAPI_ISteamMatchmakingServers_GetServerDetails( ISteamMatchmakingServers* self, HServerListRequest hRequest, int iServer ); +S_API void SteamAPI_ISteamMatchmakingServers_CancelQuery( ISteamMatchmakingServers* self, HServerListRequest hRequest ); +S_API void SteamAPI_ISteamMatchmakingServers_RefreshQuery( ISteamMatchmakingServers* self, HServerListRequest hRequest ); +S_API bool SteamAPI_ISteamMatchmakingServers_IsRefreshing( ISteamMatchmakingServers* self, HServerListRequest hRequest ); +S_API int SteamAPI_ISteamMatchmakingServers_GetServerCount( ISteamMatchmakingServers* self, HServerListRequest hRequest ); +S_API void SteamAPI_ISteamMatchmakingServers_RefreshServer( ISteamMatchmakingServers* self, HServerListRequest hRequest, int iServer ); +S_API HServerQuery SteamAPI_ISteamMatchmakingServers_PingServer( ISteamMatchmakingServers* self, uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse * pRequestServersResponse ); +S_API HServerQuery SteamAPI_ISteamMatchmakingServers_PlayerDetails( ISteamMatchmakingServers* self, uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse * pRequestServersResponse ); +S_API HServerQuery SteamAPI_ISteamMatchmakingServers_ServerRules( ISteamMatchmakingServers* self, uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse * pRequestServersResponse ); +S_API void SteamAPI_ISteamMatchmakingServers_CancelServerQuery( ISteamMatchmakingServers* self, HServerQuery hServerQuery ); + +// ISteamGameSearch + +// A versioned accessor is exported by the library +S_API ISteamGameSearch *SteamAPI_SteamGameSearch_v001(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamGameSearch(), but using this ensures that you are using a matching library. +inline ISteamGameSearch *SteamAPI_SteamGameSearch() { return SteamAPI_SteamGameSearch_v001(); } +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_AddGameSearchParams( ISteamGameSearch* self, const char * pchKeyToFind, const char * pchValuesToFind ); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_SearchForGameWithLobby( ISteamGameSearch* self, uint64_steamid steamIDLobby, int nPlayerMin, int nPlayerMax ); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_SearchForGameSolo( ISteamGameSearch* self, int nPlayerMin, int nPlayerMax ); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_AcceptGame( ISteamGameSearch* self ); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_DeclineGame( ISteamGameSearch* self ); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_RetrieveConnectionDetails( ISteamGameSearch* self, uint64_steamid steamIDHost, char * pchConnectionDetails, int cubConnectionDetails ); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_EndGameSearch( ISteamGameSearch* self ); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_SetGameHostParams( ISteamGameSearch* self, const char * pchKey, const char * pchValue ); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_SetConnectionDetails( ISteamGameSearch* self, const char * pchConnectionDetails, int cubConnectionDetails ); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_RequestPlayersForGame( ISteamGameSearch* self, int nPlayerMin, int nPlayerMax, int nMaxTeamSize ); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_HostConfirmGameStart( ISteamGameSearch* self, uint64 ullUniqueGameID ); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_CancelRequestPlayersForGame( ISteamGameSearch* self ); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_SubmitPlayerResult( ISteamGameSearch* self, uint64 ullUniqueGameID, uint64_steamid steamIDPlayer, EPlayerResult_t EPlayerResult ); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_EndGame( ISteamGameSearch* self, uint64 ullUniqueGameID ); + +// ISteamParties + +// A versioned accessor is exported by the library +S_API ISteamParties *SteamAPI_SteamParties_v002(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamParties(), but using this ensures that you are using a matching library. +inline ISteamParties *SteamAPI_SteamParties() { return SteamAPI_SteamParties_v002(); } +S_API uint32 SteamAPI_ISteamParties_GetNumActiveBeacons( ISteamParties* self ); +S_API PartyBeaconID_t SteamAPI_ISteamParties_GetBeaconByIndex( ISteamParties* self, uint32 unIndex ); +S_API bool SteamAPI_ISteamParties_GetBeaconDetails( ISteamParties* self, PartyBeaconID_t ulBeaconID, CSteamID * pSteamIDBeaconOwner, SteamPartyBeaconLocation_t * pLocation, char * pchMetadata, int cchMetadata ); +S_API SteamAPICall_t SteamAPI_ISteamParties_JoinParty( ISteamParties* self, PartyBeaconID_t ulBeaconID ); +S_API bool SteamAPI_ISteamParties_GetNumAvailableBeaconLocations( ISteamParties* self, uint32 * puNumLocations ); +S_API bool SteamAPI_ISteamParties_GetAvailableBeaconLocations( ISteamParties* self, SteamPartyBeaconLocation_t * pLocationList, uint32 uMaxNumLocations ); +S_API SteamAPICall_t SteamAPI_ISteamParties_CreateBeacon( ISteamParties* self, uint32 unOpenSlots, SteamPartyBeaconLocation_t * pBeaconLocation, const char * pchConnectString, const char * pchMetadata ); +S_API void SteamAPI_ISteamParties_OnReservationCompleted( ISteamParties* self, PartyBeaconID_t ulBeacon, uint64_steamid steamIDUser ); +S_API void SteamAPI_ISteamParties_CancelReservation( ISteamParties* self, PartyBeaconID_t ulBeacon, uint64_steamid steamIDUser ); +S_API SteamAPICall_t SteamAPI_ISteamParties_ChangeNumOpenSlots( ISteamParties* self, PartyBeaconID_t ulBeacon, uint32 unOpenSlots ); +S_API bool SteamAPI_ISteamParties_DestroyBeacon( ISteamParties* self, PartyBeaconID_t ulBeacon ); +S_API bool SteamAPI_ISteamParties_GetBeaconLocationData( ISteamParties* self, SteamPartyBeaconLocation_t BeaconLocation, ESteamPartyBeaconLocationData eData, char * pchDataStringOut, int cchDataStringOut ); + +// ISteamRemoteStorage + +// A versioned accessor is exported by the library +S_API ISteamRemoteStorage *SteamAPI_SteamRemoteStorage_v016(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamRemoteStorage(), but using this ensures that you are using a matching library. +inline ISteamRemoteStorage *SteamAPI_SteamRemoteStorage() { return SteamAPI_SteamRemoteStorage_v016(); } +S_API bool SteamAPI_ISteamRemoteStorage_FileWrite( ISteamRemoteStorage* self, const char * pchFile, const void * pvData, int32 cubData ); +S_API int32 SteamAPI_ISteamRemoteStorage_FileRead( ISteamRemoteStorage* self, const char * pchFile, void * pvData, int32 cubDataToRead ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_FileWriteAsync( ISteamRemoteStorage* self, const char * pchFile, const void * pvData, uint32 cubData ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_FileReadAsync( ISteamRemoteStorage* self, const char * pchFile, uint32 nOffset, uint32 cubToRead ); +S_API bool SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete( ISteamRemoteStorage* self, SteamAPICall_t hReadCall, void * pvBuffer, uint32 cubToRead ); +S_API bool SteamAPI_ISteamRemoteStorage_FileForget( ISteamRemoteStorage* self, const char * pchFile ); +S_API bool SteamAPI_ISteamRemoteStorage_FileDelete( ISteamRemoteStorage* self, const char * pchFile ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_FileShare( ISteamRemoteStorage* self, const char * pchFile ); +S_API bool SteamAPI_ISteamRemoteStorage_SetSyncPlatforms( ISteamRemoteStorage* self, const char * pchFile, ERemoteStoragePlatform eRemoteStoragePlatform ); +S_API UGCFileWriteStreamHandle_t SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen( ISteamRemoteStorage* self, const char * pchFile ); +S_API bool SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk( ISteamRemoteStorage* self, UGCFileWriteStreamHandle_t writeHandle, const void * pvData, int32 cubData ); +S_API bool SteamAPI_ISteamRemoteStorage_FileWriteStreamClose( ISteamRemoteStorage* self, UGCFileWriteStreamHandle_t writeHandle ); +S_API bool SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel( ISteamRemoteStorage* self, UGCFileWriteStreamHandle_t writeHandle ); +S_API bool SteamAPI_ISteamRemoteStorage_FileExists( ISteamRemoteStorage* self, const char * pchFile ); +S_API bool SteamAPI_ISteamRemoteStorage_FilePersisted( ISteamRemoteStorage* self, const char * pchFile ); +S_API int32 SteamAPI_ISteamRemoteStorage_GetFileSize( ISteamRemoteStorage* self, const char * pchFile ); +S_API int64 SteamAPI_ISteamRemoteStorage_GetFileTimestamp( ISteamRemoteStorage* self, const char * pchFile ); +S_API ERemoteStoragePlatform SteamAPI_ISteamRemoteStorage_GetSyncPlatforms( ISteamRemoteStorage* self, const char * pchFile ); +S_API int32 SteamAPI_ISteamRemoteStorage_GetFileCount( ISteamRemoteStorage* self ); +S_API const char * SteamAPI_ISteamRemoteStorage_GetFileNameAndSize( ISteamRemoteStorage* self, int iFile, int32 * pnFileSizeInBytes ); +S_API bool SteamAPI_ISteamRemoteStorage_GetQuota( ISteamRemoteStorage* self, uint64 * pnTotalBytes, uint64 * puAvailableBytes ); +S_API bool SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount( ISteamRemoteStorage* self ); +S_API bool SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp( ISteamRemoteStorage* self ); +S_API void SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp( ISteamRemoteStorage* self, bool bEnabled ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_UGCDownload( ISteamRemoteStorage* self, UGCHandle_t hContent, uint32 unPriority ); +S_API bool SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress( ISteamRemoteStorage* self, UGCHandle_t hContent, int32 * pnBytesDownloaded, int32 * pnBytesExpected ); +S_API bool SteamAPI_ISteamRemoteStorage_GetUGCDetails( ISteamRemoteStorage* self, UGCHandle_t hContent, AppId_t * pnAppID, char ** ppchName, int32 * pnFileSizeInBytes, CSteamID * pSteamIDOwner ); +S_API int32 SteamAPI_ISteamRemoteStorage_UGCRead( ISteamRemoteStorage* self, UGCHandle_t hContent, void * pvData, int32 cubDataToRead, uint32 cOffset, EUGCReadAction eAction ); +S_API int32 SteamAPI_ISteamRemoteStorage_GetCachedUGCCount( ISteamRemoteStorage* self ); +S_API UGCHandle_t SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle( ISteamRemoteStorage* self, int32 iCachedContent ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_PublishWorkshopFile( ISteamRemoteStorage* self, const char * pchFile, const char * pchPreviewFile, AppId_t nConsumerAppId, const char * pchTitle, const char * pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t * pTags, EWorkshopFileType eWorkshopFileType ); +S_API PublishedFileUpdateHandle_t SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest( ISteamRemoteStorage* self, PublishedFileId_t unPublishedFileId ); +S_API bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile( ISteamRemoteStorage* self, PublishedFileUpdateHandle_t updateHandle, const char * pchFile ); +S_API bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile( ISteamRemoteStorage* self, PublishedFileUpdateHandle_t updateHandle, const char * pchPreviewFile ); +S_API bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle( ISteamRemoteStorage* self, PublishedFileUpdateHandle_t updateHandle, const char * pchTitle ); +S_API bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription( ISteamRemoteStorage* self, PublishedFileUpdateHandle_t updateHandle, const char * pchDescription ); +S_API bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility( ISteamRemoteStorage* self, PublishedFileUpdateHandle_t updateHandle, ERemoteStoragePublishedFileVisibility eVisibility ); +S_API bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags( ISteamRemoteStorage* self, PublishedFileUpdateHandle_t updateHandle, SteamParamStringArray_t * pTags ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate( ISteamRemoteStorage* self, PublishedFileUpdateHandle_t updateHandle ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails( ISteamRemoteStorage* self, PublishedFileId_t unPublishedFileId, uint32 unMaxSecondsOld ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_DeletePublishedFile( ISteamRemoteStorage* self, PublishedFileId_t unPublishedFileId ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles( ISteamRemoteStorage* self, uint32 unStartIndex ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_SubscribePublishedFile( ISteamRemoteStorage* self, PublishedFileId_t unPublishedFileId ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles( ISteamRemoteStorage* self, uint32 unStartIndex ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile( ISteamRemoteStorage* self, PublishedFileId_t unPublishedFileId ); +S_API bool SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( ISteamRemoteStorage* self, PublishedFileUpdateHandle_t updateHandle, const char * pchChangeDescription ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails( ISteamRemoteStorage* self, PublishedFileId_t unPublishedFileId ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote( ISteamRemoteStorage* self, PublishedFileId_t unPublishedFileId, bool bVoteUp ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails( ISteamRemoteStorage* self, PublishedFileId_t unPublishedFileId ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ISteamRemoteStorage* self, uint64_steamid steamId, uint32 unStartIndex, SteamParamStringArray_t * pRequiredTags, SteamParamStringArray_t * pExcludedTags ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_PublishVideo( ISteamRemoteStorage* self, EWorkshopVideoProvider eVideoProvider, const char * pchVideoAccount, const char * pchVideoIdentifier, const char * pchPreviewFile, AppId_t nConsumerAppId, const char * pchTitle, const char * pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t * pTags ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction( ISteamRemoteStorage* self, PublishedFileId_t unPublishedFileId, EWorkshopFileAction eAction ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( ISteamRemoteStorage* self, EWorkshopFileAction eAction, uint32 unStartIndex ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( ISteamRemoteStorage* self, EWorkshopEnumerationType eEnumerationType, uint32 unStartIndex, uint32 unCount, uint32 unDays, SteamParamStringArray_t * pTags, SteamParamStringArray_t * pUserTags ); +S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation( ISteamRemoteStorage* self, UGCHandle_t hContent, const char * pchLocation, uint32 unPriority ); +S_API int32 SteamAPI_ISteamRemoteStorage_GetLocalFileChangeCount( ISteamRemoteStorage* self ); +S_API const char * SteamAPI_ISteamRemoteStorage_GetLocalFileChange( ISteamRemoteStorage* self, int iFile, ERemoteStorageLocalFileChange * pEChangeType, ERemoteStorageFilePathType * pEFilePathType ); +S_API bool SteamAPI_ISteamRemoteStorage_BeginFileWriteBatch( ISteamRemoteStorage* self ); +S_API bool SteamAPI_ISteamRemoteStorage_EndFileWriteBatch( ISteamRemoteStorage* self ); + +// ISteamUserStats + +// A versioned accessor is exported by the library +S_API ISteamUserStats *SteamAPI_SteamUserStats_v013(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamUserStats(), but using this ensures that you are using a matching library. +inline ISteamUserStats *SteamAPI_SteamUserStats() { return SteamAPI_SteamUserStats_v013(); } +S_API bool SteamAPI_ISteamUserStats_GetStatInt32( ISteamUserStats* self, const char * pchName, int32 * pData ); +S_API bool SteamAPI_ISteamUserStats_GetStatFloat( ISteamUserStats* self, const char * pchName, float * pData ); +S_API bool SteamAPI_ISteamUserStats_SetStatInt32( ISteamUserStats* self, const char * pchName, int32 nData ); +S_API bool SteamAPI_ISteamUserStats_SetStatFloat( ISteamUserStats* self, const char * pchName, float fData ); +S_API bool SteamAPI_ISteamUserStats_UpdateAvgRateStat( ISteamUserStats* self, const char * pchName, float flCountThisSession, double dSessionLength ); +S_API bool SteamAPI_ISteamUserStats_GetAchievement( ISteamUserStats* self, const char * pchName, bool * pbAchieved ); +S_API bool SteamAPI_ISteamUserStats_SetAchievement( ISteamUserStats* self, const char * pchName ); +S_API bool SteamAPI_ISteamUserStats_ClearAchievement( ISteamUserStats* self, const char * pchName ); +S_API bool SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime( ISteamUserStats* self, const char * pchName, bool * pbAchieved, uint32 * punUnlockTime ); +S_API bool SteamAPI_ISteamUserStats_StoreStats( ISteamUserStats* self ); +S_API int SteamAPI_ISteamUserStats_GetAchievementIcon( ISteamUserStats* self, const char * pchName ); +S_API const char * SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute( ISteamUserStats* self, const char * pchName, const char * pchKey ); +S_API bool SteamAPI_ISteamUserStats_IndicateAchievementProgress( ISteamUserStats* self, const char * pchName, uint32 nCurProgress, uint32 nMaxProgress ); +S_API uint32 SteamAPI_ISteamUserStats_GetNumAchievements( ISteamUserStats* self ); +S_API const char * SteamAPI_ISteamUserStats_GetAchievementName( ISteamUserStats* self, uint32 iAchievement ); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_RequestUserStats( ISteamUserStats* self, uint64_steamid steamIDUser ); +S_API bool SteamAPI_ISteamUserStats_GetUserStatInt32( ISteamUserStats* self, uint64_steamid steamIDUser, const char * pchName, int32 * pData ); +S_API bool SteamAPI_ISteamUserStats_GetUserStatFloat( ISteamUserStats* self, uint64_steamid steamIDUser, const char * pchName, float * pData ); +S_API bool SteamAPI_ISteamUserStats_GetUserAchievement( ISteamUserStats* self, uint64_steamid steamIDUser, const char * pchName, bool * pbAchieved ); +S_API bool SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime( ISteamUserStats* self, uint64_steamid steamIDUser, const char * pchName, bool * pbAchieved, uint32 * punUnlockTime ); +S_API bool SteamAPI_ISteamUserStats_ResetAllStats( ISteamUserStats* self, bool bAchievementsToo ); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_FindOrCreateLeaderboard( ISteamUserStats* self, const char * pchLeaderboardName, ELeaderboardSortMethod eLeaderboardSortMethod, ELeaderboardDisplayType eLeaderboardDisplayType ); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_FindLeaderboard( ISteamUserStats* self, const char * pchLeaderboardName ); +S_API const char * SteamAPI_ISteamUserStats_GetLeaderboardName( ISteamUserStats* self, SteamLeaderboard_t hSteamLeaderboard ); +S_API int SteamAPI_ISteamUserStats_GetLeaderboardEntryCount( ISteamUserStats* self, SteamLeaderboard_t hSteamLeaderboard ); +S_API ELeaderboardSortMethod SteamAPI_ISteamUserStats_GetLeaderboardSortMethod( ISteamUserStats* self, SteamLeaderboard_t hSteamLeaderboard ); +S_API ELeaderboardDisplayType SteamAPI_ISteamUserStats_GetLeaderboardDisplayType( ISteamUserStats* self, SteamLeaderboard_t hSteamLeaderboard ); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_DownloadLeaderboardEntries( ISteamUserStats* self, SteamLeaderboard_t hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers( ISteamUserStats* self, SteamLeaderboard_t hSteamLeaderboard, CSteamID * prgUsers, int cUsers ); +S_API bool SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry( ISteamUserStats* self, SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, LeaderboardEntry_t * pLeaderboardEntry, int32 * pDetails, int cDetailsMax ); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_UploadLeaderboardScore( ISteamUserStats* self, SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int32 nScore, const int32 * pScoreDetails, int cScoreDetailsCount ); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_AttachLeaderboardUGC( ISteamUserStats* self, SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers( ISteamUserStats* self ); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages( ISteamUserStats* self ); +S_API int SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo( ISteamUserStats* self, char * pchName, uint32 unNameBufLen, float * pflPercent, bool * pbAchieved ); +S_API int SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo( ISteamUserStats* self, int iIteratorPrevious, char * pchName, uint32 unNameBufLen, float * pflPercent, bool * pbAchieved ); +S_API bool SteamAPI_ISteamUserStats_GetAchievementAchievedPercent( ISteamUserStats* self, const char * pchName, float * pflPercent ); +S_API SteamAPICall_t SteamAPI_ISteamUserStats_RequestGlobalStats( ISteamUserStats* self, int nHistoryDays ); +S_API bool SteamAPI_ISteamUserStats_GetGlobalStatInt64( ISteamUserStats* self, const char * pchStatName, int64 * pData ); +S_API bool SteamAPI_ISteamUserStats_GetGlobalStatDouble( ISteamUserStats* self, const char * pchStatName, double * pData ); +S_API int32 SteamAPI_ISteamUserStats_GetGlobalStatHistoryInt64( ISteamUserStats* self, const char * pchStatName, int64 * pData, uint32 cubData ); +S_API int32 SteamAPI_ISteamUserStats_GetGlobalStatHistoryDouble( ISteamUserStats* self, const char * pchStatName, double * pData, uint32 cubData ); +S_API bool SteamAPI_ISteamUserStats_GetAchievementProgressLimitsInt32( ISteamUserStats* self, const char * pchName, int32 * pnMinProgress, int32 * pnMaxProgress ); +S_API bool SteamAPI_ISteamUserStats_GetAchievementProgressLimitsFloat( ISteamUserStats* self, const char * pchName, float * pfMinProgress, float * pfMaxProgress ); + +// ISteamApps + +// A versioned accessor is exported by the library +S_API ISteamApps *SteamAPI_SteamApps_v008(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamApps(), but using this ensures that you are using a matching library. +inline ISteamApps *SteamAPI_SteamApps() { return SteamAPI_SteamApps_v008(); } +S_API bool SteamAPI_ISteamApps_BIsSubscribed( ISteamApps* self ); +S_API bool SteamAPI_ISteamApps_BIsLowViolence( ISteamApps* self ); +S_API bool SteamAPI_ISteamApps_BIsCybercafe( ISteamApps* self ); +S_API bool SteamAPI_ISteamApps_BIsVACBanned( ISteamApps* self ); +S_API const char * SteamAPI_ISteamApps_GetCurrentGameLanguage( ISteamApps* self ); +S_API const char * SteamAPI_ISteamApps_GetAvailableGameLanguages( ISteamApps* self ); +S_API bool SteamAPI_ISteamApps_BIsSubscribedApp( ISteamApps* self, AppId_t appID ); +S_API bool SteamAPI_ISteamApps_BIsDlcInstalled( ISteamApps* self, AppId_t appID ); +S_API uint32 SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime( ISteamApps* self, AppId_t nAppID ); +S_API bool SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend( ISteamApps* self ); +S_API int SteamAPI_ISteamApps_GetDLCCount( ISteamApps* self ); +S_API bool SteamAPI_ISteamApps_BGetDLCDataByIndex( ISteamApps* self, int iDLC, AppId_t * pAppID, bool * pbAvailable, char * pchName, int cchNameBufferSize ); +S_API void SteamAPI_ISteamApps_InstallDLC( ISteamApps* self, AppId_t nAppID ); +S_API void SteamAPI_ISteamApps_UninstallDLC( ISteamApps* self, AppId_t nAppID ); +S_API void SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey( ISteamApps* self, AppId_t nAppID ); +S_API bool SteamAPI_ISteamApps_GetCurrentBetaName( ISteamApps* self, char * pchName, int cchNameBufferSize ); +S_API bool SteamAPI_ISteamApps_MarkContentCorrupt( ISteamApps* self, bool bMissingFilesOnly ); +S_API uint32 SteamAPI_ISteamApps_GetInstalledDepots( ISteamApps* self, AppId_t appID, DepotId_t * pvecDepots, uint32 cMaxDepots ); +S_API uint32 SteamAPI_ISteamApps_GetAppInstallDir( ISteamApps* self, AppId_t appID, char * pchFolder, uint32 cchFolderBufferSize ); +S_API bool SteamAPI_ISteamApps_BIsAppInstalled( ISteamApps* self, AppId_t appID ); +S_API uint64_steamid SteamAPI_ISteamApps_GetAppOwner( ISteamApps* self ); +S_API const char * SteamAPI_ISteamApps_GetLaunchQueryParam( ISteamApps* self, const char * pchKey ); +S_API bool SteamAPI_ISteamApps_GetDlcDownloadProgress( ISteamApps* self, AppId_t nAppID, uint64 * punBytesDownloaded, uint64 * punBytesTotal ); +S_API int SteamAPI_ISteamApps_GetAppBuildId( ISteamApps* self ); +S_API void SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys( ISteamApps* self ); +S_API SteamAPICall_t SteamAPI_ISteamApps_GetFileDetails( ISteamApps* self, const char * pszFileName ); +S_API int SteamAPI_ISteamApps_GetLaunchCommandLine( ISteamApps* self, char * pszCommandLine, int cubCommandLine ); +S_API bool SteamAPI_ISteamApps_BIsSubscribedFromFamilySharing( ISteamApps* self ); +S_API bool SteamAPI_ISteamApps_BIsTimedTrial( ISteamApps* self, uint32 * punSecondsAllowed, uint32 * punSecondsPlayed ); +S_API bool SteamAPI_ISteamApps_SetDlcContext( ISteamApps* self, AppId_t nAppID ); +S_API int SteamAPI_ISteamApps_GetNumBetas( ISteamApps* self, int * pnAvailable, int * pnPrivate ); +S_API bool SteamAPI_ISteamApps_GetBetaInfo( ISteamApps* self, int iBetaIndex, uint32 * punFlags, uint32 * punBuildID, char * pchBetaName, int cchBetaName, char * pchDescription, int cchDescription ); +S_API bool SteamAPI_ISteamApps_SetActiveBeta( ISteamApps* self, const char * pchBetaName ); + +// ISteamNetworking + +// A versioned accessor is exported by the library +S_API ISteamNetworking *SteamAPI_SteamNetworking_v006(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamNetworking(), but using this ensures that you are using a matching library. +inline ISteamNetworking *SteamAPI_SteamNetworking() { return SteamAPI_SteamNetworking_v006(); } + +// A versioned accessor is exported by the library +S_API ISteamNetworking *SteamAPI_SteamGameServerNetworking_v006(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamGameServerNetworking(), but using this ensures that you are using a matching library. +inline ISteamNetworking *SteamAPI_SteamGameServerNetworking() { return SteamAPI_SteamGameServerNetworking_v006(); } +S_API bool SteamAPI_ISteamNetworking_SendP2PPacket( ISteamNetworking* self, uint64_steamid steamIDRemote, const void * pubData, uint32 cubData, EP2PSend eP2PSendType, int nChannel ); +S_API bool SteamAPI_ISteamNetworking_IsP2PPacketAvailable( ISteamNetworking* self, uint32 * pcubMsgSize, int nChannel ); +S_API bool SteamAPI_ISteamNetworking_ReadP2PPacket( ISteamNetworking* self, void * pubDest, uint32 cubDest, uint32 * pcubMsgSize, CSteamID * psteamIDRemote, int nChannel ); +S_API bool SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser( ISteamNetworking* self, uint64_steamid steamIDRemote ); +S_API bool SteamAPI_ISteamNetworking_CloseP2PSessionWithUser( ISteamNetworking* self, uint64_steamid steamIDRemote ); +S_API bool SteamAPI_ISteamNetworking_CloseP2PChannelWithUser( ISteamNetworking* self, uint64_steamid steamIDRemote, int nChannel ); +S_API bool SteamAPI_ISteamNetworking_GetP2PSessionState( ISteamNetworking* self, uint64_steamid steamIDRemote, P2PSessionState_t * pConnectionState ); +S_API bool SteamAPI_ISteamNetworking_AllowP2PPacketRelay( ISteamNetworking* self, bool bAllow ); +S_API SNetListenSocket_t SteamAPI_ISteamNetworking_CreateListenSocket( ISteamNetworking* self, int nVirtualP2PPort, SteamIPAddress_t nIP, uint16 nPort, bool bAllowUseOfPacketRelay ); +S_API SNetSocket_t SteamAPI_ISteamNetworking_CreateP2PConnectionSocket( ISteamNetworking* self, uint64_steamid steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay ); +S_API SNetSocket_t SteamAPI_ISteamNetworking_CreateConnectionSocket( ISteamNetworking* self, SteamIPAddress_t nIP, uint16 nPort, int nTimeoutSec ); +S_API bool SteamAPI_ISteamNetworking_DestroySocket( ISteamNetworking* self, SNetSocket_t hSocket, bool bNotifyRemoteEnd ); +S_API bool SteamAPI_ISteamNetworking_DestroyListenSocket( ISteamNetworking* self, SNetListenSocket_t hSocket, bool bNotifyRemoteEnd ); +S_API bool SteamAPI_ISteamNetworking_SendDataOnSocket( ISteamNetworking* self, SNetSocket_t hSocket, void * pubData, uint32 cubData, bool bReliable ); +S_API bool SteamAPI_ISteamNetworking_IsDataAvailableOnSocket( ISteamNetworking* self, SNetSocket_t hSocket, uint32 * pcubMsgSize ); +S_API bool SteamAPI_ISteamNetworking_RetrieveDataFromSocket( ISteamNetworking* self, SNetSocket_t hSocket, void * pubDest, uint32 cubDest, uint32 * pcubMsgSize ); +S_API bool SteamAPI_ISteamNetworking_IsDataAvailable( ISteamNetworking* self, SNetListenSocket_t hListenSocket, uint32 * pcubMsgSize, SNetSocket_t * phSocket ); +S_API bool SteamAPI_ISteamNetworking_RetrieveData( ISteamNetworking* self, SNetListenSocket_t hListenSocket, void * pubDest, uint32 cubDest, uint32 * pcubMsgSize, SNetSocket_t * phSocket ); +S_API bool SteamAPI_ISteamNetworking_GetSocketInfo( ISteamNetworking* self, SNetSocket_t hSocket, CSteamID * pSteamIDRemote, int * peSocketStatus, SteamIPAddress_t * punIPRemote, uint16 * punPortRemote ); +S_API bool SteamAPI_ISteamNetworking_GetListenSocketInfo( ISteamNetworking* self, SNetListenSocket_t hListenSocket, SteamIPAddress_t * pnIP, uint16 * pnPort ); +S_API ESNetSocketConnectionType SteamAPI_ISteamNetworking_GetSocketConnectionType( ISteamNetworking* self, SNetSocket_t hSocket ); +S_API int SteamAPI_ISteamNetworking_GetMaxPacketSize( ISteamNetworking* self, SNetSocket_t hSocket ); + +// ISteamScreenshots + +// A versioned accessor is exported by the library +S_API ISteamScreenshots *SteamAPI_SteamScreenshots_v003(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamScreenshots(), but using this ensures that you are using a matching library. +inline ISteamScreenshots *SteamAPI_SteamScreenshots() { return SteamAPI_SteamScreenshots_v003(); } +S_API ScreenshotHandle SteamAPI_ISteamScreenshots_WriteScreenshot( ISteamScreenshots* self, void * pubRGB, uint32 cubRGB, int nWidth, int nHeight ); +S_API ScreenshotHandle SteamAPI_ISteamScreenshots_AddScreenshotToLibrary( ISteamScreenshots* self, const char * pchFilename, const char * pchThumbnailFilename, int nWidth, int nHeight ); +S_API void SteamAPI_ISteamScreenshots_TriggerScreenshot( ISteamScreenshots* self ); +S_API void SteamAPI_ISteamScreenshots_HookScreenshots( ISteamScreenshots* self, bool bHook ); +S_API bool SteamAPI_ISteamScreenshots_SetLocation( ISteamScreenshots* self, ScreenshotHandle hScreenshot, const char * pchLocation ); +S_API bool SteamAPI_ISteamScreenshots_TagUser( ISteamScreenshots* self, ScreenshotHandle hScreenshot, uint64_steamid steamID ); +S_API bool SteamAPI_ISteamScreenshots_TagPublishedFile( ISteamScreenshots* self, ScreenshotHandle hScreenshot, PublishedFileId_t unPublishedFileID ); +S_API bool SteamAPI_ISteamScreenshots_IsScreenshotsHooked( ISteamScreenshots* self ); +S_API ScreenshotHandle SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary( ISteamScreenshots* self, EVRScreenshotType eType, const char * pchFilename, const char * pchVRFilename ); + +// ISteamMusic + +// A versioned accessor is exported by the library +S_API ISteamMusic *SteamAPI_SteamMusic_v001(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamMusic(), but using this ensures that you are using a matching library. +inline ISteamMusic *SteamAPI_SteamMusic() { return SteamAPI_SteamMusic_v001(); } +S_API bool SteamAPI_ISteamMusic_BIsEnabled( ISteamMusic* self ); +S_API bool SteamAPI_ISteamMusic_BIsPlaying( ISteamMusic* self ); +S_API AudioPlayback_Status SteamAPI_ISteamMusic_GetPlaybackStatus( ISteamMusic* self ); +S_API void SteamAPI_ISteamMusic_Play( ISteamMusic* self ); +S_API void SteamAPI_ISteamMusic_Pause( ISteamMusic* self ); +S_API void SteamAPI_ISteamMusic_PlayPrevious( ISteamMusic* self ); +S_API void SteamAPI_ISteamMusic_PlayNext( ISteamMusic* self ); +S_API void SteamAPI_ISteamMusic_SetVolume( ISteamMusic* self, float flVolume ); +S_API float SteamAPI_ISteamMusic_GetVolume( ISteamMusic* self ); + +// ISteamMusicRemote + +// A versioned accessor is exported by the library +S_API ISteamMusicRemote *SteamAPI_SteamMusicRemote_v001(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamMusicRemote(), but using this ensures that you are using a matching library. +inline ISteamMusicRemote *SteamAPI_SteamMusicRemote() { return SteamAPI_SteamMusicRemote_v001(); } +S_API bool SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote( ISteamMusicRemote* self, const char * pchName ); +S_API bool SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote( ISteamMusicRemote* self ); +S_API bool SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote( ISteamMusicRemote* self ); +S_API bool SteamAPI_ISteamMusicRemote_BActivationSuccess( ISteamMusicRemote* self, bool bValue ); +S_API bool SteamAPI_ISteamMusicRemote_SetDisplayName( ISteamMusicRemote* self, const char * pchDisplayName ); +S_API bool SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64( ISteamMusicRemote* self, void * pvBuffer, uint32 cbBufferLength ); +S_API bool SteamAPI_ISteamMusicRemote_EnablePlayPrevious( ISteamMusicRemote* self, bool bValue ); +S_API bool SteamAPI_ISteamMusicRemote_EnablePlayNext( ISteamMusicRemote* self, bool bValue ); +S_API bool SteamAPI_ISteamMusicRemote_EnableShuffled( ISteamMusicRemote* self, bool bValue ); +S_API bool SteamAPI_ISteamMusicRemote_EnableLooped( ISteamMusicRemote* self, bool bValue ); +S_API bool SteamAPI_ISteamMusicRemote_EnableQueue( ISteamMusicRemote* self, bool bValue ); +S_API bool SteamAPI_ISteamMusicRemote_EnablePlaylists( ISteamMusicRemote* self, bool bValue ); +S_API bool SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus( ISteamMusicRemote* self, AudioPlayback_Status nStatus ); +S_API bool SteamAPI_ISteamMusicRemote_UpdateShuffled( ISteamMusicRemote* self, bool bValue ); +S_API bool SteamAPI_ISteamMusicRemote_UpdateLooped( ISteamMusicRemote* self, bool bValue ); +S_API bool SteamAPI_ISteamMusicRemote_UpdateVolume( ISteamMusicRemote* self, float flValue ); +S_API bool SteamAPI_ISteamMusicRemote_CurrentEntryWillChange( ISteamMusicRemote* self ); +S_API bool SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable( ISteamMusicRemote* self, bool bAvailable ); +S_API bool SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText( ISteamMusicRemote* self, const char * pchText ); +S_API bool SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( ISteamMusicRemote* self, int nValue ); +S_API bool SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt( ISteamMusicRemote* self, void * pvBuffer, uint32 cbBufferLength ); +S_API bool SteamAPI_ISteamMusicRemote_CurrentEntryDidChange( ISteamMusicRemote* self ); +S_API bool SteamAPI_ISteamMusicRemote_QueueWillChange( ISteamMusicRemote* self ); +S_API bool SteamAPI_ISteamMusicRemote_ResetQueueEntries( ISteamMusicRemote* self ); +S_API bool SteamAPI_ISteamMusicRemote_SetQueueEntry( ISteamMusicRemote* self, int nID, int nPosition, const char * pchEntryText ); +S_API bool SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry( ISteamMusicRemote* self, int nID ); +S_API bool SteamAPI_ISteamMusicRemote_QueueDidChange( ISteamMusicRemote* self ); +S_API bool SteamAPI_ISteamMusicRemote_PlaylistWillChange( ISteamMusicRemote* self ); +S_API bool SteamAPI_ISteamMusicRemote_ResetPlaylistEntries( ISteamMusicRemote* self ); +S_API bool SteamAPI_ISteamMusicRemote_SetPlaylistEntry( ISteamMusicRemote* self, int nID, int nPosition, const char * pchEntryText ); +S_API bool SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry( ISteamMusicRemote* self, int nID ); +S_API bool SteamAPI_ISteamMusicRemote_PlaylistDidChange( ISteamMusicRemote* self ); + +// ISteamHTTP + +// A versioned accessor is exported by the library +S_API ISteamHTTP *SteamAPI_SteamHTTP_v003(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamHTTP(), but using this ensures that you are using a matching library. +inline ISteamHTTP *SteamAPI_SteamHTTP() { return SteamAPI_SteamHTTP_v003(); } + +// A versioned accessor is exported by the library +S_API ISteamHTTP *SteamAPI_SteamGameServerHTTP_v003(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamGameServerHTTP(), but using this ensures that you are using a matching library. +inline ISteamHTTP *SteamAPI_SteamGameServerHTTP() { return SteamAPI_SteamGameServerHTTP_v003(); } +S_API HTTPRequestHandle SteamAPI_ISteamHTTP_CreateHTTPRequest( ISteamHTTP* self, EHTTPMethod eHTTPRequestMethod, const char * pchAbsoluteURL ); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestContextValue( ISteamHTTP* self, HTTPRequestHandle hRequest, uint64 ulContextValue ); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( ISteamHTTP* self, HTTPRequestHandle hRequest, uint32 unTimeoutSeconds ); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue( ISteamHTTP* self, HTTPRequestHandle hRequest, const char * pchHeaderName, const char * pchHeaderValue ); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter( ISteamHTTP* self, HTTPRequestHandle hRequest, const char * pchParamName, const char * pchParamValue ); +S_API bool SteamAPI_ISteamHTTP_SendHTTPRequest( ISteamHTTP* self, HTTPRequestHandle hRequest, SteamAPICall_t * pCallHandle ); +S_API bool SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse( ISteamHTTP* self, HTTPRequestHandle hRequest, SteamAPICall_t * pCallHandle ); +S_API bool SteamAPI_ISteamHTTP_DeferHTTPRequest( ISteamHTTP* self, HTTPRequestHandle hRequest ); +S_API bool SteamAPI_ISteamHTTP_PrioritizeHTTPRequest( ISteamHTTP* self, HTTPRequestHandle hRequest ); +S_API bool SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize( ISteamHTTP* self, HTTPRequestHandle hRequest, const char * pchHeaderName, uint32 * unResponseHeaderSize ); +S_API bool SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue( ISteamHTTP* self, HTTPRequestHandle hRequest, const char * pchHeaderName, uint8 * pHeaderValueBuffer, uint32 unBufferSize ); +S_API bool SteamAPI_ISteamHTTP_GetHTTPResponseBodySize( ISteamHTTP* self, HTTPRequestHandle hRequest, uint32 * unBodySize ); +S_API bool SteamAPI_ISteamHTTP_GetHTTPResponseBodyData( ISteamHTTP* self, HTTPRequestHandle hRequest, uint8 * pBodyDataBuffer, uint32 unBufferSize ); +S_API bool SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData( ISteamHTTP* self, HTTPRequestHandle hRequest, uint32 cOffset, uint8 * pBodyDataBuffer, uint32 unBufferSize ); +S_API bool SteamAPI_ISteamHTTP_ReleaseHTTPRequest( ISteamHTTP* self, HTTPRequestHandle hRequest ); +S_API bool SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct( ISteamHTTP* self, HTTPRequestHandle hRequest, float * pflPercentOut ); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody( ISteamHTTP* self, HTTPRequestHandle hRequest, const char * pchContentType, uint8 * pubBody, uint32 unBodyLen ); +S_API HTTPCookieContainerHandle SteamAPI_ISteamHTTP_CreateCookieContainer( ISteamHTTP* self, bool bAllowResponsesToModify ); +S_API bool SteamAPI_ISteamHTTP_ReleaseCookieContainer( ISteamHTTP* self, HTTPCookieContainerHandle hCookieContainer ); +S_API bool SteamAPI_ISteamHTTP_SetCookie( ISteamHTTP* self, HTTPCookieContainerHandle hCookieContainer, const char * pchHost, const char * pchUrl, const char * pchCookie ); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer( ISteamHTTP* self, HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer ); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo( ISteamHTTP* self, HTTPRequestHandle hRequest, const char * pchUserAgentInfo ); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( ISteamHTTP* self, HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate ); +S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( ISteamHTTP* self, HTTPRequestHandle hRequest, uint32 unMilliseconds ); +S_API bool SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut( ISteamHTTP* self, HTTPRequestHandle hRequest, bool * pbWasTimedOut ); + +// ISteamInput + +// A versioned accessor is exported by the library +S_API ISteamInput *SteamAPI_SteamInput_v006(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamInput(), but using this ensures that you are using a matching library. +inline ISteamInput *SteamAPI_SteamInput() { return SteamAPI_SteamInput_v006(); } +S_API bool SteamAPI_ISteamInput_Init( ISteamInput* self, bool bExplicitlyCallRunFrame ); +S_API bool SteamAPI_ISteamInput_Shutdown( ISteamInput* self ); +S_API bool SteamAPI_ISteamInput_SetInputActionManifestFilePath( ISteamInput* self, const char * pchInputActionManifestAbsolutePath ); +S_API void SteamAPI_ISteamInput_RunFrame( ISteamInput* self, bool bReservedValue ); +S_API bool SteamAPI_ISteamInput_BWaitForData( ISteamInput* self, bool bWaitForever, uint32 unTimeout ); +S_API bool SteamAPI_ISteamInput_BNewDataAvailable( ISteamInput* self ); +S_API int SteamAPI_ISteamInput_GetConnectedControllers( ISteamInput* self, InputHandle_t * handlesOut ); +S_API void SteamAPI_ISteamInput_EnableDeviceCallbacks( ISteamInput* self ); +S_API void SteamAPI_ISteamInput_EnableActionEventCallbacks( ISteamInput* self, SteamInputActionEventCallbackPointer pCallback ); +S_API InputActionSetHandle_t SteamAPI_ISteamInput_GetActionSetHandle( ISteamInput* self, const char * pszActionSetName ); +S_API void SteamAPI_ISteamInput_ActivateActionSet( ISteamInput* self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle ); +S_API InputActionSetHandle_t SteamAPI_ISteamInput_GetCurrentActionSet( ISteamInput* self, InputHandle_t inputHandle ); +S_API void SteamAPI_ISteamInput_ActivateActionSetLayer( ISteamInput* self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ); +S_API void SteamAPI_ISteamInput_DeactivateActionSetLayer( ISteamInput* self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ); +S_API void SteamAPI_ISteamInput_DeactivateAllActionSetLayers( ISteamInput* self, InputHandle_t inputHandle ); +S_API int SteamAPI_ISteamInput_GetActiveActionSetLayers( ISteamInput* self, InputHandle_t inputHandle, InputActionSetHandle_t * handlesOut ); +S_API InputDigitalActionHandle_t SteamAPI_ISteamInput_GetDigitalActionHandle( ISteamInput* self, const char * pszActionName ); +S_API InputDigitalActionData_t SteamAPI_ISteamInput_GetDigitalActionData( ISteamInput* self, InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ); +S_API int SteamAPI_ISteamInput_GetDigitalActionOrigins( ISteamInput* self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, EInputActionOrigin * originsOut ); +S_API const char * SteamAPI_ISteamInput_GetStringForDigitalActionName( ISteamInput* self, InputDigitalActionHandle_t eActionHandle ); +S_API InputAnalogActionHandle_t SteamAPI_ISteamInput_GetAnalogActionHandle( ISteamInput* self, const char * pszActionName ); +S_API InputAnalogActionData_t SteamAPI_ISteamInput_GetAnalogActionData( ISteamInput* self, InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ); +S_API int SteamAPI_ISteamInput_GetAnalogActionOrigins( ISteamInput* self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, EInputActionOrigin * originsOut ); +S_API const char * SteamAPI_ISteamInput_GetGlyphPNGForActionOrigin( ISteamInput* self, EInputActionOrigin eOrigin, ESteamInputGlyphSize eSize, uint32 unFlags ); +S_API const char * SteamAPI_ISteamInput_GetGlyphSVGForActionOrigin( ISteamInput* self, EInputActionOrigin eOrigin, uint32 unFlags ); +S_API const char * SteamAPI_ISteamInput_GetGlyphForActionOrigin_Legacy( ISteamInput* self, EInputActionOrigin eOrigin ); +S_API const char * SteamAPI_ISteamInput_GetStringForActionOrigin( ISteamInput* self, EInputActionOrigin eOrigin ); +S_API const char * SteamAPI_ISteamInput_GetStringForAnalogActionName( ISteamInput* self, InputAnalogActionHandle_t eActionHandle ); +S_API void SteamAPI_ISteamInput_StopAnalogActionMomentum( ISteamInput* self, InputHandle_t inputHandle, InputAnalogActionHandle_t eAction ); +S_API InputMotionData_t SteamAPI_ISteamInput_GetMotionData( ISteamInput* self, InputHandle_t inputHandle ); +S_API void SteamAPI_ISteamInput_TriggerVibration( ISteamInput* self, InputHandle_t inputHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed ); +S_API void SteamAPI_ISteamInput_TriggerVibrationExtended( ISteamInput* self, InputHandle_t inputHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed, unsigned short usLeftTriggerSpeed, unsigned short usRightTriggerSpeed ); +S_API void SteamAPI_ISteamInput_TriggerSimpleHapticEvent( ISteamInput* self, InputHandle_t inputHandle, EControllerHapticLocation eHapticLocation, uint8 nIntensity, char nGainDB, uint8 nOtherIntensity, char nOtherGainDB ); +S_API void SteamAPI_ISteamInput_SetLEDColor( ISteamInput* self, InputHandle_t inputHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ); +S_API void SteamAPI_ISteamInput_Legacy_TriggerHapticPulse( ISteamInput* self, InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec ); +S_API void SteamAPI_ISteamInput_Legacy_TriggerRepeatedHapticPulse( ISteamInput* self, InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags ); +S_API bool SteamAPI_ISteamInput_ShowBindingPanel( ISteamInput* self, InputHandle_t inputHandle ); +S_API ESteamInputType SteamAPI_ISteamInput_GetInputTypeForHandle( ISteamInput* self, InputHandle_t inputHandle ); +S_API InputHandle_t SteamAPI_ISteamInput_GetControllerForGamepadIndex( ISteamInput* self, int nIndex ); +S_API int SteamAPI_ISteamInput_GetGamepadIndexForController( ISteamInput* self, InputHandle_t ulinputHandle ); +S_API const char * SteamAPI_ISteamInput_GetStringForXboxOrigin( ISteamInput* self, EXboxOrigin eOrigin ); +S_API const char * SteamAPI_ISteamInput_GetGlyphForXboxOrigin( ISteamInput* self, EXboxOrigin eOrigin ); +S_API EInputActionOrigin SteamAPI_ISteamInput_GetActionOriginFromXboxOrigin( ISteamInput* self, InputHandle_t inputHandle, EXboxOrigin eOrigin ); +S_API EInputActionOrigin SteamAPI_ISteamInput_TranslateActionOrigin( ISteamInput* self, ESteamInputType eDestinationInputType, EInputActionOrigin eSourceOrigin ); +S_API bool SteamAPI_ISteamInput_GetDeviceBindingRevision( ISteamInput* self, InputHandle_t inputHandle, int * pMajor, int * pMinor ); +S_API uint32 SteamAPI_ISteamInput_GetRemotePlaySessionID( ISteamInput* self, InputHandle_t inputHandle ); +S_API uint16 SteamAPI_ISteamInput_GetSessionInputConfigurationSettings( ISteamInput* self ); +S_API void SteamAPI_ISteamInput_SetDualSenseTriggerEffect( ISteamInput* self, InputHandle_t inputHandle, const ScePadTriggerEffectParam * pParam ); + +// ISteamController + +// A versioned accessor is exported by the library +S_API ISteamController *SteamAPI_SteamController_v008(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamController(), but using this ensures that you are using a matching library. +inline ISteamController *SteamAPI_SteamController() { return SteamAPI_SteamController_v008(); } +S_API bool SteamAPI_ISteamController_Init( ISteamController* self ); +S_API bool SteamAPI_ISteamController_Shutdown( ISteamController* self ); +S_API void SteamAPI_ISteamController_RunFrame( ISteamController* self ); +S_API int SteamAPI_ISteamController_GetConnectedControllers( ISteamController* self, ControllerHandle_t * handlesOut ); +S_API ControllerActionSetHandle_t SteamAPI_ISteamController_GetActionSetHandle( ISteamController* self, const char * pszActionSetName ); +S_API void SteamAPI_ISteamController_ActivateActionSet( ISteamController* self, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle ); +S_API ControllerActionSetHandle_t SteamAPI_ISteamController_GetCurrentActionSet( ISteamController* self, ControllerHandle_t controllerHandle ); +S_API void SteamAPI_ISteamController_ActivateActionSetLayer( ISteamController* self, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle ); +S_API void SteamAPI_ISteamController_DeactivateActionSetLayer( ISteamController* self, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle ); +S_API void SteamAPI_ISteamController_DeactivateAllActionSetLayers( ISteamController* self, ControllerHandle_t controllerHandle ); +S_API int SteamAPI_ISteamController_GetActiveActionSetLayers( ISteamController* self, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t * handlesOut ); +S_API ControllerDigitalActionHandle_t SteamAPI_ISteamController_GetDigitalActionHandle( ISteamController* self, const char * pszActionName ); +S_API InputDigitalActionData_t SteamAPI_ISteamController_GetDigitalActionData( ISteamController* self, ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle ); +S_API int SteamAPI_ISteamController_GetDigitalActionOrigins( ISteamController* self, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, EControllerActionOrigin * originsOut ); +S_API ControllerAnalogActionHandle_t SteamAPI_ISteamController_GetAnalogActionHandle( ISteamController* self, const char * pszActionName ); +S_API InputAnalogActionData_t SteamAPI_ISteamController_GetAnalogActionData( ISteamController* self, ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle ); +S_API int SteamAPI_ISteamController_GetAnalogActionOrigins( ISteamController* self, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, EControllerActionOrigin * originsOut ); +S_API const char * SteamAPI_ISteamController_GetGlyphForActionOrigin( ISteamController* self, EControllerActionOrigin eOrigin ); +S_API const char * SteamAPI_ISteamController_GetStringForActionOrigin( ISteamController* self, EControllerActionOrigin eOrigin ); +S_API void SteamAPI_ISteamController_StopAnalogActionMomentum( ISteamController* self, ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction ); +S_API InputMotionData_t SteamAPI_ISteamController_GetMotionData( ISteamController* self, ControllerHandle_t controllerHandle ); +S_API void SteamAPI_ISteamController_TriggerHapticPulse( ISteamController* self, ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec ); +S_API void SteamAPI_ISteamController_TriggerRepeatedHapticPulse( ISteamController* self, ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags ); +S_API void SteamAPI_ISteamController_TriggerVibration( ISteamController* self, ControllerHandle_t controllerHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed ); +S_API void SteamAPI_ISteamController_SetLEDColor( ISteamController* self, ControllerHandle_t controllerHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ); +S_API bool SteamAPI_ISteamController_ShowBindingPanel( ISteamController* self, ControllerHandle_t controllerHandle ); +S_API ESteamInputType SteamAPI_ISteamController_GetInputTypeForHandle( ISteamController* self, ControllerHandle_t controllerHandle ); +S_API ControllerHandle_t SteamAPI_ISteamController_GetControllerForGamepadIndex( ISteamController* self, int nIndex ); +S_API int SteamAPI_ISteamController_GetGamepadIndexForController( ISteamController* self, ControllerHandle_t ulControllerHandle ); +S_API const char * SteamAPI_ISteamController_GetStringForXboxOrigin( ISteamController* self, EXboxOrigin eOrigin ); +S_API const char * SteamAPI_ISteamController_GetGlyphForXboxOrigin( ISteamController* self, EXboxOrigin eOrigin ); +S_API EControllerActionOrigin SteamAPI_ISteamController_GetActionOriginFromXboxOrigin( ISteamController* self, ControllerHandle_t controllerHandle, EXboxOrigin eOrigin ); +S_API EControllerActionOrigin SteamAPI_ISteamController_TranslateActionOrigin( ISteamController* self, ESteamInputType eDestinationInputType, EControllerActionOrigin eSourceOrigin ); +S_API bool SteamAPI_ISteamController_GetControllerBindingRevision( ISteamController* self, ControllerHandle_t controllerHandle, int * pMajor, int * pMinor ); + +// ISteamUGC + +// A versioned accessor is exported by the library +S_API ISteamUGC *SteamAPI_SteamUGC_v021(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamUGC(), but using this ensures that you are using a matching library. +inline ISteamUGC *SteamAPI_SteamUGC() { return SteamAPI_SteamUGC_v021(); } + +// A versioned accessor is exported by the library +S_API ISteamUGC *SteamAPI_SteamGameServerUGC_v021(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamGameServerUGC(), but using this ensures that you are using a matching library. +inline ISteamUGC *SteamAPI_SteamGameServerUGC() { return SteamAPI_SteamGameServerUGC_v021(); } +S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryUserUGCRequest( ISteamUGC* self, AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ); +S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequestPage( ISteamUGC* self, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ); +S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequestCursor( ISteamUGC* self, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, const char * pchCursor ); +S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest( ISteamUGC* self, PublishedFileId_t * pvecPublishedFileID, uint32 unNumPublishedFileIDs ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_SendQueryUGCRequest( ISteamUGC* self, UGCQueryHandle_t handle ); +S_API bool SteamAPI_ISteamUGC_GetQueryUGCResult( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t * pDetails ); +S_API uint32 SteamAPI_ISteamUGC_GetQueryUGCNumTags( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index ); +S_API bool SteamAPI_ISteamUGC_GetQueryUGCTag( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index, uint32 indexTag, char * pchValue, uint32 cchValueSize ); +S_API bool SteamAPI_ISteamUGC_GetQueryUGCTagDisplayName( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index, uint32 indexTag, char * pchValue, uint32 cchValueSize ); +S_API bool SteamAPI_ISteamUGC_GetQueryUGCPreviewURL( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index, char * pchURL, uint32 cchURLSize ); +S_API bool SteamAPI_ISteamUGC_GetQueryUGCMetadata( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index, char * pchMetadata, uint32 cchMetadatasize ); +S_API bool SteamAPI_ISteamUGC_GetQueryUGCChildren( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index, PublishedFileId_t * pvecPublishedFileID, uint32 cMaxEntries ); +S_API bool SteamAPI_ISteamUGC_GetQueryUGCStatistic( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index, EItemStatistic eStatType, uint64 * pStatValue ); +S_API uint32 SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index ); +S_API bool SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index, uint32 previewIndex, char * pchURLOrVideoID, uint32 cchURLSize, char * pchOriginalFileName, uint32 cchOriginalFileNameSize, EItemPreviewType * pPreviewType ); +S_API uint32 SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index ); +S_API bool SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index, uint32 keyValueTagIndex, char * pchKey, uint32 cchKeySize, char * pchValue, uint32 cchValueSize ); +S_API bool SteamAPI_ISteamUGC_GetQueryFirstUGCKeyValueTag( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index, const char * pchKey, char * pchValue, uint32 cchValueSize ); +S_API uint32 SteamAPI_ISteamUGC_GetNumSupportedGameVersions( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index ); +S_API bool SteamAPI_ISteamUGC_GetSupportedGameVersionData( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index, uint32 versionIndex, char * pchGameBranchMin, char * pchGameBranchMax, uint32 cchGameBranchSize ); +S_API uint32 SteamAPI_ISteamUGC_GetQueryUGCContentDescriptors( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index, EUGCContentDescriptorID * pvecDescriptors, uint32 cMaxEntries ); +S_API bool SteamAPI_ISteamUGC_ReleaseQueryUGCRequest( ISteamUGC* self, UGCQueryHandle_t handle ); +S_API bool SteamAPI_ISteamUGC_AddRequiredTag( ISteamUGC* self, UGCQueryHandle_t handle, const char * pTagName ); +S_API bool SteamAPI_ISteamUGC_AddRequiredTagGroup( ISteamUGC* self, UGCQueryHandle_t handle, const SteamParamStringArray_t * pTagGroups ); +S_API bool SteamAPI_ISteamUGC_AddExcludedTag( ISteamUGC* self, UGCQueryHandle_t handle, const char * pTagName ); +S_API bool SteamAPI_ISteamUGC_SetReturnOnlyIDs( ISteamUGC* self, UGCQueryHandle_t handle, bool bReturnOnlyIDs ); +S_API bool SteamAPI_ISteamUGC_SetReturnKeyValueTags( ISteamUGC* self, UGCQueryHandle_t handle, bool bReturnKeyValueTags ); +S_API bool SteamAPI_ISteamUGC_SetReturnLongDescription( ISteamUGC* self, UGCQueryHandle_t handle, bool bReturnLongDescription ); +S_API bool SteamAPI_ISteamUGC_SetReturnMetadata( ISteamUGC* self, UGCQueryHandle_t handle, bool bReturnMetadata ); +S_API bool SteamAPI_ISteamUGC_SetReturnChildren( ISteamUGC* self, UGCQueryHandle_t handle, bool bReturnChildren ); +S_API bool SteamAPI_ISteamUGC_SetReturnAdditionalPreviews( ISteamUGC* self, UGCQueryHandle_t handle, bool bReturnAdditionalPreviews ); +S_API bool SteamAPI_ISteamUGC_SetReturnTotalOnly( ISteamUGC* self, UGCQueryHandle_t handle, bool bReturnTotalOnly ); +S_API bool SteamAPI_ISteamUGC_SetReturnPlaytimeStats( ISteamUGC* self, UGCQueryHandle_t handle, uint32 unDays ); +S_API bool SteamAPI_ISteamUGC_SetLanguage( ISteamUGC* self, UGCQueryHandle_t handle, const char * pchLanguage ); +S_API bool SteamAPI_ISteamUGC_SetAllowCachedResponse( ISteamUGC* self, UGCQueryHandle_t handle, uint32 unMaxAgeSeconds ); +S_API bool SteamAPI_ISteamUGC_SetAdminQuery( ISteamUGC* self, UGCUpdateHandle_t handle, bool bAdminQuery ); +S_API bool SteamAPI_ISteamUGC_SetCloudFileNameFilter( ISteamUGC* self, UGCQueryHandle_t handle, const char * pMatchCloudFileName ); +S_API bool SteamAPI_ISteamUGC_SetMatchAnyTag( ISteamUGC* self, UGCQueryHandle_t handle, bool bMatchAnyTag ); +S_API bool SteamAPI_ISteamUGC_SetSearchText( ISteamUGC* self, UGCQueryHandle_t handle, const char * pSearchText ); +S_API bool SteamAPI_ISteamUGC_SetRankedByTrendDays( ISteamUGC* self, UGCQueryHandle_t handle, uint32 unDays ); +S_API bool SteamAPI_ISteamUGC_SetTimeCreatedDateRange( ISteamUGC* self, UGCQueryHandle_t handle, RTime32 rtStart, RTime32 rtEnd ); +S_API bool SteamAPI_ISteamUGC_SetTimeUpdatedDateRange( ISteamUGC* self, UGCQueryHandle_t handle, RTime32 rtStart, RTime32 rtEnd ); +S_API bool SteamAPI_ISteamUGC_AddRequiredKeyValueTag( ISteamUGC* self, UGCQueryHandle_t handle, const char * pKey, const char * pValue ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_RequestUGCDetails( ISteamUGC* self, PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_CreateItem( ISteamUGC* self, AppId_t nConsumerAppId, EWorkshopFileType eFileType ); +S_API UGCUpdateHandle_t SteamAPI_ISteamUGC_StartItemUpdate( ISteamUGC* self, AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID ); +S_API bool SteamAPI_ISteamUGC_SetItemTitle( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pchTitle ); +S_API bool SteamAPI_ISteamUGC_SetItemDescription( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pchDescription ); +S_API bool SteamAPI_ISteamUGC_SetItemUpdateLanguage( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pchLanguage ); +S_API bool SteamAPI_ISteamUGC_SetItemMetadata( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pchMetaData ); +S_API bool SteamAPI_ISteamUGC_SetItemVisibility( ISteamUGC* self, UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility ); +S_API bool SteamAPI_ISteamUGC_SetItemTags( ISteamUGC* self, UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t * pTags, bool bAllowAdminTags ); +S_API bool SteamAPI_ISteamUGC_SetItemContent( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pszContentFolder ); +S_API bool SteamAPI_ISteamUGC_SetItemPreview( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pszPreviewFile ); +S_API bool SteamAPI_ISteamUGC_SetAllowLegacyUpload( ISteamUGC* self, UGCUpdateHandle_t handle, bool bAllowLegacyUpload ); +S_API bool SteamAPI_ISteamUGC_RemoveAllItemKeyValueTags( ISteamUGC* self, UGCUpdateHandle_t handle ); +S_API bool SteamAPI_ISteamUGC_RemoveItemKeyValueTags( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pchKey ); +S_API bool SteamAPI_ISteamUGC_AddItemKeyValueTag( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pchKey, const char * pchValue ); +S_API bool SteamAPI_ISteamUGC_AddItemPreviewFile( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pszPreviewFile, EItemPreviewType type ); +S_API bool SteamAPI_ISteamUGC_AddItemPreviewVideo( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pszVideoID ); +S_API bool SteamAPI_ISteamUGC_UpdateItemPreviewFile( ISteamUGC* self, UGCUpdateHandle_t handle, uint32 index, const char * pszPreviewFile ); +S_API bool SteamAPI_ISteamUGC_UpdateItemPreviewVideo( ISteamUGC* self, UGCUpdateHandle_t handle, uint32 index, const char * pszVideoID ); +S_API bool SteamAPI_ISteamUGC_RemoveItemPreview( ISteamUGC* self, UGCUpdateHandle_t handle, uint32 index ); +S_API bool SteamAPI_ISteamUGC_AddContentDescriptor( ISteamUGC* self, UGCUpdateHandle_t handle, EUGCContentDescriptorID descid ); +S_API bool SteamAPI_ISteamUGC_RemoveContentDescriptor( ISteamUGC* self, UGCUpdateHandle_t handle, EUGCContentDescriptorID descid ); +S_API bool SteamAPI_ISteamUGC_SetRequiredGameVersions( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pszGameBranchMin, const char * pszGameBranchMax ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_SubmitItemUpdate( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pchChangeNote ); +S_API EItemUpdateStatus SteamAPI_ISteamUGC_GetItemUpdateProgress( ISteamUGC* self, UGCUpdateHandle_t handle, uint64 * punBytesProcessed, uint64 * punBytesTotal ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_SetUserItemVote( ISteamUGC* self, PublishedFileId_t nPublishedFileID, bool bVoteUp ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_GetUserItemVote( ISteamUGC* self, PublishedFileId_t nPublishedFileID ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_AddItemToFavorites( ISteamUGC* self, AppId_t nAppId, PublishedFileId_t nPublishedFileID ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_RemoveItemFromFavorites( ISteamUGC* self, AppId_t nAppId, PublishedFileId_t nPublishedFileID ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_SubscribeItem( ISteamUGC* self, PublishedFileId_t nPublishedFileID ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_UnsubscribeItem( ISteamUGC* self, PublishedFileId_t nPublishedFileID ); +S_API uint32 SteamAPI_ISteamUGC_GetNumSubscribedItems( ISteamUGC* self, bool bIncludeLocallyDisabled ); +S_API uint32 SteamAPI_ISteamUGC_GetSubscribedItems( ISteamUGC* self, PublishedFileId_t * pvecPublishedFileID, uint32 cMaxEntries, bool bIncludeLocallyDisabled ); +S_API uint32 SteamAPI_ISteamUGC_GetItemState( ISteamUGC* self, PublishedFileId_t nPublishedFileID ); +S_API bool SteamAPI_ISteamUGC_GetItemInstallInfo( ISteamUGC* self, PublishedFileId_t nPublishedFileID, uint64 * punSizeOnDisk, char * pchFolder, uint32 cchFolderSize, uint32 * punTimeStamp ); +S_API bool SteamAPI_ISteamUGC_GetItemDownloadInfo( ISteamUGC* self, PublishedFileId_t nPublishedFileID, uint64 * punBytesDownloaded, uint64 * punBytesTotal ); +S_API bool SteamAPI_ISteamUGC_DownloadItem( ISteamUGC* self, PublishedFileId_t nPublishedFileID, bool bHighPriority ); +S_API bool SteamAPI_ISteamUGC_BInitWorkshopForGameServer( ISteamUGC* self, DepotId_t unWorkshopDepotID, const char * pszFolder ); +S_API void SteamAPI_ISteamUGC_SuspendDownloads( ISteamUGC* self, bool bSuspend ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_StartPlaytimeTracking( ISteamUGC* self, PublishedFileId_t * pvecPublishedFileID, uint32 unNumPublishedFileIDs ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_StopPlaytimeTracking( ISteamUGC* self, PublishedFileId_t * pvecPublishedFileID, uint32 unNumPublishedFileIDs ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems( ISteamUGC* self ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_AddDependency( ISteamUGC* self, PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_RemoveDependency( ISteamUGC* self, PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_AddAppDependency( ISteamUGC* self, PublishedFileId_t nPublishedFileID, AppId_t nAppID ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_RemoveAppDependency( ISteamUGC* self, PublishedFileId_t nPublishedFileID, AppId_t nAppID ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_GetAppDependencies( ISteamUGC* self, PublishedFileId_t nPublishedFileID ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_DeleteItem( ISteamUGC* self, PublishedFileId_t nPublishedFileID ); +S_API bool SteamAPI_ISteamUGC_ShowWorkshopEULA( ISteamUGC* self ); +S_API SteamAPICall_t SteamAPI_ISteamUGC_GetWorkshopEULAStatus( ISteamUGC* self ); +S_API uint32 SteamAPI_ISteamUGC_GetUserContentDescriptorPreferences( ISteamUGC* self, EUGCContentDescriptorID * pvecDescriptors, uint32 cMaxEntries ); +S_API bool SteamAPI_ISteamUGC_SetItemsDisabledLocally( ISteamUGC* self, PublishedFileId_t * pvecPublishedFileIDs, uint32 unNumPublishedFileIDs, bool bDisabledLocally ); +S_API bool SteamAPI_ISteamUGC_SetSubscriptionsLoadOrder( ISteamUGC* self, PublishedFileId_t * pvecPublishedFileIDs, uint32 unNumPublishedFileIDs ); + +// ISteamHTMLSurface + +// A versioned accessor is exported by the library +S_API ISteamHTMLSurface *SteamAPI_SteamHTMLSurface_v005(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamHTMLSurface(), but using this ensures that you are using a matching library. +inline ISteamHTMLSurface *SteamAPI_SteamHTMLSurface() { return SteamAPI_SteamHTMLSurface_v005(); } +S_API bool SteamAPI_ISteamHTMLSurface_Init( ISteamHTMLSurface* self ); +S_API bool SteamAPI_ISteamHTMLSurface_Shutdown( ISteamHTMLSurface* self ); +S_API SteamAPICall_t SteamAPI_ISteamHTMLSurface_CreateBrowser( ISteamHTMLSurface* self, const char * pchUserAgent, const char * pchUserCSS ); +S_API void SteamAPI_ISteamHTMLSurface_RemoveBrowser( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle ); +S_API void SteamAPI_ISteamHTMLSurface_LoadURL( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, const char * pchURL, const char * pchPostData ); +S_API void SteamAPI_ISteamHTMLSurface_SetSize( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, uint32 unWidth, uint32 unHeight ); +S_API void SteamAPI_ISteamHTMLSurface_StopLoad( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle ); +S_API void SteamAPI_ISteamHTMLSurface_Reload( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle ); +S_API void SteamAPI_ISteamHTMLSurface_GoBack( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle ); +S_API void SteamAPI_ISteamHTMLSurface_GoForward( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle ); +S_API void SteamAPI_ISteamHTMLSurface_AddHeader( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, const char * pchKey, const char * pchValue ); +S_API void SteamAPI_ISteamHTMLSurface_ExecuteJavascript( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, const char * pchScript ); +S_API void SteamAPI_ISteamHTMLSurface_MouseUp( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, ISteamHTMLSurface::EHTMLMouseButton eMouseButton ); +S_API void SteamAPI_ISteamHTMLSurface_MouseDown( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, ISteamHTMLSurface::EHTMLMouseButton eMouseButton ); +S_API void SteamAPI_ISteamHTMLSurface_MouseDoubleClick( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, ISteamHTMLSurface::EHTMLMouseButton eMouseButton ); +S_API void SteamAPI_ISteamHTMLSurface_MouseMove( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, int x, int y ); +S_API void SteamAPI_ISteamHTMLSurface_MouseWheel( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, int32 nDelta ); +S_API void SteamAPI_ISteamHTMLSurface_KeyDown( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers, bool bIsSystemKey ); +S_API void SteamAPI_ISteamHTMLSurface_KeyUp( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers ); +S_API void SteamAPI_ISteamHTMLSurface_KeyChar( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, uint32 cUnicodeChar, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers ); +S_API void SteamAPI_ISteamHTMLSurface_SetHorizontalScroll( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll ); +S_API void SteamAPI_ISteamHTMLSurface_SetVerticalScroll( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll ); +S_API void SteamAPI_ISteamHTMLSurface_SetKeyFocus( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, bool bHasKeyFocus ); +S_API void SteamAPI_ISteamHTMLSurface_ViewSource( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle ); +S_API void SteamAPI_ISteamHTMLSurface_CopyToClipboard( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle ); +S_API void SteamAPI_ISteamHTMLSurface_PasteFromClipboard( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle ); +S_API void SteamAPI_ISteamHTMLSurface_Find( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, const char * pchSearchStr, bool bCurrentlyInFind, bool bReverse ); +S_API void SteamAPI_ISteamHTMLSurface_StopFind( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle ); +S_API void SteamAPI_ISteamHTMLSurface_GetLinkAtPosition( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, int x, int y ); +S_API void SteamAPI_ISteamHTMLSurface_SetCookie( ISteamHTMLSurface* self, const char * pchHostname, const char * pchKey, const char * pchValue, const char * pchPath, RTime32 nExpires, bool bSecure, bool bHTTPOnly ); +S_API void SteamAPI_ISteamHTMLSurface_SetPageScaleFactor( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, float flZoom, int nPointX, int nPointY ); +S_API void SteamAPI_ISteamHTMLSurface_SetBackgroundMode( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, bool bBackgroundMode ); +S_API void SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, float flDPIScaling ); +S_API void SteamAPI_ISteamHTMLSurface_OpenDeveloperTools( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle ); +S_API void SteamAPI_ISteamHTMLSurface_AllowStartRequest( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, bool bAllowed ); +S_API void SteamAPI_ISteamHTMLSurface_JSDialogResponse( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, bool bResult ); +S_API void SteamAPI_ISteamHTMLSurface_FileLoadDialogResponse( ISteamHTMLSurface* self, HHTMLBrowser unBrowserHandle, const char ** pchSelectedFiles ); + +// ISteamInventory + +// A versioned accessor is exported by the library +S_API ISteamInventory *SteamAPI_SteamInventory_v003(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamInventory(), but using this ensures that you are using a matching library. +inline ISteamInventory *SteamAPI_SteamInventory() { return SteamAPI_SteamInventory_v003(); } + +// A versioned accessor is exported by the library +S_API ISteamInventory *SteamAPI_SteamGameServerInventory_v003(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamGameServerInventory(), but using this ensures that you are using a matching library. +inline ISteamInventory *SteamAPI_SteamGameServerInventory() { return SteamAPI_SteamGameServerInventory_v003(); } +S_API EResult SteamAPI_ISteamInventory_GetResultStatus( ISteamInventory* self, SteamInventoryResult_t resultHandle ); +S_API bool SteamAPI_ISteamInventory_GetResultItems( ISteamInventory* self, SteamInventoryResult_t resultHandle, SteamItemDetails_t * pOutItemsArray, uint32 * punOutItemsArraySize ); +S_API bool SteamAPI_ISteamInventory_GetResultItemProperty( ISteamInventory* self, SteamInventoryResult_t resultHandle, uint32 unItemIndex, const char * pchPropertyName, char * pchValueBuffer, uint32 * punValueBufferSizeOut ); +S_API uint32 SteamAPI_ISteamInventory_GetResultTimestamp( ISteamInventory* self, SteamInventoryResult_t resultHandle ); +S_API bool SteamAPI_ISteamInventory_CheckResultSteamID( ISteamInventory* self, SteamInventoryResult_t resultHandle, uint64_steamid steamIDExpected ); +S_API void SteamAPI_ISteamInventory_DestroyResult( ISteamInventory* self, SteamInventoryResult_t resultHandle ); +S_API bool SteamAPI_ISteamInventory_GetAllItems( ISteamInventory* self, SteamInventoryResult_t * pResultHandle ); +S_API bool SteamAPI_ISteamInventory_GetItemsByID( ISteamInventory* self, SteamInventoryResult_t * pResultHandle, const SteamItemInstanceID_t * pInstanceIDs, uint32 unCountInstanceIDs ); +S_API bool SteamAPI_ISteamInventory_SerializeResult( ISteamInventory* self, SteamInventoryResult_t resultHandle, void * pOutBuffer, uint32 * punOutBufferSize ); +S_API bool SteamAPI_ISteamInventory_DeserializeResult( ISteamInventory* self, SteamInventoryResult_t * pOutResultHandle, const void * pBuffer, uint32 unBufferSize, bool bRESERVED_MUST_BE_FALSE ); +S_API bool SteamAPI_ISteamInventory_GenerateItems( ISteamInventory* self, SteamInventoryResult_t * pResultHandle, const SteamItemDef_t * pArrayItemDefs, const uint32 * punArrayQuantity, uint32 unArrayLength ); +S_API bool SteamAPI_ISteamInventory_GrantPromoItems( ISteamInventory* self, SteamInventoryResult_t * pResultHandle ); +S_API bool SteamAPI_ISteamInventory_AddPromoItem( ISteamInventory* self, SteamInventoryResult_t * pResultHandle, SteamItemDef_t itemDef ); +S_API bool SteamAPI_ISteamInventory_AddPromoItems( ISteamInventory* self, SteamInventoryResult_t * pResultHandle, const SteamItemDef_t * pArrayItemDefs, uint32 unArrayLength ); +S_API bool SteamAPI_ISteamInventory_ConsumeItem( ISteamInventory* self, SteamInventoryResult_t * pResultHandle, SteamItemInstanceID_t itemConsume, uint32 unQuantity ); +S_API bool SteamAPI_ISteamInventory_ExchangeItems( ISteamInventory* self, SteamInventoryResult_t * pResultHandle, const SteamItemDef_t * pArrayGenerate, const uint32 * punArrayGenerateQuantity, uint32 unArrayGenerateLength, const SteamItemInstanceID_t * pArrayDestroy, const uint32 * punArrayDestroyQuantity, uint32 unArrayDestroyLength ); +S_API bool SteamAPI_ISteamInventory_TransferItemQuantity( ISteamInventory* self, SteamInventoryResult_t * pResultHandle, SteamItemInstanceID_t itemIdSource, uint32 unQuantity, SteamItemInstanceID_t itemIdDest ); +S_API void SteamAPI_ISteamInventory_SendItemDropHeartbeat( ISteamInventory* self ); +S_API bool SteamAPI_ISteamInventory_TriggerItemDrop( ISteamInventory* self, SteamInventoryResult_t * pResultHandle, SteamItemDef_t dropListDefinition ); +S_API bool SteamAPI_ISteamInventory_TradeItems( ISteamInventory* self, SteamInventoryResult_t * pResultHandle, uint64_steamid steamIDTradePartner, const SteamItemInstanceID_t * pArrayGive, const uint32 * pArrayGiveQuantity, uint32 nArrayGiveLength, const SteamItemInstanceID_t * pArrayGet, const uint32 * pArrayGetQuantity, uint32 nArrayGetLength ); +S_API bool SteamAPI_ISteamInventory_LoadItemDefinitions( ISteamInventory* self ); +S_API bool SteamAPI_ISteamInventory_GetItemDefinitionIDs( ISteamInventory* self, SteamItemDef_t * pItemDefIDs, uint32 * punItemDefIDsArraySize ); +S_API bool SteamAPI_ISteamInventory_GetItemDefinitionProperty( ISteamInventory* self, SteamItemDef_t iDefinition, const char * pchPropertyName, char * pchValueBuffer, uint32 * punValueBufferSizeOut ); +S_API SteamAPICall_t SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( ISteamInventory* self, uint64_steamid steamID ); +S_API bool SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs( ISteamInventory* self, uint64_steamid steamID, SteamItemDef_t * pItemDefIDs, uint32 * punItemDefIDsArraySize ); +S_API SteamAPICall_t SteamAPI_ISteamInventory_StartPurchase( ISteamInventory* self, const SteamItemDef_t * pArrayItemDefs, const uint32 * punArrayQuantity, uint32 unArrayLength ); +S_API SteamAPICall_t SteamAPI_ISteamInventory_RequestPrices( ISteamInventory* self ); +S_API uint32 SteamAPI_ISteamInventory_GetNumItemsWithPrices( ISteamInventory* self ); +S_API bool SteamAPI_ISteamInventory_GetItemsWithPrices( ISteamInventory* self, SteamItemDef_t * pArrayItemDefs, uint64 * pCurrentPrices, uint64 * pBasePrices, uint32 unArrayLength ); +S_API bool SteamAPI_ISteamInventory_GetItemPrice( ISteamInventory* self, SteamItemDef_t iDefinition, uint64 * pCurrentPrice, uint64 * pBasePrice ); +S_API SteamInventoryUpdateHandle_t SteamAPI_ISteamInventory_StartUpdateProperties( ISteamInventory* self ); +S_API bool SteamAPI_ISteamInventory_RemoveProperty( ISteamInventory* self, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char * pchPropertyName ); +S_API bool SteamAPI_ISteamInventory_SetPropertyString( ISteamInventory* self, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char * pchPropertyName, const char * pchPropertyValue ); +S_API bool SteamAPI_ISteamInventory_SetPropertyBool( ISteamInventory* self, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char * pchPropertyName, bool bValue ); +S_API bool SteamAPI_ISteamInventory_SetPropertyInt64( ISteamInventory* self, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char * pchPropertyName, int64 nValue ); +S_API bool SteamAPI_ISteamInventory_SetPropertyFloat( ISteamInventory* self, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char * pchPropertyName, float flValue ); +S_API bool SteamAPI_ISteamInventory_SubmitUpdateProperties( ISteamInventory* self, SteamInventoryUpdateHandle_t handle, SteamInventoryResult_t * pResultHandle ); +S_API bool SteamAPI_ISteamInventory_InspectItem( ISteamInventory* self, SteamInventoryResult_t * pResultHandle, const char * pchItemToken ); + +// ISteamTimeline + +// A versioned accessor is exported by the library +S_API ISteamTimeline *SteamAPI_SteamTimeline_v004(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamTimeline(), but using this ensures that you are using a matching library. +inline ISteamTimeline *SteamAPI_SteamTimeline() { return SteamAPI_SteamTimeline_v004(); } +S_API void SteamAPI_ISteamTimeline_SetTimelineTooltip( ISteamTimeline* self, const char * pchDescription, float flTimeDelta ); +S_API void SteamAPI_ISteamTimeline_ClearTimelineTooltip( ISteamTimeline* self, float flTimeDelta ); +S_API void SteamAPI_ISteamTimeline_SetTimelineGameMode( ISteamTimeline* self, ETimelineGameMode eMode ); +S_API TimelineEventHandle_t SteamAPI_ISteamTimeline_AddInstantaneousTimelineEvent( ISteamTimeline* self, const char * pchTitle, const char * pchDescription, const char * pchIcon, uint32 unIconPriority, float flStartOffsetSeconds, ETimelineEventClipPriority ePossibleClip ); +S_API TimelineEventHandle_t SteamAPI_ISteamTimeline_AddRangeTimelineEvent( ISteamTimeline* self, const char * pchTitle, const char * pchDescription, const char * pchIcon, uint32 unIconPriority, float flStartOffsetSeconds, float flDuration, ETimelineEventClipPriority ePossibleClip ); +S_API TimelineEventHandle_t SteamAPI_ISteamTimeline_StartRangeTimelineEvent( ISteamTimeline* self, const char * pchTitle, const char * pchDescription, const char * pchIcon, uint32 unPriority, float flStartOffsetSeconds, ETimelineEventClipPriority ePossibleClip ); +S_API void SteamAPI_ISteamTimeline_UpdateRangeTimelineEvent( ISteamTimeline* self, TimelineEventHandle_t ulEvent, const char * pchTitle, const char * pchDescription, const char * pchIcon, uint32 unPriority, ETimelineEventClipPriority ePossibleClip ); +S_API void SteamAPI_ISteamTimeline_EndRangeTimelineEvent( ISteamTimeline* self, TimelineEventHandle_t ulEvent, float flEndOffsetSeconds ); +S_API void SteamAPI_ISteamTimeline_RemoveTimelineEvent( ISteamTimeline* self, TimelineEventHandle_t ulEvent ); +S_API SteamAPICall_t SteamAPI_ISteamTimeline_DoesEventRecordingExist( ISteamTimeline* self, TimelineEventHandle_t ulEvent ); +S_API void SteamAPI_ISteamTimeline_StartGamePhase( ISteamTimeline* self ); +S_API void SteamAPI_ISteamTimeline_EndGamePhase( ISteamTimeline* self ); +S_API void SteamAPI_ISteamTimeline_SetGamePhaseID( ISteamTimeline* self, const char * pchPhaseID ); +S_API SteamAPICall_t SteamAPI_ISteamTimeline_DoesGamePhaseRecordingExist( ISteamTimeline* self, const char * pchPhaseID ); +S_API void SteamAPI_ISteamTimeline_AddGamePhaseTag( ISteamTimeline* self, const char * pchTagName, const char * pchTagIcon, const char * pchTagGroup, uint32 unPriority ); +S_API void SteamAPI_ISteamTimeline_SetGamePhaseAttribute( ISteamTimeline* self, const char * pchAttributeGroup, const char * pchAttributeValue, uint32 unPriority ); +S_API void SteamAPI_ISteamTimeline_OpenOverlayToGamePhase( ISteamTimeline* self, const char * pchPhaseID ); +S_API void SteamAPI_ISteamTimeline_OpenOverlayToTimelineEvent( ISteamTimeline* self, const TimelineEventHandle_t ulEvent ); + +// ISteamVideo + +// A versioned accessor is exported by the library +S_API ISteamVideo *SteamAPI_SteamVideo_v007(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamVideo(), but using this ensures that you are using a matching library. +inline ISteamVideo *SteamAPI_SteamVideo() { return SteamAPI_SteamVideo_v007(); } +S_API void SteamAPI_ISteamVideo_GetVideoURL( ISteamVideo* self, AppId_t unVideoAppID ); +S_API bool SteamAPI_ISteamVideo_IsBroadcasting( ISteamVideo* self, int * pnNumViewers ); +S_API void SteamAPI_ISteamVideo_GetOPFSettings( ISteamVideo* self, AppId_t unVideoAppID ); +S_API bool SteamAPI_ISteamVideo_GetOPFStringForApp( ISteamVideo* self, AppId_t unVideoAppID, char * pchBuffer, int32 * pnBufferSize ); + +// ISteamParentalSettings + +// A versioned accessor is exported by the library +S_API ISteamParentalSettings *SteamAPI_SteamParentalSettings_v001(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamParentalSettings(), but using this ensures that you are using a matching library. +inline ISteamParentalSettings *SteamAPI_SteamParentalSettings() { return SteamAPI_SteamParentalSettings_v001(); } +S_API bool SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled( ISteamParentalSettings* self ); +S_API bool SteamAPI_ISteamParentalSettings_BIsParentalLockLocked( ISteamParentalSettings* self ); +S_API bool SteamAPI_ISteamParentalSettings_BIsAppBlocked( ISteamParentalSettings* self, AppId_t nAppID ); +S_API bool SteamAPI_ISteamParentalSettings_BIsAppInBlockList( ISteamParentalSettings* self, AppId_t nAppID ); +S_API bool SteamAPI_ISteamParentalSettings_BIsFeatureBlocked( ISteamParentalSettings* self, EParentalFeature eFeature ); +S_API bool SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList( ISteamParentalSettings* self, EParentalFeature eFeature ); + +// ISteamRemotePlay + +// A versioned accessor is exported by the library +S_API ISteamRemotePlay *SteamAPI_SteamRemotePlay_v003(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamRemotePlay(), but using this ensures that you are using a matching library. +inline ISteamRemotePlay *SteamAPI_SteamRemotePlay() { return SteamAPI_SteamRemotePlay_v003(); } +S_API uint32 SteamAPI_ISteamRemotePlay_GetSessionCount( ISteamRemotePlay* self ); +S_API RemotePlaySessionID_t SteamAPI_ISteamRemotePlay_GetSessionID( ISteamRemotePlay* self, int iSessionIndex ); +S_API uint64_steamid SteamAPI_ISteamRemotePlay_GetSessionSteamID( ISteamRemotePlay* self, RemotePlaySessionID_t unSessionID ); +S_API const char * SteamAPI_ISteamRemotePlay_GetSessionClientName( ISteamRemotePlay* self, RemotePlaySessionID_t unSessionID ); +S_API ESteamDeviceFormFactor SteamAPI_ISteamRemotePlay_GetSessionClientFormFactor( ISteamRemotePlay* self, RemotePlaySessionID_t unSessionID ); +S_API bool SteamAPI_ISteamRemotePlay_BGetSessionClientResolution( ISteamRemotePlay* self, RemotePlaySessionID_t unSessionID, int * pnResolutionX, int * pnResolutionY ); +S_API bool SteamAPI_ISteamRemotePlay_ShowRemotePlayTogetherUI( ISteamRemotePlay* self ); +S_API bool SteamAPI_ISteamRemotePlay_BSendRemotePlayTogetherInvite( ISteamRemotePlay* self, uint64_steamid steamIDFriend ); +S_API bool SteamAPI_ISteamRemotePlay_BEnableRemotePlayTogetherDirectInput( ISteamRemotePlay* self ); +S_API void SteamAPI_ISteamRemotePlay_DisableRemotePlayTogetherDirectInput( ISteamRemotePlay* self ); +S_API uint32 SteamAPI_ISteamRemotePlay_GetInput( ISteamRemotePlay* self, RemotePlayInput_t * pInput, uint32 unMaxEvents ); +S_API void SteamAPI_ISteamRemotePlay_SetMouseVisibility( ISteamRemotePlay* self, RemotePlaySessionID_t unSessionID, bool bVisible ); +S_API void SteamAPI_ISteamRemotePlay_SetMousePosition( ISteamRemotePlay* self, RemotePlaySessionID_t unSessionID, float flNormalizedX, float flNormalizedY ); +S_API RemotePlayCursorID_t SteamAPI_ISteamRemotePlay_CreateMouseCursor( ISteamRemotePlay* self, int nWidth, int nHeight, int nHotX, int nHotY, const void * pBGRA, int nPitch ); +S_API void SteamAPI_ISteamRemotePlay_SetMouseCursor( ISteamRemotePlay* self, RemotePlaySessionID_t unSessionID, RemotePlayCursorID_t unCursorID ); + +// ISteamNetworkingMessages + +// A versioned accessor is exported by the library +S_API ISteamNetworkingMessages *SteamAPI_SteamNetworkingMessages_SteamAPI_v002(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamNetworkingMessages_SteamAPI(), but using this ensures that you are using a matching library. +inline ISteamNetworkingMessages *SteamAPI_SteamNetworkingMessages_SteamAPI() { return SteamAPI_SteamNetworkingMessages_SteamAPI_v002(); } + +// A versioned accessor is exported by the library +S_API ISteamNetworkingMessages *SteamAPI_SteamGameServerNetworkingMessages_SteamAPI_v002(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamGameServerNetworkingMessages_SteamAPI(), but using this ensures that you are using a matching library. +inline ISteamNetworkingMessages *SteamAPI_SteamGameServerNetworkingMessages_SteamAPI() { return SteamAPI_SteamGameServerNetworkingMessages_SteamAPI_v002(); } +S_API EResult SteamAPI_ISteamNetworkingMessages_SendMessageToUser( ISteamNetworkingMessages* self, const SteamNetworkingIdentity & identityRemote, const void * pubData, uint32 cubData, int nSendFlags, int nRemoteChannel ); +S_API int SteamAPI_ISteamNetworkingMessages_ReceiveMessagesOnChannel( ISteamNetworkingMessages* self, int nLocalChannel, SteamNetworkingMessage_t ** ppOutMessages, int nMaxMessages ); +S_API bool SteamAPI_ISteamNetworkingMessages_AcceptSessionWithUser( ISteamNetworkingMessages* self, const SteamNetworkingIdentity & identityRemote ); +S_API bool SteamAPI_ISteamNetworkingMessages_CloseSessionWithUser( ISteamNetworkingMessages* self, const SteamNetworkingIdentity & identityRemote ); +S_API bool SteamAPI_ISteamNetworkingMessages_CloseChannelWithUser( ISteamNetworkingMessages* self, const SteamNetworkingIdentity & identityRemote, int nLocalChannel ); +S_API ESteamNetworkingConnectionState SteamAPI_ISteamNetworkingMessages_GetSessionConnectionInfo( ISteamNetworkingMessages* self, const SteamNetworkingIdentity & identityRemote, SteamNetConnectionInfo_t * pConnectionInfo, SteamNetConnectionRealTimeStatus_t * pQuickStatus ); + +// ISteamNetworkingSockets + +// A versioned accessor is exported by the library +S_API ISteamNetworkingSockets *SteamAPI_SteamNetworkingSockets_SteamAPI_v012(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamNetworkingSockets_SteamAPI(), but using this ensures that you are using a matching library. +inline ISteamNetworkingSockets *SteamAPI_SteamNetworkingSockets_SteamAPI() { return SteamAPI_SteamNetworkingSockets_SteamAPI_v012(); } + +// A versioned accessor is exported by the library +S_API ISteamNetworkingSockets *SteamAPI_SteamGameServerNetworkingSockets_SteamAPI_v012(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamGameServerNetworkingSockets_SteamAPI(), but using this ensures that you are using a matching library. +inline ISteamNetworkingSockets *SteamAPI_SteamGameServerNetworkingSockets_SteamAPI() { return SteamAPI_SteamGameServerNetworkingSockets_SteamAPI_v012(); } +S_API HSteamListenSocket SteamAPI_ISteamNetworkingSockets_CreateListenSocketIP( ISteamNetworkingSockets* self, const SteamNetworkingIPAddr & localAddress, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); +S_API HSteamNetConnection SteamAPI_ISteamNetworkingSockets_ConnectByIPAddress( ISteamNetworkingSockets* self, const SteamNetworkingIPAddr & address, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); +S_API HSteamListenSocket SteamAPI_ISteamNetworkingSockets_CreateListenSocketP2P( ISteamNetworkingSockets* self, int nLocalVirtualPort, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); +S_API HSteamNetConnection SteamAPI_ISteamNetworkingSockets_ConnectP2P( ISteamNetworkingSockets* self, const SteamNetworkingIdentity & identityRemote, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); +S_API EResult SteamAPI_ISteamNetworkingSockets_AcceptConnection( ISteamNetworkingSockets* self, HSteamNetConnection hConn ); +S_API bool SteamAPI_ISteamNetworkingSockets_CloseConnection( ISteamNetworkingSockets* self, HSteamNetConnection hPeer, int nReason, const char * pszDebug, bool bEnableLinger ); +S_API bool SteamAPI_ISteamNetworkingSockets_CloseListenSocket( ISteamNetworkingSockets* self, HSteamListenSocket hSocket ); +S_API bool SteamAPI_ISteamNetworkingSockets_SetConnectionUserData( ISteamNetworkingSockets* self, HSteamNetConnection hPeer, int64 nUserData ); +S_API int64 SteamAPI_ISteamNetworkingSockets_GetConnectionUserData( ISteamNetworkingSockets* self, HSteamNetConnection hPeer ); +S_API void SteamAPI_ISteamNetworkingSockets_SetConnectionName( ISteamNetworkingSockets* self, HSteamNetConnection hPeer, const char * pszName ); +S_API bool SteamAPI_ISteamNetworkingSockets_GetConnectionName( ISteamNetworkingSockets* self, HSteamNetConnection hPeer, char * pszName, int nMaxLen ); +S_API EResult SteamAPI_ISteamNetworkingSockets_SendMessageToConnection( ISteamNetworkingSockets* self, HSteamNetConnection hConn, const void * pData, uint32 cbData, int nSendFlags, int64 * pOutMessageNumber ); +S_API void SteamAPI_ISteamNetworkingSockets_SendMessages( ISteamNetworkingSockets* self, int nMessages, SteamNetworkingMessage_t *const * pMessages, int64 * pOutMessageNumberOrResult ); +S_API EResult SteamAPI_ISteamNetworkingSockets_FlushMessagesOnConnection( ISteamNetworkingSockets* self, HSteamNetConnection hConn ); +S_API int SteamAPI_ISteamNetworkingSockets_ReceiveMessagesOnConnection( ISteamNetworkingSockets* self, HSteamNetConnection hConn, SteamNetworkingMessage_t ** ppOutMessages, int nMaxMessages ); +S_API bool SteamAPI_ISteamNetworkingSockets_GetConnectionInfo( ISteamNetworkingSockets* self, HSteamNetConnection hConn, SteamNetConnectionInfo_t * pInfo ); +S_API EResult SteamAPI_ISteamNetworkingSockets_GetConnectionRealTimeStatus( ISteamNetworkingSockets* self, HSteamNetConnection hConn, SteamNetConnectionRealTimeStatus_t * pStatus, int nLanes, SteamNetConnectionRealTimeLaneStatus_t * pLanes ); +S_API int SteamAPI_ISteamNetworkingSockets_GetDetailedConnectionStatus( ISteamNetworkingSockets* self, HSteamNetConnection hConn, char * pszBuf, int cbBuf ); +S_API bool SteamAPI_ISteamNetworkingSockets_GetListenSocketAddress( ISteamNetworkingSockets* self, HSteamListenSocket hSocket, SteamNetworkingIPAddr * address ); +S_API bool SteamAPI_ISteamNetworkingSockets_CreateSocketPair( ISteamNetworkingSockets* self, HSteamNetConnection * pOutConnection1, HSteamNetConnection * pOutConnection2, bool bUseNetworkLoopback, const SteamNetworkingIdentity * pIdentity1, const SteamNetworkingIdentity * pIdentity2 ); +S_API EResult SteamAPI_ISteamNetworkingSockets_ConfigureConnectionLanes( ISteamNetworkingSockets* self, HSteamNetConnection hConn, int nNumLanes, const int * pLanePriorities, const uint16 * pLaneWeights ); +S_API bool SteamAPI_ISteamNetworkingSockets_GetIdentity( ISteamNetworkingSockets* self, SteamNetworkingIdentity * pIdentity ); +S_API ESteamNetworkingAvailability SteamAPI_ISteamNetworkingSockets_InitAuthentication( ISteamNetworkingSockets* self ); +S_API ESteamNetworkingAvailability SteamAPI_ISteamNetworkingSockets_GetAuthenticationStatus( ISteamNetworkingSockets* self, SteamNetAuthenticationStatus_t * pDetails ); +S_API HSteamNetPollGroup SteamAPI_ISteamNetworkingSockets_CreatePollGroup( ISteamNetworkingSockets* self ); +S_API bool SteamAPI_ISteamNetworkingSockets_DestroyPollGroup( ISteamNetworkingSockets* self, HSteamNetPollGroup hPollGroup ); +S_API bool SteamAPI_ISteamNetworkingSockets_SetConnectionPollGroup( ISteamNetworkingSockets* self, HSteamNetConnection hConn, HSteamNetPollGroup hPollGroup ); +S_API int SteamAPI_ISteamNetworkingSockets_ReceiveMessagesOnPollGroup( ISteamNetworkingSockets* self, HSteamNetPollGroup hPollGroup, SteamNetworkingMessage_t ** ppOutMessages, int nMaxMessages ); +S_API bool SteamAPI_ISteamNetworkingSockets_ReceivedRelayAuthTicket( ISteamNetworkingSockets* self, const void * pvTicket, int cbTicket, SteamDatagramRelayAuthTicket * pOutParsedTicket ); +S_API int SteamAPI_ISteamNetworkingSockets_FindRelayAuthTicketForServer( ISteamNetworkingSockets* self, const SteamNetworkingIdentity & identityGameServer, int nRemoteVirtualPort, SteamDatagramRelayAuthTicket * pOutParsedTicket ); +S_API HSteamNetConnection SteamAPI_ISteamNetworkingSockets_ConnectToHostedDedicatedServer( ISteamNetworkingSockets* self, const SteamNetworkingIdentity & identityTarget, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); +S_API uint16 SteamAPI_ISteamNetworkingSockets_GetHostedDedicatedServerPort( ISteamNetworkingSockets* self ); +S_API SteamNetworkingPOPID SteamAPI_ISteamNetworkingSockets_GetHostedDedicatedServerPOPID( ISteamNetworkingSockets* self ); +S_API EResult SteamAPI_ISteamNetworkingSockets_GetHostedDedicatedServerAddress( ISteamNetworkingSockets* self, SteamDatagramHostedAddress * pRouting ); +S_API HSteamListenSocket SteamAPI_ISteamNetworkingSockets_CreateHostedDedicatedServerListenSocket( ISteamNetworkingSockets* self, int nLocalVirtualPort, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); +S_API EResult SteamAPI_ISteamNetworkingSockets_GetGameCoordinatorServerLogin( ISteamNetworkingSockets* self, SteamDatagramGameCoordinatorServerLogin * pLoginInfo, int * pcbSignedBlob, void * pBlob ); +S_API HSteamNetConnection SteamAPI_ISteamNetworkingSockets_ConnectP2PCustomSignaling( ISteamNetworkingSockets* self, ISteamNetworkingConnectionSignaling * pSignaling, const SteamNetworkingIdentity * pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); +S_API bool SteamAPI_ISteamNetworkingSockets_ReceivedP2PCustomSignal( ISteamNetworkingSockets* self, const void * pMsg, int cbMsg, ISteamNetworkingSignalingRecvContext * pContext ); +S_API bool SteamAPI_ISteamNetworkingSockets_GetCertificateRequest( ISteamNetworkingSockets* self, int * pcbBlob, void * pBlob, SteamNetworkingErrMsg & errMsg ); +S_API bool SteamAPI_ISteamNetworkingSockets_SetCertificate( ISteamNetworkingSockets* self, const void * pCertificate, int cbCertificate, SteamNetworkingErrMsg & errMsg ); +S_API void SteamAPI_ISteamNetworkingSockets_ResetIdentity( ISteamNetworkingSockets* self, const SteamNetworkingIdentity * pIdentity ); +S_API void SteamAPI_ISteamNetworkingSockets_RunCallbacks( ISteamNetworkingSockets* self ); +S_API bool SteamAPI_ISteamNetworkingSockets_BeginAsyncRequestFakeIP( ISteamNetworkingSockets* self, int nNumPorts ); +S_API void SteamAPI_ISteamNetworkingSockets_GetFakeIP( ISteamNetworkingSockets* self, int idxFirstPort, SteamNetworkingFakeIPResult_t * pInfo ); +S_API HSteamListenSocket SteamAPI_ISteamNetworkingSockets_CreateListenSocketP2PFakeIP( ISteamNetworkingSockets* self, int idxFakePort, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); +S_API EResult SteamAPI_ISteamNetworkingSockets_GetRemoteFakeIPForConnection( ISteamNetworkingSockets* self, HSteamNetConnection hConn, SteamNetworkingIPAddr * pOutAddr ); +S_API ISteamNetworkingFakeUDPPort * SteamAPI_ISteamNetworkingSockets_CreateFakeUDPPort( ISteamNetworkingSockets* self, int idxFakeServerPort ); + +// ISteamNetworkingUtils + +// A versioned accessor is exported by the library +S_API ISteamNetworkingUtils *SteamAPI_SteamNetworkingUtils_SteamAPI_v004(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamNetworkingUtils_SteamAPI(), but using this ensures that you are using a matching library. +inline ISteamNetworkingUtils *SteamAPI_SteamNetworkingUtils_SteamAPI() { return SteamAPI_SteamNetworkingUtils_SteamAPI_v004(); } +S_API SteamNetworkingMessage_t * SteamAPI_ISteamNetworkingUtils_AllocateMessage( ISteamNetworkingUtils* self, int cbAllocateBuffer ); +S_API void SteamAPI_ISteamNetworkingUtils_InitRelayNetworkAccess( ISteamNetworkingUtils* self ); +S_API ESteamNetworkingAvailability SteamAPI_ISteamNetworkingUtils_GetRelayNetworkStatus( ISteamNetworkingUtils* self, SteamRelayNetworkStatus_t * pDetails ); +S_API float SteamAPI_ISteamNetworkingUtils_GetLocalPingLocation( ISteamNetworkingUtils* self, SteamNetworkPingLocation_t & result ); +S_API int SteamAPI_ISteamNetworkingUtils_EstimatePingTimeBetweenTwoLocations( ISteamNetworkingUtils* self, const SteamNetworkPingLocation_t & location1, const SteamNetworkPingLocation_t & location2 ); +S_API int SteamAPI_ISteamNetworkingUtils_EstimatePingTimeFromLocalHost( ISteamNetworkingUtils* self, const SteamNetworkPingLocation_t & remoteLocation ); +S_API void SteamAPI_ISteamNetworkingUtils_ConvertPingLocationToString( ISteamNetworkingUtils* self, const SteamNetworkPingLocation_t & location, char * pszBuf, int cchBufSize ); +S_API bool SteamAPI_ISteamNetworkingUtils_ParsePingLocationString( ISteamNetworkingUtils* self, const char * pszString, SteamNetworkPingLocation_t & result ); +S_API bool SteamAPI_ISteamNetworkingUtils_CheckPingDataUpToDate( ISteamNetworkingUtils* self, float flMaxAgeSeconds ); +S_API int SteamAPI_ISteamNetworkingUtils_GetPingToDataCenter( ISteamNetworkingUtils* self, SteamNetworkingPOPID popID, SteamNetworkingPOPID * pViaRelayPoP ); +S_API int SteamAPI_ISteamNetworkingUtils_GetDirectPingToPOP( ISteamNetworkingUtils* self, SteamNetworkingPOPID popID ); +S_API int SteamAPI_ISteamNetworkingUtils_GetPOPCount( ISteamNetworkingUtils* self ); +S_API int SteamAPI_ISteamNetworkingUtils_GetPOPList( ISteamNetworkingUtils* self, SteamNetworkingPOPID * list, int nListSz ); +S_API SteamNetworkingMicroseconds SteamAPI_ISteamNetworkingUtils_GetLocalTimestamp( ISteamNetworkingUtils* self ); +S_API void SteamAPI_ISteamNetworkingUtils_SetDebugOutputFunction( ISteamNetworkingUtils* self, ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ); +S_API bool SteamAPI_ISteamNetworkingUtils_IsFakeIPv4( ISteamNetworkingUtils* self, uint32 nIPv4 ); +S_API ESteamNetworkingFakeIPType SteamAPI_ISteamNetworkingUtils_GetIPv4FakeIPType( ISteamNetworkingUtils* self, uint32 nIPv4 ); +S_API EResult SteamAPI_ISteamNetworkingUtils_GetRealIdentityForFakeIP( ISteamNetworkingUtils* self, const SteamNetworkingIPAddr & fakeIP, SteamNetworkingIdentity * pOutRealIdentity ); +S_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueInt32( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, int32 val ); +S_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueFloat( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, float val ); +S_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueString( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, const char * val ); +S_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValuePtr( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, void * val ); +S_API bool SteamAPI_ISteamNetworkingUtils_SetConnectionConfigValueInt32( ISteamNetworkingUtils* self, HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, int32 val ); +S_API bool SteamAPI_ISteamNetworkingUtils_SetConnectionConfigValueFloat( ISteamNetworkingUtils* self, HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, float val ); +S_API bool SteamAPI_ISteamNetworkingUtils_SetConnectionConfigValueString( ISteamNetworkingUtils* self, HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, const char * val ); +S_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_SteamNetConnectionStatusChanged( ISteamNetworkingUtils* self, FnSteamNetConnectionStatusChanged fnCallback ); +S_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_SteamNetAuthenticationStatusChanged( ISteamNetworkingUtils* self, FnSteamNetAuthenticationStatusChanged fnCallback ); +S_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_SteamRelayNetworkStatusChanged( ISteamNetworkingUtils* self, FnSteamRelayNetworkStatusChanged fnCallback ); +S_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_FakeIPResult( ISteamNetworkingUtils* self, FnSteamNetworkingFakeIPResult fnCallback ); +S_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_MessagesSessionRequest( ISteamNetworkingUtils* self, FnSteamNetworkingMessagesSessionRequest fnCallback ); +S_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_MessagesSessionFailed( ISteamNetworkingUtils* self, FnSteamNetworkingMessagesSessionFailed fnCallback ); +S_API bool SteamAPI_ISteamNetworkingUtils_SetConfigValue( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj, ESteamNetworkingConfigDataType eDataType, const void * pArg ); +S_API bool SteamAPI_ISteamNetworkingUtils_SetConfigValueStruct( ISteamNetworkingUtils* self, const SteamNetworkingConfigValue_t & opt, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj ); +S_API ESteamNetworkingGetConfigValueResult SteamAPI_ISteamNetworkingUtils_GetConfigValue( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj, ESteamNetworkingConfigDataType * pOutDataType, void * pResult, size_t * cbResult ); +S_API const char * SteamAPI_ISteamNetworkingUtils_GetConfigValueInfo( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigDataType * pOutDataType, ESteamNetworkingConfigScope * pOutScope ); +S_API ESteamNetworkingConfigValue SteamAPI_ISteamNetworkingUtils_IterateGenericEditableConfigValues( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eCurrent, bool bEnumerateDevVars ); +S_API void SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_ToString( ISteamNetworkingUtils* self, const SteamNetworkingIPAddr & addr, char * buf, uint32 cbBuf, bool bWithPort ); +S_API bool SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_ParseString( ISteamNetworkingUtils* self, SteamNetworkingIPAddr * pAddr, const char * pszStr ); +S_API ESteamNetworkingFakeIPType SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_GetFakeIPType( ISteamNetworkingUtils* self, const SteamNetworkingIPAddr & addr ); +S_API void SteamAPI_ISteamNetworkingUtils_SteamNetworkingIdentity_ToString( ISteamNetworkingUtils* self, const SteamNetworkingIdentity & identity, char * buf, uint32 cbBuf ); +S_API bool SteamAPI_ISteamNetworkingUtils_SteamNetworkingIdentity_ParseString( ISteamNetworkingUtils* self, SteamNetworkingIdentity * pIdentity, const char * pszStr ); + +// ISteamGameServer + +// A versioned accessor is exported by the library +S_API ISteamGameServer *SteamAPI_SteamGameServer_v015(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamGameServer(), but using this ensures that you are using a matching library. +inline ISteamGameServer *SteamAPI_SteamGameServer() { return SteamAPI_SteamGameServer_v015(); } +S_API void SteamAPI_ISteamGameServer_SetProduct( ISteamGameServer* self, const char * pszProduct ); +S_API void SteamAPI_ISteamGameServer_SetGameDescription( ISteamGameServer* self, const char * pszGameDescription ); +S_API void SteamAPI_ISteamGameServer_SetModDir( ISteamGameServer* self, const char * pszModDir ); +S_API void SteamAPI_ISteamGameServer_SetDedicatedServer( ISteamGameServer* self, bool bDedicated ); +S_API void SteamAPI_ISteamGameServer_LogOn( ISteamGameServer* self, const char * pszToken ); +S_API void SteamAPI_ISteamGameServer_LogOnAnonymous( ISteamGameServer* self ); +S_API void SteamAPI_ISteamGameServer_LogOff( ISteamGameServer* self ); +S_API bool SteamAPI_ISteamGameServer_BLoggedOn( ISteamGameServer* self ); +S_API bool SteamAPI_ISteamGameServer_BSecure( ISteamGameServer* self ); +S_API uint64_steamid SteamAPI_ISteamGameServer_GetSteamID( ISteamGameServer* self ); +S_API bool SteamAPI_ISteamGameServer_WasRestartRequested( ISteamGameServer* self ); +S_API void SteamAPI_ISteamGameServer_SetMaxPlayerCount( ISteamGameServer* self, int cPlayersMax ); +S_API void SteamAPI_ISteamGameServer_SetBotPlayerCount( ISteamGameServer* self, int cBotplayers ); +S_API void SteamAPI_ISteamGameServer_SetServerName( ISteamGameServer* self, const char * pszServerName ); +S_API void SteamAPI_ISteamGameServer_SetMapName( ISteamGameServer* self, const char * pszMapName ); +S_API void SteamAPI_ISteamGameServer_SetPasswordProtected( ISteamGameServer* self, bool bPasswordProtected ); +S_API void SteamAPI_ISteamGameServer_SetSpectatorPort( ISteamGameServer* self, uint16 unSpectatorPort ); +S_API void SteamAPI_ISteamGameServer_SetSpectatorServerName( ISteamGameServer* self, const char * pszSpectatorServerName ); +S_API void SteamAPI_ISteamGameServer_ClearAllKeyValues( ISteamGameServer* self ); +S_API void SteamAPI_ISteamGameServer_SetKeyValue( ISteamGameServer* self, const char * pKey, const char * pValue ); +S_API void SteamAPI_ISteamGameServer_SetGameTags( ISteamGameServer* self, const char * pchGameTags ); +S_API void SteamAPI_ISteamGameServer_SetGameData( ISteamGameServer* self, const char * pchGameData ); +S_API void SteamAPI_ISteamGameServer_SetRegion( ISteamGameServer* self, const char * pszRegion ); +S_API void SteamAPI_ISteamGameServer_SetAdvertiseServerActive( ISteamGameServer* self, bool bActive ); +S_API HAuthTicket SteamAPI_ISteamGameServer_GetAuthSessionTicket( ISteamGameServer* self, void * pTicket, int cbMaxTicket, uint32 * pcbTicket, const SteamNetworkingIdentity * pSnid ); +S_API EBeginAuthSessionResult SteamAPI_ISteamGameServer_BeginAuthSession( ISteamGameServer* self, const void * pAuthTicket, int cbAuthTicket, uint64_steamid steamID ); +S_API void SteamAPI_ISteamGameServer_EndAuthSession( ISteamGameServer* self, uint64_steamid steamID ); +S_API void SteamAPI_ISteamGameServer_CancelAuthTicket( ISteamGameServer* self, HAuthTicket hAuthTicket ); +S_API EUserHasLicenseForAppResult SteamAPI_ISteamGameServer_UserHasLicenseForApp( ISteamGameServer* self, uint64_steamid steamID, AppId_t appID ); +S_API bool SteamAPI_ISteamGameServer_RequestUserGroupStatus( ISteamGameServer* self, uint64_steamid steamIDUser, uint64_steamid steamIDGroup ); +S_API void SteamAPI_ISteamGameServer_GetGameplayStats( ISteamGameServer* self ); +S_API SteamAPICall_t SteamAPI_ISteamGameServer_GetServerReputation( ISteamGameServer* self ); +S_API SteamIPAddress_t SteamAPI_ISteamGameServer_GetPublicIP( ISteamGameServer* self ); +S_API bool SteamAPI_ISteamGameServer_HandleIncomingPacket( ISteamGameServer* self, const void * pData, int cbData, uint32 srcIP, uint16 srcPort ); +S_API int SteamAPI_ISteamGameServer_GetNextOutgoingPacket( ISteamGameServer* self, void * pOut, int cbMaxOut, uint32 * pNetAdr, uint16 * pPort ); +S_API SteamAPICall_t SteamAPI_ISteamGameServer_AssociateWithClan( ISteamGameServer* self, uint64_steamid steamIDClan ); +S_API SteamAPICall_t SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility( ISteamGameServer* self, uint64_steamid steamIDNewPlayer ); +S_API bool SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate_DEPRECATED( ISteamGameServer* self, uint32 unIPClient, const void * pvAuthBlob, uint32 cubAuthBlobSize, CSteamID * pSteamIDUser ); +S_API uint64_steamid SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection( ISteamGameServer* self ); +S_API void SteamAPI_ISteamGameServer_SendUserDisconnect_DEPRECATED( ISteamGameServer* self, uint64_steamid steamIDUser ); +S_API bool SteamAPI_ISteamGameServer_BUpdateUserData( ISteamGameServer* self, uint64_steamid steamIDUser, const char * pchPlayerName, uint32 uScore ); + +// ISteamGameServerStats + +// A versioned accessor is exported by the library +S_API ISteamGameServerStats *SteamAPI_SteamGameServerStats_v001(); +// Inline, unversioned accessor to get the current version. Essentially the same as SteamGameServerStats(), but using this ensures that you are using a matching library. +inline ISteamGameServerStats *SteamAPI_SteamGameServerStats() { return SteamAPI_SteamGameServerStats_v001(); } +S_API SteamAPICall_t SteamAPI_ISteamGameServerStats_RequestUserStats( ISteamGameServerStats* self, uint64_steamid steamIDUser ); +S_API bool SteamAPI_ISteamGameServerStats_GetUserStatInt32( ISteamGameServerStats* self, uint64_steamid steamIDUser, const char * pchName, int32 * pData ); +S_API bool SteamAPI_ISteamGameServerStats_GetUserStatFloat( ISteamGameServerStats* self, uint64_steamid steamIDUser, const char * pchName, float * pData ); +S_API bool SteamAPI_ISteamGameServerStats_GetUserAchievement( ISteamGameServerStats* self, uint64_steamid steamIDUser, const char * pchName, bool * pbAchieved ); +S_API bool SteamAPI_ISteamGameServerStats_SetUserStatInt32( ISteamGameServerStats* self, uint64_steamid steamIDUser, const char * pchName, int32 nData ); +S_API bool SteamAPI_ISteamGameServerStats_SetUserStatFloat( ISteamGameServerStats* self, uint64_steamid steamIDUser, const char * pchName, float fData ); +S_API bool SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat( ISteamGameServerStats* self, uint64_steamid steamIDUser, const char * pchName, float flCountThisSession, double dSessionLength ); +S_API bool SteamAPI_ISteamGameServerStats_SetUserAchievement( ISteamGameServerStats* self, uint64_steamid steamIDUser, const char * pchName ); +S_API bool SteamAPI_ISteamGameServerStats_ClearUserAchievement( ISteamGameServerStats* self, uint64_steamid steamIDUser, const char * pchName ); +S_API SteamAPICall_t SteamAPI_ISteamGameServerStats_StoreUserStats( ISteamGameServerStats* self, uint64_steamid steamIDUser ); + +// ISteamNetworkingFakeUDPPort +S_API void SteamAPI_ISteamNetworkingFakeUDPPort_DestroyFakeUDPPort( ISteamNetworkingFakeUDPPort* self ); +S_API EResult SteamAPI_ISteamNetworkingFakeUDPPort_SendMessageToFakeIP( ISteamNetworkingFakeUDPPort* self, const SteamNetworkingIPAddr & remoteAddress, const void * pData, uint32 cbData, int nSendFlags ); +S_API int SteamAPI_ISteamNetworkingFakeUDPPort_ReceiveMessages( ISteamNetworkingFakeUDPPort* self, SteamNetworkingMessage_t ** ppOutMessages, int nMaxMessages ); +S_API void SteamAPI_ISteamNetworkingFakeUDPPort_ScheduleCleanup( ISteamNetworkingFakeUDPPort* self, const SteamNetworkingIPAddr & remoteAddress ); + +// SteamIPAddress_t +S_API bool SteamAPI_SteamIPAddress_t_IsSet( SteamIPAddress_t* self ); + +// MatchMakingKeyValuePair_t +S_API void SteamAPI_MatchMakingKeyValuePair_t_Construct( MatchMakingKeyValuePair_t* self ); + +// servernetadr_t +S_API void SteamAPI_servernetadr_t_Construct( servernetadr_t* self ); +S_API void SteamAPI_servernetadr_t_Init( servernetadr_t* self, unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort ); +S_API uint16 SteamAPI_servernetadr_t_GetQueryPort( servernetadr_t* self ); +S_API void SteamAPI_servernetadr_t_SetQueryPort( servernetadr_t* self, uint16 usPort ); +S_API uint16 SteamAPI_servernetadr_t_GetConnectionPort( servernetadr_t* self ); +S_API void SteamAPI_servernetadr_t_SetConnectionPort( servernetadr_t* self, uint16 usPort ); +S_API uint32 SteamAPI_servernetadr_t_GetIP( servernetadr_t* self ); +S_API void SteamAPI_servernetadr_t_SetIP( servernetadr_t* self, uint32 unIP ); +S_API const char * SteamAPI_servernetadr_t_GetConnectionAddressString( servernetadr_t* self ); +S_API const char * SteamAPI_servernetadr_t_GetQueryAddressString( servernetadr_t* self ); +S_API bool SteamAPI_servernetadr_t_IsLessThan( servernetadr_t* self, const servernetadr_t & netadr ); +S_API void SteamAPI_servernetadr_t_Assign( servernetadr_t* self, const servernetadr_t & that ); + +// gameserveritem_t +S_API void SteamAPI_gameserveritem_t_Construct( gameserveritem_t* self ); +S_API const char * SteamAPI_gameserveritem_t_GetName( gameserveritem_t* self ); +S_API void SteamAPI_gameserveritem_t_SetName( gameserveritem_t* self, const char * pName ); + +// SteamNetworkingIPAddr +S_API void SteamAPI_SteamNetworkingIPAddr_Clear( SteamNetworkingIPAddr* self ); +S_API bool SteamAPI_SteamNetworkingIPAddr_IsIPv6AllZeros( SteamNetworkingIPAddr* self ); +S_API void SteamAPI_SteamNetworkingIPAddr_SetIPv6( SteamNetworkingIPAddr* self, const uint8 * ipv6, uint16 nPort ); +S_API void SteamAPI_SteamNetworkingIPAddr_SetIPv4( SteamNetworkingIPAddr* self, uint32 nIP, uint16 nPort ); +S_API bool SteamAPI_SteamNetworkingIPAddr_IsIPv4( SteamNetworkingIPAddr* self ); +S_API uint32 SteamAPI_SteamNetworkingIPAddr_GetIPv4( SteamNetworkingIPAddr* self ); +S_API void SteamAPI_SteamNetworkingIPAddr_SetIPv6LocalHost( SteamNetworkingIPAddr* self, uint16 nPort ); +S_API bool SteamAPI_SteamNetworkingIPAddr_IsLocalHost( SteamNetworkingIPAddr* self ); +S_API void SteamAPI_SteamNetworkingIPAddr_ToString( SteamNetworkingIPAddr* self, char * buf, uint32 cbBuf, bool bWithPort ); +S_API bool SteamAPI_SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr* self, const char * pszStr ); +S_API bool SteamAPI_SteamNetworkingIPAddr_IsEqualTo( SteamNetworkingIPAddr* self, const SteamNetworkingIPAddr & x ); +S_API ESteamNetworkingFakeIPType SteamAPI_SteamNetworkingIPAddr_GetFakeIPType( SteamNetworkingIPAddr* self ); +S_API bool SteamAPI_SteamNetworkingIPAddr_IsFakeIP( SteamNetworkingIPAddr* self ); + +// SteamNetworkingIdentity +S_API void SteamAPI_SteamNetworkingIdentity_Clear( SteamNetworkingIdentity* self ); +S_API bool SteamAPI_SteamNetworkingIdentity_IsInvalid( SteamNetworkingIdentity* self ); +S_API void SteamAPI_SteamNetworkingIdentity_SetSteamID( SteamNetworkingIdentity* self, uint64_steamid steamID ); +S_API uint64_steamid SteamAPI_SteamNetworkingIdentity_GetSteamID( SteamNetworkingIdentity* self ); +S_API void SteamAPI_SteamNetworkingIdentity_SetSteamID64( SteamNetworkingIdentity* self, uint64 steamID ); +S_API uint64 SteamAPI_SteamNetworkingIdentity_GetSteamID64( SteamNetworkingIdentity* self ); +S_API bool SteamAPI_SteamNetworkingIdentity_SetXboxPairwiseID( SteamNetworkingIdentity* self, const char * pszString ); +S_API const char * SteamAPI_SteamNetworkingIdentity_GetXboxPairwiseID( SteamNetworkingIdentity* self ); +S_API void SteamAPI_SteamNetworkingIdentity_SetPSNID( SteamNetworkingIdentity* self, uint64 id ); +S_API uint64 SteamAPI_SteamNetworkingIdentity_GetPSNID( SteamNetworkingIdentity* self ); +S_API void SteamAPI_SteamNetworkingIdentity_SetIPAddr( SteamNetworkingIdentity* self, const SteamNetworkingIPAddr & addr ); +S_API const SteamNetworkingIPAddr * SteamAPI_SteamNetworkingIdentity_GetIPAddr( SteamNetworkingIdentity* self ); +S_API void SteamAPI_SteamNetworkingIdentity_SetIPv4Addr( SteamNetworkingIdentity* self, uint32 nIPv4, uint16 nPort ); +S_API uint32 SteamAPI_SteamNetworkingIdentity_GetIPv4( SteamNetworkingIdentity* self ); +S_API ESteamNetworkingFakeIPType SteamAPI_SteamNetworkingIdentity_GetFakeIPType( SteamNetworkingIdentity* self ); +S_API bool SteamAPI_SteamNetworkingIdentity_IsFakeIP( SteamNetworkingIdentity* self ); +S_API void SteamAPI_SteamNetworkingIdentity_SetLocalHost( SteamNetworkingIdentity* self ); +S_API bool SteamAPI_SteamNetworkingIdentity_IsLocalHost( SteamNetworkingIdentity* self ); +S_API bool SteamAPI_SteamNetworkingIdentity_SetGenericString( SteamNetworkingIdentity* self, const char * pszString ); +S_API const char * SteamAPI_SteamNetworkingIdentity_GetGenericString( SteamNetworkingIdentity* self ); +S_API bool SteamAPI_SteamNetworkingIdentity_SetGenericBytes( SteamNetworkingIdentity* self, const void * data, uint32 cbLen ); +S_API const uint8 * SteamAPI_SteamNetworkingIdentity_GetGenericBytes( SteamNetworkingIdentity* self, int & cbLen ); +S_API bool SteamAPI_SteamNetworkingIdentity_IsEqualTo( SteamNetworkingIdentity* self, const SteamNetworkingIdentity & x ); +S_API void SteamAPI_SteamNetworkingIdentity_ToString( SteamNetworkingIdentity* self, char * buf, uint32 cbBuf ); +S_API bool SteamAPI_SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity* self, const char * pszStr ); + +// SteamNetworkingMessage_t +S_API void SteamAPI_SteamNetworkingMessage_t_Release( SteamNetworkingMessage_t* self ); + +// SteamNetworkingConfigValue_t +S_API void SteamAPI_SteamNetworkingConfigValue_t_SetInt32( SteamNetworkingConfigValue_t* self, ESteamNetworkingConfigValue eVal, int32_t data ); +S_API void SteamAPI_SteamNetworkingConfigValue_t_SetInt64( SteamNetworkingConfigValue_t* self, ESteamNetworkingConfigValue eVal, int64_t data ); +S_API void SteamAPI_SteamNetworkingConfigValue_t_SetFloat( SteamNetworkingConfigValue_t* self, ESteamNetworkingConfigValue eVal, float data ); +S_API void SteamAPI_SteamNetworkingConfigValue_t_SetPtr( SteamNetworkingConfigValue_t* self, ESteamNetworkingConfigValue eVal, void * data ); +S_API void SteamAPI_SteamNetworkingConfigValue_t_SetString( SteamNetworkingConfigValue_t* self, ESteamNetworkingConfigValue eVal, const char * data ); + +// SteamDatagramHostedAddress +S_API void SteamAPI_SteamDatagramHostedAddress_Clear( SteamDatagramHostedAddress* self ); +S_API SteamNetworkingPOPID SteamAPI_SteamDatagramHostedAddress_GetPopID( SteamDatagramHostedAddress* self ); +S_API void SteamAPI_SteamDatagramHostedAddress_SetDevAddress( SteamDatagramHostedAddress* self, uint32 nIP, uint16 nPort, SteamNetworkingPOPID popid ); +#endif // STEAMAPIFLAT_H diff --git a/external/steamworks/public/steam/steam_api_internal.h b/external/steamworks/public/steam/steam_api_internal.h new file mode 100644 index 0000000..853d554 --- /dev/null +++ b/external/steamworks/public/steam/steam_api_internal.h @@ -0,0 +1,308 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Internal implementation details of the steamworks SDK. +// +// You should be able to figure out how to use the SDK by reading +// steam_api_common.h, and should not need to understand anything in here. +// +//----------------------------------------------------------------------------- + +#ifdef STEAM_CALLBACK_BEGIN +#error "This file should only be included from steam_api_common.h" +#endif + +#include + +// Internal functions used to locate/create interfaces +S_API HSteamPipe S_CALLTYPE SteamAPI_GetHSteamPipe(); +S_API HSteamUser S_CALLTYPE SteamAPI_GetHSteamUser(); +S_API HSteamPipe S_CALLTYPE SteamGameServer_GetHSteamPipe(); +S_API HSteamUser S_CALLTYPE SteamGameServer_GetHSteamUser(); +S_API void *S_CALLTYPE SteamInternal_ContextInit( void *pContextInitData ); +S_API void *S_CALLTYPE SteamInternal_CreateInterface( const char *ver ); +S_API void *S_CALLTYPE SteamInternal_FindOrCreateUserInterface( HSteamUser hSteamUser, const char *pszVersion ); +S_API void *S_CALLTYPE SteamInternal_FindOrCreateGameServerInterface( HSteamUser hSteamUser, const char *pszVersion ); + +// Macro used to define a type-safe accessor that will always return the version +// of the interface of the *header file* you are compiling with! We also bounce +// through a safety function that checks for interfaces being created or destroyed. +// +// SteamInternal_ContextInit takes a base pointer for the equivalent of +// struct { void (*pFn)(void* pCtx); uintptr_t counter; void *ptr; } +// Do not change layout or add non-pointer aligned data! +#define STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, expr, kind, version ) \ + inline void S_CALLTYPE SteamInternal_Init_ ## name( type *p ) { *p = (type)( expr ); } \ + STEAM_CLANG_ATTR( "interface_accessor_kind:" kind ";interface_accessor_version:" version ";" ) \ + inline type name() { \ + static void* s_CallbackCounterAndContext[ 3 ] = { (void*)&SteamInternal_Init_ ## name, 0, 0 }; \ + return *(type*)SteamInternal_ContextInit( s_CallbackCounterAndContext ); \ + } + +#define STEAM_DEFINE_USER_INTERFACE_ACCESSOR( type, name, version ) \ + STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, SteamInternal_FindOrCreateUserInterface( SteamAPI_GetHSteamUser(), version ), "user", version ) +#define STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( type, name, version ) \ + STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, SteamInternal_FindOrCreateGameServerInterface( SteamGameServer_GetHSteamUser(), version ), "gameserver", version ) + +// +// Internal stuff used for the standard, higher-level callback mechanism +// + +// Internal functions used by the utility CCallback objects to receive callbacks +S_API void S_CALLTYPE SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback ); +S_API void S_CALLTYPE SteamAPI_UnregisterCallback( class CCallbackBase *pCallback ); +// Internal functions used by the utility CCallResult objects to receive async call results +S_API void S_CALLTYPE SteamAPI_RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall ); +S_API void S_CALLTYPE SteamAPI_UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall ); + +#define _STEAM_CALLBACK_OFFSETOF( type, member ) ( (size_t)( (char *)&( (type *)0 )->member ) ) +#define _STEAM_CALLBACK_AUTO_HOOK( thisclass, func, param ) +#define _STEAM_CALLBACK_HELPER( _1, _2, SELECTED, ... ) _STEAM_CALLBACK_##SELECTED +#define _STEAM_CALLBACK_SELECT( X, Y ) _STEAM_CALLBACK_HELPER X Y +#define _STEAM_CALLBACK_3( extra_code, thisclass, func, param ) \ + struct CCallbackInternal_ ## func : private CCallbackImpl< sizeof( param ) > { \ + CCallbackInternal_ ## func () { extra_code SteamAPI_RegisterCallback( this, param::k_iCallback ); } \ + CCallbackInternal_ ## func ( const CCallbackInternal_ ## func & ) { extra_code SteamAPI_RegisterCallback( this, param::k_iCallback ); } \ + CCallbackInternal_ ## func & operator=( const CCallbackInternal_ ## func & ) { return *this; } \ + private: virtual void Run( void *pvParam ) S_OVERRIDE { _STEAM_CALLBACK_AUTO_HOOK( thisclass, func, param ) \ + thisclass *pOuter = reinterpret_cast( reinterpret_cast(this) - _STEAM_CALLBACK_OFFSETOF( thisclass, m_steamcallback_ ## func ) ); \ + pOuter->func( reinterpret_cast( pvParam ) ); \ + } \ + } m_steamcallback_ ## func ; void func( param *pParam ) +#define _STEAM_CALLBACK_4( _, thisclass, func, param, var ) \ + CCallback< thisclass, param > var; void func( param *pParam ) +#define _STEAM_CALLBACK_GS( _, thisclass, func, param, var ) \ + CCallback< thisclass, param, true > var; void func( param *pParam ) + +#ifndef API_GEN + +template< class T, class P > +inline CCallResult::CCallResult() +{ + m_hAPICall = k_uAPICallInvalid; + m_pObj = nullptr; + m_Func = nullptr; + m_iCallback = P::k_iCallback; +} + +template< class T, class P > +inline void CCallResult::Set( SteamAPICall_t hAPICall, T *p, func_t func ) +{ + if ( m_hAPICall ) + SteamAPI_UnregisterCallResult( this, m_hAPICall ); + + m_hAPICall = hAPICall; + m_pObj = p; + m_Func = func; + + if ( hAPICall ) + SteamAPI_RegisterCallResult( this, hAPICall ); +} + +template< class T, class P > +inline bool CCallResult::IsActive() const +{ + return (m_hAPICall != k_uAPICallInvalid); +} + +template< class T, class P > +inline void CCallResult::Cancel() +{ + if ( m_hAPICall != k_uAPICallInvalid ) + { + SteamAPI_UnregisterCallResult( this, m_hAPICall ); + m_hAPICall = k_uAPICallInvalid; + } +} + +template< class T, class P > +inline CCallResult::~CCallResult() +{ + Cancel(); +} + +template< class T, class P > +inline void CCallResult::Run( void *pvParam ) +{ + m_hAPICall = k_uAPICallInvalid; // caller unregisters for us + (m_pObj->*m_Func)((P *)pvParam, false); +} + +template< class T, class P > +inline void CCallResult::Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ) +{ + if ( hSteamAPICall == m_hAPICall ) + { + m_hAPICall = k_uAPICallInvalid; // caller unregisters for us + (m_pObj->*m_Func)((P *)pvParam, bIOFailure); + } +} + +template< class T, class P, bool bGameserver > +inline CCallback< T, P, bGameserver >::CCallback( T *pObj, func_t func ) + : m_pObj( nullptr ), m_Func( nullptr ) +{ + if ( bGameserver ) + { + this->SetGameserverFlag(); + } + Register( pObj, func ); +} + +template< class T, class P, bool bGameserver > +inline void CCallback< T, P, bGameserver >::Register( T *pObj, func_t func ) +{ + if ( !pObj || !func ) + return; + + if ( this->m_nCallbackFlags & CCallbackBase::k_ECallbackFlagsRegistered ) + Unregister(); + + m_pObj = pObj; + m_Func = func; + // SteamAPI_RegisterCallback sets k_ECallbackFlagsRegistered + SteamAPI_RegisterCallback( this, P::k_iCallback ); +} + +template< class T, class P, bool bGameserver > +inline void CCallback< T, P, bGameserver >::Unregister() +{ + // SteamAPI_UnregisterCallback removes k_ECallbackFlagsRegistered + SteamAPI_UnregisterCallback( this ); +} + +template< class T, class P, bool bGameserver > +inline void CCallback< T, P, bGameserver >::Run( void *pvParam ) +{ + (m_pObj->*m_Func)((P *)pvParam); +} + +#endif // #ifndef API_GEN + +// structure that contains client callback data +// see callbacks documentation for more details +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx +#endif + +/// Internal structure used in manual callback dispatch +struct CallbackMsg_t +{ + HSteamUser m_hSteamUser; // Specific user to whom this callback applies. + int m_iCallback; // Callback identifier. (Corresponds to the k_iCallback enum in the callback structure.) + uint8 *m_pubParam; // Points to the callback structure + int m_cubParam; // Size of the data pointed to by m_pubParam +}; +#pragma pack( pop ) + +// Macros to define steam callback structures. Used internally for debugging +#ifdef STEAM_CALLBACK_INSPECTION_ENABLED + #include "../../clientdll/steam_api_callback_inspection.h" +#else + #define STEAM_CALLBACK_BEGIN( callbackname, callbackid ) struct callbackname { enum { k_iCallback = callbackid }; + #define STEAM_CALLBACK_MEMBER( varidx, vartype, varname ) vartype varname ; + #define STEAM_CALLBACK_MEMBER_ARRAY( varidx, vartype, varname, varcount ) vartype varname [ varcount ]; + #define STEAM_CALLBACK_END(nArgs) }; +#endif + +// Forward declare all of the Steam interfaces. (Do we really need to do this?) +class ISteamClient; +class ISteamUser; +class ISteamGameServer; +class ISteamFriends; +class ISteamUtils; +class ISteamMatchmaking; +class ISteamContentServer; +class ISteamMatchmakingServers; +class ISteamUserStats; +class ISteamApps; +class ISteamNetworking; +class ISteamRemoteStorage; +class ISteamScreenshots; +class ISteamMusic; +class ISteamMusicRemote; +class ISteamGameServerStats; +class ISteamHTTP; +class ISteamController; +class ISteamUGC; +class ISteamHTMLSurface; +class ISteamInventory; +class ISteamVideo; +class ISteamParentalSettings; +class ISteamGameSearch; +class ISteamInput; +class ISteamParties; +class ISteamRemotePlay; + +// Forward declare types +struct SteamNetworkingIdentity; + +//----------------------------------------------------------------------------- +// Purpose: Base values for callback identifiers, each callback must +// have a unique ID. +//----------------------------------------------------------------------------- +enum { k_iSteamUserCallbacks = 100 }; +enum { k_iSteamGameServerCallbacks = 200 }; +enum { k_iSteamFriendsCallbacks = 300 }; +enum { k_iSteamBillingCallbacks = 400 }; +enum { k_iSteamMatchmakingCallbacks = 500 }; +enum { k_iSteamContentServerCallbacks = 600 }; +enum { k_iSteamUtilsCallbacks = 700 }; +enum { k_iSteamAppsCallbacks = 1000 }; +enum { k_iSteamUserStatsCallbacks = 1100 }; +enum { k_iSteamNetworkingCallbacks = 1200 }; +enum { k_iSteamNetworkingSocketsCallbacks = 1220 }; +enum { k_iSteamNetworkingMessagesCallbacks = 1250 }; +enum { k_iSteamNetworkingUtilsCallbacks = 1280 }; +enum { k_iSteamRemoteStorageCallbacks = 1300 }; +enum { k_iSteamGameServerItemsCallbacks = 1500 }; +enum { k_iSteamGameCoordinatorCallbacks = 1700 }; +enum { k_iSteamGameServerStatsCallbacks = 1800 }; +enum { k_iSteam2AsyncCallbacks = 1900 }; +enum { k_iSteamGameStatsCallbacks = 2000 }; +enum { k_iSteamHTTPCallbacks = 2100 }; +enum { k_iSteamScreenshotsCallbacks = 2300 }; +// NOTE: 2500-2599 are reserved +enum { k_iSteamStreamLauncherCallbacks = 2600 }; +enum { k_iSteamControllerCallbacks = 2800 }; +enum { k_iSteamUGCCallbacks = 3400 }; +enum { k_iSteamStreamClientCallbacks = 3500 }; +enum { k_iSteamMusicCallbacks = 4000 }; +enum { k_iSteamMusicRemoteCallbacks = 4100 }; +enum { k_iSteamGameNotificationCallbacks = 4400 }; +enum { k_iSteamHTMLSurfaceCallbacks = 4500 }; +enum { k_iSteamVideoCallbacks = 4600 }; +enum { k_iSteamInventoryCallbacks = 4700 }; +enum { k_ISteamParentalSettingsCallbacks = 5000 }; +enum { k_iSteamGameSearchCallbacks = 5200 }; +enum { k_iSteamPartiesCallbacks = 5300 }; +enum { k_iSteamSTARCallbacks = 5500 }; +enum { k_iSteamRemotePlayCallbacks = 5700 }; +enum { k_iSteamChatCallbacks = 5900 }; +enum { k_iSteamTimelineCallbacks = 6000 }; +// NOTE: Internal "IClientXxx" callback IDs go in clientenums.h + +// Macros used to annotate various Steamworks interfaces to generate the +// flat API +#ifdef API_GEN +# define STEAM_CLANG_ATTR(ATTR) __attribute__((annotate( ATTR ))) +#else +# define STEAM_CLANG_ATTR(ATTR) +#endif + +#define STEAM_OUT_STRUCT() STEAM_CLANG_ATTR( "out_struct: ;" ) +#define STEAM_OUT_STRING() STEAM_CLANG_ATTR( "out_string: ;" ) +#define STEAM_OUT_ARRAY_CALL(COUNTER,FUNCTION,PARAMS) STEAM_CLANG_ATTR( "out_array_call:" #COUNTER "," #FUNCTION "," #PARAMS ";" ) +#define STEAM_OUT_ARRAY_COUNT(COUNTER, DESC) STEAM_CLANG_ATTR( "out_array_count:" #COUNTER ";desc:" #DESC ) +#define STEAM_ARRAY_COUNT(COUNTER) STEAM_CLANG_ATTR( "array_count:" #COUNTER ";" ) +#define STEAM_ARRAY_COUNT_D(COUNTER, DESC) STEAM_CLANG_ATTR( "array_count:" #COUNTER ";desc:" #DESC ) +#define STEAM_BUFFER_COUNT(COUNTER) STEAM_CLANG_ATTR( "buffer_count:" #COUNTER ";" ) +#define STEAM_OUT_BUFFER_COUNT(COUNTER) STEAM_CLANG_ATTR( "out_buffer_count:" #COUNTER ";" ) +#define STEAM_OUT_STRING_COUNT(COUNTER) STEAM_CLANG_ATTR( "out_string_count:" #COUNTER ";" ) +#define STEAM_DESC(DESC) STEAM_CLANG_ATTR("desc:" #DESC ";") +#define STEAM_CALL_RESULT(RESULT_TYPE) STEAM_CLANG_ATTR("callresult:" #RESULT_TYPE ";") +#define STEAM_CALL_BACK(RESULT_TYPE) STEAM_CLANG_ATTR("callback:" #RESULT_TYPE ";") +#define STEAM_FLAT_NAME(NAME) STEAM_CLANG_ATTR("flat_name:" #NAME ";") diff --git a/external/steamworks/public/steam/steam_gameserver.h b/external/steamworks/public/steam/steam_gameserver.h new file mode 100644 index 0000000..623f832 --- /dev/null +++ b/external/steamworks/public/steam/steam_gameserver.h @@ -0,0 +1,114 @@ +//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: +// +//============================================================================= + +#ifndef STEAM_GAMESERVER_H +#define STEAM_GAMESERVER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api.h" +#include "isteamgameserver.h" +#include "isteamgameserverstats.h" + +enum EServerMode +{ + eServerModeInvalid = 0, // DO NOT USE + eServerModeNoAuthentication = 1, // Don't authenticate user logins and don't list on the server list + eServerModeAuthentication = 2, // Authenticate users, list on the server list, don't run VAC on clients that connect + eServerModeAuthenticationAndSecure = 3, // Authenticate users, list on the server list and VAC protect clients +}; + +/// Pass to SteamGameServer_Init to indicate that the same UDP port will be used for game traffic +/// UDP queries for server browser pings and LAN discovery. In this case, Steam will not open up a +/// socket to handle server browser queries, and you must use ISteamGameServer::HandleIncomingPacket +/// and ISteamGameServer::GetNextOutgoingPacket to handle packets related to server discovery on your socket. +const uint16 STEAMGAMESERVER_QUERY_PORT_SHARED = 0xffff; + +// DEPRECATED: This old name was really confusing. +const uint16 MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE = STEAMGAMESERVER_QUERY_PORT_SHARED; + +// Initialize SteamGameServer client and interface objects, and set server properties which may not be changed. +// +// After calling this function, you should set any additional server parameters, and then +// call ISteamGameServer::LogOnAnonymous() or ISteamGameServer::LogOn() +// +// - unIP will usually be zero. If you are on a machine with multiple IP addresses, you can pass a non-zero +// value here and the relevant sockets will be bound to that IP. This can be used to ensure that +// the IP you desire is the one used in the server browser. +// - usGamePort is the port that clients will connect to for gameplay. You will usually open up your +// own socket bound to this port. +// - usQueryPort is the port that will manage server browser related duties and info +// pings from clients. If you pass STEAMGAMESERVER_QUERY_PORT_SHARED for usQueryPort, then it +// will use "GameSocketShare" mode, which means that the game is responsible for sending and receiving +// UDP packets for the master server updater. (See ISteamGameServer::HandleIncomingPacket and +// ISteamGameServer::GetNextOutgoingPacket.) +// - The version string should be in the form x.x.x.x, and is used by the master server to detect when the +// server is out of date. (Only servers with the latest version will be listed.) +// +// On success k_ESteamAPIInitResult_OK is returned. Otherwise, if pOutErrMsg is non-NULL, +// it will receive a non-localized message that explains the reason for the failure +inline ESteamAPIInitResult SteamGameServer_InitEx( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString, SteamErrMsg *pOutErrMsg ); + +// This function is included for compatibility with older SDK. +// You can use it if you don't care about decent error handling +inline bool SteamGameServer_Init( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ) +{ + return SteamGameServer_InitEx( unIP, usGamePort, usQueryPort, eServerMode, pchVersionString, NULL ) == k_ESteamAPIInitResult_OK; +} + +// Shutdown SteamGameSeverXxx interfaces, log out, and free resources. +S_API void SteamGameServer_Shutdown(); + +// Most Steam API functions allocate some amount of thread-local memory for +// parameter storage. Calling SteamGameServer_ReleaseCurrentThreadMemory() +// will free all API-related memory associated with the calling thread. +// This memory is released automatically by SteamGameServer_RunCallbacks(), +// so single-threaded servers do not need to explicitly call this function. +inline void SteamGameServer_ReleaseCurrentThreadMemory(); + +S_API bool SteamGameServer_BSecure(); +S_API uint64 SteamGameServer_GetSteamID(); + +// Older SDKs exported this global pointer, but it is no longer supported. +// You should use SteamGameServerClient() to safely access the ISteamClient +// APIs from your game server application. +//S_API ISteamClient *g_pSteamClientGameServer; + +// SteamGameServer_InitSafe has been replaced with SteamGameServer_Init and +// is no longer supported. Use SteamGameServer_Init instead. +//S_API void S_CALLTYPE SteamGameServer_InitSafe(); + +//============================================================================= +// +// Internal implementation details below +// +//============================================================================= + +S_API ESteamAPIInitResult S_CALLTYPE SteamInternal_GameServer_Init_V2( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString, const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg ); +inline ESteamAPIInitResult SteamGameServer_InitEx( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString, SteamErrMsg *pOutErrMsg ) +{ + const char *pszInternalCheckInterfaceVersions = + STEAMUTILS_INTERFACE_VERSION "\0" + STEAMNETWORKINGUTILS_INTERFACE_VERSION "\0" + + STEAMGAMESERVER_INTERFACE_VERSION "\0" + STEAMGAMESERVERSTATS_INTERFACE_VERSION "\0" + STEAMHTTP_INTERFACE_VERSION "\0" + STEAMINVENTORY_INTERFACE_VERSION "\0" + STEAMNETWORKING_INTERFACE_VERSION "\0" + STEAMNETWORKINGMESSAGES_INTERFACE_VERSION "\0" + STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "\0" + STEAMUGC_INTERFACE_VERSION "\0" + "\0"; + return SteamInternal_GameServer_Init_V2( unIP, usGamePort, usQueryPort, eServerMode, pchVersionString, pszInternalCheckInterfaceVersions, pOutErrMsg ); +} +inline void SteamGameServer_ReleaseCurrentThreadMemory() +{ + SteamAPI_ReleaseCurrentThreadMemory(); +} + +#endif // STEAM_GAMESERVER_H diff --git a/external/steamworks/public/steam/steamclientpublic.h b/external/steamworks/public/steam/steamclientpublic.h new file mode 100644 index 0000000..365fb68 --- /dev/null +++ b/external/steamworks/public/steam/steamclientpublic.h @@ -0,0 +1,1199 @@ +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Declare common types used by the Steamworks SDK. +// +//============================================================================= + +#ifndef STEAMCLIENTPUBLIC_H +#define STEAMCLIENTPUBLIC_H + +#include "steamtypes.h" +#include "steamuniverse.h" + +// General result codes +enum EResult +{ + k_EResultNone = 0, // no result + k_EResultOK = 1, // success + k_EResultFail = 2, // generic failure + k_EResultNoConnection = 3, // no/failed network connection +// k_EResultNoConnectionRetry = 4, // OBSOLETE - removed + k_EResultInvalidPassword = 5, // password/ticket is invalid + k_EResultLoggedInElsewhere = 6, // same user logged in elsewhere + k_EResultInvalidProtocolVer = 7, // protocol version is incorrect + k_EResultInvalidParam = 8, // a parameter is incorrect + k_EResultFileNotFound = 9, // file was not found + k_EResultBusy = 10, // called method busy - action not taken + k_EResultInvalidState = 11, // called object was in an invalid state + k_EResultInvalidName = 12, // name is invalid + k_EResultInvalidEmail = 13, // email is invalid + k_EResultDuplicateName = 14, // name is not unique + k_EResultAccessDenied = 15, // access is denied + k_EResultTimeout = 16, // operation timed out + k_EResultBanned = 17, // VAC2 banned + k_EResultAccountNotFound = 18, // account not found + k_EResultInvalidSteamID = 19, // steamID is invalid + k_EResultServiceUnavailable = 20, // The requested service is currently unavailable + k_EResultNotLoggedOn = 21, // The user is not logged on + k_EResultPending = 22, // Request is pending (may be in process, or waiting on third party) + k_EResultEncryptionFailure = 23, // Encryption or Decryption failed + k_EResultInsufficientPrivilege = 24, // Insufficient privilege + k_EResultLimitExceeded = 25, // Too much of a good thing + k_EResultRevoked = 26, // Access has been revoked (used for revoked guest passes) + k_EResultExpired = 27, // License/Guest pass the user is trying to access is expired + k_EResultAlreadyRedeemed = 28, // Guest pass has already been redeemed by account, cannot be acked again + k_EResultDuplicateRequest = 29, // The request is a duplicate and the action has already occurred in the past, ignored this time + k_EResultAlreadyOwned = 30, // All the games in this guest pass redemption request are already owned by the user + k_EResultIPNotFound = 31, // IP address not found + k_EResultPersistFailed = 32, // failed to write change to the data store + k_EResultLockingFailed = 33, // failed to acquire access lock for this operation + k_EResultLogonSessionReplaced = 34, + k_EResultConnectFailed = 35, + k_EResultHandshakeFailed = 36, + k_EResultIOFailure = 37, + k_EResultRemoteDisconnect = 38, + k_EResultShoppingCartNotFound = 39, // failed to find the shopping cart requested + k_EResultBlocked = 40, // a user didn't allow it + k_EResultIgnored = 41, // target is ignoring sender + k_EResultNoMatch = 42, // nothing matching the request found + k_EResultAccountDisabled = 43, + k_EResultServiceReadOnly = 44, // this service is not accepting content changes right now + k_EResultAccountNotFeatured = 45, // account doesn't have value, so this feature isn't available + k_EResultAdministratorOK = 46, // allowed to take this action, but only because requester is admin + k_EResultContentVersion = 47, // A Version mismatch in content transmitted within the Steam protocol. + k_EResultTryAnotherCM = 48, // The current CM can't service the user making a request, user should try another. + k_EResultPasswordRequiredToKickSession = 49,// You are already logged in elsewhere, this cached credential login has failed. + k_EResultAlreadyLoggedInElsewhere = 50, // You are already logged in elsewhere, you must wait + k_EResultSuspended = 51, // Long running operation (content download) suspended/paused + k_EResultCancelled = 52, // Operation canceled (typically by user: content download) + k_EResultDataCorruption = 53, // Operation canceled because data is ill formed or unrecoverable + k_EResultDiskFull = 54, // Operation canceled - not enough disk space. + k_EResultRemoteCallFailed = 55, // an remote call or IPC call failed + k_EResultPasswordUnset = 56, // Password could not be verified as it's unset server side + k_EResultExternalAccountUnlinked = 57, // External account (PSN, Facebook...) is not linked to a Steam account + k_EResultPSNTicketInvalid = 58, // PSN ticket was invalid + k_EResultExternalAccountAlreadyLinked = 59, // External account (PSN, Facebook...) is already linked to some other account, must explicitly request to replace/delete the link first + k_EResultRemoteFileConflict = 60, // The sync cannot resume due to a conflict between the local and remote files + k_EResultIllegalPassword = 61, // The requested new password is not legal + k_EResultSameAsPreviousValue = 62, // new value is the same as the old one ( secret question and answer ) + k_EResultAccountLogonDenied = 63, // account login denied due to 2nd factor authentication failure + k_EResultCannotUseOldPassword = 64, // The requested new password is not legal + k_EResultInvalidLoginAuthCode = 65, // account login denied due to auth code invalid + k_EResultAccountLogonDeniedNoMail = 66, // account login denied due to 2nd factor auth failure - and no mail has been sent - partner site specific + k_EResultHardwareNotCapableOfIPT = 67, // + k_EResultIPTInitError = 68, // + k_EResultParentalControlRestricted = 69, // operation failed due to parental control restrictions for current user + k_EResultFacebookQueryError = 70, // Facebook query returned an error + k_EResultExpiredLoginAuthCode = 71, // account login denied due to auth code expired + k_EResultIPLoginRestrictionFailed = 72, + k_EResultAccountLockedDown = 73, + k_EResultAccountLogonDeniedVerifiedEmailRequired = 74, + k_EResultNoMatchingURL = 75, + k_EResultBadResponse = 76, // parse failure, missing field, etc. + k_EResultRequirePasswordReEntry = 77, // The user cannot complete the action until they re-enter their password + k_EResultValueOutOfRange = 78, // the value entered is outside the acceptable range + k_EResultUnexpectedError = 79, // something happened that we didn't expect to ever happen + k_EResultDisabled = 80, // The requested service has been configured to be unavailable + k_EResultInvalidCEGSubmission = 81, // The set of files submitted to the CEG server are not valid ! + k_EResultRestrictedDevice = 82, // The device being used is not allowed to perform this action + k_EResultRegionLocked = 83, // The action could not be complete because it is region restricted + k_EResultRateLimitExceeded = 84, // Temporary rate limit exceeded, try again later, different from k_EResultLimitExceeded which may be permanent + k_EResultAccountLoginDeniedNeedTwoFactor = 85, // Need two-factor code to login + k_EResultItemDeleted = 86, // The thing we're trying to access has been deleted + k_EResultAccountLoginDeniedThrottle = 87, // login attempt failed, try to throttle response to possible attacker + k_EResultTwoFactorCodeMismatch = 88, // two factor code mismatch + k_EResultTwoFactorActivationCodeMismatch = 89, // activation code for two-factor didn't match + k_EResultAccountAssociatedToMultiplePartners = 90, // account has been associated with multiple partners + k_EResultNotModified = 91, // data not modified + k_EResultNoMobileDevice = 92, // the account does not have a mobile device associated with it + k_EResultTimeNotSynced = 93, // the time presented is out of range or tolerance + k_EResultSmsCodeFailed = 94, // SMS code failure (no match, none pending, etc.) + k_EResultAccountLimitExceeded = 95, // Too many accounts access this resource + k_EResultAccountActivityLimitExceeded = 96, // Too many changes to this account + k_EResultPhoneActivityLimitExceeded = 97, // Too many changes to this phone + k_EResultRefundToWallet = 98, // Cannot refund to payment method, must use wallet + k_EResultEmailSendFailure = 99, // Cannot send an email + k_EResultNotSettled = 100, // Can't perform operation till payment has settled + k_EResultNeedCaptcha = 101, // Needs to provide a valid captcha + k_EResultGSLTDenied = 102, // a game server login token owned by this token's owner has been banned + k_EResultGSOwnerDenied = 103, // game server owner is denied for other reason (account lock, community ban, vac ban, missing phone) + k_EResultInvalidItemType = 104, // the type of thing we were requested to act on is invalid + k_EResultIPBanned = 105, // the ip address has been banned from taking this action + k_EResultGSLTExpired = 106, // this token has expired from disuse; can be reset for use + k_EResultInsufficientFunds = 107, // user doesn't have enough wallet funds to complete the action + k_EResultTooManyPending = 108, // There are too many of this thing pending already + k_EResultNoSiteLicensesFound = 109, // No site licenses found + k_EResultWGNetworkSendExceeded = 110, // the WG couldn't send a response because we exceeded max network send size + k_EResultAccountNotFriends = 111, // the user is not mutually friends + k_EResultLimitedUserAccount = 112, // the user is limited + k_EResultCantRemoveItem = 113, // item can't be removed + k_EResultAccountDeleted = 114, // account has been deleted + k_EResultExistingUserCancelledLicense = 115, // A license for this already exists, but cancelled + k_EResultCommunityCooldown = 116, // access is denied because of a community cooldown (probably from support profile data resets) + k_EResultNoLauncherSpecified = 117, // No launcher was specified, but a launcher was needed to choose correct realm for operation. + k_EResultMustAgreeToSSA = 118, // User must agree to china SSA or global SSA before login + k_EResultLauncherMigrated = 119, // The specified launcher type is no longer supported; the user should be directed elsewhere + k_EResultSteamRealmMismatch = 120, // The user's realm does not match the realm of the requested resource + k_EResultInvalidSignature = 121, // signature check did not match + k_EResultParseFailure = 122, // Failed to parse input + k_EResultNoVerifiedPhone = 123, // account does not have a verified phone number + k_EResultInsufficientBattery = 124, // user device doesn't have enough battery charge currently to complete the action + k_EResultChargerRequired = 125, // The operation requires a charger to be plugged in, which wasn't present + k_EResultCachedCredentialInvalid = 126, // Cached credential was invalid - user must reauthenticate + K_EResultPhoneNumberIsVOIP = 127, // The phone number provided is a Voice Over IP number + k_EResultNotSupported = 128, // The data being accessed is not supported by this API + k_EResultFamilySizeLimitExceeded = 129, // Reached the maximum size of the family + k_EResultOfflineAppCacheInvalid = 130, // The local data for the offline mode cache is insufficient to login +}; + +// Error codes for use with the voice functions +enum EVoiceResult +{ + k_EVoiceResultOK = 0, + k_EVoiceResultNotInitialized = 1, + k_EVoiceResultNotRecording = 2, + k_EVoiceResultNoData = 3, + k_EVoiceResultBufferTooSmall = 4, + k_EVoiceResultDataCorrupted = 5, + k_EVoiceResultRestricted = 6, + k_EVoiceResultUnsupportedCodec = 7, + k_EVoiceResultReceiverOutOfDate = 8, + k_EVoiceResultReceiverDidNotAnswer = 9, + +}; + +// Result codes to GSHandleClientDeny/Kick +enum EDenyReason +{ + k_EDenyInvalid = 0, + k_EDenyInvalidVersion = 1, + k_EDenyGeneric = 2, + k_EDenyNotLoggedOn = 3, + k_EDenyNoLicense = 4, + k_EDenyCheater = 5, + k_EDenyLoggedInElseWhere = 6, + k_EDenyUnknownText = 7, + k_EDenyIncompatibleAnticheat = 8, + k_EDenyMemoryCorruption = 9, + k_EDenyIncompatibleSoftware = 10, + k_EDenySteamConnectionLost = 11, + k_EDenySteamConnectionError = 12, + k_EDenySteamResponseTimedOut = 13, + k_EDenySteamValidationStalled = 14, + k_EDenySteamOwnerLeftGuestUser = 15, +}; + +// return type of GetAuthSessionTicket +typedef uint32 HAuthTicket; +const HAuthTicket k_HAuthTicketInvalid = 0; + +// results from BeginAuthSession +enum EBeginAuthSessionResult +{ + k_EBeginAuthSessionResultOK = 0, // Ticket is valid for this game and this steamID. + k_EBeginAuthSessionResultInvalidTicket = 1, // Ticket is not valid. + k_EBeginAuthSessionResultDuplicateRequest = 2, // A ticket has already been submitted for this steamID + k_EBeginAuthSessionResultInvalidVersion = 3, // Ticket is from an incompatible interface version + k_EBeginAuthSessionResultGameMismatch = 4, // Ticket is not for this game + k_EBeginAuthSessionResultExpiredTicket = 5, // Ticket has expired +}; + +// Callback values for callback ValidateAuthTicketResponse_t which is a response to BeginAuthSession +enum EAuthSessionResponse +{ + k_EAuthSessionResponseOK = 0, // Steam has verified the user is online, the ticket is valid and ticket has not been reused. + k_EAuthSessionResponseUserNotConnectedToSteam = 1, // The user in question is not connected to steam + k_EAuthSessionResponseNoLicenseOrExpired = 2, // The license has expired. + k_EAuthSessionResponseVACBanned = 3, // The user is VAC banned for this game. + k_EAuthSessionResponseLoggedInElseWhere = 4, // The user account has logged in elsewhere and the session containing the game instance has been disconnected. + k_EAuthSessionResponseVACCheckTimedOut = 5, // VAC has been unable to perform anti-cheat checks on this user + k_EAuthSessionResponseAuthTicketCanceled = 6, // The ticket has been canceled by the issuer + k_EAuthSessionResponseAuthTicketInvalidAlreadyUsed = 7, // This ticket has already been used, it is not valid. + k_EAuthSessionResponseAuthTicketInvalid = 8, // This ticket is not from a user instance currently connected to steam. + k_EAuthSessionResponsePublisherIssuedBan = 9, // The user is banned for this game. The ban came via the web api and not VAC + k_EAuthSessionResponseAuthTicketNetworkIdentityFailure = 10, // The network identity in the ticket does not match the server authenticating the ticket +}; + +// results from UserHasLicenseForApp +enum EUserHasLicenseForAppResult +{ + k_EUserHasLicenseResultHasLicense = 0, // User has a license for specified app + k_EUserHasLicenseResultDoesNotHaveLicense = 1, // User does not have a license for the specified app + k_EUserHasLicenseResultNoAuth = 2, // User has not been authenticated +}; + + +// Steam account types +enum EAccountType +{ + k_EAccountTypeInvalid = 0, + k_EAccountTypeIndividual = 1, // single user account + k_EAccountTypeMultiseat = 2, // multiseat (e.g. cybercafe) account + k_EAccountTypeGameServer = 3, // game server account + k_EAccountTypeAnonGameServer = 4, // anonymous game server account + k_EAccountTypePending = 5, // pending + k_EAccountTypeContentServer = 6, // content server + k_EAccountTypeClan = 7, + k_EAccountTypeChat = 8, + k_EAccountTypeConsoleUser = 9, // Fake SteamID for local PSN account on PS3 or Live account on 360, etc. + k_EAccountTypeAnonUser = 10, + + // Max of 16 items in this field + k_EAccountTypeMax +}; + + + +//----------------------------------------------------------------------------- +// Purpose: Chat Entry Types (previously was only friend-to-friend message types) +//----------------------------------------------------------------------------- +enum EChatEntryType +{ + k_EChatEntryTypeInvalid = 0, + k_EChatEntryTypeChatMsg = 1, // Normal text message from another user + k_EChatEntryTypeTyping = 2, // Another user is typing (not used in multi-user chat) + k_EChatEntryTypeInviteGame = 3, // Invite from other user into that users current game + k_EChatEntryTypeEmote = 4, // text emote message (deprecated, should be treated as ChatMsg) + //k_EChatEntryTypeLobbyGameStart = 5, // lobby game is starting (dead - listen for LobbyGameCreated_t callback instead) + k_EChatEntryTypeLeftConversation = 6, // user has left the conversation ( closed chat window ) + // Above are previous FriendMsgType entries, now merged into more generic chat entry types + k_EChatEntryTypeEntered = 7, // user has entered the conversation (used in multi-user chat and group chat) + k_EChatEntryTypeWasKicked = 8, // user was kicked (data: 64-bit steamid of actor performing the kick) + k_EChatEntryTypeWasBanned = 9, // user was banned (data: 64-bit steamid of actor performing the ban) + k_EChatEntryTypeDisconnected = 10, // user disconnected + k_EChatEntryTypeHistoricalChat = 11, // a chat message from user's chat history or offilne message + //k_EChatEntryTypeReserved1 = 12, // No longer used + //k_EChatEntryTypeReserved2 = 13, // No longer used + k_EChatEntryTypeLinkBlocked = 14, // a link was removed by the chat filter. +}; + + +//----------------------------------------------------------------------------- +// Purpose: Chat Room Enter Responses +//----------------------------------------------------------------------------- +enum EChatRoomEnterResponse +{ + k_EChatRoomEnterResponseSuccess = 1, // Success + k_EChatRoomEnterResponseDoesntExist = 2, // Chat doesn't exist (probably closed) + k_EChatRoomEnterResponseNotAllowed = 3, // General Denied - You don't have the permissions needed to join the chat + k_EChatRoomEnterResponseFull = 4, // Chat room has reached its maximum size + k_EChatRoomEnterResponseError = 5, // Unexpected Error + k_EChatRoomEnterResponseBanned = 6, // You are banned from this chat room and may not join + k_EChatRoomEnterResponseLimited = 7, // Joining this chat is not allowed because you are a limited user (no value on account) + k_EChatRoomEnterResponseClanDisabled = 8, // Attempt to join a clan chat when the clan is locked or disabled + k_EChatRoomEnterResponseCommunityBan = 9, // Attempt to join a chat when the user has a community lock on their account + k_EChatRoomEnterResponseMemberBlockedYou = 10, // Join failed - some member in the chat has blocked you from joining + k_EChatRoomEnterResponseYouBlockedMember = 11, // Join failed - you have blocked some member already in the chat + // k_EChatRoomEnterResponseNoRankingDataLobby = 12, // No longer used + // k_EChatRoomEnterResponseNoRankingDataUser = 13, // No longer used + // k_EChatRoomEnterResponseRankOutOfRange = 14, // No longer used + k_EChatRoomEnterResponseRatelimitExceeded = 15, // Join failed - to many join attempts in a very short period of time +}; + + +const unsigned int k_unSteamAccountIDMask = 0xFFFFFFFF; +const unsigned int k_unSteamAccountInstanceMask = 0x000FFFFF; +const unsigned int k_unSteamUserDefaultInstance = 1; // fixed instance for all individual users + +// Special flags for Chat accounts - they go in the top 8 bits +// of the steam ID's "instance", leaving 12 for the actual instances +enum EChatSteamIDInstanceFlags +{ + k_EChatAccountInstanceMask = 0x00000FFF, // top 8 bits are flags + + k_EChatInstanceFlagClan = ( k_unSteamAccountInstanceMask + 1 ) >> 1, // top bit + k_EChatInstanceFlagLobby = ( k_unSteamAccountInstanceMask + 1 ) >> 2, // next one down, etc + k_EChatInstanceFlagMMSLobby = ( k_unSteamAccountInstanceMask + 1 ) >> 3, // next one down, etc + + // Max of 8 flags +}; + + +//----------------------------------------------------------------------------- +// Purpose: Possible positions to tell the overlay to show notifications in +//----------------------------------------------------------------------------- +enum ENotificationPosition +{ + k_EPositionInvalid = -1, + k_EPositionTopLeft = 0, + k_EPositionTopRight = 1, + k_EPositionBottomLeft = 2, + k_EPositionBottomRight = 3, +}; + + +//----------------------------------------------------------------------------- +// Purpose: Broadcast upload result details +//----------------------------------------------------------------------------- +enum EBroadcastUploadResult +{ + k_EBroadcastUploadResultNone = 0, // broadcast state unknown + k_EBroadcastUploadResultOK = 1, // broadcast was good, no problems + k_EBroadcastUploadResultInitFailed = 2, // broadcast init failed + k_EBroadcastUploadResultFrameFailed = 3, // broadcast frame upload failed + k_EBroadcastUploadResultTimeout = 4, // broadcast upload timed out + k_EBroadcastUploadResultBandwidthExceeded = 5, // broadcast send too much data + k_EBroadcastUploadResultLowFPS = 6, // broadcast FPS too low + k_EBroadcastUploadResultMissingKeyFrames = 7, // broadcast sending not enough key frames + k_EBroadcastUploadResultNoConnection = 8, // broadcast client failed to connect to relay + k_EBroadcastUploadResultRelayFailed = 9, // relay dropped the upload + k_EBroadcastUploadResultSettingsChanged = 10, // the client changed broadcast settings + k_EBroadcastUploadResultMissingAudio = 11, // client failed to send audio data + k_EBroadcastUploadResultTooFarBehind = 12, // clients was too slow uploading + k_EBroadcastUploadResultTranscodeBehind = 13, // server failed to keep up with transcode + k_EBroadcastUploadResultNotAllowedToPlay = 14, // Broadcast does not have permissions to play game + k_EBroadcastUploadResultBusy = 15, // RTMP host to busy to take new broadcast stream, choose another + k_EBroadcastUploadResultBanned = 16, // Account banned from community broadcast + k_EBroadcastUploadResultAlreadyActive = 17, // We already already have an stream running. + k_EBroadcastUploadResultForcedOff = 18, // We explicitly shutting down a broadcast + k_EBroadcastUploadResultAudioBehind = 19, // Audio stream was too far behind video + k_EBroadcastUploadResultShutdown = 20, // Broadcast Server was shut down + k_EBroadcastUploadResultDisconnect = 21, // broadcast uploader TCP disconnected + k_EBroadcastUploadResultVideoInitFailed = 22, // invalid video settings + k_EBroadcastUploadResultAudioInitFailed = 23, // invalid audio settings +}; + + +//----------------------------------------------------------------------------- +// Purpose: Reasons a user may not use the Community Market. +// Used in MarketEligibilityResponse_t. +//----------------------------------------------------------------------------- +enum EMarketNotAllowedReasonFlags +{ + k_EMarketNotAllowedReason_None = 0, + + // A back-end call failed or something that might work again on retry + k_EMarketNotAllowedReason_TemporaryFailure = (1 << 0), + + // Disabled account + k_EMarketNotAllowedReason_AccountDisabled = (1 << 1), + + // Locked account + k_EMarketNotAllowedReason_AccountLockedDown = (1 << 2), + + // Limited account (no purchases) + k_EMarketNotAllowedReason_AccountLimited = (1 << 3), + + // The account is banned from trading items + k_EMarketNotAllowedReason_TradeBanned = (1 << 4), + + // Wallet funds aren't tradable because the user has had no purchase + // activity in the last year or has had no purchases prior to last month + k_EMarketNotAllowedReason_AccountNotTrusted = (1 << 5), + + // The user doesn't have Steam Guard enabled + k_EMarketNotAllowedReason_SteamGuardNotEnabled = (1 << 6), + + // The user has Steam Guard, but it hasn't been enabled for the required + // number of days + k_EMarketNotAllowedReason_SteamGuardOnlyRecentlyEnabled = (1 << 7), + + // The user has recently forgotten their password and reset it + k_EMarketNotAllowedReason_RecentPasswordReset = (1 << 8), + + // The user has recently funded his or her wallet with a new payment method + k_EMarketNotAllowedReason_NewPaymentMethod = (1 << 9), + + // An invalid cookie was sent by the user + k_EMarketNotAllowedReason_InvalidCookie = (1 << 10), + + // The user has Steam Guard, but is using a new computer or web browser + k_EMarketNotAllowedReason_UsingNewDevice = (1 << 11), + + // The user has recently refunded a store purchase by his or herself + k_EMarketNotAllowedReason_RecentSelfRefund = (1 << 12), + + // The user has recently funded his or her wallet with a new payment method that cannot be verified + k_EMarketNotAllowedReason_NewPaymentMethodCannotBeVerified = (1 << 13), + + // Not only is the account not trusted, but they have no recent purchases at all + k_EMarketNotAllowedReason_NoRecentPurchases = (1 << 14), + + // User accepted a wallet gift that was recently purchased + k_EMarketNotAllowedReason_AcceptedWalletGift = (1 << 15), +}; + + +// +// describes XP / progress restrictions to apply for games with duration control / +// anti-indulgence enabled for minor Steam China users. +// +// WARNING: DO NOT RENUMBER +enum EDurationControlProgress +{ + k_EDurationControlProgress_Full = 0, // Full progress + k_EDurationControlProgress_Half = 1, // deprecated - XP or persistent rewards should be halved + k_EDurationControlProgress_None = 2, // deprecated - XP or persistent rewards should be stopped + + k_EDurationControl_ExitSoon_3h = 3, // allowed 3h time since 5h gap/break has elapsed, game should exit - steam will terminate the game soon + k_EDurationControl_ExitSoon_5h = 4, // allowed 5h time in calendar day has elapsed, game should exit - steam will terminate the game soon + k_EDurationControl_ExitSoon_Night = 5, // game running after day period, game should exit - steam will terminate the game soon +}; + + +// +// describes which notification timer has expired, for steam china duration control feature +// +// WARNING: DO NOT RENUMBER +enum EDurationControlNotification +{ + k_EDurationControlNotification_None = 0, // just informing you about progress, no notification to show + k_EDurationControlNotification_1Hour = 1, // "you've been playing for N hours" + + k_EDurationControlNotification_3Hours = 2, // deprecated - "you've been playing for 3 hours; take a break" + k_EDurationControlNotification_HalfProgress = 3,// deprecated - "your XP / progress is half normal" + k_EDurationControlNotification_NoProgress = 4, // deprecated - "your XP / progress is zero" + + k_EDurationControlNotification_ExitSoon_3h = 5, // allowed 3h time since 5h gap/break has elapsed, game should exit - steam will terminate the game soon + k_EDurationControlNotification_ExitSoon_5h = 6, // allowed 5h time in calendar day has elapsed, game should exit - steam will terminate the game soon + k_EDurationControlNotification_ExitSoon_Night = 7,// game running after day period, game should exit - steam will terminate the game soon +}; + + +// +// Specifies a game's online state in relation to duration control +// +enum EDurationControlOnlineState +{ + k_EDurationControlOnlineState_Invalid = 0, // nil value + k_EDurationControlOnlineState_Offline = 1, // currently in offline play - single-player, offline co-op, etc. + k_EDurationControlOnlineState_Online = 2, // currently in online play + k_EDurationControlOnlineState_OnlineHighPri = 3, // currently in online play and requests not to be interrupted +}; + + +enum EBetaBranchFlags +{ + k_EBetaBranch_None = 0, + k_EBetaBranch_Default = 1, // this is the default branch ("public") + k_EBetaBranch_Available = 2, // this branch can be selected (available) + k_EBetaBranch_Private = 4, // this is a private branch (password protected) + k_EBetaBranch_Selected = 8, // this is the currently selected branch (active) + k_EBetaBranch_Installed = 16, // this is the currently installed branch (mounted) +}; + +#pragma pack( push, 1 ) + +#define CSTEAMID_DEFINED + +// Steam ID structure (64 bits total) +class CSteamID +{ +public: + + //----------------------------------------------------------------------------- + // Purpose: Constructor + //----------------------------------------------------------------------------- + CSteamID() + { + m_steamid.m_comp.m_unAccountID = 0; + m_steamid.m_comp.m_EAccountType = k_EAccountTypeInvalid; + m_steamid.m_comp.m_EUniverse = k_EUniverseInvalid; + m_steamid.m_comp.m_unAccountInstance = 0; + } + + + //----------------------------------------------------------------------------- + // Purpose: Constructor + // Input : unAccountID - 32-bit account ID + // eUniverse - Universe this account belongs to + // eAccountType - Type of account + //----------------------------------------------------------------------------- + CSteamID( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType ) + { + Set( unAccountID, eUniverse, eAccountType ); + } + + + //----------------------------------------------------------------------------- + // Purpose: Constructor + // Input : unAccountID - 32-bit account ID + // unAccountInstance - instance + // eUniverse - Universe this account belongs to + // eAccountType - Type of account + //----------------------------------------------------------------------------- + CSteamID( uint32 unAccountID, unsigned int unAccountInstance, EUniverse eUniverse, EAccountType eAccountType ) + { +#if defined(_SERVER) && defined(Assert) + Assert( ( k_EAccountTypeIndividual != eAccountType ) || ( unAccountInstance == k_unSteamUserDefaultInstance ) ); // enforce that for individual accounts, instance is always 1 +#endif // _SERVER + InstancedSet( unAccountID, unAccountInstance, eUniverse, eAccountType ); + } + + + //----------------------------------------------------------------------------- + // Purpose: Constructor + // Input : ulSteamID - 64-bit representation of a Steam ID + // Note: Will not accept a uint32 or int32 as input, as that is a probable mistake. + // See the stubbed out overloads in the private: section for more info. + //----------------------------------------------------------------------------- + CSteamID( uint64 ulSteamID ) + { + SetFromUint64( ulSteamID ); + } +#ifdef INT64_DIFFERENT_FROM_INT64_T + CSteamID( uint64_t ulSteamID ) + { + SetFromUint64( (uint64)ulSteamID ); + } +#endif + + + //----------------------------------------------------------------------------- + // Purpose: Sets parameters for steam ID + // Input : unAccountID - 32-bit account ID + // eUniverse - Universe this account belongs to + // eAccountType - Type of account + //----------------------------------------------------------------------------- + void Set( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType ) + { + m_steamid.m_comp.m_unAccountID = unAccountID; + m_steamid.m_comp.m_EUniverse = eUniverse; + m_steamid.m_comp.m_EAccountType = eAccountType; + + if ( eAccountType == k_EAccountTypeClan || eAccountType == k_EAccountTypeGameServer ) + { + m_steamid.m_comp.m_unAccountInstance = 0; + } + else + { + m_steamid.m_comp.m_unAccountInstance = k_unSteamUserDefaultInstance; + } + } + + + //----------------------------------------------------------------------------- + // Purpose: Sets parameters for steam ID + // Input : unAccountID - 32-bit account ID + // eUniverse - Universe this account belongs to + // eAccountType - Type of account + //----------------------------------------------------------------------------- + void InstancedSet( uint32 unAccountID, uint32 unInstance, EUniverse eUniverse, EAccountType eAccountType ) + { + m_steamid.m_comp.m_unAccountID = unAccountID; + m_steamid.m_comp.m_EUniverse = eUniverse; + m_steamid.m_comp.m_EAccountType = eAccountType; + m_steamid.m_comp.m_unAccountInstance = unInstance; + } + + + //----------------------------------------------------------------------------- + // Purpose: Initializes a steam ID from its 52 bit parts and universe/type + // Input : ulIdentifier - 52 bits of goodness + //----------------------------------------------------------------------------- + void FullSet( uint64 ulIdentifier, EUniverse eUniverse, EAccountType eAccountType ) + { + m_steamid.m_comp.m_unAccountID = ( ulIdentifier & k_unSteamAccountIDMask ); // account ID is low 32 bits + m_steamid.m_comp.m_unAccountInstance = ( ( ulIdentifier >> 32 ) & k_unSteamAccountInstanceMask ); // account instance is next 20 bits + m_steamid.m_comp.m_EUniverse = eUniverse; + m_steamid.m_comp.m_EAccountType = eAccountType; + } + + + //----------------------------------------------------------------------------- + // Purpose: Initializes a steam ID from its 64-bit representation + // Input : ulSteamID - 64-bit representation of a Steam ID + //----------------------------------------------------------------------------- + void SetFromUint64( uint64 ulSteamID ) + { + m_steamid.m_unAll64Bits = ulSteamID; + } + + + //----------------------------------------------------------------------------- + // Purpose: Clear all fields, leaving an invalid ID. + //----------------------------------------------------------------------------- + void Clear() + { + m_steamid.m_comp.m_unAccountID = 0; + m_steamid.m_comp.m_EAccountType = k_EAccountTypeInvalid; + m_steamid.m_comp.m_EUniverse = k_EUniverseInvalid; + m_steamid.m_comp.m_unAccountInstance = 0; + } + + //----------------------------------------------------------------------------- + // Purpose: Converts steam ID to its 64-bit representation + // Output : 64-bit representation of a Steam ID + //----------------------------------------------------------------------------- + uint64 ConvertToUint64() const + { + return m_steamid.m_unAll64Bits; + } + + + //----------------------------------------------------------------------------- + // Purpose: Converts the static parts of a steam ID to a 64-bit representation. + // For multiseat accounts, all instances of that account will have the + // same static account key, so they can be grouped together by the static + // account key. + // Output : 64-bit static account key + //----------------------------------------------------------------------------- + uint64 GetStaticAccountKey() const + { + // note we do NOT include the account instance (which is a dynamic property) in the static account key + return (uint64) ( ( ( (uint64) m_steamid.m_comp.m_EUniverse ) << 56 ) + ((uint64) m_steamid.m_comp.m_EAccountType << 52 ) + m_steamid.m_comp.m_unAccountID ); + } + + + //----------------------------------------------------------------------------- + // Purpose: create an anonymous game server login to be filled in by the AM + //----------------------------------------------------------------------------- + void CreateBlankAnonLogon( EUniverse eUniverse ) + { + m_steamid.m_comp.m_unAccountID = 0; + m_steamid.m_comp.m_EAccountType = k_EAccountTypeAnonGameServer; + m_steamid.m_comp.m_EUniverse = eUniverse; + m_steamid.m_comp.m_unAccountInstance = 0; + } + + + //----------------------------------------------------------------------------- + // Purpose: create an anonymous game server login to be filled in by the AM + //----------------------------------------------------------------------------- + void CreateBlankAnonUserLogon( EUniverse eUniverse ) + { + m_steamid.m_comp.m_unAccountID = 0; + m_steamid.m_comp.m_EAccountType = k_EAccountTypeAnonUser; + m_steamid.m_comp.m_EUniverse = eUniverse; + m_steamid.m_comp.m_unAccountInstance = 0; + } + + //----------------------------------------------------------------------------- + // Purpose: Is this an anonymous game server login that will be filled in? + //----------------------------------------------------------------------------- + bool BBlankAnonAccount() const + { + return m_steamid.m_comp.m_unAccountID == 0 && BAnonAccount() && m_steamid.m_comp.m_unAccountInstance == 0; + } + + //----------------------------------------------------------------------------- + // Purpose: Is this a game server account id? (Either persistent or anonymous) + //----------------------------------------------------------------------------- + bool BGameServerAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeGameServer || m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonGameServer; + } + + //----------------------------------------------------------------------------- + // Purpose: Is this a persistent (not anonymous) game server account id? + //----------------------------------------------------------------------------- + bool BPersistentGameServerAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeGameServer; + } + + //----------------------------------------------------------------------------- + // Purpose: Is this an anonymous game server account id? + //----------------------------------------------------------------------------- + bool BAnonGameServerAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonGameServer; + } + + //----------------------------------------------------------------------------- + // Purpose: Is this a content server account id? + //----------------------------------------------------------------------------- + bool BContentServerAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeContentServer; + } + + + //----------------------------------------------------------------------------- + // Purpose: Is this a clan account id? + //----------------------------------------------------------------------------- + bool BClanAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeClan; + } + + + //----------------------------------------------------------------------------- + // Purpose: Is this a chat account id? + //----------------------------------------------------------------------------- + bool BChatAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeChat; + } + + //----------------------------------------------------------------------------- + // Purpose: Is this a chat account id? + //----------------------------------------------------------------------------- + bool IsLobby() const + { + return ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeChat ) + && ( m_steamid.m_comp.m_unAccountInstance & k_EChatInstanceFlagLobby ); + } + + + //----------------------------------------------------------------------------- + // Purpose: Is this an individual user account id? + //----------------------------------------------------------------------------- + bool BIndividualAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual || m_steamid.m_comp.m_EAccountType == k_EAccountTypeConsoleUser; + } + + + //----------------------------------------------------------------------------- + // Purpose: Is this an anonymous account? + //----------------------------------------------------------------------------- + bool BAnonAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonUser || m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonGameServer; + } + + //----------------------------------------------------------------------------- + // Purpose: Is this an anonymous user account? ( used to create an account or reset a password ) + //----------------------------------------------------------------------------- + bool BAnonUserAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonUser; + } + + //----------------------------------------------------------------------------- + // Purpose: Is this a faked up Steam ID for a PSN friend account? + //----------------------------------------------------------------------------- + bool BConsoleUserAccount() const + { + return m_steamid.m_comp.m_EAccountType == k_EAccountTypeConsoleUser; + } + + // simple accessors + void SetAccountID( uint32 unAccountID ) { m_steamid.m_comp.m_unAccountID = unAccountID; } + void SetAccountInstance( uint32 unInstance ){ m_steamid.m_comp.m_unAccountInstance = unInstance; } + + AccountID_t GetAccountID() const { return m_steamid.m_comp.m_unAccountID; } + uint32 GetUnAccountInstance() const { return m_steamid.m_comp.m_unAccountInstance; } + EAccountType GetEAccountType() const { return ( EAccountType ) m_steamid.m_comp.m_EAccountType; } + EUniverse GetEUniverse() const { return m_steamid.m_comp.m_EUniverse; } + void SetEUniverse( EUniverse eUniverse ) { m_steamid.m_comp.m_EUniverse = eUniverse; } + bool IsValid() const; + + // this set of functions is hidden, will be moved out of class + explicit CSteamID( const char *pchSteamID, EUniverse eDefaultUniverse = k_EUniverseInvalid ); + const char * Render() const; // renders this steam ID to string + static const char * Render( uint64 ulSteamID ); // static method to render a uint64 representation of a steam ID to a string + + void SetFromString( const char *pchSteamID, EUniverse eDefaultUniverse ); + // SetFromString allows many partially-correct strings, constraining how + // we might be able to change things in the future. + // SetFromStringStrict requires the exact string forms that we support + // and is preferred when the caller knows it's safe to be strict. + // Returns whether the string parsed correctly. + bool SetFromStringStrict( const char *pchSteamID, EUniverse eDefaultUniverse ); + + inline bool operator==( const CSteamID &val ) const { return m_steamid.m_unAll64Bits == val.m_steamid.m_unAll64Bits; } + inline bool operator!=( const CSteamID &val ) const { return !operator==( val ); } + inline bool operator<( const CSteamID &val ) const { return m_steamid.m_unAll64Bits < val.m_steamid.m_unAll64Bits; } + inline bool operator>( const CSteamID &val ) const { return m_steamid.m_unAll64Bits > val.m_steamid.m_unAll64Bits; } + + // DEBUG function + bool BValidExternalSteamID() const; + +private: + // These are defined here to prevent accidental implicit conversion of a u32AccountID to a CSteamID. + // If you get a compiler error about an ambiguous constructor/function then it may be because you're + // passing a 32-bit int to a function that takes a CSteamID. You should explicitly create the SteamID + // using the correct Universe and account Type/Instance values. + CSteamID( uint32 ); + CSteamID( int32 ); + + // 64 bits total + union SteamID_t + { + struct SteamIDComponent_t + { +#ifdef VALVE_BIG_ENDIAN + EUniverse m_EUniverse : 8; // universe this account belongs to + unsigned int m_EAccountType : 4; // type of account - can't show as EAccountType, due to signed / unsigned difference + unsigned int m_unAccountInstance : 20; // dynamic instance ID + uint32 m_unAccountID : 32; // unique account identifier +#else + uint32 m_unAccountID : 32; // unique account identifier + unsigned int m_unAccountInstance : 20; // dynamic instance ID + unsigned int m_EAccountType : 4; // type of account - can't show as EAccountType, due to signed / unsigned difference + EUniverse m_EUniverse : 8; // universe this account belongs to +#endif + } m_comp; + + uint64 m_unAll64Bits; + } m_steamid; +}; + +inline bool CSteamID::IsValid() const +{ + if ( m_steamid.m_comp.m_EAccountType <= k_EAccountTypeInvalid || m_steamid.m_comp.m_EAccountType >= k_EAccountTypeMax ) + return false; + + if ( m_steamid.m_comp.m_EUniverse <= k_EUniverseInvalid || m_steamid.m_comp.m_EUniverse >= k_EUniverseMax ) + return false; + + if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual ) + { + if ( m_steamid.m_comp.m_unAccountID == 0 || m_steamid.m_comp.m_unAccountInstance != k_unSteamUserDefaultInstance ) + return false; + } + + if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeClan ) + { + if ( m_steamid.m_comp.m_unAccountID == 0 || m_steamid.m_comp.m_unAccountInstance != 0 ) + return false; + } + + if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeGameServer ) + { + if ( m_steamid.m_comp.m_unAccountID == 0 ) + return false; + // Any limit on instances? We use them for local users and bots + } + return true; +} + +#if defined( INCLUDED_STEAM2_USERID_STRUCTS ) + +//----------------------------------------------------------------------------- +// Purpose: Initializes a steam ID from a Steam2 ID structure +// Input: pTSteamGlobalUserID - Steam2 ID to convert +// eUniverse - universe this ID belongs to +//----------------------------------------------------------------------------- +inline CSteamID SteamIDFromSteam2UserID( TSteamGlobalUserID *pTSteamGlobalUserID, EUniverse eUniverse ) +{ + uint32 unAccountID = pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits * 2 + + pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits; + + return CSteamID( unAccountID, k_unSteamUserDefaultInstance, eUniverse, k_EAccountTypeIndividual ); +} + +bool SteamIDFromSteam2String( const char *pchSteam2ID, EUniverse eUniverse, CSteamID *pSteamIDOut ); + +//----------------------------------------------------------------------------- +// Purpose: Fills out a Steam2 ID structure +// Input: pTSteamGlobalUserID - Steam2 ID to write to +//----------------------------------------------------------------------------- +inline TSteamGlobalUserID SteamIDToSteam2UserID( CSteamID steamID ) +{ + TSteamGlobalUserID steamGlobalUserID; + + steamGlobalUserID.m_SteamInstanceID = 0; + steamGlobalUserID.m_SteamLocalUserID.Split.High32bits = steamID.GetAccountID() % 2; + steamGlobalUserID.m_SteamLocalUserID.Split.Low32bits = steamID.GetAccountID() / 2; + + return steamGlobalUserID; +} + + +#endif + +// generic invalid CSteamID +#define k_steamIDNil CSteamID() + +// This steamID comes from a user game connection to an out of date GS that hasnt implemented the protocol +// to provide its steamID +#define k_steamIDOutofDateGS CSteamID( 0, 0, k_EUniverseInvalid, k_EAccountTypeInvalid ) +// This steamID comes from a user game connection to an sv_lan GS +#define k_steamIDLanModeGS CSteamID( 0, 0, k_EUniversePublic, k_EAccountTypeInvalid ) +// This steamID can come from a user game connection to a GS that has just booted but hasnt yet even initialized +// its steam3 component and started logging on. +#define k_steamIDNotInitYetGS CSteamID( 1, 0, k_EUniverseInvalid, k_EAccountTypeInvalid ) +// This steamID can come from a user game connection to a GS that isn't using the steam authentication system but still +// wants to support the "Join Game" option in the friends list +#define k_steamIDNonSteamGS CSteamID( 2, 0, k_EUniverseInvalid, k_EAccountTypeInvalid ) + + +#ifdef STEAM +// Returns the matching chat steamID, with the default instance of 0 +// If the steamID passed in is already of type k_EAccountTypeChat it will be returned with the same instance +CSteamID ChatIDFromSteamID( const CSteamID &steamID ); +// Returns the matching clan steamID, with the default instance of 0 +// If the steamID passed in is already of type k_EAccountTypeClan it will be returned with the same instance +CSteamID ClanIDFromSteamID( const CSteamID &steamID ); +// Asserts steamID type before conversion +CSteamID ChatIDFromClanID( const CSteamID &steamIDClan ); +// Asserts steamID type before conversion +CSteamID ClanIDFromChatID( const CSteamID &steamIDChat ); + +#endif // _STEAM + + +//----------------------------------------------------------------------------- +// Purpose: encapsulates an appID/modID pair +//----------------------------------------------------------------------------- +class CGameID +{ +public: + + enum EGameIDType + { + k_EGameIDTypeApp = 0, + k_EGameIDTypeGameMod = 1, + k_EGameIDTypeShortcut = 2, + k_EGameIDTypeP2P = 3, + }; + + CGameID() + { + m_gameID.m_nType = k_EGameIDTypeApp; + m_gameID.m_nAppID = k_uAppIdInvalid; + m_gameID.m_nModID = 0; + } + + explicit CGameID( uint64 ulGameID ) + { + m_ulGameID = ulGameID; + } +#ifdef INT64_DIFFERENT_FROM_INT64_T + CGameID( uint64_t ulGameID ) + { + m_ulGameID = (uint64)ulGameID; + } +#endif + + explicit CGameID( int32 nAppID ) + { + m_ulGameID = 0; + m_gameID.m_nAppID = nAppID; + } + + explicit CGameID( uint32 nAppID ) + { + m_ulGameID = 0; + m_gameID.m_nAppID = nAppID; + } + + // Not validating anything .. use IsValid() + explicit CGameID( uint32 nAppID, uint32 nModID, CGameID::EGameIDType nType ) + { + m_gameID.m_nAppID = nAppID; + m_gameID.m_nModID = nModID; + m_gameID.m_nType = nType; + } + + CGameID( const CGameID &that ) + { + m_ulGameID = that.m_ulGameID; + } + + CGameID& operator=( const CGameID & that ) + { + m_ulGameID = that.m_ulGameID; + return *this; + } + + // Hidden functions used only by Steam + explicit CGameID( const char *pchGameID ); + const char *Render() const; // render this Game ID to string + static const char *Render( uint64 ulGameID ); // static method to render a uint64 representation of a Game ID to a string + + uint64 ToUint64() const + { + return m_ulGameID; + } + + uint64 *GetUint64Ptr() + { + return &m_ulGameID; + } + + void Set( uint64 ulGameID ) + { + m_ulGameID = ulGameID; + } + + bool IsMod() const + { + return ( m_gameID.m_nType == k_EGameIDTypeGameMod ); + } + + bool IsShortcut() const + { + return ( m_gameID.m_nType == k_EGameIDTypeShortcut ); + } + + bool IsP2PFile() const + { + return ( m_gameID.m_nType == k_EGameIDTypeP2P ); + } + + bool IsSteamApp() const + { + return ( m_gameID.m_nType == k_EGameIDTypeApp ); + } + + uint32 ModID() const + { + return m_gameID.m_nModID; + } + +#if !defined(VALVE_SHORTCUT_DEBUG) + uint32 AppID( bool = false ) const + { + return m_gameID.m_nAppID; + } +#else + uint32 AppID( bool bShortcutOK = false ) const; +#endif + + bool operator == ( const CGameID &rhs ) const + { + return m_ulGameID == rhs.m_ulGameID; + } + + bool operator != ( const CGameID &rhs ) const + { + return !(*this == rhs); + } + + bool operator < ( const CGameID &rhs ) const + { + return ( m_ulGameID < rhs.m_ulGameID ); + } + + bool IsValid() const + { + // each type has it's own invalid fixed point: + switch( m_gameID.m_nType ) + { + case k_EGameIDTypeApp: + return m_gameID.m_nAppID != k_uAppIdInvalid; + + case k_EGameIDTypeGameMod: + return m_gameID.m_nAppID != k_uAppIdInvalid && (m_gameID.m_nModID & 0x80000000); + + case k_EGameIDTypeShortcut: + return m_gameID.m_nAppID == k_uAppIdInvalid + && (m_gameID.m_nModID & 0x80000000) + && m_gameID.m_nModID >= (5000 | 0x80000000); // k_unMaxExpectedLocalAppId - shortcuts are pushed beyond that range + + case k_EGameIDTypeP2P: + return m_gameID.m_nAppID == k_uAppIdInvalid && (m_gameID.m_nModID & 0x80000000); + + default: + return false; + } + + } + + void Reset() + { + m_ulGameID = 0; + } + +// +// Internal stuff. Use the accessors above if possible +// + + struct GameID_t + { +#ifdef VALVE_BIG_ENDIAN + unsigned int m_nModID : 32; + unsigned int m_nType : 8; + unsigned int m_nAppID : 24; +#else + unsigned int m_nAppID : 24; + unsigned int m_nType : 8; + unsigned int m_nModID : 32; +#endif + }; + + union + { + uint64 m_ulGameID; + GameID_t m_gameID; + }; + + friend CGameID GameIDFromAppAndModPath( uint32 nAppID, const char *pchModPath ); +}; + +#pragma pack( pop ) + +const int k_cchGameExtraInfoMax = 64; + + +//----------------------------------------------------------------------------- +// Purpose: Passed as argument to SteamAPI_UseBreakpadCrashHandler to enable optional callback +// just before minidump file is captured after a crash has occurred. (Allows app to append additional comment data to the dump, etc.) +//----------------------------------------------------------------------------- +typedef void (*PFNPreMinidumpCallback)(void *context); + +enum EGameSearchErrorCode_t +{ + k_EGameSearchErrorCode_OK = 1, + k_EGameSearchErrorCode_Failed_Search_Already_In_Progress = 2, + k_EGameSearchErrorCode_Failed_No_Search_In_Progress = 3, + k_EGameSearchErrorCode_Failed_Not_Lobby_Leader = 4, // if not the lobby leader can not call SearchForGameWithLobby + k_EGameSearchErrorCode_Failed_No_Host_Available = 5, // no host is available that matches those search params + k_EGameSearchErrorCode_Failed_Search_Params_Invalid = 6, // search params are invalid + k_EGameSearchErrorCode_Failed_Offline = 7, // offline, could not communicate with server + k_EGameSearchErrorCode_Failed_NotAuthorized = 8, // either the user or the application does not have priveledges to do this + k_EGameSearchErrorCode_Failed_Unknown_Error = 9, // unknown error +}; + +enum EPlayerResult_t +{ + k_EPlayerResultFailedToConnect = 1, // failed to connect after confirming + k_EPlayerResultAbandoned = 2, // quit game without completing it + k_EPlayerResultKicked = 3, // kicked by other players/moderator/server rules + k_EPlayerResultIncomplete = 4, // player stayed to end but game did not conclude successfully ( nofault to player ) + k_EPlayerResultCompleted = 5, // player completed game +}; + + +enum ESteamIPv6ConnectivityProtocol +{ + k_ESteamIPv6ConnectivityProtocol_Invalid = 0, + k_ESteamIPv6ConnectivityProtocol_HTTP = 1, // because a proxy may make this different than other protocols + k_ESteamIPv6ConnectivityProtocol_UDP = 2, // test UDP connectivity. Uses a port that is commonly needed for other Steam stuff. If UDP works, TCP probably works. +}; + +// For the above transport protocol, what do we think the local machine's connectivity to the internet over ipv6 is like +enum ESteamIPv6ConnectivityState +{ + k_ESteamIPv6ConnectivityState_Unknown = 0, // We haven't run a test yet + k_ESteamIPv6ConnectivityState_Good = 1, // We have recently been able to make a request on ipv6 for the given protocol + k_ESteamIPv6ConnectivityState_Bad = 2, // We failed to make a request, either because this machine has no ipv6 address assigned, or it has no upstream connectivity +}; + + +// Define compile time assert macros to let us validate the structure sizes. +#define VALVE_COMPILE_TIME_ASSERT( pred ) typedef char compile_time_assert_type[(pred) ? 1 : -1]; + +#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) +// The 32-bit version of gcc has the alignment requirement for uint64 and double set to +// 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned. +// The 64-bit version of gcc has the alignment requirement for these types set to +// 8 meaning that unless we use #pragma pack(4) our structures will get bigger. +// The 64-bit structure packing has to match the 32-bit structure packing for each platform. +#define VALVE_CALLBACK_PACK_SMALL +#else +#define VALVE_CALLBACK_PACK_LARGE +#endif + +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error ??? +#endif + +typedef struct ValvePackingSentinel_t +{ + uint32 m_u32; + uint64 m_u64; + uint16 m_u16; + double m_d; +} ValvePackingSentinel_t; + +#pragma pack( pop ) + + +#if defined(VALVE_CALLBACK_PACK_SMALL) +VALVE_COMPILE_TIME_ASSERT( sizeof(ValvePackingSentinel_t) == 24 ) +#elif defined(VALVE_CALLBACK_PACK_LARGE) +VALVE_COMPILE_TIME_ASSERT( sizeof(ValvePackingSentinel_t) == 32 ) +#else +#error ??? +#endif + +#endif // STEAMCLIENTPUBLIC_H diff --git a/external/steamworks/public/steam/steamencryptedappticket.h b/external/steamworks/public/steam/steamencryptedappticket.h new file mode 100644 index 0000000..764c683 --- /dev/null +++ b/external/steamworks/public/steam/steamencryptedappticket.h @@ -0,0 +1,40 @@ +//========= Copyright © 1996-2010, Valve LLC, All rights reserved. ============ +// +// Purpose: utilities to decode/decrypt a ticket from the +// ISteamUser::RequestEncryptedAppTicket, ISteamUser::GetEncryptedAppTicket API +// +// To use: declare CSteamEncryptedAppTicket, then call BDecryptTicket +// if BDecryptTicket returns true, other accessors are valid +// +//============================================================================= + +#include "steam_api.h" + +static const int k_nSteamEncryptedAppTicketSymmetricKeyLen = 32; + + +S_API bool SteamEncryptedAppTicket_BDecryptTicket( const uint8 *rgubTicketEncrypted, uint32 cubTicketEncrypted, + uint8 *rgubTicketDecrypted, uint32 *pcubTicketDecrypted, + const uint8 rgubKey[k_nSteamEncryptedAppTicketSymmetricKeyLen], int cubKey ); + +S_API bool SteamEncryptedAppTicket_BIsTicketForApp( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, AppId_t nAppID ); + +S_API RTime32 SteamEncryptedAppTicket_GetTicketIssueTime( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted ); + +S_API void SteamEncryptedAppTicket_GetTicketSteamID( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, CSteamID *psteamID ); + +S_API AppId_t SteamEncryptedAppTicket_GetTicketAppID( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted ); + +S_API bool SteamEncryptedAppTicket_BUserOwnsAppInTicket( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, AppId_t nAppID ); + +S_API bool SteamEncryptedAppTicket_BUserIsVacBanned( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted ); + +S_API bool SteamEncryptedAppTicket_BGetAppDefinedValue( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, uint32 *pValue ); + +S_API const uint8 *SteamEncryptedAppTicket_GetUserVariableData( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, uint32 *pcubUserData ); + +S_API bool SteamEncryptedAppTicket_BIsTicketSigned( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, const uint8 *pubRSAKey, uint32 cubRSAKey ); + +S_API bool SteamEncryptedAppTicket_BIsLicenseBorrowed( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted ); + +S_API bool SteamEncryptedAppTicket_BIsLicenseTemporary( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted ); diff --git a/external/steamworks/public/steam/steamhttpenums.h b/external/steamworks/public/steam/steamhttpenums.h new file mode 100644 index 0000000..7ded89a --- /dev/null +++ b/external/steamworks/public/steam/steamhttpenums.h @@ -0,0 +1,105 @@ +//====== Copyright © 1996-2010, Valve Corporation, All rights reserved. ======= +// +// Purpose: HTTP related enums, stuff that is shared by both clients and servers, and our +// UI projects goes here. +// +//============================================================================= + +#ifndef STEAMHTTPENUMS_H +#define STEAMHTTPENUMS_H +#ifdef _WIN32 +#pragma once +#endif + +// HTTP related types + +// This enum is used in client API methods, do not re-number existing values. +enum EHTTPMethod +{ + k_EHTTPMethodInvalid = 0, + k_EHTTPMethodGET, + k_EHTTPMethodHEAD, + k_EHTTPMethodPOST, + k_EHTTPMethodPUT, + k_EHTTPMethodDELETE, + k_EHTTPMethodOPTIONS, + k_EHTTPMethodPATCH, + + // The remaining HTTP methods are not yet supported, per rfc2616 section 5.1.1 only GET and HEAD are required for + // a compliant general purpose server. We'll likely add more as we find uses for them. + + // k_EHTTPMethodTRACE, + // k_EHTTPMethodCONNECT +}; + + +// HTTP Status codes that the server can send in response to a request, see rfc2616 section 10.3 for descriptions +// of each of these. +enum EHTTPStatusCode +{ + // Invalid status code (this isn't defined in HTTP, used to indicate unset in our code) + k_EHTTPStatusCodeInvalid = 0, + + // Informational codes + k_EHTTPStatusCode100Continue = 100, + k_EHTTPStatusCode101SwitchingProtocols = 101, + + // Success codes + k_EHTTPStatusCode200OK = 200, + k_EHTTPStatusCode201Created = 201, + k_EHTTPStatusCode202Accepted = 202, + k_EHTTPStatusCode203NonAuthoritative = 203, + k_EHTTPStatusCode204NoContent = 204, + k_EHTTPStatusCode205ResetContent = 205, + k_EHTTPStatusCode206PartialContent = 206, + + // Redirection codes + k_EHTTPStatusCode300MultipleChoices = 300, + k_EHTTPStatusCode301MovedPermanently = 301, + k_EHTTPStatusCode302Found = 302, + k_EHTTPStatusCode303SeeOther = 303, + k_EHTTPStatusCode304NotModified = 304, + k_EHTTPStatusCode305UseProxy = 305, + //k_EHTTPStatusCode306Unused = 306, (used in old HTTP spec, now unused in 1.1) + k_EHTTPStatusCode307TemporaryRedirect = 307, + k_EHTTPStatusCode308PermanentRedirect = 308, + + // Error codes + k_EHTTPStatusCode400BadRequest = 400, + k_EHTTPStatusCode401Unauthorized = 401, // You probably want 403 or something else. 401 implies you're sending a WWW-Authenticate header and the client can sent an Authorization header in response. + k_EHTTPStatusCode402PaymentRequired = 402, // This is reserved for future HTTP specs, not really supported by clients + k_EHTTPStatusCode403Forbidden = 403, + k_EHTTPStatusCode404NotFound = 404, + k_EHTTPStatusCode405MethodNotAllowed = 405, + k_EHTTPStatusCode406NotAcceptable = 406, + k_EHTTPStatusCode407ProxyAuthRequired = 407, + k_EHTTPStatusCode408RequestTimeout = 408, + k_EHTTPStatusCode409Conflict = 409, + k_EHTTPStatusCode410Gone = 410, + k_EHTTPStatusCode411LengthRequired = 411, + k_EHTTPStatusCode412PreconditionFailed = 412, + k_EHTTPStatusCode413RequestEntityTooLarge = 413, + k_EHTTPStatusCode414RequestURITooLong = 414, + k_EHTTPStatusCode415UnsupportedMediaType = 415, + k_EHTTPStatusCode416RequestedRangeNotSatisfiable = 416, + k_EHTTPStatusCode417ExpectationFailed = 417, + k_EHTTPStatusCode4xxUnknown = 418, // 418 is reserved, so we'll use it to mean unknown + k_EHTTPStatusCode429TooManyRequests = 429, + k_EHTTPStatusCode444ConnectionClosed = 444, // nginx only? + + // Server error codes + k_EHTTPStatusCode500InternalServerError = 500, + k_EHTTPStatusCode501NotImplemented = 501, + k_EHTTPStatusCode502BadGateway = 502, + k_EHTTPStatusCode503ServiceUnavailable = 503, + k_EHTTPStatusCode504GatewayTimeout = 504, + k_EHTTPStatusCode505HTTPVersionNotSupported = 505, + k_EHTTPStatusCode5xxUnknown = 599, +}; + +inline bool BIsHTTPStatusSuccess( EHTTPStatusCode eStatus ) +{ + return eStatus >= 200 && eStatus <= 299; +} + +#endif // STEAMHTTPENUMS_H \ No newline at end of file diff --git a/external/steamworks/public/steam/steamnetworkingfakeip.h b/external/steamworks/public/steam/steamnetworkingfakeip.h new file mode 100644 index 0000000..f294081 --- /dev/null +++ b/external/steamworks/public/steam/steamnetworkingfakeip.h @@ -0,0 +1,135 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== + +#ifndef STEAMNETWORKINGFAKEIP_H +#define STEAMNETWORKINGFAKEIP_H +#pragma once + +#include "steamnetworkingtypes.h" +#include "steam_api_common.h" + +// It is HIGHLY recommended to limit messages sent via Fake UDP port to this +// value. The purpose of a Fake UDP port is to make porting ordinary ad-hoc UDP +// code easier. Although the real MTU might be higher than this, this particular +// conservative value is chosen so that fragmentation won't be occurring and +// hiding performance problems from you. +constexpr int k_cbSteamNetworkingSocketsFakeUDPPortRecommendedMTU = 1200; + +// Messages larger than this size are not allowed and cannot be sent +// via Fake UDP port. +constexpr int k_cbSteamNetworkingSocketsFakeUDPPortMaxMessageSize = 4096; + +//----------------------------------------------------------------------------- +/// ISteamNetworkingFakeUDPPort +/// +/// Acts like a UDP port, sending and receiving datagrams addressed using +/// FakeIP addresses. +/// +/// See: ISteamNetworkingSockets::CreateFakeUDPPort + +class ISteamNetworkingFakeUDPPort +{ +public: + /// Destroy the object and cleanup any internal connections. + /// Note that this function call is not threadsafe with respect + /// to any other method of this interface. (However, in general + /// all other operations are threadsafe with respect to each other.) + virtual void DestroyFakeUDPPort() = 0; + + /// Send a datagram to the specified FakeIP. + /// + /// See ISteamNetworkingSockets::SendMessageToConnection for the meaning of + /// nSendFlags and possible return codes. + /// + /// Notes: + /// - datagrams larger than the underlying MTU are supported, but + /// reliable messages (k_nSteamNetworkingSend_Reliable) are not supported. + /// - You will usually want to use k_nSteamNetworkingSend_NoNagle + /// - k_EResultBusy is returned if this is a "server" port and the global + /// allocation has not yet completed. + /// - k_EResultIPNotFound will be returned if the address is a local/ephemeral + /// address and no existing connection can be found. This can happen if + /// the remote host contacted us without having a global address, and we + /// assigned them a random local address, and then the session with + /// that host timed out. + /// - When initiating communications, the first messages may be sent + /// via backend signaling, or otherwise delayed, while a route is found. + /// Expect the ping time to fluctuate during this period, and it's possible + /// that messages will be delivered out of order (which is also possible with + /// ordinary UDP). + virtual EResult SendMessageToFakeIP( const SteamNetworkingIPAddr &remoteAddress, const void *pData, uint32 cbData, int nSendFlags ) = 0; + + /// Receive messages on the port. + /// + /// Returns the number of messages returned into your array, up to nMaxMessages. + /// + /// SteamNetworkingMessage_t::m_identity in the returned message(s) will always contain + /// a FakeIP. See ISteamNetworkingUtils::GetRealIdentityForFakeIP. + virtual int ReceiveMessages( SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0; + + /// Schedule the internal connection for a given peer to be cleaned up in a few seconds. + /// + /// Idle connections automatically time out, and so this is not strictly *necessary*, + /// but if you have reason to believe that you are done talking to a given peer for + /// a while, you can call this to speed up the timeout. If any remaining packets are + /// sent or received from the peer, the cleanup is canceled and the usual timeout + /// value is restored. Thus you will usually call this immediately after sending + /// or receiving application-layer "close connection" packets. + virtual void ScheduleCleanup( const SteamNetworkingIPAddr &remoteAddress ) = 0; +}; + +/// Callback struct used to notify when a connection has changed state +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error "Must define VALVE_CALLBACK_PACK_SMALL or VALVE_CALLBACK_PACK_LARGE" +#endif + +/// A struct used to describe a "fake IP" we have been assigned to +/// use as an identifier. This callback is posted when +/// ISteamNetworkingSoockets::BeginAsyncRequestFakeIP completes. +/// See also ISteamNetworkingSockets::GetFakeIP +struct SteamNetworkingFakeIPResult_t +{ + enum { k_iCallback = k_iSteamNetworkingSocketsCallbacks + 3 }; + + /// Status/result of the allocation request. Possible failure values are: + /// - k_EResultBusy - you called GetFakeIP but the request has not completed. + /// - k_EResultInvalidParam - you called GetFakeIP with an invalid port index + /// - k_EResultLimitExceeded - You asked for too many ports, or made an + /// additional request after one had already succeeded + /// - k_EResultNoMatch - GetFakeIP was called, but no request has been made + /// + /// Note that, with the exception of k_EResultBusy (if you are polling), + /// it is highly recommended to treat all failures as fatal. + EResult m_eResult; + + /// Local identity of the ISteamNetworkingSockets object that made + /// this request and is assigned the IP. This is needed in the callback + /// in the case where there are multiple ISteamNetworkingSockets objects. + /// (E.g. one for the user, and another for the local gameserver). + SteamNetworkingIdentity m_identity; + + /// Fake IPv4 IP address that we have been assigned. NOTE: this + /// IP address is not exclusively ours! Steam tries to avoid sharing + /// IP addresses, but this may not always be possible. The IP address + /// may be currently in use by another host, but with different port(s). + /// The exact same IP:port address may have been used previously. + /// Steam tries to avoid reusing ports until they have not been in use for + /// some time, but this may not always be possible. + uint32 m_unIP; + + /// Port number(s) assigned to us. Only the first entries will contain + /// nonzero values. Entries corresponding to ports beyond what was + /// allocated for you will be zero. + /// + /// (NOTE: At the time of this writing, the maximum number of ports you may + /// request is 4.) + enum { k_nMaxReturnPorts = 8 }; + uint16 m_unPorts[k_nMaxReturnPorts]; +}; + +#pragma pack( pop ) + +#endif // _H diff --git a/external/steamworks/public/steam/steamnetworkingtypes.h b/external/steamworks/public/steam/steamnetworkingtypes.h new file mode 100644 index 0000000..4b7aef3 --- /dev/null +++ b/external/steamworks/public/steam/steamnetworkingtypes.h @@ -0,0 +1,1918 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Purpose: misc networking utilities +// +//============================================================================= + +#ifndef STEAMNETWORKINGTYPES +#define STEAMNETWORKINGTYPES +#pragma once + +#include +#include +#include "steamtypes.h" +#include "steamclientpublic.h" + +//----------------------------------------------------------------------------- +// SteamNetworkingSockets config. +#if !defined(STEAMNETWORKINGSOCKETS_STANDALONELIB) && !defined(STEAMNETWORKINGSOCKETS_STEAMAPI) + #define STEAMNETWORKINGSOCKETS_STEAMAPI +#endif +//----------------------------------------------------------------------------- + +#ifdef NN_NINTENDO_SDK // We always static link on Nintendo + #define STEAMNETWORKINGSOCKETS_STATIC_LINK +#endif +#if defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) + #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C" +#elif defined( STEAMNETWORKINGSOCKETS_FOREXPORT ) + #if defined( _WIN32 ) || defined( __ORBIS__ ) || defined( __PROSPERO__ ) + #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C" __declspec( dllexport ) + #else + #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C" __attribute__((visibility("default"))) + #endif +#else + #ifdef _WIN32 + #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C" __declspec( dllimport ) + #else + #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C" + #endif +#endif + +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error "Must define VALVE_CALLBACK_PACK_SMALL or VALVE_CALLBACK_PACK_LARGE" +#endif + +struct SteamDatagramRelayAuthTicket; +struct SteamDatagramHostedAddress; +struct SteamDatagramGameCoordinatorServerLogin; +struct SteamNetConnectionStatusChangedCallback_t; +struct SteamNetAuthenticationStatus_t; +struct SteamRelayNetworkStatus_t; +struct SteamNetworkingMessagesSessionRequest_t; +struct SteamNetworkingMessagesSessionFailed_t; +struct SteamNetworkingFakeIPResult_t; + +typedef void (*FnSteamNetConnectionStatusChanged)( SteamNetConnectionStatusChangedCallback_t * ); +typedef void (*FnSteamNetAuthenticationStatusChanged)( SteamNetAuthenticationStatus_t * ); +typedef void (*FnSteamRelayNetworkStatusChanged)(SteamRelayNetworkStatus_t *); +typedef void (*FnSteamNetworkingMessagesSessionRequest)(SteamNetworkingMessagesSessionRequest_t *); +typedef void (*FnSteamNetworkingMessagesSessionFailed)(SteamNetworkingMessagesSessionFailed_t *); +typedef void (*FnSteamNetworkingFakeIPResult)(SteamNetworkingFakeIPResult_t *); + +/// Handle used to identify a connection to a remote host. +typedef uint32 HSteamNetConnection; +const HSteamNetConnection k_HSteamNetConnection_Invalid = 0; + +/// Handle used to identify a "listen socket". Unlike traditional +/// Berkeley sockets, a listen socket and a connection are two +/// different abstractions. +typedef uint32 HSteamListenSocket; +const HSteamListenSocket k_HSteamListenSocket_Invalid = 0; + +/// Handle used to identify a poll group, used to query many +/// connections at once efficiently. +typedef uint32 HSteamNetPollGroup; +const HSteamNetPollGroup k_HSteamNetPollGroup_Invalid = 0; + +/// Max length of diagnostic error message +const int k_cchMaxSteamNetworkingErrMsg = 1024; + +/// Used to return English-language diagnostic error messages to caller. +/// (For debugging or spewing to a console, etc. Not intended for UI.) +typedef char SteamNetworkingErrMsg[ k_cchMaxSteamNetworkingErrMsg ]; + +/// Identifier used for a network location point of presence. (E.g. a Valve data center.) +/// Typically you won't need to directly manipulate these. +typedef uint32 SteamNetworkingPOPID; + +/// A local timestamp. You can subtract two timestamps to get the number of elapsed +/// microseconds. This is guaranteed to increase over time during the lifetime +/// of a process, but not globally across runs. You don't need to worry about +/// the value wrapping around. Note that the underlying clock might not actually have +/// microsecond resolution. +typedef int64 SteamNetworkingMicroseconds; + +/// Describe the status of a particular network resource +enum ESteamNetworkingAvailability +{ + // Negative values indicate a problem. + // + // In general, we will not automatically retry unless you take some action that + // depends on of requests this resource, such as querying the status, attempting + // to initiate a connection, receive a connection, etc. If you do not take any + // action at all, we do not automatically retry in the background. + k_ESteamNetworkingAvailability_CannotTry = -102, // A dependent resource is missing, so this service is unavailable. (E.g. we cannot talk to routers because Internet is down or we don't have the network config.) + k_ESteamNetworkingAvailability_Failed = -101, // We have tried for enough time that we would expect to have been successful by now. We have never been successful + k_ESteamNetworkingAvailability_Previously = -100, // We tried and were successful at one time, but now it looks like we have a problem + + k_ESteamNetworkingAvailability_Retrying = -10, // We previously failed and are currently retrying + + // Not a problem, but not ready either + k_ESteamNetworkingAvailability_NeverTried = 1, // We don't know because we haven't ever checked/tried + k_ESteamNetworkingAvailability_Waiting = 2, // We're waiting on a dependent resource to be acquired. (E.g. we cannot obtain a cert until we are logged into Steam. We cannot measure latency to relays until we have the network config.) + k_ESteamNetworkingAvailability_Attempting = 3, // We're actively trying now, but are not yet successful. + + k_ESteamNetworkingAvailability_Current = 100, // Resource is online/available + + + k_ESteamNetworkingAvailability_Unknown = 0, // Internal dummy/sentinel, or value is not applicable in this context + k_ESteamNetworkingAvailability__Force32bit = 0x7fffffff, +}; + +// +// Describing network hosts +// + +/// Different methods of describing the identity of a network host +enum ESteamNetworkingIdentityType +{ + // Dummy/empty/invalid. + // Please note that if we parse a string that we don't recognize + // but that appears reasonable, we will NOT use this type. Instead + // we'll use k_ESteamNetworkingIdentityType_UnknownType. + k_ESteamNetworkingIdentityType_Invalid = 0, + + // + // Basic platform-specific identifiers. + // + k_ESteamNetworkingIdentityType_SteamID = 16, // 64-bit CSteamID + k_ESteamNetworkingIdentityType_XboxPairwiseID = 17, // Publisher-specific user identity, as string + k_ESteamNetworkingIdentityType_SonyPSN = 18, // 64-bit ID + + // + // Special identifiers. + // + + // Use their IP address (and port) as their "identity". + // These types of identities are always unauthenticated. + // They are useful for porting plain sockets code, and other + // situations where you don't care about authentication. In this + // case, the local identity will be "localhost", + // and the remote address will be their network address. + // + // We use the same type for either IPv4 or IPv6, and + // the address is always store as IPv6. We use IPv4 + // mapped addresses to handle IPv4. + k_ESteamNetworkingIdentityType_IPAddress = 1, + + // Generic string/binary blobs. It's up to your app to interpret this. + // This library can tell you if the remote host presented a certificate + // signed by somebody you have chosen to trust, with this identity on it. + // It's up to you to ultimately decide what this identity means. + k_ESteamNetworkingIdentityType_GenericString = 2, + k_ESteamNetworkingIdentityType_GenericBytes = 3, + + // This identity type is used when we parse a string that looks like is a + // valid identity, just of a kind that we don't recognize. In this case, we + // can often still communicate with the peer! Allowing such identities + // for types we do not recognize useful is very useful for forward + // compatibility. + k_ESteamNetworkingIdentityType_UnknownType = 4, + + // Make sure this enum is stored in an int. + k_ESteamNetworkingIdentityType__Force32bit = 0x7fffffff, +}; + +/// "Fake IPs" are assigned to hosts, to make it easier to interface with +/// older code that assumed all hosts will have an IPv4 address +enum ESteamNetworkingFakeIPType +{ + k_ESteamNetworkingFakeIPType_Invalid, // Error, argument was not even an IP address, etc. + k_ESteamNetworkingFakeIPType_NotFake, // Argument was a valid IP, but was not from the reserved "fake" range + k_ESteamNetworkingFakeIPType_GlobalIPv4, // Globally unique (for a given app) IPv4 address. Address space managed by Steam + k_ESteamNetworkingFakeIPType_LocalIPv4, // Locally unique IPv4 address. Address space managed by the local process. For internal use only; should not be shared! + + k_ESteamNetworkingFakeIPType__Force32Bit = 0x7fffffff +}; + +#pragma pack(push,1) + +/// Store an IP and port. IPv6 is always used; IPv4 is represented using +/// "IPv4-mapped" addresses: IPv4 aa.bb.cc.dd => IPv6 ::ffff:aabb:ccdd +/// (RFC 4291 section 2.5.5.2.) +struct SteamNetworkingIPAddr +{ + void Clear(); // Set everything to zero. E.g. [::]:0 + bool IsIPv6AllZeros() const; // Return true if the IP is ::0. (Doesn't check port.) + void SetIPv6( const uint8 *ipv6, uint16 nPort ); // Set IPv6 address. IP is interpreted as bytes, so there are no endian issues. (Same as inaddr_in6.) The IP can be a mapped IPv4 address + void SetIPv4( uint32 nIP, uint16 nPort ); // Sets to IPv4 mapped address. IP and port are in host byte order. + bool IsIPv4() const; // Return true if IP is mapped IPv4 + uint32 GetIPv4() const; // Returns IP in host byte order (e.g. aa.bb.cc.dd as 0xaabbccdd). Returns 0 if IP is not mapped IPv4. + void SetIPv6LocalHost( uint16 nPort = 0); // Set to the IPv6 localhost address ::1, and the specified port. + bool IsLocalHost() const; // Return true if this identity is localhost. (Either IPv6 ::1, or IPv4 127.0.0.1) + + // Max length of the buffer needed to hold IP formatted using ToString, including '\0' + // ([0123:4567:89ab:cdef:0123:4567:89ab:cdef]:12345) + enum { k_cchMaxString = 48 }; + + /// Print to a string, with or without the port. Mapped IPv4 addresses are printed + /// as dotted decimal (12.34.56.78), otherwise this will print the canonical + /// form according to RFC5952. If you include the port, IPv6 will be surrounded by + /// brackets, e.g. [::1:2]:80. Your buffer should be at least k_cchMaxString bytes + /// to avoid truncation + /// + /// See also SteamNetworkingIdentityRender + inline void ToString( char *buf, size_t cbBuf, bool bWithPort ) const; + + /// Parse an IP address and optional port. If a port is not present, it is set to 0. + /// (This means that you cannot tell if a zero port was explicitly specified.) + inline bool ParseString( const char *pszStr ); + + /// RFC4038, section 4.2 + struct IPv4MappedAddress { + uint64 m_8zeros; + uint16 m_0000; + uint16 m_ffff; + uint8 m_ip[ 4 ]; // NOTE: As bytes, i.e. network byte order + }; + + union + { + uint8 m_ipv6[ 16 ]; + IPv4MappedAddress m_ipv4; + }; + uint16 m_port; // Host byte order + + /// See if two addresses are identical + bool operator==(const SteamNetworkingIPAddr &x ) const; + + /// Classify address as FakeIP. This function never returns + /// k_ESteamNetworkingFakeIPType_Invalid. + ESteamNetworkingFakeIPType GetFakeIPType() const; + + /// Return true if we are a FakeIP + bool IsFakeIP() const { return GetFakeIPType() > k_ESteamNetworkingFakeIPType_NotFake; } +}; + +/// An abstract way to represent the identity of a network host. All identities can +/// be represented as simple string. Furthermore, this string representation is actually +/// used on the wire in several places, even though it is less efficient, in order to +/// facilitate forward compatibility. (Old client code can handle an identity type that +/// it doesn't understand.) +struct SteamNetworkingIdentity +{ + /// Type of identity. + ESteamNetworkingIdentityType m_eType; + + // + // Get/Set in various formats. + // + + void Clear(); + bool IsInvalid() const; // Return true if we are the invalid type. Does not make any other validity checks (e.g. is SteamID actually valid) + + void SetSteamID( CSteamID steamID ); + CSteamID GetSteamID() const; // Return black CSteamID (!IsValid()) if identity is not a SteamID + void SetSteamID64( uint64 steamID ); // Takes SteamID as raw 64-bit number + uint64 GetSteamID64() const; // Returns 0 if identity is not SteamID + + bool SetXboxPairwiseID( const char *pszString ); // Returns false if invalid length + const char *GetXboxPairwiseID() const; // Returns nullptr if not Xbox ID + + void SetPSNID( uint64 id ); + uint64 GetPSNID() const; // Returns 0 if not PSN + + void SetIPAddr( const SteamNetworkingIPAddr &addr ); // Set to specified IP:port + const SteamNetworkingIPAddr *GetIPAddr() const; // returns null if we are not an IP address. + void SetIPv4Addr( uint32 nIPv4, uint16 nPort ); // Set to specified IPv4:port + uint32 GetIPv4() const; // returns 0 if we are not an IPv4 address. + + ESteamNetworkingFakeIPType GetFakeIPType() const; + bool IsFakeIP() const { return GetFakeIPType() > k_ESteamNetworkingFakeIPType_NotFake; } + + // "localhost" is equivalent for many purposes to "anonymous." Our remote + // will identify us by the network address we use. + void SetLocalHost(); // Set to localhost. (We always use IPv6 ::1 for this, not 127.0.0.1) + bool IsLocalHost() const; // Return true if this identity is localhost. + + bool SetGenericString( const char *pszString ); // Returns false if invalid length + const char *GetGenericString() const; // Returns nullptr if not generic string type + + bool SetGenericBytes( const void *data, size_t cbLen ); // Returns false if invalid size. + const uint8 *GetGenericBytes( int &cbLen ) const; // Returns null if not generic bytes type + + /// See if two identities are identical + bool operator==(const SteamNetworkingIdentity &x ) const; + + /// Print to a human-readable string. This is suitable for debug messages + /// or any other time you need to encode the identity as a string. It has a + /// URL-like format (type:). Your buffer should be at least + /// k_cchMaxString bytes big to avoid truncation. + /// + /// See also SteamNetworkingIPAddrRender + void ToString( char *buf, size_t cbBuf ) const; + + /// Parse back a string that was generated using ToString. If we don't understand the + /// string, but it looks "reasonable" (it matches the pattern type: and doesn't + /// have any funky characters, etc), then we will return true, and the type is set to + /// k_ESteamNetworkingIdentityType_UnknownType. false will only be returned if the string + /// looks invalid. + bool ParseString( const char *pszStr ); + + // Max sizes + enum { + k_cchMaxString = 128, // Max length of the buffer needed to hold any identity, formatted in string format by ToString + k_cchMaxGenericString = 32, // Max length of the string for generic string identities. Including terminating '\0' + k_cchMaxXboxPairwiseID = 33, // Including terminating '\0' + k_cbMaxGenericBytes = 32, + }; + + // + // Internal representation. Don't access this directly, use the accessors! + // + // Number of bytes that are relevant below. This MUST ALWAYS be + // set. (Use the accessors!) This is important to enable old code to work + // with new identity types. + int m_cbSize; + union { + uint64 m_steamID64; + uint64 m_PSNID; + char m_szGenericString[ k_cchMaxGenericString ]; + char m_szXboxPairwiseID[ k_cchMaxXboxPairwiseID ]; + uint8 m_genericBytes[ k_cbMaxGenericBytes ]; + char m_szUnknownRawString[ k_cchMaxString ]; + SteamNetworkingIPAddr m_ip; + uint32 m_reserved[ 32 ]; // Pad structure to leave easy room for future expansion + }; +}; +#pragma pack(pop) + +// +// Connection status +// + +/// High level connection status +enum ESteamNetworkingConnectionState +{ + + /// Dummy value used to indicate an error condition in the API. + /// Specified connection doesn't exist or has already been closed. + k_ESteamNetworkingConnectionState_None = 0, + + /// We are trying to establish whether peers can talk to each other, + /// whether they WANT to talk to each other, perform basic auth, + /// and exchange crypt keys. + /// + /// - For connections on the "client" side (initiated locally): + /// We're in the process of trying to establish a connection. + /// Depending on the connection type, we might not know who they are. + /// Note that it is not possible to tell if we are waiting on the + /// network to complete handshake packets, or for the application layer + /// to accept the connection. + /// + /// - For connections on the "server" side (accepted through listen socket): + /// We have completed some basic handshake and the client has presented + /// some proof of identity. The connection is ready to be accepted + /// using AcceptConnection(). + /// + /// In either case, any unreliable packets sent now are almost certain + /// to be dropped. Attempts to receive packets are guaranteed to fail. + /// You may send messages if the send mode allows for them to be queued. + /// but if you close the connection before the connection is actually + /// established, any queued messages will be discarded immediately. + /// (We will not attempt to flush the queue and confirm delivery to the + /// remote host, which ordinarily happens when a connection is closed.) + k_ESteamNetworkingConnectionState_Connecting = 1, + + /// Some connection types use a back channel or trusted 3rd party + /// for earliest communication. If the server accepts the connection, + /// then these connections switch into the rendezvous state. During this + /// state, we still have not yet established an end-to-end route (through + /// the relay network), and so if you send any messages unreliable, they + /// are going to be discarded. + k_ESteamNetworkingConnectionState_FindingRoute = 2, + + /// We've received communications from our peer (and we know + /// who they are) and are all good. If you close the connection now, + /// we will make our best effort to flush out any reliable sent data that + /// has not been acknowledged by the peer. (But note that this happens + /// from within the application process, so unlike a TCP connection, you are + /// not totally handing it off to the operating system to deal with it.) + k_ESteamNetworkingConnectionState_Connected = 3, + + /// Connection has been closed by our peer, but not closed locally. + /// The connection still exists from an API perspective. You must close the + /// handle to free up resources. If there are any messages in the inbound queue, + /// you may retrieve them. Otherwise, nothing may be done with the connection + /// except to close it. + /// + /// This stats is similar to CLOSE_WAIT in the TCP state machine. + k_ESteamNetworkingConnectionState_ClosedByPeer = 4, + + /// A disruption in the connection has been detected locally. (E.g. timeout, + /// local internet connection disrupted, etc.) + /// + /// The connection still exists from an API perspective. You must close the + /// handle to free up resources. + /// + /// Attempts to send further messages will fail. Any remaining received messages + /// in the queue are available. + k_ESteamNetworkingConnectionState_ProblemDetectedLocally = 5, + +// +// The following values are used internally and will not be returned by any API. +// We document them here to provide a little insight into the state machine that is used +// under the hood. +// + + /// We've disconnected on our side, and from an API perspective the connection is closed. + /// No more data may be sent or received. All reliable data has been flushed, or else + /// we've given up and discarded it. We do not yet know for sure that the peer knows + /// the connection has been closed, however, so we're just hanging around so that if we do + /// get a packet from them, we can send them the appropriate packets so that they can + /// know why the connection was closed (and not have to rely on a timeout, which makes + /// it appear as if something is wrong). + k_ESteamNetworkingConnectionState_FinWait = -1, + + /// We've disconnected on our side, and from an API perspective the connection is closed. + /// No more data may be sent or received. From a network perspective, however, on the wire, + /// we have not yet given any indication to the peer that the connection is closed. + /// We are in the process of flushing out the last bit of reliable data. Once that is done, + /// we will inform the peer that the connection has been closed, and transition to the + /// FinWait state. + /// + /// Note that no indication is given to the remote host that we have closed the connection, + /// until the data has been flushed. If the remote host attempts to send us data, we will + /// do whatever is necessary to keep the connection alive until it can be closed properly. + /// But in fact the data will be discarded, since there is no way for the application to + /// read it back. Typically this is not a problem, as application protocols that utilize + /// the lingering functionality are designed for the remote host to wait for the response + /// before sending any more data. + k_ESteamNetworkingConnectionState_Linger = -2, + + /// Connection is completely inactive and ready to be destroyed + k_ESteamNetworkingConnectionState_Dead = -3, + + k_ESteamNetworkingConnectionState__Force32Bit = 0x7fffffff +}; + +/// Enumerate various causes of connection termination. These are designed to work similar +/// to HTTP error codes: the numeric range gives you a rough classification as to the source +/// of the problem. +enum ESteamNetConnectionEnd +{ + // Invalid/sentinel value + k_ESteamNetConnectionEnd_Invalid = 0, + + // + // Application codes. These are the values you will pass to + // ISteamNetworkingSockets::CloseConnection. You can use these codes if + // you want to plumb through application-specific reason codes. If you don't + // need this facility, feel free to always pass + // k_ESteamNetConnectionEnd_App_Generic. + // + // The distinction between "normal" and "exceptional" termination is + // one you may use if you find useful, but it's not necessary for you + // to do so. The only place where we distinguish between normal and + // exceptional is in connection analytics. If a significant + // proportion of connections terminates in an exceptional manner, + // this can trigger an alert. + // + + // 1xxx: Application ended the connection in a "usual" manner. + // E.g.: user intentionally disconnected from the server, + // gameplay ended normally, etc + k_ESteamNetConnectionEnd_App_Min = 1000, + k_ESteamNetConnectionEnd_App_Generic = k_ESteamNetConnectionEnd_App_Min, + // Use codes in this range for "normal" disconnection + k_ESteamNetConnectionEnd_App_Max = 1999, + + // 2xxx: Application ended the connection in some sort of exceptional + // or unusual manner that might indicate a bug or configuration + // issue. + // + k_ESteamNetConnectionEnd_AppException_Min = 2000, + k_ESteamNetConnectionEnd_AppException_Generic = k_ESteamNetConnectionEnd_AppException_Min, + // Use codes in this range for "unusual" disconnection + k_ESteamNetConnectionEnd_AppException_Max = 2999, + + // + // System codes. These will be returned by the system when + // the connection state is k_ESteamNetworkingConnectionState_ClosedByPeer + // or k_ESteamNetworkingConnectionState_ProblemDetectedLocally. It is + // illegal to pass a code in this range to ISteamNetworkingSockets::CloseConnection + // + + // 3xxx: Connection failed or ended because of problem with the + // local host or their connection to the Internet. + k_ESteamNetConnectionEnd_Local_Min = 3000, + + // You cannot do what you want to do because you're running in offline mode. + k_ESteamNetConnectionEnd_Local_OfflineMode = 3001, + + // We're having trouble contacting many (perhaps all) relays. + // Since it's unlikely that they all went offline at once, the best + // explanation is that we have a problem on our end. Note that we don't + // bother distinguishing between "many" and "all", because in practice, + // it takes time to detect a connection problem, and by the time + // the connection has timed out, we might not have been able to + // actively probe all of the relay clusters, even if we were able to + // contact them at one time. So this code just means that: + // + // * We don't have any recent successful communication with any relay. + // * We have evidence of recent failures to communicate with multiple relays. + k_ESteamNetConnectionEnd_Local_ManyRelayConnectivity = 3002, + + // A hosted server is having trouble talking to the relay + // that the client was using, so the problem is most likely + // on our end + k_ESteamNetConnectionEnd_Local_HostedServerPrimaryRelay = 3003, + + // We're not able to get the SDR network config. This is + // *almost* always a local issue, since the network config + // comes from the CDN, which is pretty darn reliable. + k_ESteamNetConnectionEnd_Local_NetworkConfig = 3004, + + // Steam rejected our request because we don't have rights + // to do this. + k_ESteamNetConnectionEnd_Local_Rights = 3005, + + // ICE P2P rendezvous failed because we were not able to + // determine our "public" address (e.g. reflexive address via STUN) + // + // If relay fallback is available (it always is on Steam), then + // this is only used internally and will not be returned as a high + // level failure. + k_ESteamNetConnectionEnd_Local_P2P_ICE_NoPublicAddresses = 3006, + + k_ESteamNetConnectionEnd_Local_Max = 3999, + + // 4xxx: Connection failed or ended, and it appears that the + // cause does NOT have to do with the local host or their + // connection to the Internet. It could be caused by the + // remote host, or it could be somewhere in between. + k_ESteamNetConnectionEnd_Remote_Min = 4000, + + // The connection was lost, and as far as we can tell our connection + // to relevant services (relays) has not been disrupted. This doesn't + // mean that the problem is "their fault", it just means that it doesn't + // appear that we are having network issues on our end. + k_ESteamNetConnectionEnd_Remote_Timeout = 4001, + + // Something was invalid with the cert or crypt handshake + // info you gave me, I don't understand or like your key types, + // etc. + k_ESteamNetConnectionEnd_Remote_BadCrypt = 4002, + + // You presented me with a cert that was I was able to parse + // and *technically* we could use encrypted communication. + // But there was a problem that prevents me from checking your identity + // or ensuring that somebody int he middle can't observe our communication. + // E.g.: - the CA key was missing (and I don't accept unsigned certs) + // - The CA key isn't one that I trust, + // - The cert doesn't was appropriately restricted by app, user, time, data center, etc. + // - The cert wasn't issued to you. + // - etc + k_ESteamNetConnectionEnd_Remote_BadCert = 4003, + + // These will never be returned + //k_ESteamNetConnectionEnd_Remote_NotLoggedIn_DEPRECATED = 4004, + //k_ESteamNetConnectionEnd_Remote_NotRunningApp_DEPRECATED = 4005, + + // Something wrong with the protocol version you are using. + // (Probably the code you are running is too old.) + k_ESteamNetConnectionEnd_Remote_BadProtocolVersion = 4006, + + // NAT punch failed failed because we never received any public + // addresses from the remote host. (But we did receive some + // signals form them.) + // + // If relay fallback is available (it always is on Steam), then + // this is only used internally and will not be returned as a high + // level failure. + k_ESteamNetConnectionEnd_Remote_P2P_ICE_NoPublicAddresses = 4007, + + k_ESteamNetConnectionEnd_Remote_Max = 4999, + + // 5xxx: Connection failed for some other reason. + k_ESteamNetConnectionEnd_Misc_Min = 5000, + + // A failure that isn't necessarily the result of a software bug, + // but that should happen rarely enough that it isn't worth specifically + // writing UI or making a localized message for. + // The debug string should contain further details. + k_ESteamNetConnectionEnd_Misc_Generic = 5001, + + // Generic failure that is most likely a software bug. + k_ESteamNetConnectionEnd_Misc_InternalError = 5002, + + // The connection to the remote host timed out, but we + // don't know if the problem is on our end, in the middle, + // or on their end. + k_ESteamNetConnectionEnd_Misc_Timeout = 5003, + + //k_ESteamNetConnectionEnd_Misc_RelayConnectivity_DEPRECATED = 5004, + + // There's some trouble talking to Steam. + k_ESteamNetConnectionEnd_Misc_SteamConnectivity = 5005, + + // A server in a dedicated hosting situation has no relay sessions + // active with which to talk back to a client. (It's the client's + // job to open and maintain those sessions.) + k_ESteamNetConnectionEnd_Misc_NoRelaySessionsToClient = 5006, + + // While trying to initiate a connection, we never received + // *any* communication from the peer. + //k_ESteamNetConnectionEnd_Misc_ServerNeverReplied = 5007, + + // P2P rendezvous failed in a way that we don't have more specific + // information + k_ESteamNetConnectionEnd_Misc_P2P_Rendezvous = 5008, + + // NAT punch failed, probably due to NAT/firewall configuration. + // + // If relay fallback is available (it always is on Steam), then + // this is only used internally and will not be returned as a high + // level failure. + k_ESteamNetConnectionEnd_Misc_P2P_NAT_Firewall = 5009, + + // Our peer replied that it has no record of the connection. + // This should not happen ordinarily, but can happen in a few + // exception cases: + // + // - This is an old connection, and the peer has already cleaned + // up and forgotten about it. (Perhaps it timed out and they + // closed it and were not able to communicate this to us.) + // - A bug or internal protocol error has caused us to try to + // talk to the peer about the connection before we received + // confirmation that the peer has accepted the connection. + // - The peer thinks that we have closed the connection for some + // reason (perhaps a bug), and believes that is it is + // acknowledging our closure. + k_ESteamNetConnectionEnd_Misc_PeerSentNoConnection = 5010, + + k_ESteamNetConnectionEnd_Misc_Max = 5999, + + k_ESteamNetConnectionEnd__Force32Bit = 0x7fffffff +}; + +/// Max length, in bytes (including null terminator) of the reason string +/// when a connection is closed. +const int k_cchSteamNetworkingMaxConnectionCloseReason = 128; + +/// Max length, in bytes (include null terminator) of debug description +/// of a connection. +const int k_cchSteamNetworkingMaxConnectionDescription = 128; + +/// Max length of the app's part of the description +const int k_cchSteamNetworkingMaxConnectionAppName = 32; + +const int k_nSteamNetworkConnectionInfoFlags_Unauthenticated = 1; // We don't have a certificate for the remote host. +const int k_nSteamNetworkConnectionInfoFlags_Unencrypted = 2; // Information is being sent out over a wire unencrypted (by this library) +const int k_nSteamNetworkConnectionInfoFlags_LoopbackBuffers = 4; // Internal loopback buffers. Won't be true for localhost. (You can check the address to determine that.) This implies k_nSteamNetworkConnectionInfoFlags_FastLAN +const int k_nSteamNetworkConnectionInfoFlags_Fast = 8; // The connection is "fast" and "reliable". Either internal/localhost (check the address to find out), or the peer is on the same LAN. (Probably. It's based on the address and the ping time, this is actually hard to determine unambiguously). +const int k_nSteamNetworkConnectionInfoFlags_Relayed = 16; // The connection is relayed somehow (SDR or TURN). +const int k_nSteamNetworkConnectionInfoFlags_DualWifi = 32; // We're taking advantage of dual-wifi multi-path + +/// Describe the state of a connection. +struct SteamNetConnectionInfo_t +{ + + /// Who is on the other end? Depending on the connection type and phase of the connection, we might not know + SteamNetworkingIdentity m_identityRemote; + + /// Arbitrary user data set by the local application code + int64 m_nUserData; + + /// Handle to listen socket this was connected on, or k_HSteamListenSocket_Invalid if we initiated the connection + HSteamListenSocket m_hListenSocket; + + /// Remote address. Might be all 0's if we don't know it, or if this is N/A. + /// (E.g. Basically everything except direct UDP connection.) + SteamNetworkingIPAddr m_addrRemote; + uint16 m__pad1; + + /// What data center is the remote host in? (0 if we don't know.) + SteamNetworkingPOPID m_idPOPRemote; + + /// What relay are we using to communicate with the remote host? + /// (0 if not applicable.) + SteamNetworkingPOPID m_idPOPRelay; + + /// High level state of the connection + ESteamNetworkingConnectionState m_eState; + + /// Basic cause of the connection termination or problem. + /// See ESteamNetConnectionEnd for the values used + int m_eEndReason; + + /// Human-readable, but non-localized explanation for connection + /// termination or problem. This is intended for debugging / + /// diagnostic purposes only, not to display to users. It might + /// have some details specific to the issue. + char m_szEndDebug[ k_cchSteamNetworkingMaxConnectionCloseReason ]; + + /// Debug description. This includes the internal connection ID, + /// connection type (and peer information), and any name + /// given to the connection by the app. This string is used in various + /// internal logging messages. + /// + /// Note that the connection ID *usually* matches the HSteamNetConnection + /// handle, but in certain cases with symmetric connections it might not. + char m_szConnectionDescription[ k_cchSteamNetworkingMaxConnectionDescription ]; + + /// Misc flags. Bitmask of k_nSteamNetworkConnectionInfoFlags_Xxxx + int m_nFlags; + + /// Internal stuff, room to change API easily + uint32 reserved[63]; +}; + +/// Quick connection state, pared down to something you could call +/// more frequently without it being too big of a perf hit. +struct SteamNetConnectionRealTimeStatus_t +{ + + /// High level state of the connection + ESteamNetworkingConnectionState m_eState; + + /// Current ping (ms) + int m_nPing; + + /// Connection quality measured locally, 0...1. (Percentage of packets delivered + /// end-to-end in order). + float m_flConnectionQualityLocal; + + /// Packet delivery success rate as observed from remote host + float m_flConnectionQualityRemote; + + /// Current data rates from recent history. + float m_flOutPacketsPerSec; + float m_flOutBytesPerSec; + float m_flInPacketsPerSec; + float m_flInBytesPerSec; + + /// Estimate rate that we believe that we can send data to our peer. + /// Note that this could be significantly higher than m_flOutBytesPerSec, + /// meaning the capacity of the channel is higher than you are sending data. + /// (That's OK!) + int m_nSendRateBytesPerSecond; + + /// Number of bytes pending to be sent. This is data that you have recently + /// requested to be sent but has not yet actually been put on the wire. The + /// reliable number ALSO includes data that was previously placed on the wire, + /// but has now been scheduled for re-transmission. Thus, it's possible to + /// observe m_cbPendingReliable increasing between two checks, even if no + /// calls were made to send reliable data between the checks. Data that is + /// awaiting the Nagle delay will appear in these numbers. + int m_cbPendingUnreliable; + int m_cbPendingReliable; + + /// Number of bytes of reliable data that has been placed the wire, but + /// for which we have not yet received an acknowledgment, and thus we may + /// have to re-transmit. + int m_cbSentUnackedReliable; + + /// If you queued a message right now, approximately how long would that message + /// wait in the queue before we actually started putting its data on the wire in + /// a packet? + /// + /// In general, data that is sent by the application is limited by the bandwidth + /// of the channel. If you send data faster than this, it must be queued and + /// put on the wire at a metered rate. Even sending a small amount of data (e.g. + /// a few MTU, say ~3k) will require some of the data to be delayed a bit. + /// + /// Ignoring multiple lanes, the estimated delay will be approximately equal to + /// + /// ( m_cbPendingUnreliable+m_cbPendingReliable ) / m_nSendRateBytesPerSecond + /// + /// plus or minus one MTU. It depends on how much time has elapsed since the last + /// packet was put on the wire. For example, the queue might have *just* been emptied, + /// and the last packet placed on the wire, and we are exactly up against the send + /// rate limit. In that case we might need to wait for one packet's worth of time to + /// elapse before we can send again. On the other extreme, the queue might have data + /// in it waiting for Nagle. (This will always be less than one packet, because as + /// soon as we have a complete packet we would send it.) In that case, we might be + /// ready to send data now, and this value will be 0. + /// + /// This value is only valid if multiple lanes are not used. If multiple lanes are + /// in use, then the queue time will be different for each lane, and you must use + /// the value in SteamNetConnectionRealTimeLaneStatus_t. + /// + /// Nagle delay is ignored for the purposes of this calculation. + SteamNetworkingMicroseconds m_usecQueueTime; + + // Internal stuff, room to change API easily + uint32 reserved[16]; +}; + +/// Quick status of a particular lane +struct SteamNetConnectionRealTimeLaneStatus_t +{ + // Counters for this particular lane. See the corresponding variables + // in SteamNetConnectionRealTimeStatus_t + int m_cbPendingUnreliable; + int m_cbPendingReliable; + int m_cbSentUnackedReliable; + int _reservePad1; // Reserved for future use + + /// Lane-specific queue time. This value takes into consideration lane priorities + /// and weights, and how much data is queued in each lane, and attempts to predict + /// how any data currently queued will be sent out. + SteamNetworkingMicroseconds m_usecQueueTime; + + // Internal stuff, room to change API easily + uint32 reserved[10]; +}; + +#pragma pack( pop ) + +// +// Network messages +// + +/// Max size of a single message that we can SEND. +/// Note: We might be wiling to receive larger messages, +/// and our peer might, too. +const int k_cbMaxSteamNetworkingSocketsMessageSizeSend = 512 * 1024; + +/// A message that has been received. +struct SteamNetworkingMessage_t +{ + + /// Message payload + void *m_pData; + + /// Size of the payload. + int m_cbSize; + + /// For messages received on connections: what connection did this come from? + /// For outgoing messages: what connection to send it to? + /// Not used when using the ISteamNetworkingMessages interface + HSteamNetConnection m_conn; + + /// For inbound messages: Who sent this to us? + /// For outbound messages on connections: not used. + /// For outbound messages on the ad-hoc ISteamNetworkingMessages interface: who should we send this to? + SteamNetworkingIdentity m_identityPeer; + + /// For messages received on connections, this is the user data + /// associated with the connection. + /// + /// This is *usually* the same as calling GetConnection() and then + /// fetching the user data associated with that connection, but for + /// the following subtle differences: + /// + /// - This user data will match the connection's user data at the time + /// is captured at the time the message is returned by the API. + /// If you subsequently change the userdata on the connection, + /// this won't be updated. + /// - This is an inline call, so it's *much* faster. + /// - You might have closed the connection, so fetching the user data + /// would not be possible. + /// + /// Not used when sending messages. + int64 m_nConnUserData; + + /// Local timestamp when the message was received + /// Not used for outbound messages. + SteamNetworkingMicroseconds m_usecTimeReceived; + + /// Message number assigned by the sender. This is not used for outbound + /// messages. Note that if multiple lanes are used, each lane has its own + /// message numbers, which are assigned sequentially, so messages from + /// different lanes will share the same numbers. + int64 m_nMessageNumber; + + /// Function used to free up m_pData. This mechanism exists so that + /// apps can create messages with buffers allocated from their own + /// heap, and pass them into the library. This function will + /// usually be something like: + /// + /// free( pMsg->m_pData ); + void (*m_pfnFreeData)( SteamNetworkingMessage_t *pMsg ); + + /// Function to used to decrement the internal reference count and, if + /// it's zero, release the message. You should not set this function pointer, + /// or need to access this directly! Use the Release() function instead! + void (*m_pfnRelease)( SteamNetworkingMessage_t *pMsg ); + + /// When using ISteamNetworkingMessages, the channel number the message was received on + /// (Not used for messages sent or received on "connections") + int m_nChannel; + + /// Bitmask of k_nSteamNetworkingSend_xxx flags. + /// For received messages, only the k_nSteamNetworkingSend_Reliable bit is valid. + /// For outbound messages, all bits are relevant + int m_nFlags; + + /// Arbitrary user data that you can use when sending messages using + /// ISteamNetworkingUtils::AllocateMessage and ISteamNetworkingSockets::SendMessage. + /// (The callback you set in m_pfnFreeData might use this field.) + /// + /// Not used for received messages. + int64 m_nUserData; + + /// For outbound messages, which lane to use? See ISteamNetworkingSockets::ConfigureConnectionLanes. + /// For inbound messages, what lane was the message received on? + uint16 m_idxLane; + uint16 _pad1__; + + /// You MUST call this when you're done with the object, + /// to free up memory, etc. + inline void Release(); + + // For code compatibility, some accessors +#ifndef API_GEN + inline uint32 GetSize() const { return m_cbSize; } + inline const void *GetData() const { return m_pData; } + inline int GetChannel() const { return m_nChannel; } + inline HSteamNetConnection GetConnection() const { return m_conn; } + inline int64 GetConnectionUserData() const { return m_nConnUserData; } + inline SteamNetworkingMicroseconds GetTimeReceived() const { return m_usecTimeReceived; } + inline int64 GetMessageNumber() const { return m_nMessageNumber; } +#endif +protected: + // Declare destructor protected. You should never need to declare a message + // object on the stack or create one yourself. + // - You will receive a pointer to a message object when you receive messages (e.g. ISteamNetworkingSockets::ReceiveMessagesOnConnection) + // - You can allocate a message object for efficient sending using ISteamNetworkingUtils::AllocateMessage + // - Call Release() to free the object + inline ~SteamNetworkingMessage_t() {} +}; + +// +// Flags used to set options for message sending +// + +// Send the message unreliably. Can be lost. Messages *can* be larger than a +// single MTU (UDP packet), but there is no retransmission, so if any piece +// of the message is lost, the entire message will be dropped. +// +// The sending API does have some knowledge of the underlying connection, so +// if there is no NAT-traversal accomplished or there is a recognized adjustment +// happening on the connection, the packet will be batched until the connection +// is open again. +// +// Migration note: This is not exactly the same as k_EP2PSendUnreliable! You +// probably want k_ESteamNetworkingSendType_UnreliableNoNagle +const int k_nSteamNetworkingSend_Unreliable = 0; + +// Disable Nagle's algorithm. +// By default, Nagle's algorithm is applied to all outbound messages. This means +// that the message will NOT be sent immediately, in case further messages are +// sent soon after you send this, which can be grouped together. Any time there +// is enough buffered data to fill a packet, the packets will be pushed out immediately, +// but partially-full packets not be sent until the Nagle timer expires. See +// ISteamNetworkingSockets::FlushMessagesOnConnection, ISteamNetworkingMessages::FlushMessagesToUser +// +// NOTE: Don't just send every message without Nagle because you want packets to get there +// quicker. Make sure you understand the problem that Nagle is solving before disabling it. +// If you are sending small messages, often many at the same time, then it is very likely that +// it will be more efficient to leave Nagle enabled. A typical proper use of this flag is +// when you are sending what you know will be the last message sent for a while (e.g. the last +// in the server simulation tick to a particular client), and you use this flag to flush all +// messages. +const int k_nSteamNetworkingSend_NoNagle = 1; + +// Send a message unreliably, bypassing Nagle's algorithm for this message and any messages +// currently pending on the Nagle timer. This is equivalent to using k_ESteamNetworkingSend_Unreliable +// and then immediately flushing the messages using ISteamNetworkingSockets::FlushMessagesOnConnection +// or ISteamNetworkingMessages::FlushMessagesToUser. (But using this flag is more efficient since you +// only make one API call.) +const int k_nSteamNetworkingSend_UnreliableNoNagle = k_nSteamNetworkingSend_Unreliable|k_nSteamNetworkingSend_NoNagle; + +// If the message cannot be sent very soon (because the connection is still doing some initial +// handshaking, route negotiations, etc), then just drop it. This is only applicable for unreliable +// messages. Using this flag on reliable messages is invalid. +const int k_nSteamNetworkingSend_NoDelay = 4; + +// Send an unreliable message, but if it cannot be sent relatively quickly, just drop it instead of queuing it. +// This is useful for messages that are not useful if they are excessively delayed, such as voice data. +// NOTE: The Nagle algorithm is not used, and if the message is not dropped, any messages waiting on the +// Nagle timer are immediately flushed. +// +// A message will be dropped under the following circumstances: +// - the connection is not fully connected. (E.g. the "Connecting" or "FindingRoute" states) +// - there is a sufficiently large number of messages queued up already such that the current message +// will not be placed on the wire in the next ~200ms or so. +// +// If a message is dropped for these reasons, k_EResultIgnored will be returned. +const int k_nSteamNetworkingSend_UnreliableNoDelay = k_nSteamNetworkingSend_Unreliable|k_nSteamNetworkingSend_NoDelay|k_nSteamNetworkingSend_NoNagle; + +// Reliable message send. Can send up to k_cbMaxSteamNetworkingSocketsMessageSizeSend bytes in a single message. +// Does fragmentation/re-assembly of messages under the hood, as well as a sliding window for +// efficient sends of large chunks of data. +// +// The Nagle algorithm is used. See notes on k_ESteamNetworkingSendType_Unreliable for more details. +// See k_ESteamNetworkingSendType_ReliableNoNagle, ISteamNetworkingSockets::FlushMessagesOnConnection, +// ISteamNetworkingMessages::FlushMessagesToUser +// +// Migration note: This is NOT the same as k_EP2PSendReliable, it's more like k_EP2PSendReliableWithBuffering +const int k_nSteamNetworkingSend_Reliable = 8; + +// Send a message reliably, but bypass Nagle's algorithm. +// +// Migration note: This is equivalent to k_EP2PSendReliable +const int k_nSteamNetworkingSend_ReliableNoNagle = k_nSteamNetworkingSend_Reliable|k_nSteamNetworkingSend_NoNagle; + +// By default, message sending is queued, and the work of encryption and talking to +// the operating system sockets, etc is done on a service thread. This is usually a +// a performance win when messages are sent from the "main thread". However, if this +// flag is set, and data is ready to be sent immediately (either from this message +// or earlier queued data), then that work will be done in the current thread, before +// the current call returns. If data is not ready to be sent (due to rate limiting +// or Nagle), then this flag has no effect. +// +// This is an advanced flag used to control performance at a very low level. For +// most applications running on modern hardware with more than one CPU core, doing +// the work of sending on a service thread will yield the best performance. Only +// use this flag if you have a really good reason and understand what you are doing. +// Otherwise you will probably just make performance worse. +const int k_nSteamNetworkingSend_UseCurrentThread = 16; + +// When sending a message using ISteamNetworkingMessages, automatically re-establish +// a broken session, without returning k_EResultNoConnection. Without this flag, +// if you attempt to send a message, and the session was proactively closed by the +// peer, or an error occurred that disrupted communications, then you must close the +// session using ISteamNetworkingMessages::CloseSessionWithUser before attempting to +// send another message. (Or you can simply add this flag and retry.) In this way, +// the disruption cannot go unnoticed, and a more clear order of events can be +// ascertained. This is especially important when reliable messages are used, since +// if the connection is disrupted, some of those messages will not have been delivered, +// and it is in general not possible to know which. Although a +// SteamNetworkingMessagesSessionFailed_t callback will be posted when an error occurs +// to notify you that a failure has happened, callbacks are asynchronous, so it is not +// possible to tell exactly when it happened. And because the primary purpose of +// ISteamNetworkingMessages is to be like UDP, there is no notification when a peer closes +// the session. +// +// If you are not using any reliable messages (e.g. you are using ISteamNetworkingMessages +// exactly as a transport replacement for UDP-style datagrams only), you may not need to +// know when an underlying connection fails, and so you may not need this notification. +const int k_nSteamNetworkingSend_AutoRestartBrokenSession = 32; + +// +// Ping location / measurement +// + +/// Object that describes a "location" on the Internet with sufficient +/// detail that we can reasonably estimate an upper bound on the ping between +/// the two hosts, even if a direct route between the hosts is not possible, +/// and the connection must be routed through the Steam Datagram Relay network. +/// This does not contain any information that identifies the host. Indeed, +/// if two hosts are in the same building or otherwise have nearly identical +/// networking characteristics, then it's valid to use the same location +/// object for both of them. +/// +/// NOTE: This object should only be used in the same process! Do not serialize it, +/// send it over the wire, or persist it in a file or database! If you need +/// to do that, convert it to a string representation using the methods in +/// ISteamNetworkingUtils(). +struct SteamNetworkPingLocation_t +{ + uint8 m_data[ 512 ]; +}; + +/// Max possible length of a ping location, in string format. This is +/// an extremely conservative worst case value which leaves room for future +/// syntax enhancements. Most strings in practice are a lot shorter. +/// If you are storing many of these, you will very likely benefit from +/// using dynamic memory. +const int k_cchMaxSteamNetworkingPingLocationString = 1024; + +/// Special values that are returned by some functions that return a ping. +const int k_nSteamNetworkingPing_Failed = -1; +const int k_nSteamNetworkingPing_Unknown = -2; + +// +// Configuration values +// + +/// Configuration values can be applied to different types of objects. +enum ESteamNetworkingConfigScope +{ + + /// Get/set global option, or defaults. Even options that apply to more specific scopes + /// have global scope, and you may be able to just change the global defaults. If you + /// need different settings per connection (for example), then you will need to set those + /// options at the more specific scope. + k_ESteamNetworkingConfig_Global = 1, + + /// Some options are specific to a particular interface. Note that all connection + /// and listen socket settings can also be set at the interface level, and they will + /// apply to objects created through those interfaces. + k_ESteamNetworkingConfig_SocketsInterface = 2, + + /// Options for a listen socket. Listen socket options can be set at the interface layer, + /// if you have multiple listen sockets and they all use the same options. + /// You can also set connection options on a listen socket, and they set the defaults + /// for all connections accepted through this listen socket. (They will be used if you don't + /// set a connection option.) + k_ESteamNetworkingConfig_ListenSocket = 3, + + /// Options for a specific connection. + k_ESteamNetworkingConfig_Connection = 4, + + k_ESteamNetworkingConfigScope__Force32Bit = 0x7fffffff +}; + +// Different configuration values have different data types +enum ESteamNetworkingConfigDataType +{ + k_ESteamNetworkingConfig_Int32 = 1, + k_ESteamNetworkingConfig_Int64 = 2, + k_ESteamNetworkingConfig_Float = 3, + k_ESteamNetworkingConfig_String = 4, + k_ESteamNetworkingConfig_Ptr = 5, + + k_ESteamNetworkingConfigDataType__Force32Bit = 0x7fffffff +}; + +/// Configuration options +enum ESteamNetworkingConfigValue +{ + k_ESteamNetworkingConfig_Invalid = 0, + +// +// Connection options +// + + /// [connection int32] Timeout value (in ms) to use when first connecting + k_ESteamNetworkingConfig_TimeoutInitial = 24, + + /// [connection int32] Timeout value (in ms) to use after connection is established + k_ESteamNetworkingConfig_TimeoutConnected = 25, + + /// [connection int32] Upper limit of buffered pending bytes to be sent, + /// if this is reached SendMessage will return k_EResultLimitExceeded + /// Default is 512k (524288 bytes) + k_ESteamNetworkingConfig_SendBufferSize = 9, + + /// [connection int32] Upper limit on total size (in bytes) of received messages + /// that will be buffered waiting to be processed by the application. If this limit + /// is exceeded, packets will be dropped. This is to protect us from a malicious + /// peer flooding us with messages faster than we can process them. + /// + /// This must be bigger than k_ESteamNetworkingConfig_RecvMaxMessageSize + k_ESteamNetworkingConfig_RecvBufferSize = 47, + + /// [connection int32] Upper limit on the number of received messages that will + /// that will be buffered waiting to be processed by the application. If this limit + /// is exceeded, packets will be dropped. This is to protect us from a malicious + /// peer flooding us with messages faster than we can pull them off the wire. + k_ESteamNetworkingConfig_RecvBufferMessages = 48, + + /// [connection int32] Maximum message size that we are willing to receive. + /// if a client attempts to send us a message larger than this, the connection + /// will be immediately closed. + /// + /// Default is 512k (524288 bytes). Note that the peer needs to be able to + /// send a message this big. (See k_cbMaxSteamNetworkingSocketsMessageSizeSend.) + k_ESteamNetworkingConfig_RecvMaxMessageSize = 49, + + /// [connection int32] Max number of message segments that can be received + /// in a single UDP packet. While decoding a packet, if the number of segments + /// exceeds this, we will abort further packet processing. + /// + /// The default is effectively unlimited. If you know that you very rarely + /// send small packets, you can protect yourself from malicious senders by + /// lowering this number. + /// + /// In particular, if you are NOT using the reliability layer and are only using + /// SteamNetworkingSockets for datagram transport, setting this to a very low + /// number may be beneficial. (We recommend a value of 2.) Make sure your sender + /// disables Nagle! + k_ESteamNetworkingConfig_RecvMaxSegmentsPerPacket = 50, + + /// [connection int64] Get/set userdata as a configuration option. + /// The default value is -1. You may want to set the user data as + /// a config value, instead of using ISteamNetworkingSockets::SetConnectionUserData + /// in two specific instances: + /// + /// - You wish to set the userdata atomically when creating + /// an outbound connection, so that the userdata is filled in properly + /// for any callbacks that happen. However, note that this trick + /// only works for connections initiated locally! For incoming + /// connections, multiple state transitions may happen and + /// callbacks be queued, before you are able to service the first + /// callback! Be careful! + /// + /// - You can set the default userdata for all newly created connections + /// by setting this value at a higher level (e.g. on the listen + /// socket or at the global level.) Then this default + /// value will be inherited when the connection is created. + /// This is useful in case -1 is a valid userdata value, and you + /// wish to use something else as the default value so you can + /// tell if it has been set or not. + /// + /// HOWEVER: once a connection is created, the effective value is + /// then bound to the connection. Unlike other connection options, + /// if you change it again at a higher level, the new value will not + /// be inherited by connections. + /// + /// Using the userdata field in callback structs is not advised because + /// of tricky race conditions. Instead, you might try one of these methods: + /// + /// - Use a separate map with the HSteamNetConnection as the key. + /// - Fetch the userdata from the connection in your callback + /// using ISteamNetworkingSockets::GetConnectionUserData, to + // ensure you have the current value. + k_ESteamNetworkingConfig_ConnectionUserData = 40, + + /// [connection int32] Minimum/maximum send rate clamp, in bytes/sec. + /// At the time of this writing these two options should always be set to + /// the same value, to manually configure a specific send rate. The default + /// value is 256K. Eventually we hope to have the library estimate the bandwidth + /// of the channel and set the send rate to that estimated bandwidth, and these + /// values will only set limits on that send rate. + k_ESteamNetworkingConfig_SendRateMin = 10, + k_ESteamNetworkingConfig_SendRateMax = 11, + + /// [connection int32] Nagle time, in microseconds. When SendMessage is called, if + /// the outgoing message is less than the size of the MTU, it will be + /// queued for a delay equal to the Nagle timer value. This is to ensure + /// that if the application sends several small messages rapidly, they are + /// coalesced into a single packet. + /// See historical RFC 896. Value is in microseconds. + /// Default is 5000us (5ms). + k_ESteamNetworkingConfig_NagleTime = 12, + + /// [connection int32] Don't automatically fail IP connections that don't have + /// strong auth. On clients, this means we will attempt the connection even if + /// we don't know our identity or can't get a cert. On the server, it means that + /// we won't automatically reject a connection due to a failure to authenticate. + /// (You can examine the incoming connection and decide whether to accept it.) + /// + /// 0: Don't attempt or accept unauthorized connections + /// 1: Attempt authorization when connecting, and allow unauthorized peers, but emit warnings + /// 2: don't attempt authentication, or complain if peer is unauthenticated + /// + /// This is a dev configuration value, and you should not let users modify it in + /// production. + k_ESteamNetworkingConfig_IP_AllowWithoutAuth = 23, + + /// [connection int32] The same as IP_AllowWithoutAuth, but will only apply + /// for connections to/from localhost addresses. Whichever value is larger + /// (more permissive) will be used. + k_ESteamNetworkingConfig_IPLocalHost_AllowWithoutAuth = 52, + + /// [connection int32] Do not send UDP packets with a payload of + /// larger than N bytes. If you set this, k_ESteamNetworkingConfig_MTU_DataSize + /// is automatically adjusted + k_ESteamNetworkingConfig_MTU_PacketSize = 32, + + /// [connection int32] (read only) Maximum message size you can send that + /// will not fragment, based on k_ESteamNetworkingConfig_MTU_PacketSize + k_ESteamNetworkingConfig_MTU_DataSize = 33, + + /// [connection int32] Allow unencrypted (and unauthenticated) communication. + /// 0: Not allowed (the default) + /// 1: Allowed, but prefer encrypted + /// 2: Allowed, and preferred + /// 3: Required. (Fail the connection if the peer requires encryption.) + /// + /// This is a dev configuration value, since its purpose is to disable encryption. + /// You should not let users modify it in production. (But note that it requires + /// the peer to also modify their value in order for encryption to be disabled.) + k_ESteamNetworkingConfig_Unencrypted = 34, + + /// [connection int32] Set this to 1 on outbound connections and listen sockets, + /// to enable "symmetric connect mode", which is useful in the following + /// common peer-to-peer use case: + /// + /// - The two peers are "equal" to each other. (Neither is clearly the "client" + /// or "server".) + /// - Either peer may initiate the connection, and indeed they may do this + /// at the same time + /// - The peers only desire a single connection to each other, and if both + /// peers initiate connections simultaneously, a protocol is needed for them + /// to resolve the conflict, so that we end up with a single connection. + /// + /// This use case is both common, and involves subtle race conditions and tricky + /// pitfalls, which is why the API has support for dealing with it. + /// + /// If an incoming connection arrives on a listen socket or via custom signaling, + /// and the application has not attempted to make a matching outbound connection + /// in symmetric mode, then the incoming connection can be accepted as usual. + /// A "matching" connection means that the relevant endpoint information matches. + /// (At the time this comment is being written, this is only supported for P2P + /// connections, which means that the peer identities must match, and the virtual + /// port must match. At a later time, symmetric mode may be supported for other + /// connection types.) + /// + /// If connections are initiated by both peers simultaneously, race conditions + /// can arise, but fortunately, most of them are handled internally and do not + /// require any special awareness from the application. However, there + /// is one important case that application code must be aware of: + /// If application code attempts an outbound connection using a ConnectXxx + /// function in symmetric mode, and a matching incoming connection is already + /// waiting on a listen socket, then instead of forming a new connection, + /// the ConnectXxx call will accept the existing incoming connection, and return + /// a connection handle to this accepted connection. + /// IMPORTANT: in this case, a SteamNetConnectionStatusChangedCallback_t + /// has probably *already* been posted to the queue for the incoming connection! + /// (Once callbacks are posted to the queue, they are not modified.) It doesn't + /// matter if the callback has not been consumed by the app. Thus, application + /// code that makes use of symmetric connections must be aware that, when processing a + /// SteamNetConnectionStatusChangedCallback_t for an incoming connection, the + /// m_hConn may refer to a new connection that the app has has not + /// seen before (the usual case), but it may also refer to a connection that + /// has already been accepted implicitly through a call to Connect()! In this + /// case, AcceptConnection() will return k_EResultDuplicateRequest. + /// + /// Only one symmetric connection to a given peer (on a given virtual port) + /// may exist at any given time. If client code attempts to create a connection, + /// and a (live) connection already exists on the local host, then either the + /// existing connection will be accepted as described above, or the attempt + /// to create a new connection will fail. Furthermore, linger mode functionality + /// is not supported on symmetric connections. + /// + /// A more complicated race condition can arise if both peers initiate a connection + /// at roughly the same time. In this situation, each peer will receive an incoming + /// connection from the other peer, when the application code has already initiated + /// an outgoing connection to that peer. The peers must resolve this conflict and + /// decide who is going to act as the "server" and who will act as the "client". + /// Typically the application does not need to be aware of this case as it is handled + /// internally. On both sides, the will observe their outbound connection being + /// "accepted", although one of them one have been converted internally to act + /// as the "server". + /// + /// In general, symmetric mode should be all-or-nothing: do not mix symmetric + /// connections with a non-symmetric connection that it might possible "match" + /// with. If you use symmetric mode on any connections, then both peers should + /// use it on all connections, and the corresponding listen socket, if any. The + /// behaviour when symmetric and ordinary connections are mixed is not defined by + /// this API, and you should not rely on it. (This advice only applies when connections + /// might possibly "match". For example, it's OK to use all symmetric mode + /// connections on one virtual port, and all ordinary, non-symmetric connections + /// on a different virtual port, as there is no potential for ambiguity.) + /// + /// When using the feature, you should set it in the following situations on + /// applicable objects: + /// + /// - When creating an outbound connection using ConnectXxx function + /// - When creating a listen socket. (Note that this will automatically cause + /// any accepted connections to inherit the flag.) + /// - When using custom signaling, before accepting an incoming connection. + /// + /// Setting the flag on listen socket and accepted connections will enable the + /// API to automatically deal with duplicate incoming connections, even if the + /// local host has not made any outbound requests. (In general, such duplicate + /// requests from a peer are ignored internally and will not be visible to the + /// application code. The previous connection must be closed or resolved first.) + k_ESteamNetworkingConfig_SymmetricConnect = 37, + + /// [connection int32] For connection types that use "virtual ports", this can be used + /// to assign a local virtual port. For incoming connections, this will always be the + /// virtual port of the listen socket (or the port requested by the remote host if custom + /// signaling is used and the connection is accepted), and cannot be changed. For + /// connections initiated locally, the local virtual port will default to the same as the + /// requested remote virtual port, if you do not specify a different option when creating + /// the connection. The local port is only relevant for symmetric connections, when + /// determining if two connections "match." In this case, if you need the local and remote + /// port to differ, you can set this value. + /// + /// You can also read back this value on listen sockets. + /// + /// This value should not be read or written in any other context. + k_ESteamNetworkingConfig_LocalVirtualPort = 38, + + /// [connection int32] Enable Dual wifi band support for this connection + /// 0 = no, 1 = yes, 2 = simulate it for debugging, even if dual wifi not available + k_ESteamNetworkingConfig_DualWifi_Enable = 39, + + /// [connection int32] True to enable diagnostics reporting through + /// generic platform UI. (Only available on Steam.) + k_ESteamNetworkingConfig_EnableDiagnosticsUI = 46, + + /// [connection int32] Send of time-since-previous-packet values in each UDP packet. + /// This add a small amount of packet overhead but allows for detailed jitter measurements + /// to be made by the receiver. + /// + /// - 0: disables the sending + /// - 1: enables sending + /// - -1: (the default) Use the default for the connection type. For plain UDP connections, + /// this is disabled, and for relayed connections, it is enabled. Note that relays + /// always send the value. + k_ESteamNetworkingConfig_SendTimeSincePreviousPacket = 59, + +// +// Simulating network conditions +// +// These are global (not per-connection) because they apply at +// a relatively low UDP layer. +// + + /// [global float, 0--100] Randomly discard N pct of packets instead of sending/recv + /// This is a global option only, since it is applied at a low level + /// where we don't have much context + k_ESteamNetworkingConfig_FakePacketLoss_Send = 2, + k_ESteamNetworkingConfig_FakePacketLoss_Recv = 3, + + /// [global int32]. Delay all outbound/inbound packets by N ms + k_ESteamNetworkingConfig_FakePacketLag_Send = 4, + k_ESteamNetworkingConfig_FakePacketLag_Recv = 5, + + /// Simulated jitter/clumping. + /// + /// For each packet, a jitter value is determined (which may + /// be zero). This amount is added as extra delay to the + /// packet. When a subsequent packet is queued, it receives its + /// own random jitter amount from the current time. if this would + /// result in the packets being delivered out of order, the later + /// packet queue time is adjusted to happen after the first packet. + /// Thus simulating jitter by itself will not reorder packets, but it + /// can "clump" them. + /// + /// - Avg: A random jitter time is generated using an exponential + /// distribution using this value as the mean (ms). The default + /// is zero, which disables random jitter. + /// - Max: Limit the random jitter time to this value (ms). + /// - Pct: odds (0-100) that a random jitter value for the packet + /// will be generated. Otherwise, a jitter value of zero + /// is used, and the packet will only be delayed by the jitter + /// system if necessary to retain order, due to the jitter of a + /// previous packet. + /// + /// All values are [global float] + /// + /// Fake jitter is simulated after fake lag, but before reordering. + k_ESteamNetworkingConfig_FakePacketJitter_Send_Avg = 53, + k_ESteamNetworkingConfig_FakePacketJitter_Send_Max = 54, + k_ESteamNetworkingConfig_FakePacketJitter_Send_Pct = 55, + k_ESteamNetworkingConfig_FakePacketJitter_Recv_Avg = 56, + k_ESteamNetworkingConfig_FakePacketJitter_Recv_Max = 57, + k_ESteamNetworkingConfig_FakePacketJitter_Recv_Pct = 58, + + /// [global float] 0-100 Percentage of packets we will add additional + /// delay to. If other packet(s) are sent/received within this delay + /// window (that doesn't also randomly receive the same extra delay), + /// then the packets become reordered. + /// + /// This mechanism is primarily intended to generate out-of-order + /// packets. To simulate random jitter, use the FakePacketJitter. + /// Fake packet reordering is applied after fake lag and jitter + k_ESteamNetworkingConfig_FakePacketReorder_Send = 6, + k_ESteamNetworkingConfig_FakePacketReorder_Recv = 7, + + /// [global int32] Extra delay, in ms, to apply to reordered + /// packets. The same time value is used for sending and receiving. + k_ESteamNetworkingConfig_FakePacketReorder_Time = 8, + + /// [global float 0--100] Globally duplicate some percentage of packets. + k_ESteamNetworkingConfig_FakePacketDup_Send = 26, + k_ESteamNetworkingConfig_FakePacketDup_Recv = 27, + + /// [global int32] Amount of delay, in ms, to delay duplicated packets. + /// (We chose a random delay between 0 and this value) + k_ESteamNetworkingConfig_FakePacketDup_TimeMax = 28, + + /// [global int32] Trace every UDP packet, similar to Wireshark or tcpdump. + /// Value is max number of bytes to dump. -1 disables tracing. + // 0 only traces the info but no actual data bytes + k_ESteamNetworkingConfig_PacketTraceMaxBytes = 41, + + + // [global int32] Global UDP token bucket rate limits. + // "Rate" refers to the steady state rate. (Bytes/sec, the + // rate that tokens are put into the bucket.) "Burst" + // refers to the max amount that could be sent in a single + // burst. (In bytes, the max capacity of the bucket.) + // Rate=0 disables the limiter entirely, which is the default. + // Burst=0 disables burst. (This is not realistic. A + // burst of at least 4K is recommended; the default is higher.) + k_ESteamNetworkingConfig_FakeRateLimit_Send_Rate = 42, + k_ESteamNetworkingConfig_FakeRateLimit_Send_Burst = 43, + k_ESteamNetworkingConfig_FakeRateLimit_Recv_Rate = 44, + k_ESteamNetworkingConfig_FakeRateLimit_Recv_Burst = 45, + + // Timeout used for out-of-order correction. This is used when we see a small + // gap in the sequence number on a packet flow. For example let's say we are + // processing packet 105 when the most recent one was 103. 104 might have dropped, + // but there is also a chance that packets are simply being reordered. It is very + // common on certain types of connections for packet 104 to arrive very soon after 105, + // especially if 104 was large and 104 was small. In this case, when we see packet 105 + // we will shunt it aside and pend it, in the hopes of seeing 104 soon after. If 104 + // arrives before the a timeout occurs, then we can deliver the packets in order to the + // remainder of packet processing, and we will record this as a "correctable" out-of-order + // situation. If the timer expires, then we will process packet 105, and assume for now + // that 104 has dropped. (If 104 later arrives, we will process it, but that will be + // accounted for as uncorrected.) + // + // The default value is 1000 microseconds. Note that the Windows scheduler does not + // have microsecond precision. + // + // Set the value to 0 to disable out of order correction at the packet layer. + // In many cases we are still effectively able to correct the situation because + // reassembly of message fragments is tolerant of fragments packets arriving out of + // order. Also, when messages are decoded and inserted into the queue for the app + // to receive them, we will correct out of order messages that have not been + // dequeued by the app yet. However, when out-of-order packets are corrected + // at the packet layer, they will not reduce the connection quality measure. + // (E.g. SteamNetConnectionRealTimeStatus_t::m_flConnectionQualityLocal) + k_ESteamNetworkingConfig_OutOfOrderCorrectionWindowMicroseconds = 51, + +// +// Callbacks +// + + // On Steam, you may use the default Steam callback dispatch mechanism. If you prefer + // to not use this dispatch mechanism (or you are not running with Steam), or you want + // to associate specific functions with specific listen sockets or connections, you can + // register them as configuration values. + // + // Note also that ISteamNetworkingUtils has some helpers to set these globally. + + /// [connection FnSteamNetConnectionStatusChanged] Callback that will be invoked + /// when the state of a connection changes. + /// + /// IMPORTANT: callbacks are dispatched to the handler that is in effect at the time + /// the event occurs, which might be in another thread. For example, immediately after + /// creating a listen socket, you may receive an incoming connection. And then immediately + /// after this, the remote host may close the connection. All of this could happen + /// before the function to create the listen socket has returned. For this reason, + /// callbacks usually must be in effect at the time of object creation. This means + /// you should set them when you are creating the listen socket or connection, or have + /// them in effect so they will be inherited at the time of object creation. + /// + /// For example: + /// + /// exterm void MyStatusChangedFunc( SteamNetConnectionStatusChangedCallback_t *info ); + /// SteamNetworkingConfigValue_t opt; opt.SetPtr( k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged, MyStatusChangedFunc ); + /// SteamNetworkingIPAddr localAddress; localAddress.Clear(); + /// HSteamListenSocket hListenSock = SteamNetworkingSockets()->CreateListenSocketIP( localAddress, 1, &opt ); + /// + /// When accepting an incoming connection, there is no atomic way to switch the + /// callback. However, if the connection is DOA, AcceptConnection() will fail, and + /// you can fetch the state of the connection at that time. + /// + /// If all connections and listen sockets can use the same callback, the simplest + /// method is to set it globally before you create any listen sockets or connections. + k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged = 201, + + /// [global FnSteamNetAuthenticationStatusChanged] Callback that will be invoked + /// when our auth state changes. If you use this, install the callback before creating + /// any connections or listen sockets, and don't change it. + /// See: ISteamNetworkingUtils::SetGlobalCallback_SteamNetAuthenticationStatusChanged + k_ESteamNetworkingConfig_Callback_AuthStatusChanged = 202, + + /// [global FnSteamRelayNetworkStatusChanged] Callback that will be invoked + /// when our auth state changes. If you use this, install the callback before creating + /// any connections or listen sockets, and don't change it. + /// See: ISteamNetworkingUtils::SetGlobalCallback_SteamRelayNetworkStatusChanged + k_ESteamNetworkingConfig_Callback_RelayNetworkStatusChanged = 203, + + /// [global FnSteamNetworkingMessagesSessionRequest] Callback that will be invoked + /// when a peer wants to initiate a SteamNetworkingMessagesSessionRequest. + /// See: ISteamNetworkingUtils::SetGlobalCallback_MessagesSessionRequest + k_ESteamNetworkingConfig_Callback_MessagesSessionRequest = 204, + + /// [global FnSteamNetworkingMessagesSessionFailed] Callback that will be invoked + /// when a session you have initiated, or accepted either fails to connect, or loses + /// connection in some unexpected way. + /// See: ISteamNetworkingUtils::SetGlobalCallback_MessagesSessionFailed + k_ESteamNetworkingConfig_Callback_MessagesSessionFailed = 205, + + /// [global FnSteamNetworkingSocketsCreateConnectionSignaling] Callback that will + /// be invoked when we need to create a signaling object for a connection + /// initiated locally. See: ISteamNetworkingSockets::ConnectP2P, + /// ISteamNetworkingMessages. + k_ESteamNetworkingConfig_Callback_CreateConnectionSignaling = 206, + + /// [global FnSteamNetworkingFakeIPResult] Callback that's invoked when + /// a FakeIP allocation finishes. See: ISteamNetworkingSockets::BeginAsyncRequestFakeIP, + /// ISteamNetworkingUtils::SetGlobalCallback_FakeIPResult + k_ESteamNetworkingConfig_Callback_FakeIPResult = 207, + +// +// P2P connection settings +// + +// /// [listen socket int32] When you create a P2P listen socket, we will automatically +// /// open up a UDP port to listen for LAN connections. LAN connections can be made +// /// without any signaling: both sides can be disconnected from the Internet. +// /// +// /// This value can be set to zero to disable the feature. +// k_ESteamNetworkingConfig_P2P_Discovery_Server_LocalPort = 101, +// +// /// [connection int32] P2P connections can perform broadcasts looking for the peer +// /// on the LAN. +// k_ESteamNetworkingConfig_P2P_Discovery_Client_RemotePort = 102, + + /// [connection string] Comma-separated list of STUN servers that can be used + /// for NAT piercing. If you set this to an empty string, NAT piercing will + /// not be attempted. Also if "public" candidates are not allowed for + /// P2P_Transport_ICE_Enable, then this is ignored. + k_ESteamNetworkingConfig_P2P_STUN_ServerList = 103, + + /// [connection int32] What types of ICE candidates to share with the peer. + /// See k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_xxx values + k_ESteamNetworkingConfig_P2P_Transport_ICE_Enable = 104, + + /// [connection int32] When selecting P2P transport, add various + /// penalties to the scores for selected transports. (Route selection + /// scores are on a scale of milliseconds. The score begins with the + /// route ping time and is then adjusted.) + k_ESteamNetworkingConfig_P2P_Transport_ICE_Penalty = 105, + k_ESteamNetworkingConfig_P2P_Transport_SDR_Penalty = 106, + k_ESteamNetworkingConfig_P2P_TURN_ServerList = 107, + k_ESteamNetworkingConfig_P2P_TURN_UserList = 108, + k_ESteamNetworkingConfig_P2P_TURN_PassList = 109, + //k_ESteamNetworkingConfig_P2P_Transport_LANBeacon_Penalty = 107, + k_ESteamNetworkingConfig_P2P_Transport_ICE_Implementation = 110, + +// +// Settings for SDR relayed connections +// + + /// [global int32] If the first N pings to a port all fail, mark that port as unavailable for + /// a while, and try a different one. Some ISPs and routers may drop the first + /// packet, so setting this to 1 may greatly disrupt communications. + k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFailInitial = 19, + + /// [global int32] If N consecutive pings to a port fail, after having received successful + /// communication, mark that port as unavailable for a while, and try a + /// different one. + k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFail = 20, + + /// [global int32] Minimum number of lifetime pings we need to send, before we think our estimate + /// is solid. The first ping to each cluster is very often delayed because of NAT, + /// routers not having the best route, etc. Until we've sent a sufficient number + /// of pings, our estimate is often inaccurate. Keep pinging until we get this + /// many pings. + k_ESteamNetworkingConfig_SDRClient_MinPingsBeforePingAccurate = 21, + + /// [global int32] Set all steam datagram traffic to originate from the same + /// local port. By default, we open up a new UDP socket (on a different local + /// port) for each relay. This is slightly less optimal, but it works around + /// some routers that don't implement NAT properly. If you have intermittent + /// problems talking to relays that might be NAT related, try toggling + /// this flag + k_ESteamNetworkingConfig_SDRClient_SingleSocket = 22, + + /// [global string] Code of relay cluster to force use. If not empty, we will + /// only use relays in that cluster. E.g. 'iad' + k_ESteamNetworkingConfig_SDRClient_ForceRelayCluster = 29, + + /// [connection string] For development, a base-64 encoded ticket generated + /// using the cert tool. This can be used to connect to a gameserver via SDR + /// without a ticket generated using the game coordinator. (You will still + /// need a key that is trusted for your app, however.) + /// + /// This can also be passed using the SDR_DEVTICKET environment variable + k_ESteamNetworkingConfig_SDRClient_DevTicket = 30, + + /// [global string] For debugging. Override list of relays from the config with + /// this set (maybe just one). Comma-separated list. + k_ESteamNetworkingConfig_SDRClient_ForceProxyAddr = 31, + + /// [global string] For debugging. Force ping times to clusters to be the specified + /// values. A comma separated list of = values. E.g. "sto=32,iad=100" + /// + /// This is a dev configuration value, you probably should not let users modify it + /// in production. + k_ESteamNetworkingConfig_SDRClient_FakeClusterPing = 36, + + /// [global int32] When probing the SteamDatagram network, we limit exploration + /// to the closest N POPs, based on our current best approximated ping to that POP. + k_ESteamNetworkingConfig_SDRClient_LimitPingProbesToNearestN = 60, + +// +// Log levels for debugging information of various subsystems. +// Higher numeric values will cause more stuff to be printed. +// See ISteamNetworkingUtils::SetDebugOutputFunction for more +// information +// +// The default for all values is k_ESteamNetworkingSocketsDebugOutputType_Warning. +// + k_ESteamNetworkingConfig_LogLevel_AckRTT = 13, // [connection int32] RTT calculations for inline pings and replies + k_ESteamNetworkingConfig_LogLevel_PacketDecode = 14, // [connection int32] log SNP packets send/recv + k_ESteamNetworkingConfig_LogLevel_Message = 15, // [connection int32] log each message send/recv + k_ESteamNetworkingConfig_LogLevel_PacketGaps = 16, // [connection int32] dropped packets + k_ESteamNetworkingConfig_LogLevel_P2PRendezvous = 17, // [connection int32] P2P rendezvous messages + k_ESteamNetworkingConfig_LogLevel_SDRRelayPings = 18, // [global int32] Ping relays + + // Experimental. Set the ECN header field on all outbound UDP packets + // -1 = the default, and means "don't set anything". + // 0..3 = set that value. (Even though 0 is the default UDP ECN value, a 0 here means "explicitly set a 0".) + k_ESteamNetworkingConfig_ECN = 999, + + // Deleted, do not use + k_ESteamNetworkingConfig_DELETED_EnumerateDevVars = 35, + + k_ESteamNetworkingConfigValue__Force32Bit = 0x7fffffff +}; + +// Bitmask of types to share +const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Default = -1; // Special value - use user defaults +const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Disable = 0; // Do not do any ICE work at all or share any IP addresses with peer +const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Relay = 1; // Relayed connection via TURN server. +const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Private = 2; // host addresses that appear to be link-local or RFC1918 addresses +const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Public = 4; // STUN reflexive addresses, or host address that isn't a "private" address +const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_All = 0x7fffffff; + +/// In a few places we need to set configuration options on listen sockets and connections, and +/// have them take effect *before* the listen socket or connection really starts doing anything. +/// Creating the object and then setting the options "immediately" after creation doesn't work +/// completely, because network packets could be received between the time the object is created and +/// when the options are applied. To set options at creation time in a reliable way, they must be +/// passed to the creation function. This structure is used to pass those options. +/// +/// For the meaning of these fields, see ISteamNetworkingUtils::SetConfigValue. Basically +/// when the object is created, we just iterate over the list of options and call +/// ISteamNetworkingUtils::SetConfigValueStruct, where the scope arguments are supplied by the +/// object being created. +struct SteamNetworkingConfigValue_t +{ + /// Which option is being set + ESteamNetworkingConfigValue m_eValue; + + /// Which field below did you fill in? + ESteamNetworkingConfigDataType m_eDataType; + + /// Option value + union + { + int32_t m_int32; + int64_t m_int64; + float m_float; + const char *m_string; // Points to your '\0'-terminated buffer + void *m_ptr; + } m_val; + + // + // Shortcut helpers to set the type and value in a single call + // + inline void SetInt32( ESteamNetworkingConfigValue eVal, int32_t data ) + { + m_eValue = eVal; + m_eDataType = k_ESteamNetworkingConfig_Int32; + m_val.m_int32 = data; + } + inline void SetInt64( ESteamNetworkingConfigValue eVal, int64_t data ) + { + m_eValue = eVal; + m_eDataType = k_ESteamNetworkingConfig_Int64; + m_val.m_int64 = data; + } + inline void SetFloat( ESteamNetworkingConfigValue eVal, float data ) + { + m_eValue = eVal; + m_eDataType = k_ESteamNetworkingConfig_Float; + m_val.m_float = data; + } + inline void SetPtr( ESteamNetworkingConfigValue eVal, void *data ) + { + m_eValue = eVal; + m_eDataType = k_ESteamNetworkingConfig_Ptr; + m_val.m_ptr = data; + } + inline void SetString( ESteamNetworkingConfigValue eVal, const char *data ) // WARNING - Just saves your pointer. Does NOT make a copy of the string + { + m_eValue = eVal; + m_eDataType = k_ESteamNetworkingConfig_Ptr; + m_val.m_string = data; + } +}; + +/// Return value of ISteamNetworkintgUtils::GetConfigValue +enum ESteamNetworkingGetConfigValueResult +{ + k_ESteamNetworkingGetConfigValue_BadValue = -1, // No such configuration value + k_ESteamNetworkingGetConfigValue_BadScopeObj = -2, // Bad connection handle, etc + k_ESteamNetworkingGetConfigValue_BufferTooSmall = -3, // Couldn't fit the result in your buffer + k_ESteamNetworkingGetConfigValue_OK = 1, + k_ESteamNetworkingGetConfigValue_OKInherited = 2, // A value was not set at this level, but the effective (inherited) value was returned. + + k_ESteamNetworkingGetConfigValueResult__Force32Bit = 0x7fffffff +}; + +// +// Debug output +// + +/// Detail level for diagnostic output callback. +/// See ISteamNetworkingUtils::SetDebugOutputFunction +enum ESteamNetworkingSocketsDebugOutputType +{ + k_ESteamNetworkingSocketsDebugOutputType_None = 0, + k_ESteamNetworkingSocketsDebugOutputType_Bug = 1, // You used the API incorrectly, or an internal error happened + k_ESteamNetworkingSocketsDebugOutputType_Error = 2, // Run-time error condition that isn't the result of a bug. (E.g. we are offline, cannot bind a port, etc) + k_ESteamNetworkingSocketsDebugOutputType_Important = 3, // Nothing is wrong, but this is an important notification + k_ESteamNetworkingSocketsDebugOutputType_Warning = 4, + k_ESteamNetworkingSocketsDebugOutputType_Msg = 5, // Recommended amount + k_ESteamNetworkingSocketsDebugOutputType_Verbose = 6, // Quite a bit + k_ESteamNetworkingSocketsDebugOutputType_Debug = 7, // Practically everything + k_ESteamNetworkingSocketsDebugOutputType_Everything = 8, // Wall of text, detailed packet contents breakdown, etc + + k_ESteamNetworkingSocketsDebugOutputType__Force32Bit = 0x7fffffff +}; + +/// Setup callback for debug output, and the desired verbosity you want. +typedef void (*FSteamNetworkingSocketsDebugOutput)( ESteamNetworkingSocketsDebugOutputType nType, const char *pszMsg ); + +// +// Valve data centers +// + +/// Convert 3- or 4-character ID to 32-bit int. +inline SteamNetworkingPOPID CalculateSteamNetworkingPOPIDFromString( const char *pszCode ) +{ + // OK we made a bad decision when we decided how to pack 3-character codes into a uint32. We'd like to support + // 4-character codes, but we don't want to break compatibility. The migration path has some subtleties that make + // this nontrivial, and there are already some IDs stored in SQL. Ug, so the 4 character code "abcd" will + // be encoded with the digits like "0xddaabbcc". + // + // Also: we don't currently use 1- or 2-character codes, but if ever do in the future, let's make sure don't read + // past the end of the string and access uninitialized memory. (And if the string is empty, we always want + // to return 0 and not read bytes past the '\0'.) + // + // There is also extra paranoia to make sure the bytes are not treated as signed. + SteamNetworkingPOPID result = (uint32)(uint8)pszCode[0] << 16U; + if ( result && pszCode[1] ) + { + result |= ( (uint32)(uint8)pszCode[1] << 8U ); + if ( pszCode[2] ) + { + result |= (uint32)(uint8)pszCode[2] | ( (uint32)(uint8)pszCode[3] << 24U ); + } + } + return result; +} + +/// Unpack integer to string representation, including terminating '\0' +/// +/// See also SteamNetworkingPOPIDRender +template +inline void GetSteamNetworkingLocationPOPStringFromID( SteamNetworkingPOPID id, char (&szCode)[N] ) +{ + static_assert( N >= 5, "Fixed-size buffer not big enough to hold SDR POP ID" ); + szCode[0] = char( id >> 16U ); + szCode[1] = char( id >> 8U ); + szCode[2] = char( id ); + szCode[3] = char( id >> 24U ); // See comment above about deep regret and sadness + szCode[4] = 0; +} + +/// The POPID "dev" is used in non-production environments for testing. +const SteamNetworkingPOPID k_SteamDatagramPOPID_dev = ( (uint32)'d' << 16U ) | ( (uint32)'e' << 8U ) | (uint32)'v'; + +#ifndef API_GEN + +/// Utility class for printing a SteamNetworkingPOPID. +struct SteamNetworkingPOPIDRender +{ + SteamNetworkingPOPIDRender( SteamNetworkingPOPID x ) { GetSteamNetworkingLocationPOPStringFromID( x, buf ); } + inline const char *c_str() const { return buf; } +private: + char buf[ 8 ]; +}; + +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// Internal stuff +#ifndef API_GEN + +// For code compatibility +typedef SteamNetworkingMessage_t ISteamNetworkingMessage; +typedef SteamNetworkingErrMsg SteamDatagramErrMsg; + +inline void SteamNetworkingIPAddr::Clear() { memset( this, 0, sizeof(*this) ); } +inline bool SteamNetworkingIPAddr::IsIPv6AllZeros() const { const uint64 *q = (const uint64 *)m_ipv6; return q[0] == 0 && q[1] == 0; } +inline void SteamNetworkingIPAddr::SetIPv6( const uint8 *ipv6, uint16 nPort ) { memcpy( m_ipv6, ipv6, 16 ); m_port = nPort; } +inline void SteamNetworkingIPAddr::SetIPv4( uint32 nIP, uint16 nPort ) { m_ipv4.m_8zeros = 0; m_ipv4.m_0000 = 0; m_ipv4.m_ffff = 0xffff; m_ipv4.m_ip[0] = uint8(nIP>>24); m_ipv4.m_ip[1] = uint8(nIP>>16); m_ipv4.m_ip[2] = uint8(nIP>>8); m_ipv4.m_ip[3] = uint8(nIP); m_port = nPort; } +inline bool SteamNetworkingIPAddr::IsIPv4() const { return m_ipv4.m_8zeros == 0 && m_ipv4.m_0000 == 0 && m_ipv4.m_ffff == 0xffff; } +inline uint32 SteamNetworkingIPAddr::GetIPv4() const { return IsIPv4() ? ( (uint32(m_ipv4.m_ip[0])<<24) | (uint32(m_ipv4.m_ip[1])<<16) | (uint32(m_ipv4.m_ip[2])<<8) | uint32(m_ipv4.m_ip[3]) ) : 0; } +inline void SteamNetworkingIPAddr::SetIPv6LocalHost( uint16 nPort ) { m_ipv4.m_8zeros = 0; m_ipv4.m_0000 = 0; m_ipv4.m_ffff = 0; m_ipv6[12] = 0; m_ipv6[13] = 0; m_ipv6[14] = 0; m_ipv6[15] = 1; m_port = nPort; } +inline bool SteamNetworkingIPAddr::IsLocalHost() const { return ( m_ipv4.m_8zeros == 0 && m_ipv4.m_0000 == 0 && m_ipv4.m_ffff == 0 && m_ipv6[12] == 0 && m_ipv6[13] == 0 && m_ipv6[14] == 0 && m_ipv6[15] == 1 ) || ( GetIPv4() == 0x7f000001 ); } +inline bool SteamNetworkingIPAddr::operator==(const SteamNetworkingIPAddr &x ) const { return memcmp( this, &x, sizeof(SteamNetworkingIPAddr) ) == 0; } + +inline void SteamNetworkingIdentity::Clear() { memset( this, 0, sizeof(*this) ); } +inline bool SteamNetworkingIdentity::IsInvalid() const { return m_eType == k_ESteamNetworkingIdentityType_Invalid; } +inline void SteamNetworkingIdentity::SetSteamID( CSteamID steamID ) { SetSteamID64( steamID.ConvertToUint64() ); } +inline CSteamID SteamNetworkingIdentity::GetSteamID() const { return CSteamID( GetSteamID64() ); } +inline void SteamNetworkingIdentity::SetSteamID64( uint64 steamID ) { m_eType = k_ESteamNetworkingIdentityType_SteamID; m_cbSize = sizeof( m_steamID64 ); m_steamID64 = steamID; } +inline uint64 SteamNetworkingIdentity::GetSteamID64() const { return m_eType == k_ESteamNetworkingIdentityType_SteamID ? m_steamID64 : 0; } +inline bool SteamNetworkingIdentity::SetXboxPairwiseID( const char *pszString ) { size_t l = strlen( pszString ); if ( l < 1 || l >= sizeof(m_szXboxPairwiseID) ) return false; + m_eType = k_ESteamNetworkingIdentityType_XboxPairwiseID; m_cbSize = int(l+1); memcpy( m_szXboxPairwiseID, pszString, m_cbSize ); return true; } +inline const char *SteamNetworkingIdentity::GetXboxPairwiseID() const { return m_eType == k_ESteamNetworkingIdentityType_XboxPairwiseID ? m_szXboxPairwiseID : NULL; } +inline void SteamNetworkingIdentity::SetPSNID( uint64 id ) { m_eType = k_ESteamNetworkingIdentityType_SonyPSN; m_cbSize = sizeof( m_PSNID ); m_PSNID = id; } +inline uint64 SteamNetworkingIdentity::GetPSNID() const { return m_eType == k_ESteamNetworkingIdentityType_SonyPSN ? m_PSNID : 0; } +inline void SteamNetworkingIdentity::SetIPAddr( const SteamNetworkingIPAddr &addr ) { m_eType = k_ESteamNetworkingIdentityType_IPAddress; m_cbSize = (int)sizeof(m_ip); m_ip = addr; } +inline const SteamNetworkingIPAddr *SteamNetworkingIdentity::GetIPAddr() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress ? &m_ip : NULL; } +inline void SteamNetworkingIdentity::SetIPv4Addr( uint32 nIPv4, uint16 nPort ) { m_eType = k_ESteamNetworkingIdentityType_IPAddress; m_cbSize = (int)sizeof(m_ip); m_ip.SetIPv4( nIPv4, nPort ); } +inline uint32 SteamNetworkingIdentity::GetIPv4() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress ? m_ip.GetIPv4() : 0; } +inline ESteamNetworkingFakeIPType SteamNetworkingIdentity::GetFakeIPType() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress ? m_ip.GetFakeIPType() : k_ESteamNetworkingFakeIPType_Invalid; } +inline void SteamNetworkingIdentity::SetLocalHost() { m_eType = k_ESteamNetworkingIdentityType_IPAddress; m_cbSize = (int)sizeof(m_ip); m_ip.SetIPv6LocalHost(); } +inline bool SteamNetworkingIdentity::IsLocalHost() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress && m_ip.IsLocalHost(); } +inline bool SteamNetworkingIdentity::SetGenericString( const char *pszString ) { size_t l = strlen( pszString ); if ( l >= sizeof(m_szGenericString) ) return false; + m_eType = k_ESteamNetworkingIdentityType_GenericString; m_cbSize = int(l+1); memcpy( m_szGenericString, pszString, m_cbSize ); return true; } +inline const char *SteamNetworkingIdentity::GetGenericString() const { return m_eType == k_ESteamNetworkingIdentityType_GenericString ? m_szGenericString : NULL; } +inline bool SteamNetworkingIdentity::SetGenericBytes( const void *data, size_t cbLen ) { if ( cbLen > sizeof(m_genericBytes) ) return false; + m_eType = k_ESteamNetworkingIdentityType_GenericBytes; m_cbSize = int(cbLen); memcpy( m_genericBytes, data, m_cbSize ); return true; } +inline const uint8 *SteamNetworkingIdentity::GetGenericBytes( int &cbLen ) const { if ( m_eType != k_ESteamNetworkingIdentityType_GenericBytes ) return NULL; + cbLen = m_cbSize; return m_genericBytes; } +inline bool SteamNetworkingIdentity::operator==(const SteamNetworkingIdentity &x ) const { return m_eType == x.m_eType && m_cbSize == x.m_cbSize && memcmp( m_genericBytes, x.m_genericBytes, m_cbSize ) == 0; } +inline void SteamNetworkingMessage_t::Release() { (*m_pfnRelease)( this ); } + +#endif // #ifndef API_GEN + +#endif // #ifndef STEAMNETWORKINGTYPES diff --git a/external/steamworks/public/steam/steamps3params.h b/external/steamworks/public/steam/steamps3params.h new file mode 100644 index 0000000..c7a659d --- /dev/null +++ b/external/steamworks/public/steam/steamps3params.h @@ -0,0 +1,112 @@ +//====== Copyright 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: +// +//============================================================================= + +#ifndef STEAMPS3PARAMS_H +#define STEAMPS3PARAMS_H +#ifdef _WIN32 +#pragma once +#endif + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// PlayStation 3 initialization parameters +// +// The following structure must be passed to when loading steam_api_ps3.prx +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +#define STEAM_PS3_PATH_MAX 1055 +#define STEAM_PS3_SERVICE_ID_MAX 32 +#define STEAM_PS3_COMMUNICATION_ID_MAX 10 +#define STEAM_PS3_COMMUNICATION_SIG_MAX 160 +#define STEAM_PS3_LANGUAGE_MAX 64 +#define STEAM_PS3_REGION_CODE_MAX 16 +#define STEAM_PS3_CURRENT_PARAMS_VER 2 +struct SteamPS3Params_t +{ + uint32 m_unVersion; // set to STEAM_PS3_CURRENT_PARAMS_VER + + void *pReserved; + uint32 m_nAppId; // set to your game's appid + + char m_rgchInstallationPath[ STEAM_PS3_PATH_MAX ]; // directory containing latest steam prx's and sdata. Can be read only (BDVD) + char m_rgchSystemCache[ STEAM_PS3_PATH_MAX ]; // temp working cache, not persistent + char m_rgchGameData[ STEAM_PS3_PATH_MAX ]; // persistent game data path for storing user data + char m_rgchNpServiceID[ STEAM_PS3_SERVICE_ID_MAX ]; + char m_rgchNpCommunicationID[ STEAM_PS3_COMMUNICATION_ID_MAX ]; + char m_rgchNpCommunicationSig[ STEAM_PS3_COMMUNICATION_SIG_MAX ]; + + // Language should be one of the following. must be zero terminated + // danish + // dutch + // english + // finnish + // french + // german + // italian + // korean + // norwegian + // polish + // portuguese + // russian + // schinese + // spanish + // swedish + // tchinese + char m_rgchSteamLanguage[ STEAM_PS3_LANGUAGE_MAX ]; + + // region codes are "SCEA", "SCEE", "SCEJ". must be zero terminated + char m_rgchRegionCode[ STEAM_PS3_REGION_CODE_MAX ]; + + // Should be SYS_TTYP3 through SYS_TTYP10, if it's 0 then Steam won't spawn a + // thread to read console input at all. Using this let's you use Steam console commands + // like: profile_on, profile_off, profile_dump, mem_stats, mem_validate. + unsigned int m_cSteamInputTTY; + + struct Ps3netInit_t + { + bool m_bNeedInit; + void *m_pMemory; + int m_nMemorySize; + int m_flags; + } m_sysNetInitInfo; + + struct Ps3jpgInit_t + { + bool m_bNeedInit; + } m_sysJpgInitInfo; + + struct Ps3pngInit_t + { + bool m_bNeedInit; + } m_sysPngInitInfo; + + struct Ps3sysutilUserInfo_t + { + bool m_bNeedInit; + } m_sysSysUtilUserInfo; + + bool m_bIncludeNewsPage; +}; + + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// PlayStation 3 memory structure +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +#define STEAMPS3_MALLOC_INUSE 0x53D04A51 +#define STEAMPS3_MALLOC_SYSTEM 0x0D102C48 +#define STEAMPS3_MALLOC_OK 0xFFD04A51 +struct SteamPS3Memory_t +{ + bool m_bSingleAllocation; // If true, Steam will request one 6MB allocation and use the returned memory for all future allocations + // If false, Steam will make call malloc for each allocation + + // required function pointers + void* (*m_pfMalloc)(size_t); + void* (*m_pfRealloc)(void *, size_t); + void (*m_pfFree)(void *); + size_t (*m_pUsable_size)(void*); +}; + + +#endif // STEAMPS3PARAMS_H diff --git a/external/steamworks/public/steam/steamtypes.h b/external/steamworks/public/steam/steamtypes.h new file mode 100644 index 0000000..80a0ce3 --- /dev/null +++ b/external/steamworks/public/steam/steamtypes.h @@ -0,0 +1,178 @@ +//========= Copyright 1996-2022, Valve LLC, All rights reserved. ============ + +#ifndef STEAMTYPES_H +#define STEAMTYPES_H + +#define S_CALLTYPE __cdecl +// WARNING: __cdecl is potentially #defined away in steam_api_common.h + +// Steam-specific types. Defined here so this header file can be included in other code bases. +#ifndef WCHARTYPES_H +typedef unsigned char uint8; +#endif + +#ifdef __GNUC__ + #if __GNUC__ < 4 + #error "Steamworks requires GCC 4.X (4.2 or 4.4 have been tested)" + #endif +#endif + +#if defined(__LP64__) || defined(__x86_64__) || defined(_WIN64) || defined(__aarch64__) || defined(__s390x__) +#define X64BITS +#endif + +#if !defined(VALVE_BIG_ENDIAN) +#if defined( __GNUC__ ) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#define VALVE_BIG_ENDIAN 1 +#endif +#endif + +typedef unsigned char uint8; +typedef signed char int8; + +#if defined( _WIN32 ) && !defined( __GNUC__ ) + +typedef __int16 int16; +typedef unsigned __int16 uint16; +typedef __int32 int32; +typedef unsigned __int32 uint32; +typedef __int64 int64; +typedef unsigned __int64 uint64; + +typedef int64 lint64; +typedef uint64 ulint64; + +#ifdef X64BITS +typedef __int64 intp; // intp is an integer that can accomodate a pointer +typedef unsigned __int64 uintp; // (ie, sizeof(intp) >= sizeof(int) && sizeof(intp) >= sizeof(void *) +#else +typedef __int32 intp; +typedef unsigned __int32 uintp; +#endif + +#else // _WIN32 + +typedef short int16; +typedef unsigned short uint16; +typedef int int32; +typedef unsigned int uint32; +typedef long long int64; +typedef unsigned long long uint64; + +// [u]int64 are actually defined as 'long long' and gcc 64-bit +// doesn't automatically consider them the same as 'long int'. +// Changing the types for [u]int64 is complicated by +// there being many definitions, so we just +// define a 'long int' here and use it in places that would +// otherwise confuse the compiler. +typedef long int lint64; +typedef unsigned long int ulint64; + +#ifdef X64BITS +typedef long long intp; +typedef unsigned long long uintp; +#else +typedef int intp; +typedef unsigned int uintp; +#endif + +#endif // else _WIN32 + +typedef uint32 AppId_t; +const AppId_t k_uAppIdInvalid = 0x0; + +// AppIds and DepotIDs also presently share the same namespace +typedef uint32 DepotId_t; +const DepotId_t k_uDepotIdInvalid = 0x0; + +// RTime32. Seconds elapsed since Jan 1 1970, i.e. unix timestamp. +// It's the same as time_t, but it is always 32-bit and unsigned. +typedef uint32 RTime32; + +// handle to a Steam API call +typedef uint64 SteamAPICall_t; +const SteamAPICall_t k_uAPICallInvalid = 0x0; + +typedef uint32 AccountID_t; +const AccountID_t k_uAccountIdInvalid = 0; + +// Party Beacon ID +typedef uint64 PartyBeaconID_t; +const PartyBeaconID_t k_ulPartyBeaconIdInvalid = 0; + +enum ESteamIPType +{ + k_ESteamIPTypeIPv4 = 0, + k_ESteamIPTypeIPv6 = 1, +}; + +#pragma pack( push, 1 ) + +struct SteamIPAddress_t +{ + union { + + uint32 m_unIPv4; // Host order + uint8 m_rgubIPv6[16]; // Network order! Same as inaddr_in6. (0011:2233:4455:6677:8899:aabb:ccdd:eeff) + + // Internal use only + uint64 m_ipv6Qword[2]; // big endian + }; + + ESteamIPType m_eType; + + bool IsSet() const + { + if ( k_ESteamIPTypeIPv4 == m_eType ) + { + return m_unIPv4 != 0; + } + else + { + return m_ipv6Qword[0] !=0 || m_ipv6Qword[1] != 0; + } + } + + static SteamIPAddress_t IPv4Any() + { + SteamIPAddress_t ipOut; + ipOut.m_eType = k_ESteamIPTypeIPv4; + ipOut.m_unIPv4 = 0; + + return ipOut; + } + + static SteamIPAddress_t IPv6Any() + { + SteamIPAddress_t ipOut; + ipOut.m_eType = k_ESteamIPTypeIPv6; + ipOut.m_ipv6Qword[0] = 0; + ipOut.m_ipv6Qword[1] = 0; + + return ipOut; + } + + static SteamIPAddress_t IPv4Loopback() + { + SteamIPAddress_t ipOut; + ipOut.m_eType = k_ESteamIPTypeIPv4; + ipOut.m_unIPv4 = 0x7f000001; + + return ipOut; + } + + static SteamIPAddress_t IPv6Loopback() + { + SteamIPAddress_t ipOut; + ipOut.m_eType = k_ESteamIPTypeIPv6; + ipOut.m_ipv6Qword[0] = 0; + ipOut.m_ipv6Qword[1] = 0; + ipOut.m_rgubIPv6[15] = 1; + + return ipOut; + } +}; + +#pragma pack( pop ) + +#endif // STEAMTYPES_H diff --git a/external/steamworks/public/steam/steamuniverse.h b/external/steamworks/public/steam/steamuniverse.h new file mode 100644 index 0000000..2318935 --- /dev/null +++ b/external/steamworks/public/steam/steamuniverse.h @@ -0,0 +1,27 @@ +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +//============================================================================= + +#ifndef STEAMUNIVERSE_H +#define STEAMUNIVERSE_H +#ifdef _WIN32 +#pragma once +#endif + + +// Steam universes. Each universe is a self-contained Steam instance. +enum EUniverse +{ + k_EUniverseInvalid = 0, + k_EUniversePublic = 1, + k_EUniverseBeta = 2, + k_EUniverseInternal = 3, + k_EUniverseDev = 4, + // k_EUniverseRC = 5, // no such universe anymore + k_EUniverseMax +}; + + +#endif // STEAMUNIVERSE_H diff --git a/external/steamworks/redistributable_bin/linux32/libsteam_api.so b/external/steamworks/redistributable_bin/linux32/libsteam_api.so new file mode 100644 index 0000000..2d9e8a7 Binary files /dev/null and b/external/steamworks/redistributable_bin/linux32/libsteam_api.so differ diff --git a/external/steamworks/redistributable_bin/linux64/libsteam_api.so b/external/steamworks/redistributable_bin/linux64/libsteam_api.so new file mode 100644 index 0000000..8783570 Binary files /dev/null and b/external/steamworks/redistributable_bin/linux64/libsteam_api.so differ diff --git a/external/steamworks/redistributable_bin/osx/libsteam_api.dylib b/external/steamworks/redistributable_bin/osx/libsteam_api.dylib new file mode 100644 index 0000000..c493b2b Binary files /dev/null and b/external/steamworks/redistributable_bin/osx/libsteam_api.dylib differ diff --git a/external/steamworks/redistributable_bin/steam_api.dll b/external/steamworks/redistributable_bin/steam_api.dll new file mode 100644 index 0000000..2372ab1 Binary files /dev/null and b/external/steamworks/redistributable_bin/steam_api.dll differ diff --git a/external/steamworks/redistributable_bin/steam_api.lib b/external/steamworks/redistributable_bin/steam_api.lib new file mode 100644 index 0000000..4efd430 Binary files /dev/null and b/external/steamworks/redistributable_bin/steam_api.lib differ diff --git a/external/steamworks/redistributable_bin/win64/steam_api64.dll b/external/steamworks/redistributable_bin/win64/steam_api64.dll new file mode 100644 index 0000000..6d11825 Binary files /dev/null and b/external/steamworks/redistributable_bin/win64/steam_api64.dll differ diff --git a/external/steamworks/redistributable_bin/win64/steam_api64.lib b/external/steamworks/redistributable_bin/win64/steam_api64.lib new file mode 100644 index 0000000..1f1c623 Binary files /dev/null and b/external/steamworks/redistributable_bin/win64/steam_api64.lib differ diff --git a/external/steamworks/steamworksexample/BaseMenu.cpp b/external/steamworks/steamworksexample/BaseMenu.cpp new file mode 100644 index 0000000..8d64fe3 --- /dev/null +++ b/external/steamworks/steamworksexample/BaseMenu.cpp @@ -0,0 +1,16 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Base class for various game menu screens +// +// $NoKeywords: $ +//============================================================================= + + +#include "stdafx.h" +#include "BaseMenu.h" + +// Static data +HGAMEFONT g_hMenuFont = 0; +uint64 g_ulLastReturnKeyTick = 0; +uint64 g_ulLastKeyDownTick = 0; +uint64 g_ulLastKeyUpTick = 0; diff --git a/external/steamworks/steamworksexample/BaseMenu.h b/external/steamworks/steamworksexample/BaseMenu.h new file mode 100644 index 0000000..0a2be73 --- /dev/null +++ b/external/steamworks/steamworksexample/BaseMenu.h @@ -0,0 +1,248 @@ +//========= Copyright (c) 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Base class for various game menu screens +// +// $NoKeywords: $ +//============================================================================= + +#ifndef BASEMENU_H +#define BASEMENU_H + +#include +#include +#include "GameEngine.h" +#include "SpaceWar.h" +#include "SpaceWarClient.h" +#include "steam/isteamcontroller.h" + +#define MENU_FONT_HEIGHT 24 +#define MENU_ITEM_PADDING 12 + +extern HGAMEFONT g_hMenuFont; +extern uint64 g_ulLastReturnKeyTick; +extern uint64 g_ulLastKeyDownTick; +extern uint64 g_ulLastKeyUpTick; + +template class CBaseMenu +{ +public: + // Typedef for menu items + typedef std::pair MenuItem_t; + + // Constructor + CBaseMenu( IGameEngine *pGameEngine ) + { + m_pGameEngine = pGameEngine; + + m_uSelectedItem = 0; + m_bSelectionPushed = false; + + if ( !g_hMenuFont ) + { + g_hMenuFont = pGameEngine->HCreateFont( MENU_FONT_HEIGHT, FW_BOLD, false, "Arial" ); + if ( !g_hMenuFont ) + OutputDebugString( "Menu font was not created properly, text won't draw\n" ); + } + + } + + // Destructor + virtual ~CBaseMenu() { } + + // Sets a heading for the menu + void SetHeading( const char *pchHeading ) + { + m_sHeading = pchHeading; + } + + // Clear all menu entries + void ClearMenuItems() + { + m_VecMenuItems.clear(); + m_uSelectedItem = 0; + } + + // Add a menu item to the menu + void AddMenuItem( MenuItem_t item ) + { + m_VecMenuItems.push_back( item ); + } + + void PushSelectedItem() + { + if ( m_VecMenuItems.size() ) + { + m_bSelectionPushed = true; + m_selection = m_VecMenuItems[m_uSelectedItem].second; + } + } + + void PopSelectedItem() + { + if ( m_bSelectionPushed ) + { + m_bSelectionPushed = false; + + // find the item and set it as selected if it exists + for ( unsigned int i = 0; i < m_VecMenuItems.size(); i++ ) + { + if ( !memcmp( &m_VecMenuItems[i].second, &m_selection, sizeof( m_selection ) ) ) + { + m_uSelectedItem = i; + break; + } + } + } + } + + // Run a frame + render + void RunFrame() + { + // Note: The below code uses globals that are shared across all menus to avoid double + // key press registration, this is so that when you do something like hit return in the pause + // menu to "go back to main menu" you don't end up immediately registering a return in the + // main menu afterwards. + + // check if the enter key is down, if it is take action + if ( m_pGameEngine->BIsKeyDown( VK_RETURN ) || + m_pGameEngine->BIsControllerActionActive( eControllerDigitalAction_MenuSelect ) ) + { + uint64 ulCurrentTickCount = m_pGameEngine->GetGameTickCount(); + if ( ulCurrentTickCount - 220 > g_ulLastReturnKeyTick ) + { + g_ulLastReturnKeyTick = ulCurrentTickCount; + if ( m_uSelectedItem < m_VecMenuItems.size() ) + { + SpaceWarClient()->OnMenuSelection( m_VecMenuItems[m_uSelectedItem].second ); + return; + } + } + } + // Check if we need to change the selected menu item + else if ( m_pGameEngine->BIsKeyDown( VK_DOWN ) || + m_pGameEngine->BIsControllerActionActive( eControllerDigitalAction_MenuDown ) ) + { + uint64 ulCurrentTickCount = m_pGameEngine->GetGameTickCount(); + if ( ulCurrentTickCount - 140 > g_ulLastKeyDownTick ) + { + g_ulLastKeyDownTick = ulCurrentTickCount; + if ( m_uSelectedItem < m_VecMenuItems.size() - 1 ) + m_uSelectedItem++; + else + m_uSelectedItem = 0; + } + } + else if ( m_pGameEngine->BIsKeyDown( VK_UP ) || + m_pGameEngine->BIsControllerActionActive( eControllerDigitalAction_MenuUp ) ) + { + uint64 ulCurrentTickCount = m_pGameEngine->GetGameTickCount(); + if ( ulCurrentTickCount - 140 > g_ulLastKeyUpTick ) + { + g_ulLastKeyUpTick = ulCurrentTickCount; + if ( m_uSelectedItem > 0 ) + m_uSelectedItem--; + else + m_uSelectedItem = (uint32)m_VecMenuItems.size() - 1; + } + } + + Render(); + } + + // Render the menu + virtual void Render() + { + const int32 iMaxMenuItems = 14; + int32 iNumItems = (int32)m_VecMenuItems.size(); + uint32 uBoxHeight = MIN( iNumItems, iMaxMenuItems ) * ( MENU_FONT_HEIGHT + MENU_ITEM_PADDING ); + uint32 yPos = m_pGameEngine->GetViewportHeight()/2 - uBoxHeight/2; + + RECT rect; + rect.top = yPos; + rect.bottom = yPos + MENU_FONT_HEIGHT + MENU_ITEM_PADDING; + rect.left = 0; + rect.right = m_pGameEngine->GetViewportWidth(); + char rgchBuffer[256]; + + if ( m_sHeading.length() ) + { + DWORD dwColor = D3DCOLOR_ARGB( 255, 255, 128, 128 ); + RECT rectHeader; + rectHeader.top = 10; + rectHeader.bottom = rectHeader.top + MENU_FONT_HEIGHT + ( MENU_ITEM_PADDING * 2 ); + rectHeader.left = 0; + rectHeader.right = m_pGameEngine->GetViewportWidth(); + m_pGameEngine->BDrawString( g_hMenuFont, rectHeader, dwColor, TEXTPOS_CENTER|TEXTPOS_VCENTER, m_sHeading.c_str() ); + } + + int32 iStartItem = 0; + int32 iEndItem = iNumItems; + if ( iNumItems > iMaxMenuItems ) + { + iStartItem = MAX( (int32)m_uSelectedItem - iMaxMenuItems/2, 0 ); + iEndItem = MIN( iStartItem + iMaxMenuItems, iNumItems ); + } + + if ( iStartItem > 0 ) + { + // Draw ... Scroll Up ... + DWORD dwColor = D3DCOLOR_ARGB( 255, 255, 255, 255 ); + m_pGameEngine->BDrawString( g_hMenuFont, rect, dwColor, TEXTPOS_CENTER|TEXTPOS_VCENTER, "... Scroll Up ..." ); + + rect.top = rect.bottom; + rect.bottom += MENU_FONT_HEIGHT + MENU_ITEM_PADDING; + } + + for( int32 i=iStartItem; i 0 ) + { + DWORD dwColor; + if ( i == m_uSelectedItem ) + { + dwColor = D3DCOLOR_ARGB( 255, 25, 200, 25 ); + sprintf_safe( rgchBuffer, "{ %s }", m_VecMenuItems[i].first.c_str() ); + } + else + { + dwColor = D3DCOLOR_ARGB( 255, 255, 255, 255 ); + sprintf_safe( rgchBuffer, "%s", m_VecMenuItems[i].first.c_str() ); + } + m_pGameEngine->BDrawString( g_hMenuFont, rect, dwColor, TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer ); + } + + rect.top = rect.bottom; + rect.bottom += MENU_FONT_HEIGHT + MENU_ITEM_PADDING; + } + + if ( iNumItems > iEndItem ) + { + // Draw ... Scroll Down ... + DWORD dwColor = D3DCOLOR_ARGB( 255, 255, 255, 255 ); + m_pGameEngine->BDrawString( g_hMenuFont, rect, dwColor, TEXTPOS_CENTER|TEXTPOS_VCENTER, "... Scroll Down ..." ); + + rect.top = rect.bottom; + rect.bottom += MENU_FONT_HEIGHT + MENU_ITEM_PADDING; + } + } + +private: + // Game engine instance + IGameEngine *m_pGameEngine; + + // Heading + std::string m_sHeading; + + // Vector of menu options + std::vector< MenuItem_t > m_VecMenuItems; + + // Currently selected item index + uint32 m_uSelectedItem; + + // pushed selection + bool m_bSelectionPushed; + T m_selection; +}; + +#endif // MAINMENU_H diff --git a/external/steamworks/steamworksexample/D3D9VRDistort.cso b/external/steamworks/steamworksexample/D3D9VRDistort.cso new file mode 100644 index 0000000..789ccbc Binary files /dev/null and b/external/steamworks/steamworksexample/D3D9VRDistort.cso differ diff --git a/external/steamworks/steamworksexample/DejaVuSans.ttf b/external/steamworks/steamworksexample/DejaVuSans.ttf new file mode 100644 index 0000000..19ed0b4 Binary files /dev/null and b/external/steamworks/steamworksexample/DejaVuSans.ttf differ diff --git a/external/steamworks/steamworksexample/DejaVuSans.txt b/external/steamworks/steamworksexample/DejaVuSans.txt new file mode 100644 index 0000000..def12fa --- /dev/null +++ b/external/steamworks/steamworksexample/DejaVuSans.txt @@ -0,0 +1,58 @@ +This package was debianized by Peter Cernak on +Sun, 5 Sep 2004 17:10:26 +0200. + +It was downloaded from http://dejavu.sourceforge.net/ + +Upstream Authors: Stepan Roh (original author), + see /usr/share/doc/ttf-dejavu/AUTHORS for full list + +Copyright: + +Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. + +Bitstream Vera Fonts Copyright +------------------------------ + +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is +a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the fonts accompanying this license ("Fonts") and associated +documentation files (the "Font Software"), to reproduce and distribute the +Font Software, including without limitation the rights to use, copy, merge, +publish, distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to the +following conditions: + +The above copyright and trademark notices and this permission notice shall +be included in all copies of one or more of the Font Software typefaces. + +The Font Software may be modified, altered, or added to, and in particular +the designs of glyphs or characters in the Fonts may be modified and +additional glyphs or characters may be added to the Fonts, only if the fonts +are renamed to names not containing either the words "Bitstream" or the word +"Vera". + +This License becomes null and void to the extent applicable to Fonts or Font +Software that has been modified and is distributed under the "Bitstream +Vera" names. + +The Font Software may be sold as part of a larger software package but no +copy of one or more of the Font Software typefaces may be sold by itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME +FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING +ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE +FONT SOFTWARE. + +Except as contained in this notice, the names of Gnome, the Gnome +Foundation, and Bitstream Inc., shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this Font Software +without prior written authorization from the Gnome Foundation or Bitstream +Inc., respectively. For further information, contact: fonts at gnome dot +org. diff --git a/external/steamworks/steamworksexample/Friends.cpp b/external/steamworks/steamworksexample/Friends.cpp new file mode 100644 index 0000000..f2f87e3 --- /dev/null +++ b/external/steamworks/steamworksexample/Friends.cpp @@ -0,0 +1,168 @@ +//========= Copyright � 1996-2009, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for tracking friends list +// +//============================================================================= + +#include "stdafx.h" +#include "Friends.h" +#include "BaseMenu.h" +#include +#include +#include + + +//----------------------------------------------------------------------------- +// Purpose: Menu that shows your friends +//----------------------------------------------------------------------------- +class CFriendsListMenu : public CBaseMenu +{ + static const FriendsListMenuItem_t k_menuItemEmpty; + +public: + + //----------------------------------------------------------------------------- + // Purpose: Constructor + //----------------------------------------------------------------------------- + CFriendsListMenu( IGameEngine *pGameEngine ) : CBaseMenu( pGameEngine ) + { + + } + + //----------------------------------------------------------------------------- + // Purpose: Creates friends list menu + //----------------------------------------------------------------------------- + void Rebuild() + { + PushSelectedItem(); + ClearMenuItems(); + + AddMenuItem( CFriendsListMenu::MenuItem_t( "Friends List", k_menuItemEmpty ) ); + + // First add pending incoming requests + AddFriendsByFlag( k_EFriendFlagFriendshipRequested, "Incoming Friend Requests" ); + + // Add each Tag group and record the users with tags + std::vector vecTaggedSteamIDs; + int nFriendsGroups = SteamFriends()->GetFriendsGroupCount(); + for ( int iFG = 0; iFG < nFriendsGroups; iFG++ ) + { + FriendsGroupID_t friendsGroupID = SteamFriends()->GetFriendsGroupIDByIndex( iFG ); + if ( friendsGroupID == k_FriendsGroupID_Invalid ) + continue; + + int nFriendsGroupMemberCount = SteamFriends()->GetFriendsGroupMembersCount( friendsGroupID ); + if ( !nFriendsGroupMemberCount ) + continue; + + const char *pszFriendsGroupName = SteamFriends()->GetFriendsGroupName( friendsGroupID ); + if ( pszFriendsGroupName == NULL ) + pszFriendsGroupName = ""; + AddMenuItem( CFriendsListMenu::MenuItem_t( "", k_menuItemEmpty ) ); + AddMenuItem( CFriendsListMenu::MenuItem_t( pszFriendsGroupName, k_menuItemEmpty ) ); + + std::vector vecSteamIDMembers( nFriendsGroupMemberCount ); + SteamFriends()->GetFriendsGroupMembersList( friendsGroupID, &vecSteamIDMembers[0], nFriendsGroupMemberCount ); + for ( int iMember = 0; iMember < nFriendsGroupMemberCount; iMember++ ) + { + const CSteamID &steamIDMember = vecSteamIDMembers[iMember]; + AddFriendToMenu( steamIDMember ); + vecTaggedSteamIDs.push_back( steamIDMember ); + } + } + + // Add the "normal" Friends category, filtering out the ones with tags + AddFriendsByFlag( k_EFriendFlagImmediate, "Friends", &vecTaggedSteamIDs ); + + // Finally add the pending outgoing requests + AddFriendsByFlag( k_EFriendFlagRequestingFriendship, "Outgoing Friend Requests" ); + + PopSelectedItem(); + } + +private: + + void AddFriendsByFlag( int iFriendFlag, const char *pszName, std::vector *pVecIgnoredSteamIDs = NULL ) + { + int iFriendCount = SteamFriends()->GetFriendCount( iFriendFlag ); + if ( !iFriendCount ) + return; + + AddMenuItem( CFriendsListMenu::MenuItem_t( "", k_menuItemEmpty ) ); + AddMenuItem( CFriendsListMenu::MenuItem_t( pszName, k_menuItemEmpty ) ); + + for ( int iFriend = 0; iFriend < iFriendCount; iFriend++ ) + { + CSteamID steamIDFriend = SteamFriends()->GetFriendByIndex( iFriend, iFriendFlag ); + + // This mimicks the Steam client's feature where it only shows + // untagged friends in the canonical Friends section by default + if ( pVecIgnoredSteamIDs && ( std::find( pVecIgnoredSteamIDs->begin(), pVecIgnoredSteamIDs->end(), steamIDFriend ) != pVecIgnoredSteamIDs->end() ) ) + continue; + + AddFriendToMenu( steamIDFriend ); + } + } + + void AddFriendToMenu( CSteamID steamIDFriend ) + { + if ( !steamIDFriend.IsValid() ) + return; + + FriendsListMenuItem_t menuItemFriend = { steamIDFriend }; + + char szFriendNameBuffer[512] = { '\0' }; + + const char *pszFriendName = SteamFriends()->GetFriendPersonaName( steamIDFriend ); + sprintf_safe( szFriendNameBuffer, "%s", pszFriendName ); + + const char *pszFriendNickname = SteamFriends()->GetPlayerNickname( steamIDFriend ); + if ( pszFriendNickname ) + { + sprintf_safe( szFriendNameBuffer, "%s (%s)", szFriendNameBuffer, pszFriendNickname ); + } + + AddMenuItem( CFriendsListMenu::MenuItem_t( szFriendNameBuffer, menuItemFriend ) ); + } +}; + +const FriendsListMenuItem_t CFriendsListMenu::k_menuItemEmpty = { k_steamIDNil }; + + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CFriendsList::CFriendsList( IGameEngine *pGameEngine ) : m_pGameEngine( pGameEngine ) +{ + m_pFriendsListMenu = new CFriendsListMenu( pGameEngine ); + + Show(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Run a frame for the CFriendsList +//----------------------------------------------------------------------------- +void CFriendsList::RunFrame() +{ + m_pFriendsListMenu->RunFrame(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles menu actions when viewing a friends list +//----------------------------------------------------------------------------- +void CFriendsList::OnMenuSelection( FriendsListMenuItem_t selection ) +{ + // Do nothing (yet) +} + + +//----------------------------------------------------------------------------- +// Purpose: Shows / Refreshes the friends list +//----------------------------------------------------------------------------- +void CFriendsList::Show() +{ + m_pFriendsListMenu->Rebuild(); +} + diff --git a/external/steamworks/steamworksexample/Friends.h b/external/steamworks/steamworksexample/Friends.h new file mode 100644 index 0000000..b59510a --- /dev/null +++ b/external/steamworks/steamworksexample/Friends.h @@ -0,0 +1,40 @@ +//========= Copyright © 1996-2009, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for tracking friends list +// +//============================================================================= + +#ifndef FRIENDS_H +#define FRIENDS_H + +#include "SpaceWar.h" +#include "GameEngine.h" +#include "SpaceWarClient.h" + + +class CSpaceWarClient; +class CFriendsListMenu; + +class CFriendsList +{ +public: + // Constructor + CFriendsList( IGameEngine *pGameEngine ); + + // Run a frame + void RunFrame(); + + // shows / refreshes friends list + void Show(); + + // handles input from friends list menu + void OnMenuSelection( FriendsListMenuItem_t selection ); + +private: + // Engine + IGameEngine *m_pGameEngine; + + CFriendsListMenu *m_pFriendsListMenu; +}; + +#endif // FRIENDS_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/GL/glew.h b/external/steamworks/steamworksexample/GL/glew.h new file mode 100644 index 0000000..c9d3203 --- /dev/null +++ b/external/steamworks/steamworksexample/GL/glew.h @@ -0,0 +1,18062 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __glew_h__ +#define __glew_h__ +#define __GLEW_H__ + +#if defined(__gl_h_) || defined(__GL_H__) || defined(__X_GL_H) +#error gl.h included before glew.h +#endif +#if defined(__gl2_h_) +#error gl2.h included before glew.h +#endif +#if defined(__gltypes_h_) +#error gltypes.h included before glew.h +#endif +#if defined(__REGAL_H__) +#error Regal.h included before glew.h +#endif +#if defined(__glext_h_) || defined(__GLEXT_H_) +#error glext.h included before glew.h +#endif +#if defined(__gl_ATI_h_) +#error glATI.h included before glew.h +#endif + +#define __gl_h_ +#define __gl2_h_ +#define __GL_H__ +#define __gltypes_h_ +#define __REGAL_H__ +#define __X_GL_H +#define __glext_h_ +#define __GLEXT_H_ +#define __gl_ATI_h_ + +#if defined(_WIN32) + +/* + * GLEW does not include to avoid name space pollution. + * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t + * defined properly. + */ +/* */ +#ifndef APIENTRY +#define GLEW_APIENTRY_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define APIENTRY __stdcall +# elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) +# define APIENTRY __stdcall +# else +# define APIENTRY +# endif +#endif +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# endif +#endif +/* */ +#ifndef CALLBACK +#define GLEW_CALLBACK_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define CALLBACK __attribute__ ((__stdcall__)) +# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) +# define CALLBACK __stdcall +# else +# define CALLBACK +# endif +#endif +/* and */ +#ifndef WINGDIAPI +#define GLEW_WINGDIAPI_DEFINED +#define WINGDIAPI __declspec(dllimport) +#endif +/* */ +#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED) +typedef unsigned short wchar_t; +# define _WCHAR_T_DEFINED +#endif +/* */ +#if !defined(_W64) +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif +#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__) +# ifdef _WIN64 +typedef __int64 ptrdiff_t; +# else +typedef _W64 int ptrdiff_t; +# endif +# define _PTRDIFF_T_DEFINED +# define _PTRDIFF_T_ +#endif + +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# else +# define GLAPI WINGDIAPI +# endif +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY APIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY APIENTRY +#endif + +/* + * GLEW_STATIC is defined for static library. + * GLEW_BUILD is defined for building the DLL library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#else /* _UNIX */ + +/* + * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO + * C. On my system, this amounts to _3 lines_ of included code, all of + * them pretty much harmless. If you know of a way of detecting 32 vs + * 64 _targets_ at compile time you are free to replace this with + * something that's portable. For now, _this_ is the portable solution. + * (mem, 2004-01-04) + */ + +#include + +/* SGI MIPSPro doesn't like stdint.h in C++ mode */ +/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */ + +#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__) +#include +#else +#include +#endif + +#define GLEW_APIENTRY_DEFINED +#define APIENTRY + +/* + * GLEW_STATIC is defined for static library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# if defined(__GNUC__) && __GNUC__>=4 +# define GLEWAPI extern __attribute__ ((visibility("default"))) +# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# define GLEWAPI extern __global +# else +# define GLEWAPI extern +# endif +#endif + +/* */ +#ifndef GLAPI +#define GLAPI extern +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY +#endif + +#endif /* _WIN32 */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ----------------------------- GL_VERSION_1_1 ---------------------------- */ + +#ifndef GL_VERSION_1_1 +#define GL_VERSION_1_1 1 + +typedef unsigned int GLenum; +typedef unsigned int GLbitfield; +typedef unsigned int GLuint; +typedef int GLint; +typedef int GLsizei; +typedef unsigned char GLboolean; +typedef signed char GLbyte; +typedef short GLshort; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned long GLulong; +typedef float GLfloat; +typedef float GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void GLvoid; +#if defined(_MSC_VER) && _MSC_VER < 1400 +typedef __int64 GLint64EXT; +typedef unsigned __int64 GLuint64EXT; +#elif defined(_MSC_VER) || defined(__BORLANDC__) +typedef signed long long GLint64EXT; +typedef unsigned long long GLuint64EXT; +#else +# if defined(__MINGW32__) || defined(__CYGWIN__) +#include +# endif +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif +typedef GLint64EXT GLint64; +typedef GLuint64EXT GLuint64; +typedef struct __GLsync *GLsync; + +typedef char GLchar; + +#define GL_ZERO 0 +#define GL_FALSE 0 +#define GL_LOGIC_OP 0x0BF1 +#define GL_NONE 0 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_NO_ERROR 0 +#define GL_POINTS 0x0000 +#define GL_CURRENT_BIT 0x00000001 +#define GL_TRUE 1 +#define GL_ONE 1 +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_POINT_BIT 0x00000002 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_LINE_STRIP 0x0003 +#define GL_LINE_BIT 0x00000004 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON 0x0009 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM 0x0100 +#define GL_LOAD 0x0101 +#define GL_RETURN 0x0102 +#define GL_MULT 0x0103 +#define GL_ADD 0x0104 +#define GL_NEVER 0x0200 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_EXP 0x0800 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_EXP2 0x0801 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_RANGE 0x0B12 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_RANGE 0x0B22 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LIST_MODE 0x0B30 +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_SHADE_MODEL 0x0B54 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_FOG 0x0B60 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_NORMALIZE 0x0BA1 +#define GL_VIEWPORT 0x0BA2 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_DITHER 0x0BD0 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND 0x0BE2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_READ_BUFFER 0x0C02 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_INDEX_MODE 0x0C30 +#define GL_RGBA_MODE 0x0C31 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_RENDER_MODE 0x0C40 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_INDEX_BITS 0x0D51 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_COLOR_INDEX 0x1900 +#define GL_STENCIL_INDEX 0x1901 +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_BITMAP 0x1A00 +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_RENDER 0x1C00 +#define GL_FEEDBACK 0x1C01 +#define GL_SELECT 0x1C02 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_S 0x2000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_ENV 0x2300 +#define GL_EYE_LINEAR 0x2400 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_SPHERE_MAP 0x2402 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_PLANE 0x2502 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_CLAMP 0x2900 +#define GL_REPEAT 0x2901 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_R3_G3_B2 0x2A10 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 +#define GL_LIGHT0 0x4000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_HINT_BIT 0x00008000 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000fffff +#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff + +GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value); +GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref); +GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void GLAPIENTRY glArrayElement (GLint i); +GLAPI void GLAPIENTRY glBegin (GLenum mode); +GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture); +GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GLAPI void GLAPIENTRY glCallList (GLuint list); +GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists); +GLAPI void GLAPIENTRY glClear (GLbitfield mask); +GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GLAPI void GLAPIENTRY glClearDepth (GLclampd depth); +GLAPI void GLAPIENTRY glClearIndex (GLfloat c); +GLAPI void GLAPIENTRY glClearStencil (GLint s); +GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation); +GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue); +GLAPI void GLAPIENTRY glColor3iv (const GLint *v); +GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void GLAPIENTRY glColor3sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void GLAPIENTRY glColor3usv (const GLushort *v); +GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void GLAPIENTRY glColor4iv (const GLint *v); +GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); +GLAPI void GLAPIENTRY glColor4sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); +GLAPI void GLAPIENTRY glColor4usv (const GLushort *v); +GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glCullFace (GLenum mode); +GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range); +GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GLAPI void GLAPIENTRY glDepthFunc (GLenum func); +GLAPI void GLAPIENTRY glDepthMask (GLboolean flag); +GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar); +GLAPI void GLAPIENTRY glDisable (GLenum cap); +GLAPI void GLAPIENTRY glDisableClientState (GLenum array); +GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode); +GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); +GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag); +GLAPI void GLAPIENTRY glEnable (GLenum cap); +GLAPI void GLAPIENTRY glEnableClientState (GLenum array); +GLAPI void GLAPIENTRY glEnd (void); +GLAPI void GLAPIENTRY glEndList (void); +GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u); +GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u); +GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v); +GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v); +GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2); +GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +GLAPI void GLAPIENTRY glEvalPoint1 (GLint i); +GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j); +GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); +GLAPI void GLAPIENTRY glFinish (void); +GLAPI void GLAPIENTRY glFlush (void); +GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glFrontFace (GLenum mode); +GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range); +GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures); +GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation); +GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params); +GLAPI GLenum GLAPIENTRY glGetError (void); +GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v); +GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v); +GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v); +GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); +GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); +GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values); +GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, GLvoid* *params); +GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask); +GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name); +GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); +GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode); +GLAPI void GLAPIENTRY glIndexMask (GLuint mask); +GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glIndexd (GLdouble c); +GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c); +GLAPI void GLAPIENTRY glIndexf (GLfloat c); +GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c); +GLAPI void GLAPIENTRY glIndexi (GLint c); +GLAPI void GLAPIENTRY glIndexiv (const GLint *c); +GLAPI void GLAPIENTRY glIndexs (GLshort c); +GLAPI void GLAPIENTRY glIndexsv (const GLshort *c); +GLAPI void GLAPIENTRY glIndexub (GLubyte c); +GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c); +GLAPI void GLAPIENTRY glInitNames (void); +GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer); +GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap); +GLAPI GLboolean GLAPIENTRY glIsList (GLuint list); +GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture); +GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern); +GLAPI void GLAPIENTRY glLineWidth (GLfloat width); +GLAPI void GLAPIENTRY glListBase (GLuint base); +GLAPI void GLAPIENTRY glLoadIdentity (void); +GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glLoadName (GLuint name); +GLAPI void GLAPIENTRY glLogicOp (GLenum opcode); +GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); +GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); +GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glMatrixMode (GLenum mode); +GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode); +GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); +GLAPI void GLAPIENTRY glNormal3iv (const GLint *v); +GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); +GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v); +GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void GLAPIENTRY glPassThrough (GLfloat token); +GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); +GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); +GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); +GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor); +GLAPI void GLAPIENTRY glPointSize (GLfloat size); +GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask); +GLAPI void GLAPIENTRY glPopAttrib (void); +GLAPI void GLAPIENTRY glPopClientAttrib (void); +GLAPI void GLAPIENTRY glPopMatrix (void); +GLAPI void GLAPIENTRY glPopName (void); +GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); +GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushMatrix (void); +GLAPI void GLAPIENTRY glPushName (GLuint name); +GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v); +GLAPI void GLAPIENTRY glReadBuffer (GLenum mode); +GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); +GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2); +GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2); +GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2); +GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); +GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2); +GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode); +GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer); +GLAPI void GLAPIENTRY glShadeModel (GLenum mode); +GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GLAPI void GLAPIENTRY glStencilMask (GLuint mask); +GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s); +GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s); +GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord1i (GLint s); +GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord1s (GLshort s); +GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t); +GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t); +GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param); +GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glVertex2iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glVertex3iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) + +#endif /* GL_VERSION_1_1 */ + +/* ---------------------------------- GLU ---------------------------------- */ + +#ifndef GLEW_NO_GLU +/* this is where we can safely include GLU */ +# if defined(__APPLE__) && defined(__MACH__) +# include +# else +# include +# endif +#endif + +/* ----------------------------- GL_VERSION_1_2 ---------------------------- */ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 + +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E + +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); + +#define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D) +#define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements) +#define glTexImage3D GLEW_GET_FUN(__glewTexImage3D) +#define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D) + +#define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2) + +#endif /* GL_VERSION_1_2 */ + +/* ---------------------------- GL_VERSION_1_2_1 --------------------------- */ + +#ifndef GL_VERSION_1_2_1 +#define GL_VERSION_1_2_1 1 + +#define GLEW_VERSION_1_2_1 GLEW_GET_VAR(__GLEW_VERSION_1_2_1) + +#endif /* GL_VERSION_1_2_1 */ + +/* ----------------------------- GL_VERSION_1_3 ---------------------------- */ + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 + +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_SUBTRACT 0x84E7 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#define GL_MULTISAMPLE_BIT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLvoid *img); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); + +#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture) +#define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture) +#define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D) +#define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D) +#define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D) +#define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D) +#define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D) +#define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D) +#define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage) +#define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd) +#define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf) +#define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd) +#define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf) +#define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d) +#define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv) +#define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f) +#define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv) +#define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i) +#define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv) +#define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s) +#define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv) +#define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d) +#define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv) +#define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f) +#define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv) +#define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i) +#define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv) +#define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s) +#define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv) +#define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d) +#define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv) +#define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f) +#define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv) +#define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i) +#define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv) +#define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s) +#define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv) +#define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d) +#define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv) +#define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f) +#define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv) +#define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i) +#define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv) +#define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s) +#define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv) +#define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage) + +#define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3) + +#endif /* GL_VERSION_1_3 */ + +/* ----------------------------- GL_VERSION_1_4 ---------------------------- */ + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 + +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_COMPARE_R_TO_TEXTURE 0x884E + +typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p); + +#define glBlendColor GLEW_GET_FUN(__glewBlendColor) +#define glBlendEquation GLEW_GET_FUN(__glewBlendEquation) +#define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate) +#define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer) +#define glFogCoordd GLEW_GET_FUN(__glewFogCoordd) +#define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv) +#define glFogCoordf GLEW_GET_FUN(__glewFogCoordf) +#define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv) +#define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays) +#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements) +#define glPointParameterf GLEW_GET_FUN(__glewPointParameterf) +#define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv) +#define glPointParameteri GLEW_GET_FUN(__glewPointParameteri) +#define glPointParameteriv GLEW_GET_FUN(__glewPointParameteriv) +#define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b) +#define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv) +#define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d) +#define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv) +#define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f) +#define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv) +#define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i) +#define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv) +#define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s) +#define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv) +#define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub) +#define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv) +#define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui) +#define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv) +#define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us) +#define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv) +#define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer) +#define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d) +#define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv) +#define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f) +#define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv) +#define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i) +#define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv) +#define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s) +#define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv) +#define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d) +#define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv) +#define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f) +#define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv) +#define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i) +#define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv) +#define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s) +#define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv) + +#define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4) + +#endif /* GL_VERSION_1_4 */ + +/* ----------------------------- GL_VERSION_1_5 ---------------------------- */ + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 + +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 + +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id); +typedef GLvoid* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target); + +#define glBeginQuery GLEW_GET_FUN(__glewBeginQuery) +#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer) +#define glBufferData GLEW_GET_FUN(__glewBufferData) +#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData) +#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers) +#define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries) +#define glEndQuery GLEW_GET_FUN(__glewEndQuery) +#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers) +#define glGenQueries GLEW_GET_FUN(__glewGenQueries) +#define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv) +#define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv) +#define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData) +#define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv) +#define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv) +#define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv) +#define glIsBuffer GLEW_GET_FUN(__glewIsBuffer) +#define glIsQuery GLEW_GET_FUN(__glewIsQuery) +#define glMapBuffer GLEW_GET_FUN(__glewMapBuffer) +#define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer) + +#define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5) + +#endif /* GL_VERSION_1_5 */ + +/* ----------------------------- GL_VERSION_2_0 ---------------------------- */ + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 + +#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 + +typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum, GLenum); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source); +typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint, GLenum, GLvoid**); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint, GLenum, GLdouble*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint, GLenum, GLfloat*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint, GLenum, GLint*); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar** strings, const GLint* lengths); +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer); + +#define glAttachShader GLEW_GET_FUN(__glewAttachShader) +#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation) +#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate) +#define glCompileShader GLEW_GET_FUN(__glewCompileShader) +#define glCreateProgram GLEW_GET_FUN(__glewCreateProgram) +#define glCreateShader GLEW_GET_FUN(__glewCreateShader) +#define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram) +#define glDeleteShader GLEW_GET_FUN(__glewDeleteShader) +#define glDetachShader GLEW_GET_FUN(__glewDetachShader) +#define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray) +#define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers) +#define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray) +#define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib) +#define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform) +#define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders) +#define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation) +#define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog) +#define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv) +#define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog) +#define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource) +#define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv) +#define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation) +#define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv) +#define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv) +#define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv) +#define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv) +#define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv) +#define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv) +#define glIsProgram GLEW_GET_FUN(__glewIsProgram) +#define glIsShader GLEW_GET_FUN(__glewIsShader) +#define glLinkProgram GLEW_GET_FUN(__glewLinkProgram) +#define glShaderSource GLEW_GET_FUN(__glewShaderSource) +#define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate) +#define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate) +#define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate) +#define glUniform1f GLEW_GET_FUN(__glewUniform1f) +#define glUniform1fv GLEW_GET_FUN(__glewUniform1fv) +#define glUniform1i GLEW_GET_FUN(__glewUniform1i) +#define glUniform1iv GLEW_GET_FUN(__glewUniform1iv) +#define glUniform2f GLEW_GET_FUN(__glewUniform2f) +#define glUniform2fv GLEW_GET_FUN(__glewUniform2fv) +#define glUniform2i GLEW_GET_FUN(__glewUniform2i) +#define glUniform2iv GLEW_GET_FUN(__glewUniform2iv) +#define glUniform3f GLEW_GET_FUN(__glewUniform3f) +#define glUniform3fv GLEW_GET_FUN(__glewUniform3fv) +#define glUniform3i GLEW_GET_FUN(__glewUniform3i) +#define glUniform3iv GLEW_GET_FUN(__glewUniform3iv) +#define glUniform4f GLEW_GET_FUN(__glewUniform4f) +#define glUniform4fv GLEW_GET_FUN(__glewUniform4fv) +#define glUniform4i GLEW_GET_FUN(__glewUniform4i) +#define glUniform4iv GLEW_GET_FUN(__glewUniform4iv) +#define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv) +#define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv) +#define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv) +#define glUseProgram GLEW_GET_FUN(__glewUseProgram) +#define glValidateProgram GLEW_GET_FUN(__glewValidateProgram) +#define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d) +#define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv) +#define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f) +#define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv) +#define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s) +#define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv) +#define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d) +#define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv) +#define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f) +#define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv) +#define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s) +#define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv) +#define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d) +#define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv) +#define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f) +#define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv) +#define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s) +#define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv) +#define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv) +#define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv) +#define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv) +#define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub) +#define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv) +#define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv) +#define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv) +#define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv) +#define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d) +#define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv) +#define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f) +#define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv) +#define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv) +#define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s) +#define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv) +#define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv) +#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv) +#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv) +#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer) + +#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0) + +#endif /* GL_VERSION_2_0 */ + +/* ----------------------------- GL_VERSION_2_1 ---------------------------- */ + +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 + +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B + +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + +#define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv) +#define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv) +#define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv) +#define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv) +#define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv) +#define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv) + +#define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1) + +#endif /* GL_VERSION_2_1 */ + +/* ----------------------------- GL_VERSION_3_0 ---------------------------- */ + +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 + +#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES +#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 +#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 +#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 +#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB +#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 +#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 +#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 +#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_DEPTH_BUFFER 0x8223 +#define GL_STENCIL_BUFFER 0x8224 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_ALPHA_INTEGER 0x8D97 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint, GLenum); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum); +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint, GLuint, const GLchar*); +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum, GLenum); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum, GLint, GLfloat, GLint); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum, GLint, const GLfloat*); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum, GLint, const GLint*); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum, GLint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); +typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum, GLuint, GLboolean*); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint, const GLchar*); +typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum, GLenum, GLint*); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum, GLenum, GLuint*); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint, GLint, GLuint*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint, GLenum, GLint*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint, GLenum, GLuint*); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum, GLenum, const GLint*); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum, GLenum, const GLuint*); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint, GLsizei, const GLchar **, GLenum); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint, GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint, GLint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint, const GLbyte*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint, GLint, GLint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint, const GLshort*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint, const GLubyte*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint, GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint, const GLushort*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint, GLint, GLenum, GLsizei, const GLvoid*); + +#define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender) +#define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback) +#define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation) +#define glClampColor GLEW_GET_FUN(__glewClampColor) +#define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi) +#define glClearBufferfv GLEW_GET_FUN(__glewClearBufferfv) +#define glClearBufferiv GLEW_GET_FUN(__glewClearBufferiv) +#define glClearBufferuiv GLEW_GET_FUN(__glewClearBufferuiv) +#define glColorMaski GLEW_GET_FUN(__glewColorMaski) +#define glDisablei GLEW_GET_FUN(__glewDisablei) +#define glEnablei GLEW_GET_FUN(__glewEnablei) +#define glEndConditionalRender GLEW_GET_FUN(__glewEndConditionalRender) +#define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback) +#define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v) +#define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation) +#define glGetStringi GLEW_GET_FUN(__glewGetStringi) +#define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv) +#define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv) +#define glGetTransformFeedbackVarying GLEW_GET_FUN(__glewGetTransformFeedbackVarying) +#define glGetUniformuiv GLEW_GET_FUN(__glewGetUniformuiv) +#define glGetVertexAttribIiv GLEW_GET_FUN(__glewGetVertexAttribIiv) +#define glGetVertexAttribIuiv GLEW_GET_FUN(__glewGetVertexAttribIuiv) +#define glIsEnabledi GLEW_GET_FUN(__glewIsEnabledi) +#define glTexParameterIiv GLEW_GET_FUN(__glewTexParameterIiv) +#define glTexParameterIuiv GLEW_GET_FUN(__glewTexParameterIuiv) +#define glTransformFeedbackVaryings GLEW_GET_FUN(__glewTransformFeedbackVaryings) +#define glUniform1ui GLEW_GET_FUN(__glewUniform1ui) +#define glUniform1uiv GLEW_GET_FUN(__glewUniform1uiv) +#define glUniform2ui GLEW_GET_FUN(__glewUniform2ui) +#define glUniform2uiv GLEW_GET_FUN(__glewUniform2uiv) +#define glUniform3ui GLEW_GET_FUN(__glewUniform3ui) +#define glUniform3uiv GLEW_GET_FUN(__glewUniform3uiv) +#define glUniform4ui GLEW_GET_FUN(__glewUniform4ui) +#define glUniform4uiv GLEW_GET_FUN(__glewUniform4uiv) +#define glVertexAttribI1i GLEW_GET_FUN(__glewVertexAttribI1i) +#define glVertexAttribI1iv GLEW_GET_FUN(__glewVertexAttribI1iv) +#define glVertexAttribI1ui GLEW_GET_FUN(__glewVertexAttribI1ui) +#define glVertexAttribI1uiv GLEW_GET_FUN(__glewVertexAttribI1uiv) +#define glVertexAttribI2i GLEW_GET_FUN(__glewVertexAttribI2i) +#define glVertexAttribI2iv GLEW_GET_FUN(__glewVertexAttribI2iv) +#define glVertexAttribI2ui GLEW_GET_FUN(__glewVertexAttribI2ui) +#define glVertexAttribI2uiv GLEW_GET_FUN(__glewVertexAttribI2uiv) +#define glVertexAttribI3i GLEW_GET_FUN(__glewVertexAttribI3i) +#define glVertexAttribI3iv GLEW_GET_FUN(__glewVertexAttribI3iv) +#define glVertexAttribI3ui GLEW_GET_FUN(__glewVertexAttribI3ui) +#define glVertexAttribI3uiv GLEW_GET_FUN(__glewVertexAttribI3uiv) +#define glVertexAttribI4bv GLEW_GET_FUN(__glewVertexAttribI4bv) +#define glVertexAttribI4i GLEW_GET_FUN(__glewVertexAttribI4i) +#define glVertexAttribI4iv GLEW_GET_FUN(__glewVertexAttribI4iv) +#define glVertexAttribI4sv GLEW_GET_FUN(__glewVertexAttribI4sv) +#define glVertexAttribI4ubv GLEW_GET_FUN(__glewVertexAttribI4ubv) +#define glVertexAttribI4ui GLEW_GET_FUN(__glewVertexAttribI4ui) +#define glVertexAttribI4uiv GLEW_GET_FUN(__glewVertexAttribI4uiv) +#define glVertexAttribI4usv GLEW_GET_FUN(__glewVertexAttribI4usv) +#define glVertexAttribIPointer GLEW_GET_FUN(__glewVertexAttribIPointer) + +#define GLEW_VERSION_3_0 GLEW_GET_VAR(__GLEW_VERSION_3_0) + +#endif /* GL_VERSION_3_0 */ + +/* ----------------------------- GL_VERSION_3_1 ---------------------------- */ + +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 + +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum, GLint, GLsizei, GLsizei); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum, GLsizei, GLenum, const GLvoid*, GLsizei); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum, GLenum, GLuint); + +#define glDrawArraysInstanced GLEW_GET_FUN(__glewDrawArraysInstanced) +#define glDrawElementsInstanced GLEW_GET_FUN(__glewDrawElementsInstanced) +#define glPrimitiveRestartIndex GLEW_GET_FUN(__glewPrimitiveRestartIndex) +#define glTexBuffer GLEW_GET_FUN(__glewTexBuffer) + +#define GLEW_VERSION_3_1 GLEW_GET_VAR(__GLEW_VERSION_3_1) + +#endif /* GL_VERSION_3_1 */ + +/* ----------------------------- GL_VERSION_3_2 ---------------------------- */ + +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 + +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum, GLenum, GLuint, GLint); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum, GLenum, GLint64 *); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum, GLuint, GLint64 *); + +#define glFramebufferTexture GLEW_GET_FUN(__glewFramebufferTexture) +#define glGetBufferParameteri64v GLEW_GET_FUN(__glewGetBufferParameteri64v) +#define glGetInteger64i_v GLEW_GET_FUN(__glewGetInteger64i_v) + +#define GLEW_VERSION_3_2 GLEW_GET_VAR(__GLEW_VERSION_3_2) + +#endif /* GL_VERSION_3_2 */ + +/* ----------------------------- GL_VERSION_3_3 ---------------------------- */ + +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +#define GL_RGB10_A2UI 0x906F + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisor GLEW_GET_FUN(__glewVertexAttribDivisor) + +#define GLEW_VERSION_3_3 GLEW_GET_VAR(__GLEW_VERSION_3_3) + +#endif /* GL_VERSION_3_3 */ + +/* ----------------------------- GL_VERSION_4_0 ---------------------------- */ + +#ifndef GL_VERSION_4_0 +#define GL_VERSION_4_0 1 + +#define GL_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value); + +#define glBlendEquationSeparatei GLEW_GET_FUN(__glewBlendEquationSeparatei) +#define glBlendEquationi GLEW_GET_FUN(__glewBlendEquationi) +#define glBlendFuncSeparatei GLEW_GET_FUN(__glewBlendFuncSeparatei) +#define glBlendFunci GLEW_GET_FUN(__glewBlendFunci) +#define glMinSampleShading GLEW_GET_FUN(__glewMinSampleShading) + +#define GLEW_VERSION_4_0 GLEW_GET_VAR(__GLEW_VERSION_4_0) + +#endif /* GL_VERSION_4_0 */ + +/* ----------------------------- GL_VERSION_4_1 ---------------------------- */ + +#ifndef GL_VERSION_4_1 +#define GL_VERSION_4_1 1 + +#define GLEW_VERSION_4_1 GLEW_GET_VAR(__GLEW_VERSION_4_1) + +#endif /* GL_VERSION_4_1 */ + +/* ----------------------------- GL_VERSION_4_2 ---------------------------- */ + +#ifndef GL_VERSION_4_2 +#define GL_VERSION_4_2 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F + +#define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2) + +#endif /* GL_VERSION_4_2 */ + +/* ----------------------------- GL_VERSION_4_3 ---------------------------- */ + +#ifndef GL_VERSION_4_3 +#define GL_VERSION_4_3 1 + +#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 +#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E + +#define GLEW_VERSION_4_3 GLEW_GET_VAR(__GLEW_VERSION_4_3) + +#endif /* GL_VERSION_4_3 */ + +/* ----------------------------- GL_VERSION_4_4 ---------------------------- */ + +#ifndef GL_VERSION_4_4 +#define GL_VERSION_4_4 1 + +#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 + +#define GLEW_VERSION_4_4 GLEW_GET_VAR(__GLEW_VERSION_4_4) + +#endif /* GL_VERSION_4_4 */ + +/* -------------------------- GL_3DFX_multisample -------------------------- */ + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 + +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 + +#define GLEW_3DFX_multisample GLEW_GET_VAR(__GLEW_3DFX_multisample) + +#endif /* GL_3DFX_multisample */ + +/* ---------------------------- GL_3DFX_tbuffer ---------------------------- */ + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 + +typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); + +#define glTbufferMask3DFX GLEW_GET_FUN(__glewTbufferMask3DFX) + +#define GLEW_3DFX_tbuffer GLEW_GET_VAR(__GLEW_3DFX_tbuffer) + +#endif /* GL_3DFX_tbuffer */ + +/* -------------------- GL_3DFX_texture_compression_FXT1 ------------------- */ + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 + +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 + +#define GLEW_3DFX_texture_compression_FXT1 GLEW_GET_VAR(__GLEW_3DFX_texture_compression_FXT1) + +#endif /* GL_3DFX_texture_compression_FXT1 */ + +/* ----------------------- GL_AMD_blend_minmax_factor ---------------------- */ + +#ifndef GL_AMD_blend_minmax_factor +#define GL_AMD_blend_minmax_factor 1 + +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D + +#define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor) + +#endif /* GL_AMD_blend_minmax_factor */ + +/* ----------------------- GL_AMD_conservative_depth ----------------------- */ + +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 + +#define GLEW_AMD_conservative_depth GLEW_GET_VAR(__GLEW_AMD_conservative_depth) + +#endif /* GL_AMD_conservative_depth */ + +/* -------------------------- GL_AMD_debug_output -------------------------- */ + +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 + +#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 + +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, GLvoid *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); + +#define glDebugMessageCallbackAMD GLEW_GET_FUN(__glewDebugMessageCallbackAMD) +#define glDebugMessageEnableAMD GLEW_GET_FUN(__glewDebugMessageEnableAMD) +#define glDebugMessageInsertAMD GLEW_GET_FUN(__glewDebugMessageInsertAMD) +#define glGetDebugMessageLogAMD GLEW_GET_FUN(__glewGetDebugMessageLogAMD) + +#define GLEW_AMD_debug_output GLEW_GET_VAR(__GLEW_AMD_debug_output) + +#endif /* GL_AMD_debug_output */ + +/* ---------------------- GL_AMD_depth_clamp_separate ---------------------- */ + +#ifndef GL_AMD_depth_clamp_separate +#define GL_AMD_depth_clamp_separate 1 + +#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E +#define GL_DEPTH_CLAMP_FAR_AMD 0x901F + +#define GLEW_AMD_depth_clamp_separate GLEW_GET_VAR(__GLEW_AMD_depth_clamp_separate) + +#endif /* GL_AMD_depth_clamp_separate */ + +/* ----------------------- GL_AMD_draw_buffers_blend ----------------------- */ + +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); + +#define glBlendEquationIndexedAMD GLEW_GET_FUN(__glewBlendEquationIndexedAMD) +#define glBlendEquationSeparateIndexedAMD GLEW_GET_FUN(__glewBlendEquationSeparateIndexedAMD) +#define glBlendFuncIndexedAMD GLEW_GET_FUN(__glewBlendFuncIndexedAMD) +#define glBlendFuncSeparateIndexedAMD GLEW_GET_FUN(__glewBlendFuncSeparateIndexedAMD) + +#define GLEW_AMD_draw_buffers_blend GLEW_GET_VAR(__GLEW_AMD_draw_buffers_blend) + +#endif /* GL_AMD_draw_buffers_blend */ + +/* ---------------------- GL_AMD_interleaved_elements ---------------------- */ + +#ifndef GL_AMD_interleaved_elements +#define GL_AMD_interleaved_elements 1 + +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RG8UI 0x8238 +#define GL_RG16UI 0x823A +#define GL_RGBA8UI 0x8D7C +#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 +#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param); + +#define glVertexAttribParameteriAMD GLEW_GET_FUN(__glewVertexAttribParameteriAMD) + +#define GLEW_AMD_interleaved_elements GLEW_GET_VAR(__GLEW_AMD_interleaved_elements) + +#endif /* GL_AMD_interleaved_elements */ + +/* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */ + +#ifndef GL_AMD_multi_draw_indirect +#define GL_AMD_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD) +#define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD) + +#define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect) + +#endif /* GL_AMD_multi_draw_indirect */ + +/* ------------------------- GL_AMD_name_gen_delete ------------------------ */ + +#ifndef GL_AMD_name_gen_delete +#define GL_AMD_name_gen_delete 1 + +#define GL_DATA_BUFFER_AMD 0x9151 +#define GL_PERFORMANCE_MONITOR_AMD 0x9152 +#define GL_QUERY_OBJECT_AMD 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 +#define GL_SAMPLER_OBJECT_AMD 0x9155 + +typedef void (GLAPIENTRY * PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint* names); +typedef void (GLAPIENTRY * PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint* names); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); + +#define glDeleteNamesAMD GLEW_GET_FUN(__glewDeleteNamesAMD) +#define glGenNamesAMD GLEW_GET_FUN(__glewGenNamesAMD) +#define glIsNameAMD GLEW_GET_FUN(__glewIsNameAMD) + +#define GLEW_AMD_name_gen_delete GLEW_GET_VAR(__GLEW_AMD_name_gen_delete) + +#endif /* GL_AMD_name_gen_delete */ + +/* ----------------------- GL_AMD_performance_monitor ---------------------- */ + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 + +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 + +typedef void (GLAPIENTRY * PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar *counterString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei* length, GLchar *groupString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint* numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList); + +#define glBeginPerfMonitorAMD GLEW_GET_FUN(__glewBeginPerfMonitorAMD) +#define glDeletePerfMonitorsAMD GLEW_GET_FUN(__glewDeletePerfMonitorsAMD) +#define glEndPerfMonitorAMD GLEW_GET_FUN(__glewEndPerfMonitorAMD) +#define glGenPerfMonitorsAMD GLEW_GET_FUN(__glewGenPerfMonitorsAMD) +#define glGetPerfMonitorCounterDataAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterDataAMD) +#define glGetPerfMonitorCounterInfoAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterInfoAMD) +#define glGetPerfMonitorCounterStringAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterStringAMD) +#define glGetPerfMonitorCountersAMD GLEW_GET_FUN(__glewGetPerfMonitorCountersAMD) +#define glGetPerfMonitorGroupStringAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupStringAMD) +#define glGetPerfMonitorGroupsAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupsAMD) +#define glSelectPerfMonitorCountersAMD GLEW_GET_FUN(__glewSelectPerfMonitorCountersAMD) + +#define GLEW_AMD_performance_monitor GLEW_GET_VAR(__GLEW_AMD_performance_monitor) + +#endif /* GL_AMD_performance_monitor */ + +/* -------------------------- GL_AMD_pinned_memory ------------------------- */ + +#ifndef GL_AMD_pinned_memory +#define GL_AMD_pinned_memory 1 + +#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 + +#define GLEW_AMD_pinned_memory GLEW_GET_VAR(__GLEW_AMD_pinned_memory) + +#endif /* GL_AMD_pinned_memory */ + +/* ----------------------- GL_AMD_query_buffer_object ---------------------- */ + +#ifndef GL_AMD_query_buffer_object +#define GL_AMD_query_buffer_object 1 + +#define GL_QUERY_BUFFER_AMD 0x9192 +#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 +#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 + +#define GLEW_AMD_query_buffer_object GLEW_GET_VAR(__GLEW_AMD_query_buffer_object) + +#endif /* GL_AMD_query_buffer_object */ + +/* ------------------------ GL_AMD_sample_positions ------------------------ */ + +#ifndef GL_AMD_sample_positions +#define GL_AMD_sample_positions 1 + +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F + +typedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val); + +#define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD) + +#define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions) + +#endif /* GL_AMD_sample_positions */ + +/* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB 0x884F + +#define GLEW_AMD_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_AMD_seamless_cubemap_per_texture) + +#endif /* GL_AMD_seamless_cubemap_per_texture */ + +/* ---------------------- GL_AMD_shader_stencil_export --------------------- */ + +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 + +#define GLEW_AMD_shader_stencil_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_export) + +#endif /* GL_AMD_shader_stencil_export */ + +/* ---------------------- GL_AMD_shader_trinary_minmax --------------------- */ + +#ifndef GL_AMD_shader_trinary_minmax +#define GL_AMD_shader_trinary_minmax 1 + +#define GLEW_AMD_shader_trinary_minmax GLEW_GET_VAR(__GLEW_AMD_shader_trinary_minmax) + +#endif /* GL_AMD_shader_trinary_minmax */ + +/* ------------------------- GL_AMD_sparse_texture ------------------------- */ + +#ifndef GL_AMD_sparse_texture +#define GL_AMD_sparse_texture 1 + +#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 +#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A +#define GL_MIN_SPARSE_LEVEL_AMD 0x919B +#define GL_MIN_LOD_WARNING_AMD 0x919C + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); + +#define glTexStorageSparseAMD GLEW_GET_FUN(__glewTexStorageSparseAMD) +#define glTextureStorageSparseAMD GLEW_GET_FUN(__glewTextureStorageSparseAMD) + +#define GLEW_AMD_sparse_texture GLEW_GET_VAR(__GLEW_AMD_sparse_texture) + +#endif /* GL_AMD_sparse_texture */ + +/* ------------------- GL_AMD_stencil_operation_extended ------------------- */ + +#ifndef GL_AMD_stencil_operation_extended +#define GL_AMD_stencil_operation_extended 1 + +#define GL_SET_AMD 0x874A +#define GL_REPLACE_VALUE_AMD 0x874B +#define GL_STENCIL_OP_VALUE_AMD 0x874C +#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D + +typedef void (GLAPIENTRY * PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); + +#define glStencilOpValueAMD GLEW_GET_FUN(__glewStencilOpValueAMD) + +#define GLEW_AMD_stencil_operation_extended GLEW_GET_VAR(__GLEW_AMD_stencil_operation_extended) + +#endif /* GL_AMD_stencil_operation_extended */ + +/* ------------------------ GL_AMD_texture_texture4 ------------------------ */ + +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 + +#define GLEW_AMD_texture_texture4 GLEW_GET_VAR(__GLEW_AMD_texture_texture4) + +#endif /* GL_AMD_texture_texture4 */ + +/* --------------- GL_AMD_transform_feedback3_lines_triangles -------------- */ + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 + +#define GLEW_AMD_transform_feedback3_lines_triangles GLEW_GET_VAR(__GLEW_AMD_transform_feedback3_lines_triangles) + +#endif /* GL_AMD_transform_feedback3_lines_triangles */ + +/* ----------------------- GL_AMD_vertex_shader_layer ---------------------- */ + +#ifndef GL_AMD_vertex_shader_layer +#define GL_AMD_vertex_shader_layer 1 + +#define GLEW_AMD_vertex_shader_layer GLEW_GET_VAR(__GLEW_AMD_vertex_shader_layer) + +#endif /* GL_AMD_vertex_shader_layer */ + +/* -------------------- GL_AMD_vertex_shader_tessellator ------------------- */ + +#ifndef GL_AMD_vertex_shader_tessellator +#define GL_AMD_vertex_shader_tessellator 1 + +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 + +typedef void (GLAPIENTRY * PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); + +#define glTessellationFactorAMD GLEW_GET_FUN(__glewTessellationFactorAMD) +#define glTessellationModeAMD GLEW_GET_FUN(__glewTessellationModeAMD) + +#define GLEW_AMD_vertex_shader_tessellator GLEW_GET_VAR(__GLEW_AMD_vertex_shader_tessellator) + +#endif /* GL_AMD_vertex_shader_tessellator */ + +/* ------------------ GL_AMD_vertex_shader_viewport_index ------------------ */ + +#ifndef GL_AMD_vertex_shader_viewport_index +#define GL_AMD_vertex_shader_viewport_index 1 + +#define GLEW_AMD_vertex_shader_viewport_index GLEW_GET_VAR(__GLEW_AMD_vertex_shader_viewport_index) + +#endif /* GL_AMD_vertex_shader_viewport_index */ + +/* ------------------------- GL_ANGLE_depth_texture ------------------------ */ + +#ifndef GL_ANGLE_depth_texture +#define GL_ANGLE_depth_texture 1 + +#define GLEW_ANGLE_depth_texture GLEW_GET_VAR(__GLEW_ANGLE_depth_texture) + +#endif /* GL_ANGLE_depth_texture */ + +/* ----------------------- GL_ANGLE_framebuffer_blit ----------------------- */ + +#ifndef GL_ANGLE_framebuffer_blit +#define GL_ANGLE_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferANGLE GLEW_GET_FUN(__glewBlitFramebufferANGLE) + +#define GLEW_ANGLE_framebuffer_blit GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_blit) + +#endif /* GL_ANGLE_framebuffer_blit */ + +/* -------------------- GL_ANGLE_framebuffer_multisample ------------------- */ + +#ifndef GL_ANGLE_framebuffer_multisample +#define GL_ANGLE_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 +#define GL_MAX_SAMPLES_ANGLE 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleANGLE GLEW_GET_FUN(__glewRenderbufferStorageMultisampleANGLE) + +#define GLEW_ANGLE_framebuffer_multisample GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_multisample) + +#endif /* GL_ANGLE_framebuffer_multisample */ + +/* ----------------------- GL_ANGLE_instanced_arrays ----------------------- */ + +#ifndef GL_ANGLE_instanced_arrays +#define GL_ANGLE_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); + +#define glDrawArraysInstancedANGLE GLEW_GET_FUN(__glewDrawArraysInstancedANGLE) +#define glDrawElementsInstancedANGLE GLEW_GET_FUN(__glewDrawElementsInstancedANGLE) +#define glVertexAttribDivisorANGLE GLEW_GET_FUN(__glewVertexAttribDivisorANGLE) + +#define GLEW_ANGLE_instanced_arrays GLEW_GET_VAR(__GLEW_ANGLE_instanced_arrays) + +#endif /* GL_ANGLE_instanced_arrays */ + +/* -------------------- GL_ANGLE_pack_reverse_row_order -------------------- */ + +#ifndef GL_ANGLE_pack_reverse_row_order +#define GL_ANGLE_pack_reverse_row_order 1 + +#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 + +#define GLEW_ANGLE_pack_reverse_row_order GLEW_GET_VAR(__GLEW_ANGLE_pack_reverse_row_order) + +#endif /* GL_ANGLE_pack_reverse_row_order */ + +/* ------------------------ GL_ANGLE_program_binary ------------------------ */ + +#ifndef GL_ANGLE_program_binary +#define GL_ANGLE_program_binary 1 + +#define GL_PROGRAM_BINARY_ANGLE 0x93A6 + +#define GLEW_ANGLE_program_binary GLEW_GET_VAR(__GLEW_ANGLE_program_binary) + +#endif /* GL_ANGLE_program_binary */ + +/* ------------------- GL_ANGLE_texture_compression_dxt1 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt1 +#define GL_ANGLE_texture_compression_dxt1 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt1) + +#endif /* GL_ANGLE_texture_compression_dxt1 */ + +/* ------------------- GL_ANGLE_texture_compression_dxt3 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt3 +#define GL_ANGLE_texture_compression_dxt3 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt3 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt3) + +#endif /* GL_ANGLE_texture_compression_dxt3 */ + +/* ------------------- GL_ANGLE_texture_compression_dxt5 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt5 +#define GL_ANGLE_texture_compression_dxt5 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt5 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt5) + +#endif /* GL_ANGLE_texture_compression_dxt5 */ + +/* ------------------------- GL_ANGLE_texture_usage ------------------------ */ + +#ifndef GL_ANGLE_texture_usage +#define GL_ANGLE_texture_usage 1 + +#define GL_TEXTURE_USAGE_ANGLE 0x93A2 +#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 + +#define GLEW_ANGLE_texture_usage GLEW_GET_VAR(__GLEW_ANGLE_texture_usage) + +#endif /* GL_ANGLE_texture_usage */ + +/* -------------------------- GL_ANGLE_timer_query ------------------------- */ + +#ifndef GL_ANGLE_timer_query +#define GL_ANGLE_timer_query 1 + +#define GL_QUERY_COUNTER_BITS_ANGLE 0x8864 +#define GL_CURRENT_QUERY_ANGLE 0x8865 +#define GL_QUERY_RESULT_ANGLE 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ANGLE 0x8867 +#define GL_TIME_ELAPSED_ANGLE 0x88BF +#define GL_TIMESTAMP_ANGLE 0x8E28 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYANGLEPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESANGLEPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYANGLEPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESANGLEPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VANGLEPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVANGLEPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VANGLEPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVANGLEPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVANGLEPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYANGLEPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERANGLEPROC) (GLuint id, GLenum target); + +#define glBeginQueryANGLE GLEW_GET_FUN(__glewBeginQueryANGLE) +#define glDeleteQueriesANGLE GLEW_GET_FUN(__glewDeleteQueriesANGLE) +#define glEndQueryANGLE GLEW_GET_FUN(__glewEndQueryANGLE) +#define glGenQueriesANGLE GLEW_GET_FUN(__glewGenQueriesANGLE) +#define glGetQueryObjecti64vANGLE GLEW_GET_FUN(__glewGetQueryObjecti64vANGLE) +#define glGetQueryObjectivANGLE GLEW_GET_FUN(__glewGetQueryObjectivANGLE) +#define glGetQueryObjectui64vANGLE GLEW_GET_FUN(__glewGetQueryObjectui64vANGLE) +#define glGetQueryObjectuivANGLE GLEW_GET_FUN(__glewGetQueryObjectuivANGLE) +#define glGetQueryivANGLE GLEW_GET_FUN(__glewGetQueryivANGLE) +#define glIsQueryANGLE GLEW_GET_FUN(__glewIsQueryANGLE) +#define glQueryCounterANGLE GLEW_GET_FUN(__glewQueryCounterANGLE) + +#define GLEW_ANGLE_timer_query GLEW_GET_VAR(__GLEW_ANGLE_timer_query) + +#endif /* GL_ANGLE_timer_query */ + +/* ------------------- GL_ANGLE_translated_shader_source ------------------- */ + +#ifndef GL_ANGLE_translated_shader_source +#define GL_ANGLE_translated_shader_source 1 + +#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 + +typedef void (GLAPIENTRY * PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); + +#define glGetTranslatedShaderSourceANGLE GLEW_GET_FUN(__glewGetTranslatedShaderSourceANGLE) + +#define GLEW_ANGLE_translated_shader_source GLEW_GET_VAR(__GLEW_ANGLE_translated_shader_source) + +#endif /* GL_ANGLE_translated_shader_source */ + +/* ----------------------- GL_APPLE_aux_depth_stencil ---------------------- */ + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 + +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 + +#define GLEW_APPLE_aux_depth_stencil GLEW_GET_VAR(__GLEW_APPLE_aux_depth_stencil) + +#endif /* GL_APPLE_aux_depth_stencil */ + +/* ------------------------ GL_APPLE_client_storage ------------------------ */ + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 + +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 + +#define GLEW_APPLE_client_storage GLEW_GET_VAR(__GLEW_APPLE_client_storage) + +#endif /* GL_APPLE_client_storage */ + +/* ------------------------- GL_APPLE_element_array ------------------------ */ + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 + +#define GL_ELEMENT_ARRAY_APPLE 0x8A0C +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount); + +#define glDrawElementArrayAPPLE GLEW_GET_FUN(__glewDrawElementArrayAPPLE) +#define glDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewDrawRangeElementArrayAPPLE) +#define glElementPointerAPPLE GLEW_GET_FUN(__glewElementPointerAPPLE) +#define glMultiDrawElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawElementArrayAPPLE) +#define glMultiDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawRangeElementArrayAPPLE) + +#define GLEW_APPLE_element_array GLEW_GET_VAR(__GLEW_APPLE_element_array) + +#endif /* GL_APPLE_element_array */ + +/* ----------------------------- GL_APPLE_fence ---------------------------- */ + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 + +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +typedef void (GLAPIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint* fences); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); + +#define glDeleteFencesAPPLE GLEW_GET_FUN(__glewDeleteFencesAPPLE) +#define glFinishFenceAPPLE GLEW_GET_FUN(__glewFinishFenceAPPLE) +#define glFinishObjectAPPLE GLEW_GET_FUN(__glewFinishObjectAPPLE) +#define glGenFencesAPPLE GLEW_GET_FUN(__glewGenFencesAPPLE) +#define glIsFenceAPPLE GLEW_GET_FUN(__glewIsFenceAPPLE) +#define glSetFenceAPPLE GLEW_GET_FUN(__glewSetFenceAPPLE) +#define glTestFenceAPPLE GLEW_GET_FUN(__glewTestFenceAPPLE) +#define glTestObjectAPPLE GLEW_GET_FUN(__glewTestObjectAPPLE) + +#define GLEW_APPLE_fence GLEW_GET_VAR(__GLEW_APPLE_fence) + +#endif /* GL_APPLE_fence */ + +/* ------------------------- GL_APPLE_float_pixels ------------------------- */ + +#ifndef GL_APPLE_float_pixels +#define GL_APPLE_float_pixels 1 + +#define GL_HALF_APPLE 0x140B +#define GL_RGBA_FLOAT32_APPLE 0x8814 +#define GL_RGB_FLOAT32_APPLE 0x8815 +#define GL_ALPHA_FLOAT32_APPLE 0x8816 +#define GL_INTENSITY_FLOAT32_APPLE 0x8817 +#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 +#define GL_RGBA_FLOAT16_APPLE 0x881A +#define GL_RGB_FLOAT16_APPLE 0x881B +#define GL_ALPHA_FLOAT16_APPLE 0x881C +#define GL_INTENSITY_FLOAT16_APPLE 0x881D +#define GL_LUMINANCE_FLOAT16_APPLE 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F +#define GL_COLOR_FLOAT_APPLE 0x8A0F + +#define GLEW_APPLE_float_pixels GLEW_GET_VAR(__GLEW_APPLE_float_pixels) + +#endif /* GL_APPLE_float_pixels */ + +/* ---------------------- GL_APPLE_flush_buffer_range ---------------------- */ + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 + +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 + +typedef void (GLAPIENTRY * PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); + +#define glBufferParameteriAPPLE GLEW_GET_FUN(__glewBufferParameteriAPPLE) +#define glFlushMappedBufferRangeAPPLE GLEW_GET_FUN(__glewFlushMappedBufferRangeAPPLE) + +#define GLEW_APPLE_flush_buffer_range GLEW_GET_VAR(__GLEW_APPLE_flush_buffer_range) + +#endif /* GL_APPLE_flush_buffer_range */ + +/* ----------------------- GL_APPLE_object_purgeable ----------------------- */ + +#ifndef GL_APPLE_object_purgeable +#define GL_APPLE_object_purgeable 1 + +#define GL_BUFFER_OBJECT_APPLE 0x85B3 +#define GL_RELEASED_APPLE 0x8A19 +#define GL_VOLATILE_APPLE 0x8A1A +#define GL_RETAINED_APPLE 0x8A1B +#define GL_UNDEFINED_APPLE 0x8A1C +#define GL_PURGEABLE_APPLE 0x8A1D + +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); + +#define glGetObjectParameterivAPPLE GLEW_GET_FUN(__glewGetObjectParameterivAPPLE) +#define glObjectPurgeableAPPLE GLEW_GET_FUN(__glewObjectPurgeableAPPLE) +#define glObjectUnpurgeableAPPLE GLEW_GET_FUN(__glewObjectUnpurgeableAPPLE) + +#define GLEW_APPLE_object_purgeable GLEW_GET_VAR(__GLEW_APPLE_object_purgeable) + +#endif /* GL_APPLE_object_purgeable */ + +/* ------------------------- GL_APPLE_pixel_buffer ------------------------- */ + +#ifndef GL_APPLE_pixel_buffer +#define GL_APPLE_pixel_buffer 1 + +#define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 + +#define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer) + +#endif /* GL_APPLE_pixel_buffer */ + +/* ---------------------------- GL_APPLE_rgb_422 --------------------------- */ + +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 + +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#define GL_RGB_422_APPLE 0x8A1F + +#define GLEW_APPLE_rgb_422 GLEW_GET_VAR(__GLEW_APPLE_rgb_422) + +#endif /* GL_APPLE_rgb_422 */ + +/* --------------------------- GL_APPLE_row_bytes -------------------------- */ + +#ifndef GL_APPLE_row_bytes +#define GL_APPLE_row_bytes 1 + +#define GL_PACK_ROW_BYTES_APPLE 0x8A15 +#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 + +#define GLEW_APPLE_row_bytes GLEW_GET_VAR(__GLEW_APPLE_row_bytes) + +#endif /* GL_APPLE_row_bytes */ + +/* ------------------------ GL_APPLE_specular_vector ----------------------- */ + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 + +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 + +#define GLEW_APPLE_specular_vector GLEW_GET_VAR(__GLEW_APPLE_specular_vector) + +#endif /* GL_APPLE_specular_vector */ + +/* ------------------------- GL_APPLE_texture_range ------------------------ */ + +#ifndef GL_APPLE_texture_range +#define GL_APPLE_texture_range 1 + +#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 +#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_STORAGE_PRIVATE_APPLE 0x85BD +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid **params); +typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, GLvoid *pointer); + +#define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE) +#define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE) + +#define GLEW_APPLE_texture_range GLEW_GET_VAR(__GLEW_APPLE_texture_range) + +#endif /* GL_APPLE_texture_range */ + +/* ------------------------ GL_APPLE_transform_hint ------------------------ */ + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 + +#define GL_TRANSFORM_HINT_APPLE 0x85B1 + +#define GLEW_APPLE_transform_hint GLEW_GET_VAR(__GLEW_APPLE_transform_hint) + +#endif /* GL_APPLE_transform_hint */ + +/* ---------------------- GL_APPLE_vertex_array_object --------------------- */ + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); + +#define glBindVertexArrayAPPLE GLEW_GET_FUN(__glewBindVertexArrayAPPLE) +#define glDeleteVertexArraysAPPLE GLEW_GET_FUN(__glewDeleteVertexArraysAPPLE) +#define glGenVertexArraysAPPLE GLEW_GET_FUN(__glewGenVertexArraysAPPLE) +#define glIsVertexArrayAPPLE GLEW_GET_FUN(__glewIsVertexArrayAPPLE) + +#define GLEW_APPLE_vertex_array_object GLEW_GET_VAR(__GLEW_APPLE_vertex_array_object) + +#endif /* GL_APPLE_vertex_array_object */ + +/* ---------------------- GL_APPLE_vertex_array_range ---------------------- */ + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CLIENT_APPLE 0x85B4 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); + +#define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE) +#define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE) +#define glVertexArrayRangeAPPLE GLEW_GET_FUN(__glewVertexArrayRangeAPPLE) + +#define GLEW_APPLE_vertex_array_range GLEW_GET_VAR(__GLEW_APPLE_vertex_array_range) + +#endif /* GL_APPLE_vertex_array_range */ + +/* ------------------- GL_APPLE_vertex_program_evaluators ------------------ */ + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_APPLE_vertex_program_evaluators 1 + +#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 +#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 +#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 +#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 +#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 +#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 +#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 +#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 +#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 +#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 + +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); + +#define glDisableVertexAttribAPPLE GLEW_GET_FUN(__glewDisableVertexAttribAPPLE) +#define glEnableVertexAttribAPPLE GLEW_GET_FUN(__glewEnableVertexAttribAPPLE) +#define glIsVertexAttribEnabledAPPLE GLEW_GET_FUN(__glewIsVertexAttribEnabledAPPLE) +#define glMapVertexAttrib1dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1dAPPLE) +#define glMapVertexAttrib1fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1fAPPLE) +#define glMapVertexAttrib2dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2dAPPLE) +#define glMapVertexAttrib2fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2fAPPLE) + +#define GLEW_APPLE_vertex_program_evaluators GLEW_GET_VAR(__GLEW_APPLE_vertex_program_evaluators) + +#endif /* GL_APPLE_vertex_program_evaluators */ + +/* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */ + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 + +#define GL_YCBCR_422_APPLE 0x85B9 + +#define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422) + +#endif /* GL_APPLE_ycbcr_422 */ + +/* ------------------------ GL_ARB_ES2_compatibility ----------------------- */ + +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 + +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_RGB565 0x8D62 +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD + +typedef int GLfixed; + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFPROC) (GLclampf d); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f); +typedef void (GLAPIENTRY * PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision); +typedef void (GLAPIENTRY * PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* shaders, GLenum binaryformat, const GLvoid*binary, GLsizei length); + +#define glClearDepthf GLEW_GET_FUN(__glewClearDepthf) +#define glDepthRangef GLEW_GET_FUN(__glewDepthRangef) +#define glGetShaderPrecisionFormat GLEW_GET_FUN(__glewGetShaderPrecisionFormat) +#define glReleaseShaderCompiler GLEW_GET_FUN(__glewReleaseShaderCompiler) +#define glShaderBinary GLEW_GET_FUN(__glewShaderBinary) + +#define GLEW_ARB_ES2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES2_compatibility) + +#endif /* GL_ARB_ES2_compatibility */ + +/* ------------------------ GL_ARB_ES3_compatibility ----------------------- */ + +#ifndef GL_ARB_ES3_compatibility +#define GL_ARB_ES3_compatibility 1 + +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#define GL_MAX_ELEMENT_INDEX 0x8D6B +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 + +#define GLEW_ARB_ES3_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_compatibility) + +#endif /* GL_ARB_ES3_compatibility */ + +/* ------------------------ GL_ARB_arrays_of_arrays ------------------------ */ + +#ifndef GL_ARB_arrays_of_arrays +#define GL_ARB_arrays_of_arrays 1 + +#define GLEW_ARB_arrays_of_arrays GLEW_GET_VAR(__GLEW_ARB_arrays_of_arrays) + +#endif /* GL_ARB_arrays_of_arrays */ + +/* -------------------------- GL_ARB_base_instance ------------------------- */ + +#ifndef GL_ARB_base_instance +#define GL_ARB_base_instance 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); + +#define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance) +#define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance) +#define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance) + +#define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance) + +#endif /* GL_ARB_base_instance */ + +/* ------------------------ GL_ARB_bindless_texture ------------------------ */ + +#ifndef GL_ARB_bindless_texture +#define GL_ARB_bindless_texture 1 + +#define GL_UNSIGNED_INT64_ARB 0x140F + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT* v); + +#define glGetImageHandleARB GLEW_GET_FUN(__glewGetImageHandleARB) +#define glGetTextureHandleARB GLEW_GET_FUN(__glewGetTextureHandleARB) +#define glGetTextureSamplerHandleARB GLEW_GET_FUN(__glewGetTextureSamplerHandleARB) +#define glGetVertexAttribLui64vARB GLEW_GET_FUN(__glewGetVertexAttribLui64vARB) +#define glIsImageHandleResidentARB GLEW_GET_FUN(__glewIsImageHandleResidentARB) +#define glIsTextureHandleResidentARB GLEW_GET_FUN(__glewIsTextureHandleResidentARB) +#define glMakeImageHandleNonResidentARB GLEW_GET_FUN(__glewMakeImageHandleNonResidentARB) +#define glMakeImageHandleResidentARB GLEW_GET_FUN(__glewMakeImageHandleResidentARB) +#define glMakeTextureHandleNonResidentARB GLEW_GET_FUN(__glewMakeTextureHandleNonResidentARB) +#define glMakeTextureHandleResidentARB GLEW_GET_FUN(__glewMakeTextureHandleResidentARB) +#define glProgramUniformHandleui64ARB GLEW_GET_FUN(__glewProgramUniformHandleui64ARB) +#define glProgramUniformHandleui64vARB GLEW_GET_FUN(__glewProgramUniformHandleui64vARB) +#define glUniformHandleui64ARB GLEW_GET_FUN(__glewUniformHandleui64ARB) +#define glUniformHandleui64vARB GLEW_GET_FUN(__glewUniformHandleui64vARB) +#define glVertexAttribL1ui64ARB GLEW_GET_FUN(__glewVertexAttribL1ui64ARB) +#define glVertexAttribL1ui64vARB GLEW_GET_FUN(__glewVertexAttribL1ui64vARB) + +#define GLEW_ARB_bindless_texture GLEW_GET_VAR(__GLEW_ARB_bindless_texture) + +#endif /* GL_ARB_bindless_texture */ + +/* ----------------------- GL_ARB_blend_func_extended ---------------------- */ + +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 + +#define GL_SRC1_COLOR 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar * name); + +#define glBindFragDataLocationIndexed GLEW_GET_FUN(__glewBindFragDataLocationIndexed) +#define glGetFragDataIndex GLEW_GET_FUN(__glewGetFragDataIndex) + +#define GLEW_ARB_blend_func_extended GLEW_GET_VAR(__GLEW_ARB_blend_func_extended) + +#endif /* GL_ARB_blend_func_extended */ + +/* ------------------------- GL_ARB_buffer_storage ------------------------- */ + +#ifndef GL_ARB_buffer_storage +#define GL_ARB_buffer_storage 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_PERSISTENT_BIT 0x00000040 +#define GL_MAP_COHERENT_BIT 0x00000080 +#define GL_DYNAMIC_STORAGE_BIT 0x0100 +#define GL_CLIENT_STORAGE_BIT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F +#define GL_BUFFER_STORAGE_FLAGS 0x8220 + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid* data, GLbitfield flags); + +#define glBufferStorage GLEW_GET_FUN(__glewBufferStorage) +#define glNamedBufferStorageEXT GLEW_GET_FUN(__glewNamedBufferStorageEXT) + +#define GLEW_ARB_buffer_storage GLEW_GET_VAR(__GLEW_ARB_buffer_storage) + +#endif /* GL_ARB_buffer_storage */ + +/* ---------------------------- GL_ARB_cl_event ---------------------------- */ + +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 + +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 + +typedef struct _cl_context *cl_context; +typedef struct _cl_event *cl_event; + +typedef GLsync (GLAPIENTRY * PFNGLCREATESYNCFROMCLEVENTARBPROC) (cl_context context, cl_event event, GLbitfield flags); + +#define glCreateSyncFromCLeventARB GLEW_GET_FUN(__glewCreateSyncFromCLeventARB) + +#define GLEW_ARB_cl_event GLEW_GET_VAR(__GLEW_ARB_cl_event) + +#endif /* GL_ARB_cl_event */ + +/* ----------------------- GL_ARB_clear_buffer_object ---------------------- */ + +#ifndef GL_ARB_clear_buffer_object +#define GL_ARB_clear_buffer_object 1 + +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data); + +#define glClearBufferData GLEW_GET_FUN(__glewClearBufferData) +#define glClearBufferSubData GLEW_GET_FUN(__glewClearBufferSubData) +#define glClearNamedBufferDataEXT GLEW_GET_FUN(__glewClearNamedBufferDataEXT) +#define glClearNamedBufferSubDataEXT GLEW_GET_FUN(__glewClearNamedBufferSubDataEXT) + +#define GLEW_ARB_clear_buffer_object GLEW_GET_VAR(__GLEW_ARB_clear_buffer_object) + +#endif /* GL_ARB_clear_buffer_object */ + +/* -------------------------- GL_ARB_clear_texture ------------------------- */ + +#ifndef GL_ARB_clear_texture +#define GL_ARB_clear_texture 1 + +#define GL_CLEAR_TEXTURE 0x9365 + +typedef void (GLAPIENTRY * PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* data); + +#define glClearTexImage GLEW_GET_FUN(__glewClearTexImage) +#define glClearTexSubImage GLEW_GET_FUN(__glewClearTexSubImage) + +#define GLEW_ARB_clear_texture GLEW_GET_VAR(__GLEW_ARB_clear_texture) + +#endif /* GL_ARB_clear_texture */ + +/* ----------------------- GL_ARB_color_buffer_float ----------------------- */ + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 + +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D + +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); + +#define glClampColorARB GLEW_GET_FUN(__glewClampColorARB) + +#define GLEW_ARB_color_buffer_float GLEW_GET_VAR(__GLEW_ARB_color_buffer_float) + +#endif /* GL_ARB_color_buffer_float */ + +/* -------------------------- GL_ARB_compatibility ------------------------- */ + +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 + +#define GLEW_ARB_compatibility GLEW_GET_VAR(__GLEW_ARB_compatibility) + +#endif /* GL_ARB_compatibility */ + +/* ---------------- GL_ARB_compressed_texture_pixel_storage ---------------- */ + +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_ARB_compressed_texture_pixel_storage 1 + +#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 +#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 +#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 +#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A +#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B +#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C +#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D +#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E + +#define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage) + +#endif /* GL_ARB_compressed_texture_pixel_storage */ + +/* ------------------------- GL_ARB_compute_shader ------------------------- */ + +#ifndef GL_ARB_compute_shader +#define GL_ARB_compute_shader 1 + +#define GL_COMPUTE_SHADER_BIT 0x00000020 +#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 +#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 +#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 +#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 +#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 +#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 +#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB +#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED +#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE +#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF +#define GL_COMPUTE_SHADER 0x91B9 +#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB +#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC +#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD +#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE +#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF + +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); + +#define glDispatchCompute GLEW_GET_FUN(__glewDispatchCompute) +#define glDispatchComputeIndirect GLEW_GET_FUN(__glewDispatchComputeIndirect) + +#define GLEW_ARB_compute_shader GLEW_GET_VAR(__GLEW_ARB_compute_shader) + +#endif /* GL_ARB_compute_shader */ + +/* ------------------- GL_ARB_compute_variable_group_size ------------------ */ + +#ifndef GL_ARB_compute_variable_group_size +#define GL_ARB_compute_variable_group_size 1 + +#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB +#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF +#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 +#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 + +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); + +#define glDispatchComputeGroupSizeARB GLEW_GET_FUN(__glewDispatchComputeGroupSizeARB) + +#define GLEW_ARB_compute_variable_group_size GLEW_GET_VAR(__GLEW_ARB_compute_variable_group_size) + +#endif /* GL_ARB_compute_variable_group_size */ + +/* ----------------------- GL_ARB_conservative_depth ----------------------- */ + +#ifndef GL_ARB_conservative_depth +#define GL_ARB_conservative_depth 1 + +#define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth) + +#endif /* GL_ARB_conservative_depth */ + +/* --------------------------- GL_ARB_copy_buffer -------------------------- */ + +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 + +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 + +typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); + +#define glCopyBufferSubData GLEW_GET_FUN(__glewCopyBufferSubData) + +#define GLEW_ARB_copy_buffer GLEW_GET_VAR(__GLEW_ARB_copy_buffer) + +#endif /* GL_ARB_copy_buffer */ + +/* --------------------------- GL_ARB_copy_image --------------------------- */ + +#ifndef GL_ARB_copy_image +#define GL_ARB_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); + +#define glCopyImageSubData GLEW_GET_FUN(__glewCopyImageSubData) + +#define GLEW_ARB_copy_image GLEW_GET_VAR(__GLEW_ARB_copy_image) + +#endif /* GL_ARB_copy_image */ + +/* -------------------------- GL_ARB_debug_output -------------------------- */ + +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 + +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 + +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); + +#define glDebugMessageCallbackARB GLEW_GET_FUN(__glewDebugMessageCallbackARB) +#define glDebugMessageControlARB GLEW_GET_FUN(__glewDebugMessageControlARB) +#define glDebugMessageInsertARB GLEW_GET_FUN(__glewDebugMessageInsertARB) +#define glGetDebugMessageLogARB GLEW_GET_FUN(__glewGetDebugMessageLogARB) + +#define GLEW_ARB_debug_output GLEW_GET_VAR(__GLEW_ARB_debug_output) + +#endif /* GL_ARB_debug_output */ + +/* ----------------------- GL_ARB_depth_buffer_float ----------------------- */ + +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 + +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD + +#define GLEW_ARB_depth_buffer_float GLEW_GET_VAR(__GLEW_ARB_depth_buffer_float) + +#endif /* GL_ARB_depth_buffer_float */ + +/* --------------------------- GL_ARB_depth_clamp -------------------------- */ + +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 + +#define GL_DEPTH_CLAMP 0x864F + +#define GLEW_ARB_depth_clamp GLEW_GET_VAR(__GLEW_ARB_depth_clamp) + +#endif /* GL_ARB_depth_clamp */ + +/* -------------------------- GL_ARB_depth_texture ------------------------- */ + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B + +#define GLEW_ARB_depth_texture GLEW_GET_VAR(__GLEW_ARB_depth_texture) + +#endif /* GL_ARB_depth_texture */ + +/* -------------------------- GL_ARB_draw_buffers -------------------------- */ + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB) + +#define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers) + +#endif /* GL_ARB_draw_buffers */ + +/* ----------------------- GL_ARB_draw_buffers_blend ----------------------- */ + +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); + +#define glBlendEquationSeparateiARB GLEW_GET_FUN(__glewBlendEquationSeparateiARB) +#define glBlendEquationiARB GLEW_GET_FUN(__glewBlendEquationiARB) +#define glBlendFuncSeparateiARB GLEW_GET_FUN(__glewBlendFuncSeparateiARB) +#define glBlendFunciARB GLEW_GET_FUN(__glewBlendFunciARB) + +#define GLEW_ARB_draw_buffers_blend GLEW_GET_VAR(__GLEW_ARB_draw_buffers_blend) + +#endif /* GL_ARB_draw_buffers_blend */ + +/* -------------------- GL_ARB_draw_elements_base_vertex ------------------- */ + +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei* count, GLenum type, const GLvoid* const *indices, GLsizei primcount, const GLint *basevertex); + +#define glDrawElementsBaseVertex GLEW_GET_FUN(__glewDrawElementsBaseVertex) +#define glDrawElementsInstancedBaseVertex GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertex) +#define glDrawRangeElementsBaseVertex GLEW_GET_FUN(__glewDrawRangeElementsBaseVertex) +#define glMultiDrawElementsBaseVertex GLEW_GET_FUN(__glewMultiDrawElementsBaseVertex) + +#define GLEW_ARB_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_ARB_draw_elements_base_vertex) + +#endif /* GL_ARB_draw_elements_base_vertex */ + +/* -------------------------- GL_ARB_draw_indirect ------------------------- */ + +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 + +#define GL_DRAW_INDIRECT_BUFFER 0x8F3F +#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect); + +#define glDrawArraysIndirect GLEW_GET_FUN(__glewDrawArraysIndirect) +#define glDrawElementsIndirect GLEW_GET_FUN(__glewDrawElementsIndirect) + +#define GLEW_ARB_draw_indirect GLEW_GET_VAR(__GLEW_ARB_draw_indirect) + +#endif /* GL_ARB_draw_indirect */ + +/* ------------------------- GL_ARB_draw_instanced ------------------------- */ + +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 + +#define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced) + +#endif /* GL_ARB_draw_instanced */ + +/* ------------------------ GL_ARB_enhanced_layouts ------------------------ */ + +#ifndef GL_ARB_enhanced_layouts +#define GL_ARB_enhanced_layouts 1 + +#define GL_LOCATION_COMPONENT 0x934A +#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B +#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C + +#define GLEW_ARB_enhanced_layouts GLEW_GET_VAR(__GLEW_ARB_enhanced_layouts) + +#endif /* GL_ARB_enhanced_layouts */ + +/* -------------------- GL_ARB_explicit_attrib_location -------------------- */ + +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 + +#define GLEW_ARB_explicit_attrib_location GLEW_GET_VAR(__GLEW_ARB_explicit_attrib_location) + +#endif /* GL_ARB_explicit_attrib_location */ + +/* -------------------- GL_ARB_explicit_uniform_location ------------------- */ + +#ifndef GL_ARB_explicit_uniform_location +#define GL_ARB_explicit_uniform_location 1 + +#define GL_MAX_UNIFORM_LOCATIONS 0x826E + +#define GLEW_ARB_explicit_uniform_location GLEW_GET_VAR(__GLEW_ARB_explicit_uniform_location) + +#endif /* GL_ARB_explicit_uniform_location */ + +/* ------------------- GL_ARB_fragment_coord_conventions ------------------- */ + +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 + +#define GLEW_ARB_fragment_coord_conventions GLEW_GET_VAR(__GLEW_ARB_fragment_coord_conventions) + +#endif /* GL_ARB_fragment_coord_conventions */ + +/* --------------------- GL_ARB_fragment_layer_viewport -------------------- */ + +#ifndef GL_ARB_fragment_layer_viewport +#define GL_ARB_fragment_layer_viewport 1 + +#define GLEW_ARB_fragment_layer_viewport GLEW_GET_VAR(__GLEW_ARB_fragment_layer_viewport) + +#endif /* GL_ARB_fragment_layer_viewport */ + +/* ------------------------ GL_ARB_fragment_program ------------------------ */ + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 + +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 + +#define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program) + +#endif /* GL_ARB_fragment_program */ + +/* --------------------- GL_ARB_fragment_program_shadow -------------------- */ + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 + +#define GLEW_ARB_fragment_program_shadow GLEW_GET_VAR(__GLEW_ARB_fragment_program_shadow) + +#endif /* GL_ARB_fragment_program_shadow */ + +/* ------------------------- GL_ARB_fragment_shader ------------------------ */ + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 + +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B + +#define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader) + +#endif /* GL_ARB_fragment_shader */ + +/* ------------------- GL_ARB_framebuffer_no_attachments ------------------- */ + +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_ARB_framebuffer_no_attachments 1 + +#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 +#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 +#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 +#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 +#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 +#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 +#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 +#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); + +#define glFramebufferParameteri GLEW_GET_FUN(__glewFramebufferParameteri) +#define glGetFramebufferParameteriv GLEW_GET_FUN(__glewGetFramebufferParameteriv) +#define glGetNamedFramebufferParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferParameterivEXT) +#define glNamedFramebufferParameteriEXT GLEW_GET_FUN(__glewNamedFramebufferParameteriEXT) + +#define GLEW_ARB_framebuffer_no_attachments GLEW_GET_VAR(__GLEW_ARB_framebuffer_no_attachments) + +#endif /* GL_ARB_framebuffer_no_attachments */ + +/* ----------------------- GL_ARB_framebuffer_object ----------------------- */ + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_INDEX 0x8222 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_SRGB 0x8C40 +#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebuffer GLEW_GET_FUN(__glewBindFramebuffer) +#define glBindRenderbuffer GLEW_GET_FUN(__glewBindRenderbuffer) +#define glBlitFramebuffer GLEW_GET_FUN(__glewBlitFramebuffer) +#define glCheckFramebufferStatus GLEW_GET_FUN(__glewCheckFramebufferStatus) +#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers) +#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers) +#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer) +#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D) +#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D) +#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D) +#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer) +#define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers) +#define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers) +#define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap) +#define glGetFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetFramebufferAttachmentParameteriv) +#define glGetRenderbufferParameteriv GLEW_GET_FUN(__glewGetRenderbufferParameteriv) +#define glIsFramebuffer GLEW_GET_FUN(__glewIsFramebuffer) +#define glIsRenderbuffer GLEW_GET_FUN(__glewIsRenderbuffer) +#define glRenderbufferStorage GLEW_GET_FUN(__glewRenderbufferStorage) +#define glRenderbufferStorageMultisample GLEW_GET_FUN(__glewRenderbufferStorageMultisample) + +#define GLEW_ARB_framebuffer_object GLEW_GET_VAR(__GLEW_ARB_framebuffer_object) + +#endif /* GL_ARB_framebuffer_object */ + +/* ------------------------ GL_ARB_framebuffer_sRGB ------------------------ */ + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB 0x8DB9 + +#define GLEW_ARB_framebuffer_sRGB GLEW_GET_VAR(__GLEW_ARB_framebuffer_sRGB) + +#endif /* GL_ARB_framebuffer_sRGB */ + +/* ------------------------ GL_ARB_geometry_shader4 ------------------------ */ + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_ARB 0xA +#define GL_LINE_STRIP_ADJACENCY_ARB 0xB +#define GL_TRIANGLES_ADJACENCY_ARB 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureARB GLEW_GET_FUN(__glewFramebufferTextureARB) +#define glFramebufferTextureFaceARB GLEW_GET_FUN(__glewFramebufferTextureFaceARB) +#define glFramebufferTextureLayerARB GLEW_GET_FUN(__glewFramebufferTextureLayerARB) +#define glProgramParameteriARB GLEW_GET_FUN(__glewProgramParameteriARB) + +#define GLEW_ARB_geometry_shader4 GLEW_GET_VAR(__GLEW_ARB_geometry_shader4) + +#endif /* GL_ARB_geometry_shader4 */ + +/* ----------------------- GL_ARB_get_program_binary ----------------------- */ + +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 + +#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 +#define GL_PROGRAM_BINARY_LENGTH 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE +#define GL_PROGRAM_BINARY_FORMATS 0x87FF + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, GLvoid*binary); +typedef void (GLAPIENTRY * PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); + +#define glGetProgramBinary GLEW_GET_FUN(__glewGetProgramBinary) +#define glProgramBinary GLEW_GET_FUN(__glewProgramBinary) +#define glProgramParameteri GLEW_GET_FUN(__glewProgramParameteri) + +#define GLEW_ARB_get_program_binary GLEW_GET_VAR(__GLEW_ARB_get_program_binary) + +#endif /* GL_ARB_get_program_binary */ + +/* --------------------------- GL_ARB_gpu_shader5 -------------------------- */ + +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 + +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +#define GLEW_ARB_gpu_shader5 GLEW_GET_VAR(__GLEW_ARB_gpu_shader5) + +#endif /* GL_ARB_gpu_shader5 */ + +/* ------------------------- GL_ARB_gpu_shader_fp64 ------------------------ */ + +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 + +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); + +#define glGetUniformdv GLEW_GET_FUN(__glewGetUniformdv) +#define glUniform1d GLEW_GET_FUN(__glewUniform1d) +#define glUniform1dv GLEW_GET_FUN(__glewUniform1dv) +#define glUniform2d GLEW_GET_FUN(__glewUniform2d) +#define glUniform2dv GLEW_GET_FUN(__glewUniform2dv) +#define glUniform3d GLEW_GET_FUN(__glewUniform3d) +#define glUniform3dv GLEW_GET_FUN(__glewUniform3dv) +#define glUniform4d GLEW_GET_FUN(__glewUniform4d) +#define glUniform4dv GLEW_GET_FUN(__glewUniform4dv) +#define glUniformMatrix2dv GLEW_GET_FUN(__glewUniformMatrix2dv) +#define glUniformMatrix2x3dv GLEW_GET_FUN(__glewUniformMatrix2x3dv) +#define glUniformMatrix2x4dv GLEW_GET_FUN(__glewUniformMatrix2x4dv) +#define glUniformMatrix3dv GLEW_GET_FUN(__glewUniformMatrix3dv) +#define glUniformMatrix3x2dv GLEW_GET_FUN(__glewUniformMatrix3x2dv) +#define glUniformMatrix3x4dv GLEW_GET_FUN(__glewUniformMatrix3x4dv) +#define glUniformMatrix4dv GLEW_GET_FUN(__glewUniformMatrix4dv) +#define glUniformMatrix4x2dv GLEW_GET_FUN(__glewUniformMatrix4x2dv) +#define glUniformMatrix4x3dv GLEW_GET_FUN(__glewUniformMatrix4x3dv) + +#define GLEW_ARB_gpu_shader_fp64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_fp64) + +#endif /* GL_ARB_gpu_shader_fp64 */ + +/* ------------------------ GL_ARB_half_float_pixel ------------------------ */ + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 + +#define GL_HALF_FLOAT_ARB 0x140B + +#define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel) + +#endif /* GL_ARB_half_float_pixel */ + +/* ------------------------ GL_ARB_half_float_vertex ----------------------- */ + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 + +#define GL_HALF_FLOAT 0x140B + +#define GLEW_ARB_half_float_vertex GLEW_GET_VAR(__GLEW_ARB_half_float_vertex) + +#endif /* GL_ARB_half_float_vertex */ + +/* ----------------------------- GL_ARB_imaging ---------------------------- */ + +#ifndef GL_ARB_imaging +#define GL_ARB_imaging 1 + +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_IGNORE_BORDER 0x8150 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_WRAP_BORDER 0x8152 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); + +#define glColorSubTable GLEW_GET_FUN(__glewColorSubTable) +#define glColorTable GLEW_GET_FUN(__glewColorTable) +#define glColorTableParameterfv GLEW_GET_FUN(__glewColorTableParameterfv) +#define glColorTableParameteriv GLEW_GET_FUN(__glewColorTableParameteriv) +#define glConvolutionFilter1D GLEW_GET_FUN(__glewConvolutionFilter1D) +#define glConvolutionFilter2D GLEW_GET_FUN(__glewConvolutionFilter2D) +#define glConvolutionParameterf GLEW_GET_FUN(__glewConvolutionParameterf) +#define glConvolutionParameterfv GLEW_GET_FUN(__glewConvolutionParameterfv) +#define glConvolutionParameteri GLEW_GET_FUN(__glewConvolutionParameteri) +#define glConvolutionParameteriv GLEW_GET_FUN(__glewConvolutionParameteriv) +#define glCopyColorSubTable GLEW_GET_FUN(__glewCopyColorSubTable) +#define glCopyColorTable GLEW_GET_FUN(__glewCopyColorTable) +#define glCopyConvolutionFilter1D GLEW_GET_FUN(__glewCopyConvolutionFilter1D) +#define glCopyConvolutionFilter2D GLEW_GET_FUN(__glewCopyConvolutionFilter2D) +#define glGetColorTable GLEW_GET_FUN(__glewGetColorTable) +#define glGetColorTableParameterfv GLEW_GET_FUN(__glewGetColorTableParameterfv) +#define glGetColorTableParameteriv GLEW_GET_FUN(__glewGetColorTableParameteriv) +#define glGetConvolutionFilter GLEW_GET_FUN(__glewGetConvolutionFilter) +#define glGetConvolutionParameterfv GLEW_GET_FUN(__glewGetConvolutionParameterfv) +#define glGetConvolutionParameteriv GLEW_GET_FUN(__glewGetConvolutionParameteriv) +#define glGetHistogram GLEW_GET_FUN(__glewGetHistogram) +#define glGetHistogramParameterfv GLEW_GET_FUN(__glewGetHistogramParameterfv) +#define glGetHistogramParameteriv GLEW_GET_FUN(__glewGetHistogramParameteriv) +#define glGetMinmax GLEW_GET_FUN(__glewGetMinmax) +#define glGetMinmaxParameterfv GLEW_GET_FUN(__glewGetMinmaxParameterfv) +#define glGetMinmaxParameteriv GLEW_GET_FUN(__glewGetMinmaxParameteriv) +#define glGetSeparableFilter GLEW_GET_FUN(__glewGetSeparableFilter) +#define glHistogram GLEW_GET_FUN(__glewHistogram) +#define glMinmax GLEW_GET_FUN(__glewMinmax) +#define glResetHistogram GLEW_GET_FUN(__glewResetHistogram) +#define glResetMinmax GLEW_GET_FUN(__glewResetMinmax) +#define glSeparableFilter2D GLEW_GET_FUN(__glewSeparableFilter2D) + +#define GLEW_ARB_imaging GLEW_GET_VAR(__GLEW_ARB_imaging) + +#endif /* GL_ARB_imaging */ + +/* ----------------------- GL_ARB_indirect_parameters ---------------------- */ + +#ifndef GL_ARB_indirect_parameters +#define GL_ARB_indirect_parameters 1 + +#define GL_PARAMETER_BUFFER_ARB 0x80EE +#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); + +#define glMultiDrawArraysIndirectCountARB GLEW_GET_FUN(__glewMultiDrawArraysIndirectCountARB) +#define glMultiDrawElementsIndirectCountARB GLEW_GET_FUN(__glewMultiDrawElementsIndirectCountARB) + +#define GLEW_ARB_indirect_parameters GLEW_GET_VAR(__GLEW_ARB_indirect_parameters) + +#endif /* GL_ARB_indirect_parameters */ + +/* ------------------------ GL_ARB_instanced_arrays ------------------------ */ + +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); + +#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB) +#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB) +#define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB) + +#define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays) + +#endif /* GL_ARB_instanced_arrays */ + +/* ---------------------- GL_ARB_internalformat_query ---------------------- */ + +#ifndef GL_ARB_internalformat_query +#define GL_ARB_internalformat_query 1 + +#define GL_NUM_SAMPLE_COUNTS 0x9380 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); + +#define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ) + +#define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query) + +#endif /* GL_ARB_internalformat_query */ + +/* ---------------------- GL_ARB_internalformat_query2 --------------------- */ + +#ifndef GL_ARB_internalformat_query2 +#define GL_ARB_internalformat_query2 1 + +#define GL_INTERNALFORMAT_SUPPORTED 0x826F +#define GL_INTERNALFORMAT_PREFERRED 0x8270 +#define GL_INTERNALFORMAT_RED_SIZE 0x8271 +#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 +#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 +#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 +#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 +#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 +#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 +#define GL_INTERNALFORMAT_RED_TYPE 0x8278 +#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 +#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A +#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B +#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C +#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D +#define GL_MAX_WIDTH 0x827E +#define GL_MAX_HEIGHT 0x827F +#define GL_MAX_DEPTH 0x8280 +#define GL_MAX_LAYERS 0x8281 +#define GL_MAX_COMBINED_DIMENSIONS 0x8282 +#define GL_COLOR_COMPONENTS 0x8283 +#define GL_DEPTH_COMPONENTS 0x8284 +#define GL_STENCIL_COMPONENTS 0x8285 +#define GL_COLOR_RENDERABLE 0x8286 +#define GL_DEPTH_RENDERABLE 0x8287 +#define GL_STENCIL_RENDERABLE 0x8288 +#define GL_FRAMEBUFFER_RENDERABLE 0x8289 +#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A +#define GL_FRAMEBUFFER_BLEND 0x828B +#define GL_READ_PIXELS 0x828C +#define GL_READ_PIXELS_FORMAT 0x828D +#define GL_READ_PIXELS_TYPE 0x828E +#define GL_TEXTURE_IMAGE_FORMAT 0x828F +#define GL_TEXTURE_IMAGE_TYPE 0x8290 +#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 +#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 +#define GL_MIPMAP 0x8293 +#define GL_MANUAL_GENERATE_MIPMAP 0x8294 +#define GL_AUTO_GENERATE_MIPMAP 0x8295 +#define GL_COLOR_ENCODING 0x8296 +#define GL_SRGB_READ 0x8297 +#define GL_SRGB_WRITE 0x8298 +#define GL_SRGB_DECODE_ARB 0x8299 +#define GL_FILTER 0x829A +#define GL_VERTEX_TEXTURE 0x829B +#define GL_TESS_CONTROL_TEXTURE 0x829C +#define GL_TESS_EVALUATION_TEXTURE 0x829D +#define GL_GEOMETRY_TEXTURE 0x829E +#define GL_FRAGMENT_TEXTURE 0x829F +#define GL_COMPUTE_TEXTURE 0x82A0 +#define GL_TEXTURE_SHADOW 0x82A1 +#define GL_TEXTURE_GATHER 0x82A2 +#define GL_TEXTURE_GATHER_SHADOW 0x82A3 +#define GL_SHADER_IMAGE_LOAD 0x82A4 +#define GL_SHADER_IMAGE_STORE 0x82A5 +#define GL_SHADER_IMAGE_ATOMIC 0x82A6 +#define GL_IMAGE_TEXEL_SIZE 0x82A7 +#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 +#define GL_IMAGE_PIXEL_FORMAT 0x82A9 +#define GL_IMAGE_PIXEL_TYPE 0x82AA +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF +#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 +#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 +#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 +#define GL_CLEAR_BUFFER 0x82B4 +#define GL_TEXTURE_VIEW 0x82B5 +#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 +#define GL_FULL_SUPPORT 0x82B7 +#define GL_CAVEAT_SUPPORT 0x82B8 +#define GL_IMAGE_CLASS_4_X_32 0x82B9 +#define GL_IMAGE_CLASS_2_X_32 0x82BA +#define GL_IMAGE_CLASS_1_X_32 0x82BB +#define GL_IMAGE_CLASS_4_X_16 0x82BC +#define GL_IMAGE_CLASS_2_X_16 0x82BD +#define GL_IMAGE_CLASS_1_X_16 0x82BE +#define GL_IMAGE_CLASS_4_X_8 0x82BF +#define GL_IMAGE_CLASS_2_X_8 0x82C0 +#define GL_IMAGE_CLASS_1_X_8 0x82C1 +#define GL_IMAGE_CLASS_11_11_10 0x82C2 +#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 +#define GL_VIEW_CLASS_128_BITS 0x82C4 +#define GL_VIEW_CLASS_96_BITS 0x82C5 +#define GL_VIEW_CLASS_64_BITS 0x82C6 +#define GL_VIEW_CLASS_48_BITS 0x82C7 +#define GL_VIEW_CLASS_32_BITS 0x82C8 +#define GL_VIEW_CLASS_24_BITS 0x82C9 +#define GL_VIEW_CLASS_16_BITS 0x82CA +#define GL_VIEW_CLASS_8_BITS 0x82CB +#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC +#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD +#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE +#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF +#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 +#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 +#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 +#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params); + +#define glGetInternalformati64v GLEW_GET_FUN(__glewGetInternalformati64v) + +#define GLEW_ARB_internalformat_query2 GLEW_GET_VAR(__GLEW_ARB_internalformat_query2) + +#endif /* GL_ARB_internalformat_query2 */ + +/* ----------------------- GL_ARB_invalidate_subdata ----------------------- */ + +#ifndef GL_ARB_invalidate_subdata +#define GL_ARB_invalidate_subdata 1 + +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); +typedef void (GLAPIENTRY * PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); + +#define glInvalidateBufferData GLEW_GET_FUN(__glewInvalidateBufferData) +#define glInvalidateBufferSubData GLEW_GET_FUN(__glewInvalidateBufferSubData) +#define glInvalidateFramebuffer GLEW_GET_FUN(__glewInvalidateFramebuffer) +#define glInvalidateSubFramebuffer GLEW_GET_FUN(__glewInvalidateSubFramebuffer) +#define glInvalidateTexImage GLEW_GET_FUN(__glewInvalidateTexImage) +#define glInvalidateTexSubImage GLEW_GET_FUN(__glewInvalidateTexSubImage) + +#define GLEW_ARB_invalidate_subdata GLEW_GET_VAR(__GLEW_ARB_invalidate_subdata) + +#endif /* GL_ARB_invalidate_subdata */ + +/* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */ + +#ifndef GL_ARB_map_buffer_alignment +#define GL_ARB_map_buffer_alignment 1 + +#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC + +#define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment) + +#endif /* GL_ARB_map_buffer_alignment */ + +/* ------------------------ GL_ARB_map_buffer_range ------------------------ */ + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 + +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + +#define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange) +#define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange) + +#define GLEW_ARB_map_buffer_range GLEW_GET_VAR(__GLEW_ARB_map_buffer_range) + +#endif /* GL_ARB_map_buffer_range */ + +/* ------------------------- GL_ARB_matrix_palette ------------------------- */ + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 + +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 + +typedef void (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices); + +#define glCurrentPaletteMatrixARB GLEW_GET_FUN(__glewCurrentPaletteMatrixARB) +#define glMatrixIndexPointerARB GLEW_GET_FUN(__glewMatrixIndexPointerARB) +#define glMatrixIndexubvARB GLEW_GET_FUN(__glewMatrixIndexubvARB) +#define glMatrixIndexuivARB GLEW_GET_FUN(__glewMatrixIndexuivARB) +#define glMatrixIndexusvARB GLEW_GET_FUN(__glewMatrixIndexusvARB) + +#define GLEW_ARB_matrix_palette GLEW_GET_VAR(__GLEW_ARB_matrix_palette) + +#endif /* GL_ARB_matrix_palette */ + +/* --------------------------- GL_ARB_multi_bind --------------------------- */ + +#ifndef GL_ARB_multi_bind +#define GL_ARB_multi_bind 1 + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizeiptr *sizes); +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); + +#define glBindBuffersBase GLEW_GET_FUN(__glewBindBuffersBase) +#define glBindBuffersRange GLEW_GET_FUN(__glewBindBuffersRange) +#define glBindImageTextures GLEW_GET_FUN(__glewBindImageTextures) +#define glBindSamplers GLEW_GET_FUN(__glewBindSamplers) +#define glBindTextures GLEW_GET_FUN(__glewBindTextures) +#define glBindVertexBuffers GLEW_GET_FUN(__glewBindVertexBuffers) + +#define GLEW_ARB_multi_bind GLEW_GET_VAR(__GLEW_ARB_multi_bind) + +#endif /* GL_ARB_multi_bind */ + +/* ----------------------- GL_ARB_multi_draw_indirect ---------------------- */ + +#ifndef GL_ARB_multi_draw_indirect +#define GL_ARB_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirect GLEW_GET_FUN(__glewMultiDrawArraysIndirect) +#define glMultiDrawElementsIndirect GLEW_GET_FUN(__glewMultiDrawElementsIndirect) + +#define GLEW_ARB_multi_draw_indirect GLEW_GET_VAR(__GLEW_ARB_multi_draw_indirect) + +#endif /* GL_ARB_multi_draw_indirect */ + +/* --------------------------- GL_ARB_multisample -------------------------- */ + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 + +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); + +#define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB) + +#define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample) + +#endif /* GL_ARB_multisample */ + +/* -------------------------- GL_ARB_multitexture -------------------------- */ + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 + +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); + +#define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB) +#define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB) +#define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB) +#define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB) +#define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB) +#define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB) +#define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB) +#define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB) +#define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB) +#define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB) +#define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB) +#define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB) +#define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB) +#define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB) +#define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB) +#define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB) +#define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB) +#define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB) +#define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB) +#define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB) +#define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB) +#define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB) +#define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB) +#define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB) +#define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB) +#define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB) +#define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB) +#define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB) +#define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB) +#define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB) +#define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB) +#define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB) +#define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB) +#define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB) + +#define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture) + +#endif /* GL_ARB_multitexture */ + +/* ------------------------- GL_ARB_occlusion_query ------------------------ */ + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 + +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id); + +#define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB) +#define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB) +#define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB) +#define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB) +#define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB) +#define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB) +#define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB) +#define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB) + +#define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query) + +#endif /* GL_ARB_occlusion_query */ + +/* ------------------------ GL_ARB_occlusion_query2 ------------------------ */ + +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 + +#define GL_ANY_SAMPLES_PASSED 0x8C2F + +#define GLEW_ARB_occlusion_query2 GLEW_GET_VAR(__GLEW_ARB_occlusion_query2) + +#endif /* GL_ARB_occlusion_query2 */ + +/* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */ + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF + +#define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object) + +#endif /* GL_ARB_pixel_buffer_object */ + +/* ------------------------ GL_ARB_point_parameters ------------------------ */ + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 + +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB) +#define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB) + +#define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters) + +#endif /* GL_ARB_point_parameters */ + +/* -------------------------- GL_ARB_point_sprite -------------------------- */ + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 + +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 + +#define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite) + +#endif /* GL_ARB_point_sprite */ + +/* --------------------- GL_ARB_program_interface_query -------------------- */ + +#ifndef GL_ARB_program_interface_query +#define GL_ARB_program_interface_query 1 + +#define GL_UNIFORM 0x92E1 +#define GL_UNIFORM_BLOCK 0x92E2 +#define GL_PROGRAM_INPUT 0x92E3 +#define GL_PROGRAM_OUTPUT 0x92E4 +#define GL_BUFFER_VARIABLE 0x92E5 +#define GL_SHADER_STORAGE_BLOCK 0x92E6 +#define GL_IS_PER_PATCH 0x92E7 +#define GL_VERTEX_SUBROUTINE 0x92E8 +#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 +#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA +#define GL_GEOMETRY_SUBROUTINE 0x92EB +#define GL_FRAGMENT_SUBROUTINE 0x92EC +#define GL_COMPUTE_SUBROUTINE 0x92ED +#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE +#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF +#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 +#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 +#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 +#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 +#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 +#define GL_ACTIVE_RESOURCES 0x92F5 +#define GL_MAX_NAME_LENGTH 0x92F6 +#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 +#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 +#define GL_NAME_LENGTH 0x92F9 +#define GL_TYPE 0x92FA +#define GL_ARRAY_SIZE 0x92FB +#define GL_OFFSET 0x92FC +#define GL_BLOCK_INDEX 0x92FD +#define GL_ARRAY_STRIDE 0x92FE +#define GL_MATRIX_STRIDE 0x92FF +#define GL_IS_ROW_MAJOR 0x9300 +#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 +#define GL_BUFFER_BINDING 0x9302 +#define GL_BUFFER_DATA_SIZE 0x9303 +#define GL_NUM_ACTIVE_VARIABLES 0x9304 +#define GL_ACTIVE_VARIABLES 0x9305 +#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 +#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 +#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 +#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 +#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A +#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B +#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C +#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D +#define GL_LOCATION 0x930E +#define GL_LOCATION_INDEX 0x930F + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint* params); +typedef GLuint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params); + +#define glGetProgramInterfaceiv GLEW_GET_FUN(__glewGetProgramInterfaceiv) +#define glGetProgramResourceIndex GLEW_GET_FUN(__glewGetProgramResourceIndex) +#define glGetProgramResourceLocation GLEW_GET_FUN(__glewGetProgramResourceLocation) +#define glGetProgramResourceLocationIndex GLEW_GET_FUN(__glewGetProgramResourceLocationIndex) +#define glGetProgramResourceName GLEW_GET_FUN(__glewGetProgramResourceName) +#define glGetProgramResourceiv GLEW_GET_FUN(__glewGetProgramResourceiv) + +#define GLEW_ARB_program_interface_query GLEW_GET_VAR(__GLEW_ARB_program_interface_query) + +#endif /* GL_ARB_program_interface_query */ + +/* ------------------------ GL_ARB_provoking_vertex ------------------------ */ + +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode); + +#define glProvokingVertex GLEW_GET_FUN(__glewProvokingVertex) + +#define GLEW_ARB_provoking_vertex GLEW_GET_VAR(__GLEW_ARB_provoking_vertex) + +#endif /* GL_ARB_provoking_vertex */ + +/* ----------------------- GL_ARB_query_buffer_object ---------------------- */ + +#ifndef GL_ARB_query_buffer_object +#define GL_ARB_query_buffer_object 1 + +#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 +#define GL_QUERY_BUFFER 0x9192 +#define GL_QUERY_BUFFER_BINDING 0x9193 +#define GL_QUERY_RESULT_NO_WAIT 0x9194 + +#define GLEW_ARB_query_buffer_object GLEW_GET_VAR(__GLEW_ARB_query_buffer_object) + +#endif /* GL_ARB_query_buffer_object */ + +/* ------------------ GL_ARB_robust_buffer_access_behavior ----------------- */ + +#ifndef GL_ARB_robust_buffer_access_behavior +#define GL_ARB_robust_buffer_access_behavior 1 + +#define GLEW_ARB_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_ARB_robust_buffer_access_behavior) + +#endif /* GL_ARB_robust_buffer_access_behavior */ + +/* --------------------------- GL_ARB_robustness --------------------------- */ + +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 + +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 + +typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); +typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); +typedef void (GLAPIENTRY * PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint* v); +typedef void (GLAPIENTRY * PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort* values); +typedef void (GLAPIENTRY * PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte* pattern); +typedef void (GLAPIENTRY * PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, GLvoid*column, GLvoid*span); +typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); +typedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); + +#define glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB) +#define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB) +#define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB) +#define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB) +#define glGetnHistogramARB GLEW_GET_FUN(__glewGetnHistogramARB) +#define glGetnMapdvARB GLEW_GET_FUN(__glewGetnMapdvARB) +#define glGetnMapfvARB GLEW_GET_FUN(__glewGetnMapfvARB) +#define glGetnMapivARB GLEW_GET_FUN(__glewGetnMapivARB) +#define glGetnMinmaxARB GLEW_GET_FUN(__glewGetnMinmaxARB) +#define glGetnPixelMapfvARB GLEW_GET_FUN(__glewGetnPixelMapfvARB) +#define glGetnPixelMapuivARB GLEW_GET_FUN(__glewGetnPixelMapuivARB) +#define glGetnPixelMapusvARB GLEW_GET_FUN(__glewGetnPixelMapusvARB) +#define glGetnPolygonStippleARB GLEW_GET_FUN(__glewGetnPolygonStippleARB) +#define glGetnSeparableFilterARB GLEW_GET_FUN(__glewGetnSeparableFilterARB) +#define glGetnTexImageARB GLEW_GET_FUN(__glewGetnTexImageARB) +#define glGetnUniformdvARB GLEW_GET_FUN(__glewGetnUniformdvARB) +#define glGetnUniformfvARB GLEW_GET_FUN(__glewGetnUniformfvARB) +#define glGetnUniformivARB GLEW_GET_FUN(__glewGetnUniformivARB) +#define glGetnUniformuivARB GLEW_GET_FUN(__glewGetnUniformuivARB) +#define glReadnPixelsARB GLEW_GET_FUN(__glewReadnPixelsARB) + +#define GLEW_ARB_robustness GLEW_GET_VAR(__GLEW_ARB_robustness) + +#endif /* GL_ARB_robustness */ + +/* ---------------- GL_ARB_robustness_application_isolation ---------------- */ + +#ifndef GL_ARB_robustness_application_isolation +#define GL_ARB_robustness_application_isolation 1 + +#define GLEW_ARB_robustness_application_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_application_isolation) + +#endif /* GL_ARB_robustness_application_isolation */ + +/* ---------------- GL_ARB_robustness_share_group_isolation ---------------- */ + +#ifndef GL_ARB_robustness_share_group_isolation +#define GL_ARB_robustness_share_group_isolation 1 + +#define GLEW_ARB_robustness_share_group_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_share_group_isolation) + +#endif /* GL_ARB_robustness_share_group_isolation */ + +/* ------------------------- GL_ARB_sample_shading ------------------------- */ + +#ifndef GL_ARB_sample_shading +#define GL_ARB_sample_shading 1 + +#define GL_SAMPLE_SHADING_ARB 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 + +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value); + +#define glMinSampleShadingARB GLEW_GET_FUN(__glewMinSampleShadingARB) + +#define GLEW_ARB_sample_shading GLEW_GET_VAR(__GLEW_ARB_sample_shading) + +#endif /* GL_ARB_sample_shading */ + +/* ------------------------- GL_ARB_sampler_objects ------------------------ */ + +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 + +#define GL_SAMPLER_BINDING 0x8919 + +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint * samplers); +typedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* params); + +#define glBindSampler GLEW_GET_FUN(__glewBindSampler) +#define glDeleteSamplers GLEW_GET_FUN(__glewDeleteSamplers) +#define glGenSamplers GLEW_GET_FUN(__glewGenSamplers) +#define glGetSamplerParameterIiv GLEW_GET_FUN(__glewGetSamplerParameterIiv) +#define glGetSamplerParameterIuiv GLEW_GET_FUN(__glewGetSamplerParameterIuiv) +#define glGetSamplerParameterfv GLEW_GET_FUN(__glewGetSamplerParameterfv) +#define glGetSamplerParameteriv GLEW_GET_FUN(__glewGetSamplerParameteriv) +#define glIsSampler GLEW_GET_FUN(__glewIsSampler) +#define glSamplerParameterIiv GLEW_GET_FUN(__glewSamplerParameterIiv) +#define glSamplerParameterIuiv GLEW_GET_FUN(__glewSamplerParameterIuiv) +#define glSamplerParameterf GLEW_GET_FUN(__glewSamplerParameterf) +#define glSamplerParameterfv GLEW_GET_FUN(__glewSamplerParameterfv) +#define glSamplerParameteri GLEW_GET_FUN(__glewSamplerParameteri) +#define glSamplerParameteriv GLEW_GET_FUN(__glewSamplerParameteriv) + +#define GLEW_ARB_sampler_objects GLEW_GET_VAR(__GLEW_ARB_sampler_objects) + +#endif /* GL_ARB_sampler_objects */ + +/* ------------------------ GL_ARB_seamless_cube_map ----------------------- */ + +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cube_map GLEW_GET_VAR(__GLEW_ARB_seamless_cube_map) + +#endif /* GL_ARB_seamless_cube_map */ + +/* ------------------ GL_ARB_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_ARB_seamless_cubemap_per_texture +#define GL_ARB_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_ARB_seamless_cubemap_per_texture) + +#endif /* GL_ARB_seamless_cubemap_per_texture */ + +/* --------------------- GL_ARB_separate_shader_objects -------------------- */ + +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 + +#define GL_VERTEX_SHADER_BIT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT 0x00000002 +#define GL_GEOMETRY_SHADER_BIT 0x00000004 +#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 +#define GL_PROGRAM_SEPARABLE 0x8258 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#define GL_ALL_SHADER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar ** strings); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); + +#define glActiveShaderProgram GLEW_GET_FUN(__glewActiveShaderProgram) +#define glBindProgramPipeline GLEW_GET_FUN(__glewBindProgramPipeline) +#define glCreateShaderProgramv GLEW_GET_FUN(__glewCreateShaderProgramv) +#define glDeleteProgramPipelines GLEW_GET_FUN(__glewDeleteProgramPipelines) +#define glGenProgramPipelines GLEW_GET_FUN(__glewGenProgramPipelines) +#define glGetProgramPipelineInfoLog GLEW_GET_FUN(__glewGetProgramPipelineInfoLog) +#define glGetProgramPipelineiv GLEW_GET_FUN(__glewGetProgramPipelineiv) +#define glIsProgramPipeline GLEW_GET_FUN(__glewIsProgramPipeline) +#define glProgramUniform1d GLEW_GET_FUN(__glewProgramUniform1d) +#define glProgramUniform1dv GLEW_GET_FUN(__glewProgramUniform1dv) +#define glProgramUniform1f GLEW_GET_FUN(__glewProgramUniform1f) +#define glProgramUniform1fv GLEW_GET_FUN(__glewProgramUniform1fv) +#define glProgramUniform1i GLEW_GET_FUN(__glewProgramUniform1i) +#define glProgramUniform1iv GLEW_GET_FUN(__glewProgramUniform1iv) +#define glProgramUniform1ui GLEW_GET_FUN(__glewProgramUniform1ui) +#define glProgramUniform1uiv GLEW_GET_FUN(__glewProgramUniform1uiv) +#define glProgramUniform2d GLEW_GET_FUN(__glewProgramUniform2d) +#define glProgramUniform2dv GLEW_GET_FUN(__glewProgramUniform2dv) +#define glProgramUniform2f GLEW_GET_FUN(__glewProgramUniform2f) +#define glProgramUniform2fv GLEW_GET_FUN(__glewProgramUniform2fv) +#define glProgramUniform2i GLEW_GET_FUN(__glewProgramUniform2i) +#define glProgramUniform2iv GLEW_GET_FUN(__glewProgramUniform2iv) +#define glProgramUniform2ui GLEW_GET_FUN(__glewProgramUniform2ui) +#define glProgramUniform2uiv GLEW_GET_FUN(__glewProgramUniform2uiv) +#define glProgramUniform3d GLEW_GET_FUN(__glewProgramUniform3d) +#define glProgramUniform3dv GLEW_GET_FUN(__glewProgramUniform3dv) +#define glProgramUniform3f GLEW_GET_FUN(__glewProgramUniform3f) +#define glProgramUniform3fv GLEW_GET_FUN(__glewProgramUniform3fv) +#define glProgramUniform3i GLEW_GET_FUN(__glewProgramUniform3i) +#define glProgramUniform3iv GLEW_GET_FUN(__glewProgramUniform3iv) +#define glProgramUniform3ui GLEW_GET_FUN(__glewProgramUniform3ui) +#define glProgramUniform3uiv GLEW_GET_FUN(__glewProgramUniform3uiv) +#define glProgramUniform4d GLEW_GET_FUN(__glewProgramUniform4d) +#define glProgramUniform4dv GLEW_GET_FUN(__glewProgramUniform4dv) +#define glProgramUniform4f GLEW_GET_FUN(__glewProgramUniform4f) +#define glProgramUniform4fv GLEW_GET_FUN(__glewProgramUniform4fv) +#define glProgramUniform4i GLEW_GET_FUN(__glewProgramUniform4i) +#define glProgramUniform4iv GLEW_GET_FUN(__glewProgramUniform4iv) +#define glProgramUniform4ui GLEW_GET_FUN(__glewProgramUniform4ui) +#define glProgramUniform4uiv GLEW_GET_FUN(__glewProgramUniform4uiv) +#define glProgramUniformMatrix2dv GLEW_GET_FUN(__glewProgramUniformMatrix2dv) +#define glProgramUniformMatrix2fv GLEW_GET_FUN(__glewProgramUniformMatrix2fv) +#define glProgramUniformMatrix2x3dv GLEW_GET_FUN(__glewProgramUniformMatrix2x3dv) +#define glProgramUniformMatrix2x3fv GLEW_GET_FUN(__glewProgramUniformMatrix2x3fv) +#define glProgramUniformMatrix2x4dv GLEW_GET_FUN(__glewProgramUniformMatrix2x4dv) +#define glProgramUniformMatrix2x4fv GLEW_GET_FUN(__glewProgramUniformMatrix2x4fv) +#define glProgramUniformMatrix3dv GLEW_GET_FUN(__glewProgramUniformMatrix3dv) +#define glProgramUniformMatrix3fv GLEW_GET_FUN(__glewProgramUniformMatrix3fv) +#define glProgramUniformMatrix3x2dv GLEW_GET_FUN(__glewProgramUniformMatrix3x2dv) +#define glProgramUniformMatrix3x2fv GLEW_GET_FUN(__glewProgramUniformMatrix3x2fv) +#define glProgramUniformMatrix3x4dv GLEW_GET_FUN(__glewProgramUniformMatrix3x4dv) +#define glProgramUniformMatrix3x4fv GLEW_GET_FUN(__glewProgramUniformMatrix3x4fv) +#define glProgramUniformMatrix4dv GLEW_GET_FUN(__glewProgramUniformMatrix4dv) +#define glProgramUniformMatrix4fv GLEW_GET_FUN(__glewProgramUniformMatrix4fv) +#define glProgramUniformMatrix4x2dv GLEW_GET_FUN(__glewProgramUniformMatrix4x2dv) +#define glProgramUniformMatrix4x2fv GLEW_GET_FUN(__glewProgramUniformMatrix4x2fv) +#define glProgramUniformMatrix4x3dv GLEW_GET_FUN(__glewProgramUniformMatrix4x3dv) +#define glProgramUniformMatrix4x3fv GLEW_GET_FUN(__glewProgramUniformMatrix4x3fv) +#define glUseProgramStages GLEW_GET_FUN(__glewUseProgramStages) +#define glValidateProgramPipeline GLEW_GET_FUN(__glewValidateProgramPipeline) + +#define GLEW_ARB_separate_shader_objects GLEW_GET_VAR(__GLEW_ARB_separate_shader_objects) + +#endif /* GL_ARB_separate_shader_objects */ + +/* --------------------- GL_ARB_shader_atomic_counters --------------------- */ + +#ifndef GL_ARB_shader_atomic_counters +#define GL_ARB_shader_atomic_counters 1 + +#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 +#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 +#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 +#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 +#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB +#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF +#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 +#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 +#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 +#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 +#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 +#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 +#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB +#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC + +typedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); + +#define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv) + +#define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters) + +#endif /* GL_ARB_shader_atomic_counters */ + +/* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */ + +#ifndef GL_ARB_shader_bit_encoding +#define GL_ARB_shader_bit_encoding 1 + +#define GLEW_ARB_shader_bit_encoding GLEW_GET_VAR(__GLEW_ARB_shader_bit_encoding) + +#endif /* GL_ARB_shader_bit_encoding */ + +/* --------------------- GL_ARB_shader_draw_parameters --------------------- */ + +#ifndef GL_ARB_shader_draw_parameters +#define GL_ARB_shader_draw_parameters 1 + +#define GLEW_ARB_shader_draw_parameters GLEW_GET_VAR(__GLEW_ARB_shader_draw_parameters) + +#endif /* GL_ARB_shader_draw_parameters */ + +/* ------------------------ GL_ARB_shader_group_vote ----------------------- */ + +#ifndef GL_ARB_shader_group_vote +#define GL_ARB_shader_group_vote 1 + +#define GLEW_ARB_shader_group_vote GLEW_GET_VAR(__GLEW_ARB_shader_group_vote) + +#endif /* GL_ARB_shader_group_vote */ + +/* --------------------- GL_ARB_shader_image_load_store -------------------- */ + +#ifndef GL_ARB_shader_image_load_store +#define GL_ARB_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 +#define GL_COMMAND_BARRIER_BIT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 +#define GL_MAX_IMAGE_UNITS 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 +#define GL_IMAGE_BINDING_NAME 0x8F3A +#define GL_IMAGE_BINDING_LEVEL 0x8F3B +#define GL_IMAGE_BINDING_LAYERED 0x8F3C +#define GL_IMAGE_BINDING_LAYER 0x8F3D +#define GL_IMAGE_BINDING_ACCESS 0x8F3E +#define GL_IMAGE_1D 0x904C +#define GL_IMAGE_2D 0x904D +#define GL_IMAGE_3D 0x904E +#define GL_IMAGE_2D_RECT 0x904F +#define GL_IMAGE_CUBE 0x9050 +#define GL_IMAGE_BUFFER 0x9051 +#define GL_IMAGE_1D_ARRAY 0x9052 +#define GL_IMAGE_2D_ARRAY 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 +#define GL_INT_IMAGE_1D 0x9057 +#define GL_INT_IMAGE_2D 0x9058 +#define GL_INT_IMAGE_3D 0x9059 +#define GL_INT_IMAGE_2D_RECT 0x905A +#define GL_INT_IMAGE_CUBE 0x905B +#define GL_INT_IMAGE_BUFFER 0x905C +#define GL_INT_IMAGE_1D_ARRAY 0x905D +#define GL_INT_IMAGE_2D_ARRAY 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C +#define GL_MAX_IMAGE_SAMPLES 0x906D +#define GL_IMAGE_BINDING_FORMAT 0x906E +#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 +#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD +#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE +#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#define GL_ALL_BARRIER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); + +#define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture) +#define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier) + +#define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store) + +#endif /* GL_ARB_shader_image_load_store */ + +/* ------------------------ GL_ARB_shader_image_size ----------------------- */ + +#ifndef GL_ARB_shader_image_size +#define GL_ARB_shader_image_size 1 + +#define GLEW_ARB_shader_image_size GLEW_GET_VAR(__GLEW_ARB_shader_image_size) + +#endif /* GL_ARB_shader_image_size */ + +/* ------------------------- GL_ARB_shader_objects ------------------------- */ + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 + +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 + +typedef char GLcharARB; +typedef unsigned int GLhandleARB; + +typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj); +typedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); + +#define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB) +#define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB) +#define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB) +#define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB) +#define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB) +#define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB) +#define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB) +#define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB) +#define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB) +#define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB) +#define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB) +#define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB) +#define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB) +#define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB) +#define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB) +#define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB) +#define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB) +#define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB) +#define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB) +#define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB) +#define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB) +#define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB) +#define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB) +#define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB) +#define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB) +#define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB) +#define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB) +#define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB) +#define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB) +#define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB) +#define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB) +#define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB) +#define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB) +#define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB) +#define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB) +#define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB) +#define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB) +#define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB) +#define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB) + +#define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects) + +#endif /* GL_ARB_shader_objects */ + +/* ------------------------ GL_ARB_shader_precision ------------------------ */ + +#ifndef GL_ARB_shader_precision +#define GL_ARB_shader_precision 1 + +#define GLEW_ARB_shader_precision GLEW_GET_VAR(__GLEW_ARB_shader_precision) + +#endif /* GL_ARB_shader_precision */ + +/* ---------------------- GL_ARB_shader_stencil_export --------------------- */ + +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 + +#define GLEW_ARB_shader_stencil_export GLEW_GET_VAR(__GLEW_ARB_shader_stencil_export) + +#endif /* GL_ARB_shader_stencil_export */ + +/* ------------------ GL_ARB_shader_storage_buffer_object ------------------ */ + +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_ARB_shader_storage_buffer_object 1 + +#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000 +#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 +#define GL_SHADER_STORAGE_BUFFER 0x90D2 +#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 +#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 +#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 +#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 +#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 +#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 +#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA +#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB +#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC +#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD +#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE +#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF + +typedef void (GLAPIENTRY * PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); + +#define glShaderStorageBlockBinding GLEW_GET_FUN(__glewShaderStorageBlockBinding) + +#define GLEW_ARB_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_ARB_shader_storage_buffer_object) + +#endif /* GL_ARB_shader_storage_buffer_object */ + +/* ------------------------ GL_ARB_shader_subroutine ----------------------- */ + +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 + +#define GL_ACTIVE_SUBROUTINES 0x8DE5 +#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 +#define GL_MAX_SUBROUTINES 0x8DE7 +#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 +#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 +#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A +#define GL_COMPATIBLE_SUBROUTINES 0x8E4B + +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint* values); +typedef GLuint (GLAPIENTRY * PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint* params); +typedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint* indices); + +#define glGetActiveSubroutineName GLEW_GET_FUN(__glewGetActiveSubroutineName) +#define glGetActiveSubroutineUniformName GLEW_GET_FUN(__glewGetActiveSubroutineUniformName) +#define glGetActiveSubroutineUniformiv GLEW_GET_FUN(__glewGetActiveSubroutineUniformiv) +#define glGetProgramStageiv GLEW_GET_FUN(__glewGetProgramStageiv) +#define glGetSubroutineIndex GLEW_GET_FUN(__glewGetSubroutineIndex) +#define glGetSubroutineUniformLocation GLEW_GET_FUN(__glewGetSubroutineUniformLocation) +#define glGetUniformSubroutineuiv GLEW_GET_FUN(__glewGetUniformSubroutineuiv) +#define glUniformSubroutinesuiv GLEW_GET_FUN(__glewUniformSubroutinesuiv) + +#define GLEW_ARB_shader_subroutine GLEW_GET_VAR(__GLEW_ARB_shader_subroutine) + +#endif /* GL_ARB_shader_subroutine */ + +/* ----------------------- GL_ARB_shader_texture_lod ----------------------- */ + +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 + +#define GLEW_ARB_shader_texture_lod GLEW_GET_VAR(__GLEW_ARB_shader_texture_lod) + +#endif /* GL_ARB_shader_texture_lod */ + +/* ---------------------- GL_ARB_shading_language_100 ---------------------- */ + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 + +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C + +#define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100) + +#endif /* GL_ARB_shading_language_100 */ + +/* -------------------- GL_ARB_shading_language_420pack -------------------- */ + +#ifndef GL_ARB_shading_language_420pack +#define GL_ARB_shading_language_420pack 1 + +#define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack) + +#endif /* GL_ARB_shading_language_420pack */ + +/* -------------------- GL_ARB_shading_language_include -------------------- */ + +#ifndef GL_ARB_shading_language_include +#define GL_ARB_shading_language_include 1 + +#define GL_SHADER_INCLUDE_ARB 0x8DAE +#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 +#define GL_NAMED_STRING_TYPE_ARB 0x8DEA + +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* const *path, const GLint *length); +typedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name, GLsizei bufSize, GLint *stringlen, GLchar *string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar* name, GLenum pname, GLint *params); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar *string); + +#define glCompileShaderIncludeARB GLEW_GET_FUN(__glewCompileShaderIncludeARB) +#define glDeleteNamedStringARB GLEW_GET_FUN(__glewDeleteNamedStringARB) +#define glGetNamedStringARB GLEW_GET_FUN(__glewGetNamedStringARB) +#define glGetNamedStringivARB GLEW_GET_FUN(__glewGetNamedStringivARB) +#define glIsNamedStringARB GLEW_GET_FUN(__glewIsNamedStringARB) +#define glNamedStringARB GLEW_GET_FUN(__glewNamedStringARB) + +#define GLEW_ARB_shading_language_include GLEW_GET_VAR(__GLEW_ARB_shading_language_include) + +#endif /* GL_ARB_shading_language_include */ + +/* -------------------- GL_ARB_shading_language_packing -------------------- */ + +#ifndef GL_ARB_shading_language_packing +#define GL_ARB_shading_language_packing 1 + +#define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing) + +#endif /* GL_ARB_shading_language_packing */ + +/* ----------------------------- GL_ARB_shadow ----------------------------- */ + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 + +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E + +#define GLEW_ARB_shadow GLEW_GET_VAR(__GLEW_ARB_shadow) + +#endif /* GL_ARB_shadow */ + +/* ------------------------- GL_ARB_shadow_ambient ------------------------- */ + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 + +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF + +#define GLEW_ARB_shadow_ambient GLEW_GET_VAR(__GLEW_ARB_shadow_ambient) + +#endif /* GL_ARB_shadow_ambient */ + +/* ------------------------- GL_ARB_sparse_texture ------------------------- */ + +#ifndef GL_ARB_sparse_texture +#define GL_ARB_sparse_texture 1 + +#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A +#define GL_TEXTURE_SPARSE_ARB 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 +#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 +#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA + +typedef void (GLAPIENTRY * PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +typedef void (GLAPIENTRY * PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); + +#define glTexPageCommitmentARB GLEW_GET_FUN(__glewTexPageCommitmentARB) +#define glTexturePageCommitmentEXT GLEW_GET_FUN(__glewTexturePageCommitmentEXT) + +#define GLEW_ARB_sparse_texture GLEW_GET_VAR(__GLEW_ARB_sparse_texture) + +#endif /* GL_ARB_sparse_texture */ + +/* ------------------------ GL_ARB_stencil_texturing ----------------------- */ + +#ifndef GL_ARB_stencil_texturing +#define GL_ARB_stencil_texturing 1 + +#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA + +#define GLEW_ARB_stencil_texturing GLEW_GET_VAR(__GLEW_ARB_stencil_texturing) + +#endif /* GL_ARB_stencil_texturing */ + +/* ------------------------------ GL_ARB_sync ------------------------------ */ + +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 + +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF + +typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); +typedef void (GLAPIENTRY * PFNGLDELETESYNCPROC) (GLsync GLsync); +typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCPROC) (GLenum condition,GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETSYNCIVPROC) (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values); +typedef GLboolean (GLAPIENTRY * PFNGLISSYNCPROC) (GLsync GLsync); +typedef void (GLAPIENTRY * PFNGLWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); + +#define glClientWaitSync GLEW_GET_FUN(__glewClientWaitSync) +#define glDeleteSync GLEW_GET_FUN(__glewDeleteSync) +#define glFenceSync GLEW_GET_FUN(__glewFenceSync) +#define glGetInteger64v GLEW_GET_FUN(__glewGetInteger64v) +#define glGetSynciv GLEW_GET_FUN(__glewGetSynciv) +#define glIsSync GLEW_GET_FUN(__glewIsSync) +#define glWaitSync GLEW_GET_FUN(__glewWaitSync) + +#define GLEW_ARB_sync GLEW_GET_VAR(__GLEW_ARB_sync) + +#endif /* GL_ARB_sync */ + +/* ----------------------- GL_ARB_tessellation_shader ---------------------- */ + +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 + +#define GL_PATCHES 0xE +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F +#define GL_PATCH_VERTICES 0x8E72 +#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 +#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 +#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 +#define GL_TESS_GEN_MODE 0x8E76 +#define GL_TESS_GEN_SPACING 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 +#define GL_TESS_GEN_POINT_MODE 0x8E79 +#define GL_ISOLINES 0x8E7A +#define GL_FRACTIONAL_ODD 0x8E7B +#define GL_FRACTIONAL_EVEN 0x8E7C +#define GL_MAX_PATCH_VERTICES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 +#define GL_TESS_EVALUATION_SHADER 0x8E87 +#define GL_TESS_CONTROL_SHADER 0x8E88 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A + +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat* values); +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); + +#define glPatchParameterfv GLEW_GET_FUN(__glewPatchParameterfv) +#define glPatchParameteri GLEW_GET_FUN(__glewPatchParameteri) + +#define GLEW_ARB_tessellation_shader GLEW_GET_VAR(__GLEW_ARB_tessellation_shader) + +#endif /* GL_ARB_tessellation_shader */ + +/* ---------------------- GL_ARB_texture_border_clamp ---------------------- */ + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_ARB 0x812D + +#define GLEW_ARB_texture_border_clamp GLEW_GET_VAR(__GLEW_ARB_texture_border_clamp) + +#endif /* GL_ARB_texture_border_clamp */ + +/* ---------------------- GL_ARB_texture_buffer_object --------------------- */ + +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 + +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferARB GLEW_GET_FUN(__glewTexBufferARB) + +#define GLEW_ARB_texture_buffer_object GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object) + +#endif /* GL_ARB_texture_buffer_object */ + +/* ------------------- GL_ARB_texture_buffer_object_rgb32 ------------------ */ + +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 + +#define GLEW_ARB_texture_buffer_object_rgb32 GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object_rgb32) + +#endif /* GL_ARB_texture_buffer_object_rgb32 */ + +/* ---------------------- GL_ARB_texture_buffer_range ---------------------- */ + +#ifndef GL_ARB_texture_buffer_range +#define GL_ARB_texture_buffer_range 1 + +#define GL_TEXTURE_BUFFER_OFFSET 0x919D +#define GL_TEXTURE_BUFFER_SIZE 0x919E +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); + +#define glTexBufferRange GLEW_GET_FUN(__glewTexBufferRange) +#define glTextureBufferRangeEXT GLEW_GET_FUN(__glewTextureBufferRangeEXT) + +#define GLEW_ARB_texture_buffer_range GLEW_GET_VAR(__GLEW_ARB_texture_buffer_range) + +#endif /* GL_ARB_texture_buffer_range */ + +/* ----------------------- GL_ARB_texture_compression ---------------------- */ + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 + +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 + +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLvoid *img); + +#define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB) +#define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB) +#define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB) +#define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB) +#define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB) +#define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB) +#define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB) + +#define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression) + +#endif /* GL_ARB_texture_compression */ + +/* -------------------- GL_ARB_texture_compression_bptc -------------------- */ + +#ifndef GL_ARB_texture_compression_bptc +#define GL_ARB_texture_compression_bptc 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F + +#define GLEW_ARB_texture_compression_bptc GLEW_GET_VAR(__GLEW_ARB_texture_compression_bptc) + +#endif /* GL_ARB_texture_compression_bptc */ + +/* -------------------- GL_ARB_texture_compression_rgtc -------------------- */ + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 + +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE + +#define GLEW_ARB_texture_compression_rgtc GLEW_GET_VAR(__GLEW_ARB_texture_compression_rgtc) + +#endif /* GL_ARB_texture_compression_rgtc */ + +/* ------------------------ GL_ARB_texture_cube_map ------------------------ */ + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 + +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C + +#define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map) + +#endif /* GL_ARB_texture_cube_map */ + +/* --------------------- GL_ARB_texture_cube_map_array --------------------- */ + +#ifndef GL_ARB_texture_cube_map_array +#define GL_ARB_texture_cube_map_array 1 + +#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F + +#define GLEW_ARB_texture_cube_map_array GLEW_GET_VAR(__GLEW_ARB_texture_cube_map_array) + +#endif /* GL_ARB_texture_cube_map_array */ + +/* ------------------------- GL_ARB_texture_env_add ------------------------ */ + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 + +#define GLEW_ARB_texture_env_add GLEW_GET_VAR(__GLEW_ARB_texture_env_add) + +#endif /* GL_ARB_texture_env_add */ + +/* ----------------------- GL_ARB_texture_env_combine ---------------------- */ + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 + +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A + +#define GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine) + +#endif /* GL_ARB_texture_env_combine */ + +/* ---------------------- GL_ARB_texture_env_crossbar ---------------------- */ + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 + +#define GLEW_ARB_texture_env_crossbar GLEW_GET_VAR(__GLEW_ARB_texture_env_crossbar) + +#endif /* GL_ARB_texture_env_crossbar */ + +/* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */ + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 + +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF + +#define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3) + +#endif /* GL_ARB_texture_env_dot3 */ + +/* -------------------------- GL_ARB_texture_float ------------------------- */ + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 + +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 + +#define GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float) + +#endif /* GL_ARB_texture_float */ + +/* ------------------------- GL_ARB_texture_gather ------------------------- */ + +#ifndef GL_ARB_texture_gather +#define GL_ARB_texture_gather 1 + +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F + +#define GLEW_ARB_texture_gather GLEW_GET_VAR(__GLEW_ARB_texture_gather) + +#endif /* GL_ARB_texture_gather */ + +/* ------------------ GL_ARB_texture_mirror_clamp_to_edge ------------------ */ + +#ifndef GL_ARB_texture_mirror_clamp_to_edge +#define GL_ARB_texture_mirror_clamp_to_edge 1 + +#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 + +#define GLEW_ARB_texture_mirror_clamp_to_edge GLEW_GET_VAR(__GLEW_ARB_texture_mirror_clamp_to_edge) + +#endif /* GL_ARB_texture_mirror_clamp_to_edge */ + +/* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */ + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_ARB 0x8370 + +#define GLEW_ARB_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_ARB_texture_mirrored_repeat) + +#endif /* GL_ARB_texture_mirrored_repeat */ + +/* ----------------------- GL_ARB_texture_multisample ---------------------- */ + +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 + +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glGetMultisamplefv GLEW_GET_FUN(__glewGetMultisamplefv) +#define glSampleMaski GLEW_GET_FUN(__glewSampleMaski) +#define glTexImage2DMultisample GLEW_GET_FUN(__glewTexImage2DMultisample) +#define glTexImage3DMultisample GLEW_GET_FUN(__glewTexImage3DMultisample) + +#define GLEW_ARB_texture_multisample GLEW_GET_VAR(__GLEW_ARB_texture_multisample) + +#endif /* GL_ARB_texture_multisample */ + +/* -------------------- GL_ARB_texture_non_power_of_two -------------------- */ + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 + +#define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two) + +#endif /* GL_ARB_texture_non_power_of_two */ + +/* ---------------------- GL_ARB_texture_query_levels ---------------------- */ + +#ifndef GL_ARB_texture_query_levels +#define GL_ARB_texture_query_levels 1 + +#define GLEW_ARB_texture_query_levels GLEW_GET_VAR(__GLEW_ARB_texture_query_levels) + +#endif /* GL_ARB_texture_query_levels */ + +/* ------------------------ GL_ARB_texture_query_lod ----------------------- */ + +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 + +#define GLEW_ARB_texture_query_lod GLEW_GET_VAR(__GLEW_ARB_texture_query_lod) + +#endif /* GL_ARB_texture_query_lod */ + +/* ------------------------ GL_ARB_texture_rectangle ----------------------- */ + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 + +#define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle) + +#endif /* GL_ARB_texture_rectangle */ + +/* --------------------------- GL_ARB_texture_rg --------------------------- */ + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 + +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C + +#define GLEW_ARB_texture_rg GLEW_GET_VAR(__GLEW_ARB_texture_rg) + +#endif /* GL_ARB_texture_rg */ + +/* ----------------------- GL_ARB_texture_rgb10_a2ui ----------------------- */ + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 + +#define GL_RGB10_A2UI 0x906F + +#define GLEW_ARB_texture_rgb10_a2ui GLEW_GET_VAR(__GLEW_ARB_texture_rgb10_a2ui) + +#endif /* GL_ARB_texture_rgb10_a2ui */ + +/* ------------------------ GL_ARB_texture_stencil8 ------------------------ */ + +#ifndef GL_ARB_texture_stencil8 +#define GL_ARB_texture_stencil8 1 + +#define GL_STENCIL_INDEX 0x1901 +#define GL_STENCIL_INDEX8 0x8D48 + +#define GLEW_ARB_texture_stencil8 GLEW_GET_VAR(__GLEW_ARB_texture_stencil8) + +#endif /* GL_ARB_texture_stencil8 */ + +/* ------------------------- GL_ARB_texture_storage ------------------------ */ + +#ifndef GL_ARB_texture_storage +#define GL_ARB_texture_storage 1 + +#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + +#define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D) +#define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D) +#define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D) +#define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT) +#define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT) +#define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT) + +#define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage) + +#endif /* GL_ARB_texture_storage */ + +/* ------------------- GL_ARB_texture_storage_multisample ------------------ */ + +#ifndef GL_ARB_texture_storage_multisample +#define GL_ARB_texture_storage_multisample 1 + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glTexStorage2DMultisample GLEW_GET_FUN(__glewTexStorage2DMultisample) +#define glTexStorage3DMultisample GLEW_GET_FUN(__glewTexStorage3DMultisample) +#define glTextureStorage2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage2DMultisampleEXT) +#define glTextureStorage3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage3DMultisampleEXT) + +#define GLEW_ARB_texture_storage_multisample GLEW_GET_VAR(__GLEW_ARB_texture_storage_multisample) + +#endif /* GL_ARB_texture_storage_multisample */ + +/* ------------------------- GL_ARB_texture_swizzle ------------------------ */ + +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 + +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 + +#define GLEW_ARB_texture_swizzle GLEW_GET_VAR(__GLEW_ARB_texture_swizzle) + +#endif /* GL_ARB_texture_swizzle */ + +/* -------------------------- GL_ARB_texture_view -------------------------- */ + +#ifndef GL_ARB_texture_view +#define GL_ARB_texture_view 1 + +#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF + +typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); + +#define glTextureView GLEW_GET_FUN(__glewTextureView) + +#define GLEW_ARB_texture_view GLEW_GET_VAR(__GLEW_ARB_texture_view) + +#endif /* GL_ARB_texture_view */ + +/* --------------------------- GL_ARB_timer_query -------------------------- */ + +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 + +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); + +#define glGetQueryObjecti64v GLEW_GET_FUN(__glewGetQueryObjecti64v) +#define glGetQueryObjectui64v GLEW_GET_FUN(__glewGetQueryObjectui64v) +#define glQueryCounter GLEW_GET_FUN(__glewQueryCounter) + +#define GLEW_ARB_timer_query GLEW_GET_VAR(__GLEW_ARB_timer_query) + +#endif /* GL_ARB_timer_query */ + +/* ----------------------- GL_ARB_transform_feedback2 ---------------------- */ + +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); + +#define glBindTransformFeedback GLEW_GET_FUN(__glewBindTransformFeedback) +#define glDeleteTransformFeedbacks GLEW_GET_FUN(__glewDeleteTransformFeedbacks) +#define glDrawTransformFeedback GLEW_GET_FUN(__glewDrawTransformFeedback) +#define glGenTransformFeedbacks GLEW_GET_FUN(__glewGenTransformFeedbacks) +#define glIsTransformFeedback GLEW_GET_FUN(__glewIsTransformFeedback) +#define glPauseTransformFeedback GLEW_GET_FUN(__glewPauseTransformFeedback) +#define glResumeTransformFeedback GLEW_GET_FUN(__glewResumeTransformFeedback) + +#define GLEW_ARB_transform_feedback2 GLEW_GET_VAR(__GLEW_ARB_transform_feedback2) + +#endif /* GL_ARB_transform_feedback2 */ + +/* ----------------------- GL_ARB_transform_feedback3 ---------------------- */ + +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 + +#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); +typedef void (GLAPIENTRY * PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); + +#define glBeginQueryIndexed GLEW_GET_FUN(__glewBeginQueryIndexed) +#define glDrawTransformFeedbackStream GLEW_GET_FUN(__glewDrawTransformFeedbackStream) +#define glEndQueryIndexed GLEW_GET_FUN(__glewEndQueryIndexed) +#define glGetQueryIndexediv GLEW_GET_FUN(__glewGetQueryIndexediv) + +#define GLEW_ARB_transform_feedback3 GLEW_GET_VAR(__GLEW_ARB_transform_feedback3) + +#endif /* GL_ARB_transform_feedback3 */ + +/* ------------------ GL_ARB_transform_feedback_instanced ------------------ */ + +#ifndef GL_ARB_transform_feedback_instanced +#define GL_ARB_transform_feedback_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); + +#define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced) +#define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced) + +#define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced) + +#endif /* GL_ARB_transform_feedback_instanced */ + +/* ------------------------ GL_ARB_transpose_matrix ------------------------ */ + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 + +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 + +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); + +#define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB) +#define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB) +#define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB) +#define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB) + +#define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix) + +#endif /* GL_ARB_transpose_matrix */ + +/* ---------------------- GL_ARB_uniform_buffer_object --------------------- */ + +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 + +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +#define GL_INVALID_INDEX 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data); +typedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices); +typedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); + +#define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase) +#define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange) +#define glGetActiveUniformBlockName GLEW_GET_FUN(__glewGetActiveUniformBlockName) +#define glGetActiveUniformBlockiv GLEW_GET_FUN(__glewGetActiveUniformBlockiv) +#define glGetActiveUniformName GLEW_GET_FUN(__glewGetActiveUniformName) +#define glGetActiveUniformsiv GLEW_GET_FUN(__glewGetActiveUniformsiv) +#define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v) +#define glGetUniformBlockIndex GLEW_GET_FUN(__glewGetUniformBlockIndex) +#define glGetUniformIndices GLEW_GET_FUN(__glewGetUniformIndices) +#define glUniformBlockBinding GLEW_GET_FUN(__glewUniformBlockBinding) + +#define GLEW_ARB_uniform_buffer_object GLEW_GET_VAR(__GLEW_ARB_uniform_buffer_object) + +#endif /* GL_ARB_uniform_buffer_object */ + +/* ------------------------ GL_ARB_vertex_array_bgra ----------------------- */ + +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_ARB_vertex_array_bgra GLEW_GET_VAR(__GLEW_ARB_vertex_array_bgra) + +#endif /* GL_ARB_vertex_array_bgra */ + +/* ----------------------- GL_ARB_vertex_array_object ---------------------- */ + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array); + +#define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray) +#define glDeleteVertexArrays GLEW_GET_FUN(__glewDeleteVertexArrays) +#define glGenVertexArrays GLEW_GET_FUN(__glewGenVertexArrays) +#define glIsVertexArray GLEW_GET_FUN(__glewIsVertexArray) + +#define GLEW_ARB_vertex_array_object GLEW_GET_VAR(__GLEW_ARB_vertex_array_object) + +#endif /* GL_ARB_vertex_array_object */ + +/* ----------------------- GL_ARB_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); + +#define glGetVertexAttribLdv GLEW_GET_FUN(__glewGetVertexAttribLdv) +#define glVertexAttribL1d GLEW_GET_FUN(__glewVertexAttribL1d) +#define glVertexAttribL1dv GLEW_GET_FUN(__glewVertexAttribL1dv) +#define glVertexAttribL2d GLEW_GET_FUN(__glewVertexAttribL2d) +#define glVertexAttribL2dv GLEW_GET_FUN(__glewVertexAttribL2dv) +#define glVertexAttribL3d GLEW_GET_FUN(__glewVertexAttribL3d) +#define glVertexAttribL3dv GLEW_GET_FUN(__glewVertexAttribL3dv) +#define glVertexAttribL4d GLEW_GET_FUN(__glewVertexAttribL4d) +#define glVertexAttribL4dv GLEW_GET_FUN(__glewVertexAttribL4dv) +#define glVertexAttribLPointer GLEW_GET_FUN(__glewVertexAttribLPointer) + +#define GLEW_ARB_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_64bit) + +#endif /* GL_ARB_vertex_attrib_64bit */ + +/* ---------------------- GL_ARB_vertex_attrib_binding --------------------- */ + +#ifndef GL_ARB_vertex_attrib_binding +#define GL_ARB_vertex_attrib_binding 1 + +#define GL_VERTEX_ATTRIB_BINDING 0x82D4 +#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 +#define GL_VERTEX_BINDING_DIVISOR 0x82D6 +#define GL_VERTEX_BINDING_OFFSET 0x82D7 +#define GL_VERTEX_BINDING_STRIDE 0x82D8 +#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 +#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); + +#define glBindVertexBuffer GLEW_GET_FUN(__glewBindVertexBuffer) +#define glVertexAttribBinding GLEW_GET_FUN(__glewVertexAttribBinding) +#define glVertexAttribFormat GLEW_GET_FUN(__glewVertexAttribFormat) +#define glVertexAttribIFormat GLEW_GET_FUN(__glewVertexAttribIFormat) +#define glVertexAttribLFormat GLEW_GET_FUN(__glewVertexAttribLFormat) +#define glVertexBindingDivisor GLEW_GET_FUN(__glewVertexBindingDivisor) + +#define GLEW_ARB_vertex_attrib_binding GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_binding) + +#endif /* GL_ARB_vertex_attrib_binding */ + +/* -------------------------- GL_ARB_vertex_blend -------------------------- */ + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 + +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F + +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); +typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, GLint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, GLshort *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, GLubyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, GLuint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights); + +#define glVertexBlendARB GLEW_GET_FUN(__glewVertexBlendARB) +#define glWeightPointerARB GLEW_GET_FUN(__glewWeightPointerARB) +#define glWeightbvARB GLEW_GET_FUN(__glewWeightbvARB) +#define glWeightdvARB GLEW_GET_FUN(__glewWeightdvARB) +#define glWeightfvARB GLEW_GET_FUN(__glewWeightfvARB) +#define glWeightivARB GLEW_GET_FUN(__glewWeightivARB) +#define glWeightsvARB GLEW_GET_FUN(__glewWeightsvARB) +#define glWeightubvARB GLEW_GET_FUN(__glewWeightubvARB) +#define glWeightuivARB GLEW_GET_FUN(__glewWeightuivARB) +#define glWeightusvARB GLEW_GET_FUN(__glewWeightusvARB) + +#define GLEW_ARB_vertex_blend GLEW_GET_VAR(__GLEW_ARB_vertex_blend) + +#endif /* GL_ARB_vertex_blend */ + +/* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */ + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 + +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA + +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target); + +#define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB) +#define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB) +#define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB) +#define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB) +#define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB) +#define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB) +#define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB) +#define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB) +#define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB) +#define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB) +#define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB) + +#define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object) + +#endif /* GL_ARB_vertex_buffer_object */ + +/* ------------------------- GL_ARB_vertex_program ------------------------- */ + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 + +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF + +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); + +#define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB) +#define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB) +#define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB) +#define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB) +#define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB) +#define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB) +#define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB) +#define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB) +#define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB) +#define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB) +#define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB) +#define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB) +#define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB) +#define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB) +#define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB) +#define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB) +#define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB) +#define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB) +#define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB) +#define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB) +#define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB) +#define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB) +#define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB) +#define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB) +#define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB) +#define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB) +#define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB) +#define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB) +#define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB) +#define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB) +#define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB) +#define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB) +#define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB) +#define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB) +#define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB) +#define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB) +#define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB) +#define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB) +#define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB) +#define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB) +#define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB) +#define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB) +#define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB) +#define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB) +#define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB) +#define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB) +#define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB) +#define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB) +#define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB) +#define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB) +#define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB) +#define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB) +#define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB) +#define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB) +#define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB) +#define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB) +#define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB) +#define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB) +#define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB) +#define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB) +#define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB) +#define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB) + +#define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program) + +#endif /* GL_ARB_vertex_program */ + +/* -------------------------- GL_ARB_vertex_shader ------------------------- */ + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 + +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A + +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); + +#define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB) +#define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB) +#define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB) + +#define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader) + +#endif /* GL_ARB_vertex_shader */ + +/* ------------------- GL_ARB_vertex_type_10f_11f_11f_rev ------------------ */ + +#ifndef GL_ARB_vertex_type_10f_11f_11f_rev +#define GL_ARB_vertex_type_10f_11f_11f_rev 1 + +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B + +#define GLEW_ARB_vertex_type_10f_11f_11f_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_10f_11f_11f_rev) + +#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ + +/* ------------------- GL_ARB_vertex_type_2_10_10_10_rev ------------------- */ + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 + +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_INT_2_10_10_10_REV 0x8D9F + +typedef void (GLAPIENTRY * PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint* value); + +#define glColorP3ui GLEW_GET_FUN(__glewColorP3ui) +#define glColorP3uiv GLEW_GET_FUN(__glewColorP3uiv) +#define glColorP4ui GLEW_GET_FUN(__glewColorP4ui) +#define glColorP4uiv GLEW_GET_FUN(__glewColorP4uiv) +#define glMultiTexCoordP1ui GLEW_GET_FUN(__glewMultiTexCoordP1ui) +#define glMultiTexCoordP1uiv GLEW_GET_FUN(__glewMultiTexCoordP1uiv) +#define glMultiTexCoordP2ui GLEW_GET_FUN(__glewMultiTexCoordP2ui) +#define glMultiTexCoordP2uiv GLEW_GET_FUN(__glewMultiTexCoordP2uiv) +#define glMultiTexCoordP3ui GLEW_GET_FUN(__glewMultiTexCoordP3ui) +#define glMultiTexCoordP3uiv GLEW_GET_FUN(__glewMultiTexCoordP3uiv) +#define glMultiTexCoordP4ui GLEW_GET_FUN(__glewMultiTexCoordP4ui) +#define glMultiTexCoordP4uiv GLEW_GET_FUN(__glewMultiTexCoordP4uiv) +#define glNormalP3ui GLEW_GET_FUN(__glewNormalP3ui) +#define glNormalP3uiv GLEW_GET_FUN(__glewNormalP3uiv) +#define glSecondaryColorP3ui GLEW_GET_FUN(__glewSecondaryColorP3ui) +#define glSecondaryColorP3uiv GLEW_GET_FUN(__glewSecondaryColorP3uiv) +#define glTexCoordP1ui GLEW_GET_FUN(__glewTexCoordP1ui) +#define glTexCoordP1uiv GLEW_GET_FUN(__glewTexCoordP1uiv) +#define glTexCoordP2ui GLEW_GET_FUN(__glewTexCoordP2ui) +#define glTexCoordP2uiv GLEW_GET_FUN(__glewTexCoordP2uiv) +#define glTexCoordP3ui GLEW_GET_FUN(__glewTexCoordP3ui) +#define glTexCoordP3uiv GLEW_GET_FUN(__glewTexCoordP3uiv) +#define glTexCoordP4ui GLEW_GET_FUN(__glewTexCoordP4ui) +#define glTexCoordP4uiv GLEW_GET_FUN(__glewTexCoordP4uiv) +#define glVertexAttribP1ui GLEW_GET_FUN(__glewVertexAttribP1ui) +#define glVertexAttribP1uiv GLEW_GET_FUN(__glewVertexAttribP1uiv) +#define glVertexAttribP2ui GLEW_GET_FUN(__glewVertexAttribP2ui) +#define glVertexAttribP2uiv GLEW_GET_FUN(__glewVertexAttribP2uiv) +#define glVertexAttribP3ui GLEW_GET_FUN(__glewVertexAttribP3ui) +#define glVertexAttribP3uiv GLEW_GET_FUN(__glewVertexAttribP3uiv) +#define glVertexAttribP4ui GLEW_GET_FUN(__glewVertexAttribP4ui) +#define glVertexAttribP4uiv GLEW_GET_FUN(__glewVertexAttribP4uiv) +#define glVertexP2ui GLEW_GET_FUN(__glewVertexP2ui) +#define glVertexP2uiv GLEW_GET_FUN(__glewVertexP2uiv) +#define glVertexP3ui GLEW_GET_FUN(__glewVertexP3ui) +#define glVertexP3uiv GLEW_GET_FUN(__glewVertexP3uiv) +#define glVertexP4ui GLEW_GET_FUN(__glewVertexP4ui) +#define glVertexP4uiv GLEW_GET_FUN(__glewVertexP4uiv) + +#define GLEW_ARB_vertex_type_2_10_10_10_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_2_10_10_10_rev) + +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +/* ------------------------- GL_ARB_viewport_array ------------------------- */ + +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 + +#define GL_DEPTH_RANGE 0x0B70 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_MAX_VIEWPORTS 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE 0x825D +#define GL_LAYER_PROVOKING_VERTEX 0x825E +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F +#define GL_UNDEFINED_VERTEX 0x8260 +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd * v); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble* data); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint * v); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat * v); + +#define glDepthRangeArrayv GLEW_GET_FUN(__glewDepthRangeArrayv) +#define glDepthRangeIndexed GLEW_GET_FUN(__glewDepthRangeIndexed) +#define glGetDoublei_v GLEW_GET_FUN(__glewGetDoublei_v) +#define glGetFloati_v GLEW_GET_FUN(__glewGetFloati_v) +#define glScissorArrayv GLEW_GET_FUN(__glewScissorArrayv) +#define glScissorIndexed GLEW_GET_FUN(__glewScissorIndexed) +#define glScissorIndexedv GLEW_GET_FUN(__glewScissorIndexedv) +#define glViewportArrayv GLEW_GET_FUN(__glewViewportArrayv) +#define glViewportIndexedf GLEW_GET_FUN(__glewViewportIndexedf) +#define glViewportIndexedfv GLEW_GET_FUN(__glewViewportIndexedfv) + +#define GLEW_ARB_viewport_array GLEW_GET_VAR(__GLEW_ARB_viewport_array) + +#endif /* GL_ARB_viewport_array */ + +/* --------------------------- GL_ARB_window_pos --------------------------- */ + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p); + +#define glWindowPos2dARB GLEW_GET_FUN(__glewWindowPos2dARB) +#define glWindowPos2dvARB GLEW_GET_FUN(__glewWindowPos2dvARB) +#define glWindowPos2fARB GLEW_GET_FUN(__glewWindowPos2fARB) +#define glWindowPos2fvARB GLEW_GET_FUN(__glewWindowPos2fvARB) +#define glWindowPos2iARB GLEW_GET_FUN(__glewWindowPos2iARB) +#define glWindowPos2ivARB GLEW_GET_FUN(__glewWindowPos2ivARB) +#define glWindowPos2sARB GLEW_GET_FUN(__glewWindowPos2sARB) +#define glWindowPos2svARB GLEW_GET_FUN(__glewWindowPos2svARB) +#define glWindowPos3dARB GLEW_GET_FUN(__glewWindowPos3dARB) +#define glWindowPos3dvARB GLEW_GET_FUN(__glewWindowPos3dvARB) +#define glWindowPos3fARB GLEW_GET_FUN(__glewWindowPos3fARB) +#define glWindowPos3fvARB GLEW_GET_FUN(__glewWindowPos3fvARB) +#define glWindowPos3iARB GLEW_GET_FUN(__glewWindowPos3iARB) +#define glWindowPos3ivARB GLEW_GET_FUN(__glewWindowPos3ivARB) +#define glWindowPos3sARB GLEW_GET_FUN(__glewWindowPos3sARB) +#define glWindowPos3svARB GLEW_GET_FUN(__glewWindowPos3svARB) + +#define GLEW_ARB_window_pos GLEW_GET_VAR(__GLEW_ARB_window_pos) + +#endif /* GL_ARB_window_pos */ + +/* ------------------------- GL_ATIX_point_sprites ------------------------- */ + +#ifndef GL_ATIX_point_sprites +#define GL_ATIX_point_sprites 1 + +#define GL_TEXTURE_POINT_MODE_ATIX 0x60B0 +#define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1 +#define GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2 +#define GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3 +#define GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4 +#define GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5 + +#define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites) + +#endif /* GL_ATIX_point_sprites */ + +/* ---------------------- GL_ATIX_texture_env_combine3 --------------------- */ + +#ifndef GL_ATIX_texture_env_combine3 +#define GL_ATIX_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATIX 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATIX 0x8745 +#define GL_MODULATE_SUBTRACT_ATIX 0x8746 + +#define GLEW_ATIX_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATIX_texture_env_combine3) + +#endif /* GL_ATIX_texture_env_combine3 */ + +/* ----------------------- GL_ATIX_texture_env_route ----------------------- */ + +#ifndef GL_ATIX_texture_env_route +#define GL_ATIX_texture_env_route 1 + +#define GL_SECONDARY_COLOR_ATIX 0x8747 +#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 +#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 + +#define GLEW_ATIX_texture_env_route GLEW_GET_VAR(__GLEW_ATIX_texture_env_route) + +#endif /* GL_ATIX_texture_env_route */ + +/* ---------------- GL_ATIX_vertex_shader_output_point_size ---------------- */ + +#ifndef GL_ATIX_vertex_shader_output_point_size +#define GL_ATIX_vertex_shader_output_point_size 1 + +#define GL_OUTPUT_POINT_SIZE_ATIX 0x610E + +#define GLEW_ATIX_vertex_shader_output_point_size GLEW_GET_VAR(__GLEW_ATIX_vertex_shader_output_point_size) + +#endif /* GL_ATIX_vertex_shader_output_point_size */ + +/* -------------------------- GL_ATI_draw_buffers -------------------------- */ + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI) + +#define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers) + +#endif /* GL_ATI_draw_buffers */ + +/* -------------------------- GL_ATI_element_array ------------------------- */ + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 + +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); + +#define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI) +#define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI) +#define glElementPointerATI GLEW_GET_FUN(__glewElementPointerATI) + +#define GLEW_ATI_element_array GLEW_GET_VAR(__GLEW_ATI_element_array) + +#endif /* GL_ATI_element_array */ + +/* ------------------------- GL_ATI_envmap_bumpmap ------------------------- */ + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 + +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C + +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); + +#define glGetTexBumpParameterfvATI GLEW_GET_FUN(__glewGetTexBumpParameterfvATI) +#define glGetTexBumpParameterivATI GLEW_GET_FUN(__glewGetTexBumpParameterivATI) +#define glTexBumpParameterfvATI GLEW_GET_FUN(__glewTexBumpParameterfvATI) +#define glTexBumpParameterivATI GLEW_GET_FUN(__glewTexBumpParameterivATI) + +#define GLEW_ATI_envmap_bumpmap GLEW_GET_VAR(__GLEW_ATI_envmap_bumpmap) + +#endif /* GL_ATI_envmap_bumpmap */ + +/* ------------------------- GL_ATI_fragment_shader ------------------------ */ + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 + +#define GL_RED_BIT_ATI 0x00000001 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B + +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value); + +#define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI) +#define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI) +#define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI) +#define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI) +#define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI) +#define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI) +#define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI) +#define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI) +#define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI) +#define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI) +#define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI) +#define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI) +#define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI) +#define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI) + +#define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader) + +#endif /* GL_ATI_fragment_shader */ + +/* ------------------------ GL_ATI_map_object_buffer ----------------------- */ + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 + +typedef GLvoid * (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); + +#define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI) +#define glUnmapObjectBufferATI GLEW_GET_FUN(__glewUnmapObjectBufferATI) + +#define GLEW_ATI_map_object_buffer GLEW_GET_VAR(__GLEW_ATI_map_object_buffer) + +#endif /* GL_ATI_map_object_buffer */ + +/* ----------------------------- GL_ATI_meminfo ---------------------------- */ + +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 + +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD + +#define GLEW_ATI_meminfo GLEW_GET_VAR(__GLEW_ATI_meminfo) + +#endif /* GL_ATI_meminfo */ + +/* -------------------------- GL_ATI_pn_triangles -------------------------- */ + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 + +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 + +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); + +#define glPNTrianglesfATI GLEW_GET_FUN(__glewPNTrianglesfATI) +#define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI) + +#define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles) + +#endif /* GL_ATI_pn_triangles */ + +/* ------------------------ GL_ATI_separate_stencil ------------------------ */ + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 + +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 + +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); + +#define glStencilFuncSeparateATI GLEW_GET_FUN(__glewStencilFuncSeparateATI) +#define glStencilOpSeparateATI GLEW_GET_FUN(__glewStencilOpSeparateATI) + +#define GLEW_ATI_separate_stencil GLEW_GET_VAR(__GLEW_ATI_separate_stencil) + +#endif /* GL_ATI_separate_stencil */ + +/* ----------------------- GL_ATI_shader_texture_lod ----------------------- */ + +#ifndef GL_ATI_shader_texture_lod +#define GL_ATI_shader_texture_lod 1 + +#define GLEW_ATI_shader_texture_lod GLEW_GET_VAR(__GLEW_ATI_shader_texture_lod) + +#endif /* GL_ATI_shader_texture_lod */ + +/* ---------------------- GL_ATI_text_fragment_shader ---------------------- */ + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 + +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 + +#define GLEW_ATI_text_fragment_shader GLEW_GET_VAR(__GLEW_ATI_text_fragment_shader) + +#endif /* GL_ATI_text_fragment_shader */ + +/* --------------------- GL_ATI_texture_compression_3dc -------------------- */ + +#ifndef GL_ATI_texture_compression_3dc +#define GL_ATI_texture_compression_3dc 1 + +#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 + +#define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc) + +#endif /* GL_ATI_texture_compression_3dc */ + +/* ---------------------- GL_ATI_texture_env_combine3 ---------------------- */ + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 + +#define GLEW_ATI_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATI_texture_env_combine3) + +#endif /* GL_ATI_texture_env_combine3 */ + +/* -------------------------- GL_ATI_texture_float ------------------------- */ + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 + +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F + +#define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float) + +#endif /* GL_ATI_texture_float */ + +/* ----------------------- GL_ATI_texture_mirror_once ---------------------- */ + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 + +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 + +#define GLEW_ATI_texture_mirror_once GLEW_GET_VAR(__GLEW_ATI_texture_mirror_once) + +#endif /* GL_ATI_texture_mirror_once */ + +/* ----------------------- GL_ATI_vertex_array_object ---------------------- */ + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 + +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 + +typedef void (GLAPIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (GLAPIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); +typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +typedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); + +#define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI) +#define glFreeObjectBufferATI GLEW_GET_FUN(__glewFreeObjectBufferATI) +#define glGetArrayObjectfvATI GLEW_GET_FUN(__glewGetArrayObjectfvATI) +#define glGetArrayObjectivATI GLEW_GET_FUN(__glewGetArrayObjectivATI) +#define glGetObjectBufferfvATI GLEW_GET_FUN(__glewGetObjectBufferfvATI) +#define glGetObjectBufferivATI GLEW_GET_FUN(__glewGetObjectBufferivATI) +#define glGetVariantArrayObjectfvATI GLEW_GET_FUN(__glewGetVariantArrayObjectfvATI) +#define glGetVariantArrayObjectivATI GLEW_GET_FUN(__glewGetVariantArrayObjectivATI) +#define glIsObjectBufferATI GLEW_GET_FUN(__glewIsObjectBufferATI) +#define glNewObjectBufferATI GLEW_GET_FUN(__glewNewObjectBufferATI) +#define glUpdateObjectBufferATI GLEW_GET_FUN(__glewUpdateObjectBufferATI) +#define glVariantArrayObjectATI GLEW_GET_FUN(__glewVariantArrayObjectATI) + +#define GLEW_ATI_vertex_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_array_object) + +#endif /* GL_ATI_vertex_array_object */ + +/* ------------------- GL_ATI_vertex_attrib_array_object ------------------- */ + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); + +#define glGetVertexAttribArrayObjectfvATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectfvATI) +#define glGetVertexAttribArrayObjectivATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectivATI) +#define glVertexAttribArrayObjectATI GLEW_GET_FUN(__glewVertexAttribArrayObjectATI) + +#define GLEW_ATI_vertex_attrib_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_attrib_array_object) + +#endif /* GL_ATI_vertex_attrib_array_object */ + +/* ------------------------- GL_ATI_vertex_streams ------------------------- */ + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 + +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_SOURCE_ATI 0x876C +#define GL_VERTEX_STREAM0_ATI 0x876D +#define GL_VERTEX_STREAM1_ATI 0x876E +#define GL_VERTEX_STREAM2_ATI 0x876F +#define GL_VERTEX_STREAM3_ATI 0x8770 +#define GL_VERTEX_STREAM4_ATI 0x8771 +#define GL_VERTEX_STREAM5_ATI 0x8772 +#define GL_VERTEX_STREAM6_ATI 0x8773 +#define GL_VERTEX_STREAM7_ATI 0x8774 + +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); + +#define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI) +#define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI) +#define glNormalStream3bvATI GLEW_GET_FUN(__glewNormalStream3bvATI) +#define glNormalStream3dATI GLEW_GET_FUN(__glewNormalStream3dATI) +#define glNormalStream3dvATI GLEW_GET_FUN(__glewNormalStream3dvATI) +#define glNormalStream3fATI GLEW_GET_FUN(__glewNormalStream3fATI) +#define glNormalStream3fvATI GLEW_GET_FUN(__glewNormalStream3fvATI) +#define glNormalStream3iATI GLEW_GET_FUN(__glewNormalStream3iATI) +#define glNormalStream3ivATI GLEW_GET_FUN(__glewNormalStream3ivATI) +#define glNormalStream3sATI GLEW_GET_FUN(__glewNormalStream3sATI) +#define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI) +#define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI) +#define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI) +#define glVertexStream1dATI GLEW_GET_FUN(__glewVertexStream1dATI) +#define glVertexStream1dvATI GLEW_GET_FUN(__glewVertexStream1dvATI) +#define glVertexStream1fATI GLEW_GET_FUN(__glewVertexStream1fATI) +#define glVertexStream1fvATI GLEW_GET_FUN(__glewVertexStream1fvATI) +#define glVertexStream1iATI GLEW_GET_FUN(__glewVertexStream1iATI) +#define glVertexStream1ivATI GLEW_GET_FUN(__glewVertexStream1ivATI) +#define glVertexStream1sATI GLEW_GET_FUN(__glewVertexStream1sATI) +#define glVertexStream1svATI GLEW_GET_FUN(__glewVertexStream1svATI) +#define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI) +#define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI) +#define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI) +#define glVertexStream2fvATI GLEW_GET_FUN(__glewVertexStream2fvATI) +#define glVertexStream2iATI GLEW_GET_FUN(__glewVertexStream2iATI) +#define glVertexStream2ivATI GLEW_GET_FUN(__glewVertexStream2ivATI) +#define glVertexStream2sATI GLEW_GET_FUN(__glewVertexStream2sATI) +#define glVertexStream2svATI GLEW_GET_FUN(__glewVertexStream2svATI) +#define glVertexStream3dATI GLEW_GET_FUN(__glewVertexStream3dATI) +#define glVertexStream3dvATI GLEW_GET_FUN(__glewVertexStream3dvATI) +#define glVertexStream3fATI GLEW_GET_FUN(__glewVertexStream3fATI) +#define glVertexStream3fvATI GLEW_GET_FUN(__glewVertexStream3fvATI) +#define glVertexStream3iATI GLEW_GET_FUN(__glewVertexStream3iATI) +#define glVertexStream3ivATI GLEW_GET_FUN(__glewVertexStream3ivATI) +#define glVertexStream3sATI GLEW_GET_FUN(__glewVertexStream3sATI) +#define glVertexStream3svATI GLEW_GET_FUN(__glewVertexStream3svATI) +#define glVertexStream4dATI GLEW_GET_FUN(__glewVertexStream4dATI) +#define glVertexStream4dvATI GLEW_GET_FUN(__glewVertexStream4dvATI) +#define glVertexStream4fATI GLEW_GET_FUN(__glewVertexStream4fATI) +#define glVertexStream4fvATI GLEW_GET_FUN(__glewVertexStream4fvATI) +#define glVertexStream4iATI GLEW_GET_FUN(__glewVertexStream4iATI) +#define glVertexStream4ivATI GLEW_GET_FUN(__glewVertexStream4ivATI) +#define glVertexStream4sATI GLEW_GET_FUN(__glewVertexStream4sATI) +#define glVertexStream4svATI GLEW_GET_FUN(__glewVertexStream4svATI) + +#define GLEW_ATI_vertex_streams GLEW_GET_VAR(__GLEW_ATI_vertex_streams) + +#endif /* GL_ATI_vertex_streams */ + +/* --------------------------- GL_EXT_422_pixels --------------------------- */ + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 + +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF + +#define GLEW_EXT_422_pixels GLEW_GET_VAR(__GLEW_EXT_422_pixels) + +#endif /* GL_EXT_422_pixels */ + +/* ---------------------------- GL_EXT_Cg_shader --------------------------- */ + +#ifndef GL_EXT_Cg_shader +#define GL_EXT_Cg_shader 1 + +#define GL_CG_VERTEX_SHADER_EXT 0x890E +#define GL_CG_FRAGMENT_SHADER_EXT 0x890F + +#define GLEW_EXT_Cg_shader GLEW_GET_VAR(__GLEW_EXT_Cg_shader) + +#endif /* GL_EXT_Cg_shader */ + +/* ------------------------------ GL_EXT_abgr ------------------------------ */ + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 + +#define GL_ABGR_EXT 0x8000 + +#define GLEW_EXT_abgr GLEW_GET_VAR(__GLEW_EXT_abgr) + +#endif /* GL_EXT_abgr */ + +/* ------------------------------ GL_EXT_bgra ------------------------------ */ + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 + +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 + +#define GLEW_EXT_bgra GLEW_GET_VAR(__GLEW_EXT_bgra) + +#endif /* GL_EXT_bgra */ + +/* ------------------------ GL_EXT_bindable_uniform ------------------------ */ + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 + +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF + +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (GLAPIENTRY * PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +typedef void (GLAPIENTRY * PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); + +#define glGetUniformBufferSizeEXT GLEW_GET_FUN(__glewGetUniformBufferSizeEXT) +#define glGetUniformOffsetEXT GLEW_GET_FUN(__glewGetUniformOffsetEXT) +#define glUniformBufferEXT GLEW_GET_FUN(__glewUniformBufferEXT) + +#define GLEW_EXT_bindable_uniform GLEW_GET_VAR(__GLEW_EXT_bindable_uniform) + +#endif /* GL_EXT_bindable_uniform */ + +/* --------------------------- GL_EXT_blend_color -------------------------- */ + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 + +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 + +typedef void (GLAPIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); + +#define glBlendColorEXT GLEW_GET_FUN(__glewBlendColorEXT) + +#define GLEW_EXT_blend_color GLEW_GET_VAR(__GLEW_EXT_blend_color) + +#endif /* GL_EXT_blend_color */ + +/* --------------------- GL_EXT_blend_equation_separate -------------------- */ + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 + +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); + +#define glBlendEquationSeparateEXT GLEW_GET_FUN(__glewBlendEquationSeparateEXT) + +#define GLEW_EXT_blend_equation_separate GLEW_GET_VAR(__GLEW_EXT_blend_equation_separate) + +#endif /* GL_EXT_blend_equation_separate */ + +/* ----------------------- GL_EXT_blend_func_separate ---------------------- */ + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 + +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB + +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + +#define glBlendFuncSeparateEXT GLEW_GET_FUN(__glewBlendFuncSeparateEXT) + +#define GLEW_EXT_blend_func_separate GLEW_GET_VAR(__GLEW_EXT_blend_func_separate) + +#endif /* GL_EXT_blend_func_separate */ + +/* ------------------------- GL_EXT_blend_logic_op ------------------------- */ + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 + +#define GLEW_EXT_blend_logic_op GLEW_GET_VAR(__GLEW_EXT_blend_logic_op) + +#endif /* GL_EXT_blend_logic_op */ + +/* -------------------------- GL_EXT_blend_minmax -------------------------- */ + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 + +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); + +#define glBlendEquationEXT GLEW_GET_FUN(__glewBlendEquationEXT) + +#define GLEW_EXT_blend_minmax GLEW_GET_VAR(__GLEW_EXT_blend_minmax) + +#endif /* GL_EXT_blend_minmax */ + +/* ------------------------- GL_EXT_blend_subtract ------------------------- */ + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 + +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B + +#define GLEW_EXT_blend_subtract GLEW_GET_VAR(__GLEW_EXT_blend_subtract) + +#endif /* GL_EXT_blend_subtract */ + +/* ------------------------ GL_EXT_clip_volume_hint ------------------------ */ + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 + +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 + +#define GLEW_EXT_clip_volume_hint GLEW_GET_VAR(__GLEW_EXT_clip_volume_hint) + +#endif /* GL_EXT_clip_volume_hint */ + +/* ------------------------------ GL_EXT_cmyka ----------------------------- */ + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 + +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F + +#define GLEW_EXT_cmyka GLEW_GET_VAR(__GLEW_EXT_cmyka) + +#endif /* GL_EXT_cmyka */ + +/* ------------------------- GL_EXT_color_subtable ------------------------- */ + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); + +#define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT) +#define glCopyColorSubTableEXT GLEW_GET_FUN(__glewCopyColorSubTableEXT) + +#define GLEW_EXT_color_subtable GLEW_GET_VAR(__GLEW_EXT_color_subtable) + +#endif /* GL_EXT_color_subtable */ + +/* ---------------------- GL_EXT_compiled_vertex_array --------------------- */ + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 + +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 + +typedef void (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); + +#define glLockArraysEXT GLEW_GET_FUN(__glewLockArraysEXT) +#define glUnlockArraysEXT GLEW_GET_FUN(__glewUnlockArraysEXT) + +#define GLEW_EXT_compiled_vertex_array GLEW_GET_VAR(__GLEW_EXT_compiled_vertex_array) + +#endif /* GL_EXT_compiled_vertex_array */ + +/* --------------------------- GL_EXT_convolution -------------------------- */ + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 + +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 + +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); + +#define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT) +#define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT) +#define glConvolutionParameterfEXT GLEW_GET_FUN(__glewConvolutionParameterfEXT) +#define glConvolutionParameterfvEXT GLEW_GET_FUN(__glewConvolutionParameterfvEXT) +#define glConvolutionParameteriEXT GLEW_GET_FUN(__glewConvolutionParameteriEXT) +#define glConvolutionParameterivEXT GLEW_GET_FUN(__glewConvolutionParameterivEXT) +#define glCopyConvolutionFilter1DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter1DEXT) +#define glCopyConvolutionFilter2DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter2DEXT) +#define glGetConvolutionFilterEXT GLEW_GET_FUN(__glewGetConvolutionFilterEXT) +#define glGetConvolutionParameterfvEXT GLEW_GET_FUN(__glewGetConvolutionParameterfvEXT) +#define glGetConvolutionParameterivEXT GLEW_GET_FUN(__glewGetConvolutionParameterivEXT) +#define glGetSeparableFilterEXT GLEW_GET_FUN(__glewGetSeparableFilterEXT) +#define glSeparableFilter2DEXT GLEW_GET_FUN(__glewSeparableFilter2DEXT) + +#define GLEW_EXT_convolution GLEW_GET_VAR(__GLEW_EXT_convolution) + +#endif /* GL_EXT_convolution */ + +/* ------------------------ GL_EXT_coordinate_frame ------------------------ */ + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 + +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 + +typedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, GLvoid *pointer); + +#define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT) +#define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT) + +#define GLEW_EXT_coordinate_frame GLEW_GET_VAR(__GLEW_EXT_coordinate_frame) + +#endif /* GL_EXT_coordinate_frame */ + +/* -------------------------- GL_EXT_copy_texture -------------------------- */ + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 + +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glCopyTexImage1DEXT GLEW_GET_FUN(__glewCopyTexImage1DEXT) +#define glCopyTexImage2DEXT GLEW_GET_FUN(__glewCopyTexImage2DEXT) +#define glCopyTexSubImage1DEXT GLEW_GET_FUN(__glewCopyTexSubImage1DEXT) +#define glCopyTexSubImage2DEXT GLEW_GET_FUN(__glewCopyTexSubImage2DEXT) +#define glCopyTexSubImage3DEXT GLEW_GET_FUN(__glewCopyTexSubImage3DEXT) + +#define GLEW_EXT_copy_texture GLEW_GET_VAR(__GLEW_EXT_copy_texture) + +#endif /* GL_EXT_copy_texture */ + +/* --------------------------- GL_EXT_cull_vertex -------------------------- */ + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 + +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC + +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); + +#define glCullParameterdvEXT GLEW_GET_FUN(__glewCullParameterdvEXT) +#define glCullParameterfvEXT GLEW_GET_FUN(__glewCullParameterfvEXT) + +#define GLEW_EXT_cull_vertex GLEW_GET_VAR(__GLEW_EXT_cull_vertex) + +#endif /* GL_EXT_cull_vertex */ + +/* -------------------------- GL_EXT_debug_marker -------------------------- */ + +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 + +typedef void (GLAPIENTRY * PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar* marker); +typedef void (GLAPIENTRY * PFNGLPOPGROUPMARKEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar* marker); + +#define glInsertEventMarkerEXT GLEW_GET_FUN(__glewInsertEventMarkerEXT) +#define glPopGroupMarkerEXT GLEW_GET_FUN(__glewPopGroupMarkerEXT) +#define glPushGroupMarkerEXT GLEW_GET_FUN(__glewPushGroupMarkerEXT) + +#define GLEW_EXT_debug_marker GLEW_GET_VAR(__GLEW_EXT_debug_marker) + +#endif /* GL_EXT_debug_marker */ + +/* ------------------------ GL_EXT_depth_bounds_test ----------------------- */ + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 + +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 + +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); + +#define glDepthBoundsEXT GLEW_GET_FUN(__glewDepthBoundsEXT) + +#define GLEW_EXT_depth_bounds_test GLEW_GET_VAR(__GLEW_EXT_depth_bounds_test) + +#endif /* GL_EXT_depth_bounds_test */ + +/* ----------------------- GL_EXT_direct_state_access ---------------------- */ + +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 + +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F + +typedef void (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLvoid *img); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLvoid *img); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLvoid** param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, GLvoid** param); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXORTHOEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXPOPEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXPUSHEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEDEXTPROC) (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEFEXTPROC) (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); + +#define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT) +#define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT) +#define glClientAttribDefaultEXT GLEW_GET_FUN(__glewClientAttribDefaultEXT) +#define glCompressedMultiTexImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage1DEXT) +#define glCompressedMultiTexImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage2DEXT) +#define glCompressedMultiTexImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage3DEXT) +#define glCompressedMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage1DEXT) +#define glCompressedMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage2DEXT) +#define glCompressedMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage3DEXT) +#define glCompressedTextureImage1DEXT GLEW_GET_FUN(__glewCompressedTextureImage1DEXT) +#define glCompressedTextureImage2DEXT GLEW_GET_FUN(__glewCompressedTextureImage2DEXT) +#define glCompressedTextureImage3DEXT GLEW_GET_FUN(__glewCompressedTextureImage3DEXT) +#define glCompressedTextureSubImage1DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage1DEXT) +#define glCompressedTextureSubImage2DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage2DEXT) +#define glCompressedTextureSubImage3DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage3DEXT) +#define glCopyMultiTexImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexImage1DEXT) +#define glCopyMultiTexImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexImage2DEXT) +#define glCopyMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage1DEXT) +#define glCopyMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage2DEXT) +#define glCopyMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage3DEXT) +#define glCopyTextureImage1DEXT GLEW_GET_FUN(__glewCopyTextureImage1DEXT) +#define glCopyTextureImage2DEXT GLEW_GET_FUN(__glewCopyTextureImage2DEXT) +#define glCopyTextureSubImage1DEXT GLEW_GET_FUN(__glewCopyTextureSubImage1DEXT) +#define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT) +#define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT) +#define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT) +#define glDisableClientStateiEXT GLEW_GET_FUN(__glewDisableClientStateiEXT) +#define glDisableVertexArrayAttribEXT GLEW_GET_FUN(__glewDisableVertexArrayAttribEXT) +#define glDisableVertexArrayEXT GLEW_GET_FUN(__glewDisableVertexArrayEXT) +#define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT) +#define glEnableClientStateiEXT GLEW_GET_FUN(__glewEnableClientStateiEXT) +#define glEnableVertexArrayAttribEXT GLEW_GET_FUN(__glewEnableVertexArrayAttribEXT) +#define glEnableVertexArrayEXT GLEW_GET_FUN(__glewEnableVertexArrayEXT) +#define glFlushMappedNamedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedNamedBufferRangeEXT) +#define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT) +#define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT) +#define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT) +#define glGenerateMultiTexMipmapEXT GLEW_GET_FUN(__glewGenerateMultiTexMipmapEXT) +#define glGenerateTextureMipmapEXT GLEW_GET_FUN(__glewGenerateTextureMipmapEXT) +#define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT) +#define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT) +#define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT) +#define glGetDoublei_vEXT GLEW_GET_FUN(__glewGetDoublei_vEXT) +#define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT) +#define glGetFloati_vEXT GLEW_GET_FUN(__glewGetFloati_vEXT) +#define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT) +#define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT) +#define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT) +#define glGetMultiTexGendvEXT GLEW_GET_FUN(__glewGetMultiTexGendvEXT) +#define glGetMultiTexGenfvEXT GLEW_GET_FUN(__glewGetMultiTexGenfvEXT) +#define glGetMultiTexGenivEXT GLEW_GET_FUN(__glewGetMultiTexGenivEXT) +#define glGetMultiTexImageEXT GLEW_GET_FUN(__glewGetMultiTexImageEXT) +#define glGetMultiTexLevelParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterfvEXT) +#define glGetMultiTexLevelParameterivEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterivEXT) +#define glGetMultiTexParameterIivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIivEXT) +#define glGetMultiTexParameterIuivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIuivEXT) +#define glGetMultiTexParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexParameterfvEXT) +#define glGetMultiTexParameterivEXT GLEW_GET_FUN(__glewGetMultiTexParameterivEXT) +#define glGetNamedBufferParameterivEXT GLEW_GET_FUN(__glewGetNamedBufferParameterivEXT) +#define glGetNamedBufferPointervEXT GLEW_GET_FUN(__glewGetNamedBufferPointervEXT) +#define glGetNamedBufferSubDataEXT GLEW_GET_FUN(__glewGetNamedBufferSubDataEXT) +#define glGetNamedFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameterivEXT) +#define glGetNamedProgramLocalParameterIivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIivEXT) +#define glGetNamedProgramLocalParameterIuivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIuivEXT) +#define glGetNamedProgramLocalParameterdvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterdvEXT) +#define glGetNamedProgramLocalParameterfvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterfvEXT) +#define glGetNamedProgramStringEXT GLEW_GET_FUN(__glewGetNamedProgramStringEXT) +#define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT) +#define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT) +#define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT) +#define glGetPointeri_vEXT GLEW_GET_FUN(__glewGetPointeri_vEXT) +#define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT) +#define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT) +#define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT) +#define glGetTextureParameterIivEXT GLEW_GET_FUN(__glewGetTextureParameterIivEXT) +#define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT) +#define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT) +#define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT) +#define glGetVertexArrayIntegeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayIntegeri_vEXT) +#define glGetVertexArrayIntegervEXT GLEW_GET_FUN(__glewGetVertexArrayIntegervEXT) +#define glGetVertexArrayPointeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayPointeri_vEXT) +#define glGetVertexArrayPointervEXT GLEW_GET_FUN(__glewGetVertexArrayPointervEXT) +#define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT) +#define glMapNamedBufferRangeEXT GLEW_GET_FUN(__glewMapNamedBufferRangeEXT) +#define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT) +#define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT) +#define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT) +#define glMatrixLoadTransposefEXT GLEW_GET_FUN(__glewMatrixLoadTransposefEXT) +#define glMatrixLoaddEXT GLEW_GET_FUN(__glewMatrixLoaddEXT) +#define glMatrixLoadfEXT GLEW_GET_FUN(__glewMatrixLoadfEXT) +#define glMatrixMultTransposedEXT GLEW_GET_FUN(__glewMatrixMultTransposedEXT) +#define glMatrixMultTransposefEXT GLEW_GET_FUN(__glewMatrixMultTransposefEXT) +#define glMatrixMultdEXT GLEW_GET_FUN(__glewMatrixMultdEXT) +#define glMatrixMultfEXT GLEW_GET_FUN(__glewMatrixMultfEXT) +#define glMatrixOrthoEXT GLEW_GET_FUN(__glewMatrixOrthoEXT) +#define glMatrixPopEXT GLEW_GET_FUN(__glewMatrixPopEXT) +#define glMatrixPushEXT GLEW_GET_FUN(__glewMatrixPushEXT) +#define glMatrixRotatedEXT GLEW_GET_FUN(__glewMatrixRotatedEXT) +#define glMatrixRotatefEXT GLEW_GET_FUN(__glewMatrixRotatefEXT) +#define glMatrixScaledEXT GLEW_GET_FUN(__glewMatrixScaledEXT) +#define glMatrixScalefEXT GLEW_GET_FUN(__glewMatrixScalefEXT) +#define glMatrixTranslatedEXT GLEW_GET_FUN(__glewMatrixTranslatedEXT) +#define glMatrixTranslatefEXT GLEW_GET_FUN(__glewMatrixTranslatefEXT) +#define glMultiTexBufferEXT GLEW_GET_FUN(__glewMultiTexBufferEXT) +#define glMultiTexCoordPointerEXT GLEW_GET_FUN(__glewMultiTexCoordPointerEXT) +#define glMultiTexEnvfEXT GLEW_GET_FUN(__glewMultiTexEnvfEXT) +#define glMultiTexEnvfvEXT GLEW_GET_FUN(__glewMultiTexEnvfvEXT) +#define glMultiTexEnviEXT GLEW_GET_FUN(__glewMultiTexEnviEXT) +#define glMultiTexEnvivEXT GLEW_GET_FUN(__glewMultiTexEnvivEXT) +#define glMultiTexGendEXT GLEW_GET_FUN(__glewMultiTexGendEXT) +#define glMultiTexGendvEXT GLEW_GET_FUN(__glewMultiTexGendvEXT) +#define glMultiTexGenfEXT GLEW_GET_FUN(__glewMultiTexGenfEXT) +#define glMultiTexGenfvEXT GLEW_GET_FUN(__glewMultiTexGenfvEXT) +#define glMultiTexGeniEXT GLEW_GET_FUN(__glewMultiTexGeniEXT) +#define glMultiTexGenivEXT GLEW_GET_FUN(__glewMultiTexGenivEXT) +#define glMultiTexImage1DEXT GLEW_GET_FUN(__glewMultiTexImage1DEXT) +#define glMultiTexImage2DEXT GLEW_GET_FUN(__glewMultiTexImage2DEXT) +#define glMultiTexImage3DEXT GLEW_GET_FUN(__glewMultiTexImage3DEXT) +#define glMultiTexParameterIivEXT GLEW_GET_FUN(__glewMultiTexParameterIivEXT) +#define glMultiTexParameterIuivEXT GLEW_GET_FUN(__glewMultiTexParameterIuivEXT) +#define glMultiTexParameterfEXT GLEW_GET_FUN(__glewMultiTexParameterfEXT) +#define glMultiTexParameterfvEXT GLEW_GET_FUN(__glewMultiTexParameterfvEXT) +#define glMultiTexParameteriEXT GLEW_GET_FUN(__glewMultiTexParameteriEXT) +#define glMultiTexParameterivEXT GLEW_GET_FUN(__glewMultiTexParameterivEXT) +#define glMultiTexRenderbufferEXT GLEW_GET_FUN(__glewMultiTexRenderbufferEXT) +#define glMultiTexSubImage1DEXT GLEW_GET_FUN(__glewMultiTexSubImage1DEXT) +#define glMultiTexSubImage2DEXT GLEW_GET_FUN(__glewMultiTexSubImage2DEXT) +#define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT) +#define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT) +#define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT) +#define glNamedCopyBufferSubDataEXT GLEW_GET_FUN(__glewNamedCopyBufferSubDataEXT) +#define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT) +#define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT) +#define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT) +#define glNamedFramebufferTexture3DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture3DEXT) +#define glNamedFramebufferTextureEXT GLEW_GET_FUN(__glewNamedFramebufferTextureEXT) +#define glNamedFramebufferTextureFaceEXT GLEW_GET_FUN(__glewNamedFramebufferTextureFaceEXT) +#define glNamedFramebufferTextureLayerEXT GLEW_GET_FUN(__glewNamedFramebufferTextureLayerEXT) +#define glNamedProgramLocalParameter4dEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dEXT) +#define glNamedProgramLocalParameter4dvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dvEXT) +#define glNamedProgramLocalParameter4fEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fEXT) +#define glNamedProgramLocalParameter4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fvEXT) +#define glNamedProgramLocalParameterI4iEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4iEXT) +#define glNamedProgramLocalParameterI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4ivEXT) +#define glNamedProgramLocalParameterI4uiEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uiEXT) +#define glNamedProgramLocalParameterI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uivEXT) +#define glNamedProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameters4fvEXT) +#define glNamedProgramLocalParametersI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4ivEXT) +#define glNamedProgramLocalParametersI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4uivEXT) +#define glNamedProgramStringEXT GLEW_GET_FUN(__glewNamedProgramStringEXT) +#define glNamedRenderbufferStorageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageEXT) +#define glNamedRenderbufferStorageMultisampleCoverageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleCoverageEXT) +#define glNamedRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleEXT) +#define glProgramUniform1fEXT GLEW_GET_FUN(__glewProgramUniform1fEXT) +#define glProgramUniform1fvEXT GLEW_GET_FUN(__glewProgramUniform1fvEXT) +#define glProgramUniform1iEXT GLEW_GET_FUN(__glewProgramUniform1iEXT) +#define glProgramUniform1ivEXT GLEW_GET_FUN(__glewProgramUniform1ivEXT) +#define glProgramUniform1uiEXT GLEW_GET_FUN(__glewProgramUniform1uiEXT) +#define glProgramUniform1uivEXT GLEW_GET_FUN(__glewProgramUniform1uivEXT) +#define glProgramUniform2fEXT GLEW_GET_FUN(__glewProgramUniform2fEXT) +#define glProgramUniform2fvEXT GLEW_GET_FUN(__glewProgramUniform2fvEXT) +#define glProgramUniform2iEXT GLEW_GET_FUN(__glewProgramUniform2iEXT) +#define glProgramUniform2ivEXT GLEW_GET_FUN(__glewProgramUniform2ivEXT) +#define glProgramUniform2uiEXT GLEW_GET_FUN(__glewProgramUniform2uiEXT) +#define glProgramUniform2uivEXT GLEW_GET_FUN(__glewProgramUniform2uivEXT) +#define glProgramUniform3fEXT GLEW_GET_FUN(__glewProgramUniform3fEXT) +#define glProgramUniform3fvEXT GLEW_GET_FUN(__glewProgramUniform3fvEXT) +#define glProgramUniform3iEXT GLEW_GET_FUN(__glewProgramUniform3iEXT) +#define glProgramUniform3ivEXT GLEW_GET_FUN(__glewProgramUniform3ivEXT) +#define glProgramUniform3uiEXT GLEW_GET_FUN(__glewProgramUniform3uiEXT) +#define glProgramUniform3uivEXT GLEW_GET_FUN(__glewProgramUniform3uivEXT) +#define glProgramUniform4fEXT GLEW_GET_FUN(__glewProgramUniform4fEXT) +#define glProgramUniform4fvEXT GLEW_GET_FUN(__glewProgramUniform4fvEXT) +#define glProgramUniform4iEXT GLEW_GET_FUN(__glewProgramUniform4iEXT) +#define glProgramUniform4ivEXT GLEW_GET_FUN(__glewProgramUniform4ivEXT) +#define glProgramUniform4uiEXT GLEW_GET_FUN(__glewProgramUniform4uiEXT) +#define glProgramUniform4uivEXT GLEW_GET_FUN(__glewProgramUniform4uivEXT) +#define glProgramUniformMatrix2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2fvEXT) +#define glProgramUniformMatrix2x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3fvEXT) +#define glProgramUniformMatrix2x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4fvEXT) +#define glProgramUniformMatrix3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3fvEXT) +#define glProgramUniformMatrix3x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2fvEXT) +#define glProgramUniformMatrix3x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4fvEXT) +#define glProgramUniformMatrix4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4fvEXT) +#define glProgramUniformMatrix4x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2fvEXT) +#define glProgramUniformMatrix4x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3fvEXT) +#define glPushClientAttribDefaultEXT GLEW_GET_FUN(__glewPushClientAttribDefaultEXT) +#define glTextureBufferEXT GLEW_GET_FUN(__glewTextureBufferEXT) +#define glTextureImage1DEXT GLEW_GET_FUN(__glewTextureImage1DEXT) +#define glTextureImage2DEXT GLEW_GET_FUN(__glewTextureImage2DEXT) +#define glTextureImage3DEXT GLEW_GET_FUN(__glewTextureImage3DEXT) +#define glTextureParameterIivEXT GLEW_GET_FUN(__glewTextureParameterIivEXT) +#define glTextureParameterIuivEXT GLEW_GET_FUN(__glewTextureParameterIuivEXT) +#define glTextureParameterfEXT GLEW_GET_FUN(__glewTextureParameterfEXT) +#define glTextureParameterfvEXT GLEW_GET_FUN(__glewTextureParameterfvEXT) +#define glTextureParameteriEXT GLEW_GET_FUN(__glewTextureParameteriEXT) +#define glTextureParameterivEXT GLEW_GET_FUN(__glewTextureParameterivEXT) +#define glTextureRenderbufferEXT GLEW_GET_FUN(__glewTextureRenderbufferEXT) +#define glTextureSubImage1DEXT GLEW_GET_FUN(__glewTextureSubImage1DEXT) +#define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT) +#define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT) +#define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT) +#define glVertexArrayColorOffsetEXT GLEW_GET_FUN(__glewVertexArrayColorOffsetEXT) +#define glVertexArrayEdgeFlagOffsetEXT GLEW_GET_FUN(__glewVertexArrayEdgeFlagOffsetEXT) +#define glVertexArrayFogCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayFogCoordOffsetEXT) +#define glVertexArrayIndexOffsetEXT GLEW_GET_FUN(__glewVertexArrayIndexOffsetEXT) +#define glVertexArrayMultiTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayMultiTexCoordOffsetEXT) +#define glVertexArrayNormalOffsetEXT GLEW_GET_FUN(__glewVertexArrayNormalOffsetEXT) +#define glVertexArraySecondaryColorOffsetEXT GLEW_GET_FUN(__glewVertexArraySecondaryColorOffsetEXT) +#define glVertexArrayTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayTexCoordOffsetEXT) +#define glVertexArrayVertexAttribIOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIOffsetEXT) +#define glVertexArrayVertexAttribOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribOffsetEXT) +#define glVertexArrayVertexOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexOffsetEXT) + +#define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access) + +#endif /* GL_EXT_direct_state_access */ + +/* -------------------------- GL_EXT_draw_buffers2 ------------------------- */ + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 + +typedef void (GLAPIENTRY * PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (GLAPIENTRY * PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum value, GLuint index, GLboolean* data); +typedef void (GLAPIENTRY * PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum value, GLuint index, GLint* data); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); + +#define glColorMaskIndexedEXT GLEW_GET_FUN(__glewColorMaskIndexedEXT) +#define glDisableIndexedEXT GLEW_GET_FUN(__glewDisableIndexedEXT) +#define glEnableIndexedEXT GLEW_GET_FUN(__glewEnableIndexedEXT) +#define glGetBooleanIndexedvEXT GLEW_GET_FUN(__glewGetBooleanIndexedvEXT) +#define glGetIntegerIndexedvEXT GLEW_GET_FUN(__glewGetIntegerIndexedvEXT) +#define glIsEnabledIndexedEXT GLEW_GET_FUN(__glewIsEnabledIndexedEXT) + +#define GLEW_EXT_draw_buffers2 GLEW_GET_VAR(__GLEW_EXT_draw_buffers2) + +#endif /* GL_EXT_draw_buffers2 */ + +/* ------------------------- GL_EXT_draw_instanced ------------------------- */ + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); + +#define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT) +#define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT) + +#define GLEW_EXT_draw_instanced GLEW_GET_VAR(__GLEW_EXT_draw_instanced) + +#endif /* GL_EXT_draw_instanced */ + +/* ----------------------- GL_EXT_draw_range_elements ---------------------- */ + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 + +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 + +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); + +#define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT) + +#define GLEW_EXT_draw_range_elements GLEW_GET_VAR(__GLEW_EXT_draw_range_elements) + +#endif /* GL_EXT_draw_range_elements */ + +/* ---------------------------- GL_EXT_fog_coord --------------------------- */ + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 + +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 + +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); + +#define glFogCoordPointerEXT GLEW_GET_FUN(__glewFogCoordPointerEXT) +#define glFogCoorddEXT GLEW_GET_FUN(__glewFogCoorddEXT) +#define glFogCoorddvEXT GLEW_GET_FUN(__glewFogCoorddvEXT) +#define glFogCoordfEXT GLEW_GET_FUN(__glewFogCoordfEXT) +#define glFogCoordfvEXT GLEW_GET_FUN(__glewFogCoordfvEXT) + +#define GLEW_EXT_fog_coord GLEW_GET_VAR(__GLEW_EXT_fog_coord) + +#endif /* GL_EXT_fog_coord */ + +/* ------------------------ GL_EXT_fragment_lighting ----------------------- */ + +#ifndef GL_EXT_fragment_lighting +#define GL_EXT_fragment_lighting 1 + +#define GL_FRAGMENT_LIGHTING_EXT 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 +#define GL_CURRENT_RASTER_NORMAL_EXT 0x8406 +#define GL_LIGHT_ENV_MODE_EXT 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B +#define GL_FRAGMENT_LIGHT0_EXT 0x840C +#define GL_FRAGMENT_LIGHT7_EXT 0x8413 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param); + +#define glFragmentColorMaterialEXT GLEW_GET_FUN(__glewFragmentColorMaterialEXT) +#define glFragmentLightModelfEXT GLEW_GET_FUN(__glewFragmentLightModelfEXT) +#define glFragmentLightModelfvEXT GLEW_GET_FUN(__glewFragmentLightModelfvEXT) +#define glFragmentLightModeliEXT GLEW_GET_FUN(__glewFragmentLightModeliEXT) +#define glFragmentLightModelivEXT GLEW_GET_FUN(__glewFragmentLightModelivEXT) +#define glFragmentLightfEXT GLEW_GET_FUN(__glewFragmentLightfEXT) +#define glFragmentLightfvEXT GLEW_GET_FUN(__glewFragmentLightfvEXT) +#define glFragmentLightiEXT GLEW_GET_FUN(__glewFragmentLightiEXT) +#define glFragmentLightivEXT GLEW_GET_FUN(__glewFragmentLightivEXT) +#define glFragmentMaterialfEXT GLEW_GET_FUN(__glewFragmentMaterialfEXT) +#define glFragmentMaterialfvEXT GLEW_GET_FUN(__glewFragmentMaterialfvEXT) +#define glFragmentMaterialiEXT GLEW_GET_FUN(__glewFragmentMaterialiEXT) +#define glFragmentMaterialivEXT GLEW_GET_FUN(__glewFragmentMaterialivEXT) +#define glGetFragmentLightfvEXT GLEW_GET_FUN(__glewGetFragmentLightfvEXT) +#define glGetFragmentLightivEXT GLEW_GET_FUN(__glewGetFragmentLightivEXT) +#define glGetFragmentMaterialfvEXT GLEW_GET_FUN(__glewGetFragmentMaterialfvEXT) +#define glGetFragmentMaterialivEXT GLEW_GET_FUN(__glewGetFragmentMaterialivEXT) +#define glLightEnviEXT GLEW_GET_FUN(__glewLightEnviEXT) + +#define GLEW_EXT_fragment_lighting GLEW_GET_VAR(__GLEW_EXT_fragment_lighting) + +#endif /* GL_EXT_fragment_lighting */ + +/* ------------------------ GL_EXT_framebuffer_blit ------------------------ */ + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT) + +#define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit) + +#endif /* GL_EXT_framebuffer_blit */ + +/* --------------------- GL_EXT_framebuffer_multisample -------------------- */ + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT) + +#define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample) + +#endif /* GL_EXT_framebuffer_multisample */ + +/* --------------- GL_EXT_framebuffer_multisample_blit_scaled -------------- */ + +#ifndef GL_EXT_framebuffer_multisample_blit_scaled +#define GL_EXT_framebuffer_multisample_blit_scaled 1 + +#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA +#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB + +#define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled) + +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + +/* ----------------------- GL_EXT_framebuffer_object ----------------------- */ + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT) +#define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT) +#define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT) +#define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT) +#define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT) +#define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT) +#define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT) +#define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT) +#define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT) +#define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT) +#define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT) +#define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT) +#define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT) +#define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT) +#define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT) +#define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT) +#define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT) + +#define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object) + +#endif /* GL_EXT_framebuffer_object */ + +/* ------------------------ GL_EXT_framebuffer_sRGB ------------------------ */ + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA + +#define GLEW_EXT_framebuffer_sRGB GLEW_GET_VAR(__GLEW_EXT_framebuffer_sRGB) + +#endif /* GL_EXT_framebuffer_sRGB */ + +/* ------------------------ GL_EXT_geometry_shader4 ------------------------ */ + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_EXT 0xA +#define GL_LINE_STRIP_ADJACENCY_EXT 0xB +#define GL_TRIANGLES_ADJACENCY_EXT 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT) +#define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT) +#define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT) + +#define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4) + +#endif /* GL_EXT_geometry_shader4 */ + +/* --------------------- GL_EXT_gpu_program_parameters --------------------- */ + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 + +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); + +#define glProgramEnvParameters4fvEXT GLEW_GET_FUN(__glewProgramEnvParameters4fvEXT) +#define glProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewProgramLocalParameters4fvEXT) + +#define GLEW_EXT_gpu_program_parameters GLEW_GET_VAR(__GLEW_EXT_gpu_program_parameters) + +#endif /* GL_EXT_gpu_program_parameters */ + +/* --------------------------- GL_EXT_gpu_shader4 -------------------------- */ + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 + +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT) +#define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT) +#define glGetUniformuivEXT GLEW_GET_FUN(__glewGetUniformuivEXT) +#define glGetVertexAttribIivEXT GLEW_GET_FUN(__glewGetVertexAttribIivEXT) +#define glGetVertexAttribIuivEXT GLEW_GET_FUN(__glewGetVertexAttribIuivEXT) +#define glUniform1uiEXT GLEW_GET_FUN(__glewUniform1uiEXT) +#define glUniform1uivEXT GLEW_GET_FUN(__glewUniform1uivEXT) +#define glUniform2uiEXT GLEW_GET_FUN(__glewUniform2uiEXT) +#define glUniform2uivEXT GLEW_GET_FUN(__glewUniform2uivEXT) +#define glUniform3uiEXT GLEW_GET_FUN(__glewUniform3uiEXT) +#define glUniform3uivEXT GLEW_GET_FUN(__glewUniform3uivEXT) +#define glUniform4uiEXT GLEW_GET_FUN(__glewUniform4uiEXT) +#define glUniform4uivEXT GLEW_GET_FUN(__glewUniform4uivEXT) +#define glVertexAttribI1iEXT GLEW_GET_FUN(__glewVertexAttribI1iEXT) +#define glVertexAttribI1ivEXT GLEW_GET_FUN(__glewVertexAttribI1ivEXT) +#define glVertexAttribI1uiEXT GLEW_GET_FUN(__glewVertexAttribI1uiEXT) +#define glVertexAttribI1uivEXT GLEW_GET_FUN(__glewVertexAttribI1uivEXT) +#define glVertexAttribI2iEXT GLEW_GET_FUN(__glewVertexAttribI2iEXT) +#define glVertexAttribI2ivEXT GLEW_GET_FUN(__glewVertexAttribI2ivEXT) +#define glVertexAttribI2uiEXT GLEW_GET_FUN(__glewVertexAttribI2uiEXT) +#define glVertexAttribI2uivEXT GLEW_GET_FUN(__glewVertexAttribI2uivEXT) +#define glVertexAttribI3iEXT GLEW_GET_FUN(__glewVertexAttribI3iEXT) +#define glVertexAttribI3ivEXT GLEW_GET_FUN(__glewVertexAttribI3ivEXT) +#define glVertexAttribI3uiEXT GLEW_GET_FUN(__glewVertexAttribI3uiEXT) +#define glVertexAttribI3uivEXT GLEW_GET_FUN(__glewVertexAttribI3uivEXT) +#define glVertexAttribI4bvEXT GLEW_GET_FUN(__glewVertexAttribI4bvEXT) +#define glVertexAttribI4iEXT GLEW_GET_FUN(__glewVertexAttribI4iEXT) +#define glVertexAttribI4ivEXT GLEW_GET_FUN(__glewVertexAttribI4ivEXT) +#define glVertexAttribI4svEXT GLEW_GET_FUN(__glewVertexAttribI4svEXT) +#define glVertexAttribI4ubvEXT GLEW_GET_FUN(__glewVertexAttribI4ubvEXT) +#define glVertexAttribI4uiEXT GLEW_GET_FUN(__glewVertexAttribI4uiEXT) +#define glVertexAttribI4uivEXT GLEW_GET_FUN(__glewVertexAttribI4uivEXT) +#define glVertexAttribI4usvEXT GLEW_GET_FUN(__glewVertexAttribI4usvEXT) +#define glVertexAttribIPointerEXT GLEW_GET_FUN(__glewVertexAttribIPointerEXT) + +#define GLEW_EXT_gpu_shader4 GLEW_GET_VAR(__GLEW_EXT_gpu_shader4) + +#endif /* GL_EXT_gpu_shader4 */ + +/* ---------------------------- GL_EXT_histogram --------------------------- */ + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 + +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 + +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); + +#define glGetHistogramEXT GLEW_GET_FUN(__glewGetHistogramEXT) +#define glGetHistogramParameterfvEXT GLEW_GET_FUN(__glewGetHistogramParameterfvEXT) +#define glGetHistogramParameterivEXT GLEW_GET_FUN(__glewGetHistogramParameterivEXT) +#define glGetMinmaxEXT GLEW_GET_FUN(__glewGetMinmaxEXT) +#define glGetMinmaxParameterfvEXT GLEW_GET_FUN(__glewGetMinmaxParameterfvEXT) +#define glGetMinmaxParameterivEXT GLEW_GET_FUN(__glewGetMinmaxParameterivEXT) +#define glHistogramEXT GLEW_GET_FUN(__glewHistogramEXT) +#define glMinmaxEXT GLEW_GET_FUN(__glewMinmaxEXT) +#define glResetHistogramEXT GLEW_GET_FUN(__glewResetHistogramEXT) +#define glResetMinmaxEXT GLEW_GET_FUN(__glewResetMinmaxEXT) + +#define GLEW_EXT_histogram GLEW_GET_VAR(__GLEW_EXT_histogram) + +#endif /* GL_EXT_histogram */ + +/* ----------------------- GL_EXT_index_array_formats ---------------------- */ + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 + +#define GLEW_EXT_index_array_formats GLEW_GET_VAR(__GLEW_EXT_index_array_formats) + +#endif /* GL_EXT_index_array_formats */ + +/* --------------------------- GL_EXT_index_func --------------------------- */ + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 + +typedef void (GLAPIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); + +#define glIndexFuncEXT GLEW_GET_FUN(__glewIndexFuncEXT) + +#define GLEW_EXT_index_func GLEW_GET_VAR(__GLEW_EXT_index_func) + +#endif /* GL_EXT_index_func */ + +/* ------------------------- GL_EXT_index_material ------------------------- */ + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 + +typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glIndexMaterialEXT GLEW_GET_FUN(__glewIndexMaterialEXT) + +#define GLEW_EXT_index_material GLEW_GET_VAR(__GLEW_EXT_index_material) + +#endif /* GL_EXT_index_material */ + +/* -------------------------- GL_EXT_index_texture ------------------------- */ + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 + +#define GLEW_EXT_index_texture GLEW_GET_VAR(__GLEW_EXT_index_texture) + +#endif /* GL_EXT_index_texture */ + +/* -------------------------- GL_EXT_light_texture ------------------------- */ + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 + +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 + +typedef void (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glApplyTextureEXT GLEW_GET_FUN(__glewApplyTextureEXT) +#define glTextureLightEXT GLEW_GET_FUN(__glewTextureLightEXT) +#define glTextureMaterialEXT GLEW_GET_FUN(__glewTextureMaterialEXT) + +#define GLEW_EXT_light_texture GLEW_GET_VAR(__GLEW_EXT_light_texture) + +#endif /* GL_EXT_light_texture */ + +/* ------------------------- GL_EXT_misc_attribute ------------------------- */ + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 + +#define GLEW_EXT_misc_attribute GLEW_GET_VAR(__GLEW_EXT_misc_attribute) + +#endif /* GL_EXT_misc_attribute */ + +/* ------------------------ GL_EXT_multi_draw_arrays ----------------------- */ + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const GLvoid * const *indices, GLsizei primcount); + +#define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT) +#define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT) + +#define GLEW_EXT_multi_draw_arrays GLEW_GET_VAR(__GLEW_EXT_multi_draw_arrays) + +#endif /* GL_EXT_multi_draw_arrays */ + +/* --------------------------- GL_EXT_multisample -------------------------- */ + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 + +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); + +#define glSampleMaskEXT GLEW_GET_FUN(__glewSampleMaskEXT) +#define glSamplePatternEXT GLEW_GET_FUN(__glewSamplePatternEXT) + +#define GLEW_EXT_multisample GLEW_GET_VAR(__GLEW_EXT_multisample) + +#endif /* GL_EXT_multisample */ + +/* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */ + +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 + +#define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil) + +#endif /* GL_EXT_packed_depth_stencil */ + +/* -------------------------- GL_EXT_packed_float -------------------------- */ + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 + +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C + +#define GLEW_EXT_packed_float GLEW_GET_VAR(__GLEW_EXT_packed_float) + +#endif /* GL_EXT_packed_float */ + +/* -------------------------- GL_EXT_packed_pixels ------------------------- */ + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 + +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 + +#define GLEW_EXT_packed_pixels GLEW_GET_VAR(__GLEW_EXT_packed_pixels) + +#endif /* GL_EXT_packed_pixels */ + +/* ------------------------ GL_EXT_paletted_texture ------------------------ */ + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 + +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 +#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); + +#define glColorTableEXT GLEW_GET_FUN(__glewColorTableEXT) +#define glGetColorTableEXT GLEW_GET_FUN(__glewGetColorTableEXT) +#define glGetColorTableParameterfvEXT GLEW_GET_FUN(__glewGetColorTableParameterfvEXT) +#define glGetColorTableParameterivEXT GLEW_GET_FUN(__glewGetColorTableParameterivEXT) + +#define GLEW_EXT_paletted_texture GLEW_GET_VAR(__GLEW_EXT_paletted_texture) + +#endif /* GL_EXT_paletted_texture */ + +/* ----------------------- GL_EXT_pixel_buffer_object ---------------------- */ + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF + +#define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object) + +#endif /* GL_EXT_pixel_buffer_object */ + +/* ------------------------- GL_EXT_pixel_transform ------------------------ */ + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 + +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 + +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetPixelTransformParameterfvEXT GLEW_GET_FUN(__glewGetPixelTransformParameterfvEXT) +#define glGetPixelTransformParameterivEXT GLEW_GET_FUN(__glewGetPixelTransformParameterivEXT) +#define glPixelTransformParameterfEXT GLEW_GET_FUN(__glewPixelTransformParameterfEXT) +#define glPixelTransformParameterfvEXT GLEW_GET_FUN(__glewPixelTransformParameterfvEXT) +#define glPixelTransformParameteriEXT GLEW_GET_FUN(__glewPixelTransformParameteriEXT) +#define glPixelTransformParameterivEXT GLEW_GET_FUN(__glewPixelTransformParameterivEXT) + +#define GLEW_EXT_pixel_transform GLEW_GET_VAR(__GLEW_EXT_pixel_transform) + +#endif /* GL_EXT_pixel_transform */ + +/* ------------------- GL_EXT_pixel_transform_color_table ------------------ */ + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 + +#define GLEW_EXT_pixel_transform_color_table GLEW_GET_VAR(__GLEW_EXT_pixel_transform_color_table) + +#endif /* GL_EXT_pixel_transform_color_table */ + +/* ------------------------ GL_EXT_point_parameters ------------------------ */ + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 + +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT) +#define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT) + +#define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters) + +#endif /* GL_EXT_point_parameters */ + +/* ------------------------- GL_EXT_polygon_offset ------------------------- */ + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 + +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 + +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); + +#define glPolygonOffsetEXT GLEW_GET_FUN(__glewPolygonOffsetEXT) + +#define GLEW_EXT_polygon_offset GLEW_GET_VAR(__GLEW_EXT_polygon_offset) + +#endif /* GL_EXT_polygon_offset */ + +/* ------------------------ GL_EXT_provoking_vertex ------------------------ */ + +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); + +#define glProvokingVertexEXT GLEW_GET_FUN(__glewProvokingVertexEXT) + +#define GLEW_EXT_provoking_vertex GLEW_GET_VAR(__GLEW_EXT_provoking_vertex) + +#endif /* GL_EXT_provoking_vertex */ + +/* ------------------------- GL_EXT_rescale_normal ------------------------- */ + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 + +#define GL_RESCALE_NORMAL_EXT 0x803A + +#define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal) + +#endif /* GL_EXT_rescale_normal */ + +/* -------------------------- GL_EXT_scene_marker -------------------------- */ + +#ifndef GL_EXT_scene_marker +#define GL_EXT_scene_marker 1 + +typedef void (GLAPIENTRY * PFNGLBEGINSCENEEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDSCENEEXTPROC) (void); + +#define glBeginSceneEXT GLEW_GET_FUN(__glewBeginSceneEXT) +#define glEndSceneEXT GLEW_GET_FUN(__glewEndSceneEXT) + +#define GLEW_EXT_scene_marker GLEW_GET_VAR(__GLEW_EXT_scene_marker) + +#endif /* GL_EXT_scene_marker */ + +/* ------------------------- GL_EXT_secondary_color ------------------------ */ + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 + +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E + +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT) +#define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT) +#define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT) +#define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT) +#define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT) +#define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT) +#define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT) +#define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT) +#define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT) +#define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT) +#define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT) +#define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT) +#define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT) +#define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT) +#define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT) +#define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT) +#define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT) + +#define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color) + +#endif /* GL_EXT_secondary_color */ + +/* --------------------- GL_EXT_separate_shader_objects -------------------- */ + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 + +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D + +typedef void (GLAPIENTRY * PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar* string); +typedef void (GLAPIENTRY * PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); + +#define glActiveProgramEXT GLEW_GET_FUN(__glewActiveProgramEXT) +#define glCreateShaderProgramEXT GLEW_GET_FUN(__glewCreateShaderProgramEXT) +#define glUseShaderProgramEXT GLEW_GET_FUN(__glewUseShaderProgramEXT) + +#define GLEW_EXT_separate_shader_objects GLEW_GET_VAR(__GLEW_EXT_separate_shader_objects) + +#endif /* GL_EXT_separate_shader_objects */ + +/* --------------------- GL_EXT_separate_specular_color -------------------- */ + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 + +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA + +#define GLEW_EXT_separate_specular_color GLEW_GET_VAR(__GLEW_EXT_separate_specular_color) + +#endif /* GL_EXT_separate_specular_color */ + +/* --------------------- GL_EXT_shader_image_load_store -------------------- */ + +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 +#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 +#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 +#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A +#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B +#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C +#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D +#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E +#define GL_IMAGE_1D_EXT 0x904C +#define GL_IMAGE_2D_EXT 0x904D +#define GL_IMAGE_3D_EXT 0x904E +#define GL_IMAGE_2D_RECT_EXT 0x904F +#define GL_IMAGE_CUBE_EXT 0x9050 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_IMAGE_1D_ARRAY_EXT 0x9052 +#define GL_IMAGE_2D_ARRAY_EXT 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 +#define GL_INT_IMAGE_1D_EXT 0x9057 +#define GL_INT_IMAGE_2D_EXT 0x9058 +#define GL_INT_IMAGE_3D_EXT 0x9059 +#define GL_INT_IMAGE_2D_RECT_EXT 0x905A +#define GL_INT_IMAGE_CUBE_EXT 0x905B +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D +#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C +#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D +#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E +#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); + +#define glBindImageTextureEXT GLEW_GET_FUN(__glewBindImageTextureEXT) +#define glMemoryBarrierEXT GLEW_GET_FUN(__glewMemoryBarrierEXT) + +#define GLEW_EXT_shader_image_load_store GLEW_GET_VAR(__GLEW_EXT_shader_image_load_store) + +#endif /* GL_EXT_shader_image_load_store */ + +/* -------------------------- GL_EXT_shadow_funcs -------------------------- */ + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 + +#define GLEW_EXT_shadow_funcs GLEW_GET_VAR(__GLEW_EXT_shadow_funcs) + +#endif /* GL_EXT_shadow_funcs */ + +/* --------------------- GL_EXT_shared_texture_palette --------------------- */ + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 + +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB + +#define GLEW_EXT_shared_texture_palette GLEW_GET_VAR(__GLEW_EXT_shared_texture_palette) + +#endif /* GL_EXT_shared_texture_palette */ + +/* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */ + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 + +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 + +#define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag) + +#endif /* GL_EXT_stencil_clear_tag */ + +/* ------------------------ GL_EXT_stencil_two_side ------------------------ */ + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 + +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 + +typedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); + +#define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT) + +#define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side) + +#endif /* GL_EXT_stencil_two_side */ + +/* -------------------------- GL_EXT_stencil_wrap -------------------------- */ + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 + +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 + +#define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap) + +#endif /* GL_EXT_stencil_wrap */ + +/* --------------------------- GL_EXT_subtexture --------------------------- */ + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 + +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); + +#define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT) +#define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT) +#define glTexSubImage3DEXT GLEW_GET_FUN(__glewTexSubImage3DEXT) + +#define GLEW_EXT_subtexture GLEW_GET_VAR(__GLEW_EXT_subtexture) + +#endif /* GL_EXT_subtexture */ + +/* ----------------------------- GL_EXT_texture ---------------------------- */ + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 + +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 + +#define GLEW_EXT_texture GLEW_GET_VAR(__GLEW_EXT_texture) + +#endif /* GL_EXT_texture */ + +/* ---------------------------- GL_EXT_texture3D --------------------------- */ + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 + +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); + +#define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT) + +#define GLEW_EXT_texture3D GLEW_GET_VAR(__GLEW_EXT_texture3D) + +#endif /* GL_EXT_texture3D */ + +/* -------------------------- GL_EXT_texture_array ------------------------- */ + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 + +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); + +#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT) + +#define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array) + +#endif /* GL_EXT_texture_array */ + +/* ---------------------- GL_EXT_texture_buffer_object --------------------- */ + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 + +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E + +typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferEXT GLEW_GET_FUN(__glewTexBufferEXT) + +#define GLEW_EXT_texture_buffer_object GLEW_GET_VAR(__GLEW_EXT_texture_buffer_object) + +#endif /* GL_EXT_texture_buffer_object */ + +/* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */ + +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 + +#define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1) + +#endif /* GL_EXT_texture_compression_dxt1 */ + +/* -------------------- GL_EXT_texture_compression_latc -------------------- */ + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 + +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 + +#define GLEW_EXT_texture_compression_latc GLEW_GET_VAR(__GLEW_EXT_texture_compression_latc) + +#endif /* GL_EXT_texture_compression_latc */ + +/* -------------------- GL_EXT_texture_compression_rgtc -------------------- */ + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 + +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE + +#define GLEW_EXT_texture_compression_rgtc GLEW_GET_VAR(__GLEW_EXT_texture_compression_rgtc) + +#endif /* GL_EXT_texture_compression_rgtc */ + +/* -------------------- GL_EXT_texture_compression_s3tc -------------------- */ + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 + +#define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc) + +#endif /* GL_EXT_texture_compression_s3tc */ + +/* ------------------------ GL_EXT_texture_cube_map ------------------------ */ + +#ifndef GL_EXT_texture_cube_map +#define GL_EXT_texture_cube_map 1 + +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C + +#define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map) + +#endif /* GL_EXT_texture_cube_map */ + +/* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */ + +#ifndef GL_EXT_texture_edge_clamp +#define GL_EXT_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_EXT 0x812F + +#define GLEW_EXT_texture_edge_clamp GLEW_GET_VAR(__GLEW_EXT_texture_edge_clamp) + +#endif /* GL_EXT_texture_edge_clamp */ + +/* --------------------------- GL_EXT_texture_env -------------------------- */ + +#ifndef GL_EXT_texture_env +#define GL_EXT_texture_env 1 + +#define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env) + +#endif /* GL_EXT_texture_env */ + +/* ------------------------- GL_EXT_texture_env_add ------------------------ */ + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 + +#define GLEW_EXT_texture_env_add GLEW_GET_VAR(__GLEW_EXT_texture_env_add) + +#endif /* GL_EXT_texture_env_add */ + +/* ----------------------- GL_EXT_texture_env_combine ---------------------- */ + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 + +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A + +#define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine) + +#endif /* GL_EXT_texture_env_combine */ + +/* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */ + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 + +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 + +#define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3) + +#endif /* GL_EXT_texture_env_dot3 */ + +/* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */ + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 + +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF + +#define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic) + +#endif /* GL_EXT_texture_filter_anisotropic */ + +/* ------------------------- GL_EXT_texture_integer ------------------------ */ + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 + +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E + +typedef void (GLAPIENTRY * PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (GLAPIENTRY * PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); + +#define glClearColorIiEXT GLEW_GET_FUN(__glewClearColorIiEXT) +#define glClearColorIuiEXT GLEW_GET_FUN(__glewClearColorIuiEXT) +#define glGetTexParameterIivEXT GLEW_GET_FUN(__glewGetTexParameterIivEXT) +#define glGetTexParameterIuivEXT GLEW_GET_FUN(__glewGetTexParameterIuivEXT) +#define glTexParameterIivEXT GLEW_GET_FUN(__glewTexParameterIivEXT) +#define glTexParameterIuivEXT GLEW_GET_FUN(__glewTexParameterIuivEXT) + +#define GLEW_EXT_texture_integer GLEW_GET_VAR(__GLEW_EXT_texture_integer) + +#endif /* GL_EXT_texture_integer */ + +/* ------------------------ GL_EXT_texture_lod_bias ------------------------ */ + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 + +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 + +#define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias) + +#endif /* GL_EXT_texture_lod_bias */ + +/* ---------------------- GL_EXT_texture_mirror_clamp ---------------------- */ + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 + +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 + +#define GLEW_EXT_texture_mirror_clamp GLEW_GET_VAR(__GLEW_EXT_texture_mirror_clamp) + +#endif /* GL_EXT_texture_mirror_clamp */ + +/* ------------------------- GL_EXT_texture_object ------------------------- */ + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 + +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A + +typedef GLboolean (GLAPIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint* textures, GLboolean* residences); +typedef void (GLAPIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint* textures); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint* textures, const GLclampf* priorities); + +#define glAreTexturesResidentEXT GLEW_GET_FUN(__glewAreTexturesResidentEXT) +#define glBindTextureEXT GLEW_GET_FUN(__glewBindTextureEXT) +#define glDeleteTexturesEXT GLEW_GET_FUN(__glewDeleteTexturesEXT) +#define glGenTexturesEXT GLEW_GET_FUN(__glewGenTexturesEXT) +#define glIsTextureEXT GLEW_GET_FUN(__glewIsTextureEXT) +#define glPrioritizeTexturesEXT GLEW_GET_FUN(__glewPrioritizeTexturesEXT) + +#define GLEW_EXT_texture_object GLEW_GET_VAR(__GLEW_EXT_texture_object) + +#endif /* GL_EXT_texture_object */ + +/* --------------------- GL_EXT_texture_perturb_normal --------------------- */ + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 + +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF + +typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); + +#define glTextureNormalEXT GLEW_GET_FUN(__glewTextureNormalEXT) + +#define GLEW_EXT_texture_perturb_normal GLEW_GET_VAR(__GLEW_EXT_texture_perturb_normal) + +#endif /* GL_EXT_texture_perturb_normal */ + +/* ------------------------ GL_EXT_texture_rectangle ----------------------- */ + +#ifndef GL_EXT_texture_rectangle +#define GL_EXT_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_EXT 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 + +#define GLEW_EXT_texture_rectangle GLEW_GET_VAR(__GLEW_EXT_texture_rectangle) + +#endif /* GL_EXT_texture_rectangle */ + +/* -------------------------- GL_EXT_texture_sRGB -------------------------- */ + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 + +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F + +#define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB) + +#endif /* GL_EXT_texture_sRGB */ + +/* ----------------------- GL_EXT_texture_sRGB_decode ---------------------- */ + +#ifndef GL_EXT_texture_sRGB_decode +#define GL_EXT_texture_sRGB_decode 1 + +#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 +#define GL_DECODE_EXT 0x8A49 +#define GL_SKIP_DECODE_EXT 0x8A4A + +#define GLEW_EXT_texture_sRGB_decode GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_decode) + +#endif /* GL_EXT_texture_sRGB_decode */ + +/* --------------------- GL_EXT_texture_shared_exponent -------------------- */ + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 + +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F + +#define GLEW_EXT_texture_shared_exponent GLEW_GET_VAR(__GLEW_EXT_texture_shared_exponent) + +#endif /* GL_EXT_texture_shared_exponent */ + +/* -------------------------- GL_EXT_texture_snorm ------------------------- */ + +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 + +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_ALPHA_SNORM 0x9010 +#define GL_LUMINANCE_SNORM 0x9011 +#define GL_LUMINANCE_ALPHA_SNORM 0x9012 +#define GL_INTENSITY_SNORM 0x9013 +#define GL_ALPHA8_SNORM 0x9014 +#define GL_LUMINANCE8_SNORM 0x9015 +#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 +#define GL_INTENSITY8_SNORM 0x9017 +#define GL_ALPHA16_SNORM 0x9018 +#define GL_LUMINANCE16_SNORM 0x9019 +#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A +#define GL_INTENSITY16_SNORM 0x901B + +#define GLEW_EXT_texture_snorm GLEW_GET_VAR(__GLEW_EXT_texture_snorm) + +#endif /* GL_EXT_texture_snorm */ + +/* ------------------------- GL_EXT_texture_swizzle ------------------------ */ + +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 + +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 + +#define GLEW_EXT_texture_swizzle GLEW_GET_VAR(__GLEW_EXT_texture_swizzle) + +#endif /* GL_EXT_texture_swizzle */ + +/* --------------------------- GL_EXT_timer_query -------------------------- */ + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 + +#define GL_TIME_ELAPSED_EXT 0x88BF + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); + +#define glGetQueryObjecti64vEXT GLEW_GET_FUN(__glewGetQueryObjecti64vEXT) +#define glGetQueryObjectui64vEXT GLEW_GET_FUN(__glewGetQueryObjectui64vEXT) + +#define GLEW_EXT_timer_query GLEW_GET_VAR(__GLEW_EXT_timer_query) + +#endif /* GL_EXT_timer_query */ + +/* ----------------------- GL_EXT_transform_feedback ----------------------- */ + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 + +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F + +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar * const* varyings, GLenum bufferMode); + +#define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT) +#define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT) +#define glBindBufferOffsetEXT GLEW_GET_FUN(__glewBindBufferOffsetEXT) +#define glBindBufferRangeEXT GLEW_GET_FUN(__glewBindBufferRangeEXT) +#define glEndTransformFeedbackEXT GLEW_GET_FUN(__glewEndTransformFeedbackEXT) +#define glGetTransformFeedbackVaryingEXT GLEW_GET_FUN(__glewGetTransformFeedbackVaryingEXT) +#define glTransformFeedbackVaryingsEXT GLEW_GET_FUN(__glewTransformFeedbackVaryingsEXT) + +#define GLEW_EXT_transform_feedback GLEW_GET_VAR(__GLEW_EXT_transform_feedback) + +#endif /* GL_EXT_transform_feedback */ + +/* -------------------------- GL_EXT_vertex_array -------------------------- */ + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 + +#define GL_DOUBLE_EXT 0x140A +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 + +typedef void (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); + +#define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT) +#define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT) +#define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT) +#define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT) +#define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT) +#define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT) +#define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT) +#define glVertexPointerEXT GLEW_GET_FUN(__glewVertexPointerEXT) + +#define GLEW_EXT_vertex_array GLEW_GET_VAR(__GLEW_EXT_vertex_array) + +#endif /* GL_EXT_vertex_array */ + +/* ------------------------ GL_EXT_vertex_array_bgra ----------------------- */ + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_EXT_vertex_array_bgra GLEW_GET_VAR(__GLEW_EXT_vertex_array_bgra) + +#endif /* GL_EXT_vertex_array_bgra */ + +/* ----------------------- GL_EXT_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 + +#define GL_DOUBLE_MAT2_EXT 0x8F46 +#define GL_DOUBLE_MAT3_EXT 0x8F47 +#define GL_DOUBLE_MAT4_EXT 0x8F48 +#define GL_DOUBLE_MAT2x3_EXT 0x8F49 +#define GL_DOUBLE_MAT2x4_EXT 0x8F4A +#define GL_DOUBLE_MAT3x2_EXT 0x8F4B +#define GL_DOUBLE_MAT3x4_EXT 0x8F4C +#define GL_DOUBLE_MAT4x2_EXT 0x8F4D +#define GL_DOUBLE_MAT4x3_EXT 0x8F4E +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glGetVertexAttribLdvEXT GLEW_GET_FUN(__glewGetVertexAttribLdvEXT) +#define glVertexArrayVertexAttribLOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLOffsetEXT) +#define glVertexAttribL1dEXT GLEW_GET_FUN(__glewVertexAttribL1dEXT) +#define glVertexAttribL1dvEXT GLEW_GET_FUN(__glewVertexAttribL1dvEXT) +#define glVertexAttribL2dEXT GLEW_GET_FUN(__glewVertexAttribL2dEXT) +#define glVertexAttribL2dvEXT GLEW_GET_FUN(__glewVertexAttribL2dvEXT) +#define glVertexAttribL3dEXT GLEW_GET_FUN(__glewVertexAttribL3dEXT) +#define glVertexAttribL3dvEXT GLEW_GET_FUN(__glewVertexAttribL3dvEXT) +#define glVertexAttribL4dEXT GLEW_GET_FUN(__glewVertexAttribL4dEXT) +#define glVertexAttribL4dvEXT GLEW_GET_FUN(__glewVertexAttribL4dvEXT) +#define glVertexAttribLPointerEXT GLEW_GET_FUN(__glewVertexAttribLPointerEXT) + +#define GLEW_EXT_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_EXT_vertex_attrib_64bit) + +#endif /* GL_EXT_vertex_attrib_64bit */ + +/* -------------------------- GL_EXT_vertex_shader ------------------------- */ + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 + +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED + +typedef void (GLAPIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (GLAPIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum dataType, GLenum storageType, GLenum range, GLuint components); +typedef GLuint (GLAPIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid **data); +typedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, GLint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, GLshort *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, GLubyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, GLuint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, GLushort *addr); +typedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); + +#define glBeginVertexShaderEXT GLEW_GET_FUN(__glewBeginVertexShaderEXT) +#define glBindLightParameterEXT GLEW_GET_FUN(__glewBindLightParameterEXT) +#define glBindMaterialParameterEXT GLEW_GET_FUN(__glewBindMaterialParameterEXT) +#define glBindParameterEXT GLEW_GET_FUN(__glewBindParameterEXT) +#define glBindTexGenParameterEXT GLEW_GET_FUN(__glewBindTexGenParameterEXT) +#define glBindTextureUnitParameterEXT GLEW_GET_FUN(__glewBindTextureUnitParameterEXT) +#define glBindVertexShaderEXT GLEW_GET_FUN(__glewBindVertexShaderEXT) +#define glDeleteVertexShaderEXT GLEW_GET_FUN(__glewDeleteVertexShaderEXT) +#define glDisableVariantClientStateEXT GLEW_GET_FUN(__glewDisableVariantClientStateEXT) +#define glEnableVariantClientStateEXT GLEW_GET_FUN(__glewEnableVariantClientStateEXT) +#define glEndVertexShaderEXT GLEW_GET_FUN(__glewEndVertexShaderEXT) +#define glExtractComponentEXT GLEW_GET_FUN(__glewExtractComponentEXT) +#define glGenSymbolsEXT GLEW_GET_FUN(__glewGenSymbolsEXT) +#define glGenVertexShadersEXT GLEW_GET_FUN(__glewGenVertexShadersEXT) +#define glGetInvariantBooleanvEXT GLEW_GET_FUN(__glewGetInvariantBooleanvEXT) +#define glGetInvariantFloatvEXT GLEW_GET_FUN(__glewGetInvariantFloatvEXT) +#define glGetInvariantIntegervEXT GLEW_GET_FUN(__glewGetInvariantIntegervEXT) +#define glGetLocalConstantBooleanvEXT GLEW_GET_FUN(__glewGetLocalConstantBooleanvEXT) +#define glGetLocalConstantFloatvEXT GLEW_GET_FUN(__glewGetLocalConstantFloatvEXT) +#define glGetLocalConstantIntegervEXT GLEW_GET_FUN(__glewGetLocalConstantIntegervEXT) +#define glGetVariantBooleanvEXT GLEW_GET_FUN(__glewGetVariantBooleanvEXT) +#define glGetVariantFloatvEXT GLEW_GET_FUN(__glewGetVariantFloatvEXT) +#define glGetVariantIntegervEXT GLEW_GET_FUN(__glewGetVariantIntegervEXT) +#define glGetVariantPointervEXT GLEW_GET_FUN(__glewGetVariantPointervEXT) +#define glInsertComponentEXT GLEW_GET_FUN(__glewInsertComponentEXT) +#define glIsVariantEnabledEXT GLEW_GET_FUN(__glewIsVariantEnabledEXT) +#define glSetInvariantEXT GLEW_GET_FUN(__glewSetInvariantEXT) +#define glSetLocalConstantEXT GLEW_GET_FUN(__glewSetLocalConstantEXT) +#define glShaderOp1EXT GLEW_GET_FUN(__glewShaderOp1EXT) +#define glShaderOp2EXT GLEW_GET_FUN(__glewShaderOp2EXT) +#define glShaderOp3EXT GLEW_GET_FUN(__glewShaderOp3EXT) +#define glSwizzleEXT GLEW_GET_FUN(__glewSwizzleEXT) +#define glVariantPointerEXT GLEW_GET_FUN(__glewVariantPointerEXT) +#define glVariantbvEXT GLEW_GET_FUN(__glewVariantbvEXT) +#define glVariantdvEXT GLEW_GET_FUN(__glewVariantdvEXT) +#define glVariantfvEXT GLEW_GET_FUN(__glewVariantfvEXT) +#define glVariantivEXT GLEW_GET_FUN(__glewVariantivEXT) +#define glVariantsvEXT GLEW_GET_FUN(__glewVariantsvEXT) +#define glVariantubvEXT GLEW_GET_FUN(__glewVariantubvEXT) +#define glVariantuivEXT GLEW_GET_FUN(__glewVariantuivEXT) +#define glVariantusvEXT GLEW_GET_FUN(__glewVariantusvEXT) +#define glWriteMaskEXT GLEW_GET_FUN(__glewWriteMaskEXT) + +#define GLEW_EXT_vertex_shader GLEW_GET_VAR(__GLEW_EXT_vertex_shader) + +#endif /* GL_EXT_vertex_shader */ + +/* ------------------------ GL_EXT_vertex_weighting ------------------------ */ + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 + +#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 +#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 +#define GL_MODELVIEW0_EXT 0x1700 +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 + +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight); + +#define glVertexWeightPointerEXT GLEW_GET_FUN(__glewVertexWeightPointerEXT) +#define glVertexWeightfEXT GLEW_GET_FUN(__glewVertexWeightfEXT) +#define glVertexWeightfvEXT GLEW_GET_FUN(__glewVertexWeightfvEXT) + +#define GLEW_EXT_vertex_weighting GLEW_GET_VAR(__GLEW_EXT_vertex_weighting) + +#endif /* GL_EXT_vertex_weighting */ + +/* ------------------------- GL_EXT_x11_sync_object ------------------------ */ + +#ifndef GL_EXT_x11_sync_object +#define GL_EXT_x11_sync_object 1 + +#define GL_SYNC_X11_FENCE_EXT 0x90E1 + +typedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); + +#define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT) + +#define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object) + +#endif /* GL_EXT_x11_sync_object */ + +/* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */ + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 + +typedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void); + +#define glFrameTerminatorGREMEDY GLEW_GET_FUN(__glewFrameTerminatorGREMEDY) + +#define GLEW_GREMEDY_frame_terminator GLEW_GET_VAR(__GLEW_GREMEDY_frame_terminator) + +#endif /* GL_GREMEDY_frame_terminator */ + +/* ------------------------ GL_GREMEDY_string_marker ----------------------- */ + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 + +typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); + +#define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY) + +#define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker) + +#endif /* GL_GREMEDY_string_marker */ + +/* --------------------- GL_HP_convolution_border_modes -------------------- */ + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 + +#define GLEW_HP_convolution_border_modes GLEW_GET_VAR(__GLEW_HP_convolution_border_modes) + +#endif /* GL_HP_convolution_border_modes */ + +/* ------------------------- GL_HP_image_transform ------------------------- */ + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 + +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetImageTransformParameterfvHP GLEW_GET_FUN(__glewGetImageTransformParameterfvHP) +#define glGetImageTransformParameterivHP GLEW_GET_FUN(__glewGetImageTransformParameterivHP) +#define glImageTransformParameterfHP GLEW_GET_FUN(__glewImageTransformParameterfHP) +#define glImageTransformParameterfvHP GLEW_GET_FUN(__glewImageTransformParameterfvHP) +#define glImageTransformParameteriHP GLEW_GET_FUN(__glewImageTransformParameteriHP) +#define glImageTransformParameterivHP GLEW_GET_FUN(__glewImageTransformParameterivHP) + +#define GLEW_HP_image_transform GLEW_GET_VAR(__GLEW_HP_image_transform) + +#endif /* GL_HP_image_transform */ + +/* -------------------------- GL_HP_occlusion_test ------------------------- */ + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 + +#define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test) + +#endif /* GL_HP_occlusion_test */ + +/* ------------------------- GL_HP_texture_lighting ------------------------ */ + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 + +#define GLEW_HP_texture_lighting GLEW_GET_VAR(__GLEW_HP_texture_lighting) + +#endif /* GL_HP_texture_lighting */ + +/* --------------------------- GL_IBM_cull_vertex -------------------------- */ + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 + +#define GL_CULL_VERTEX_IBM 103050 + +#define GLEW_IBM_cull_vertex GLEW_GET_VAR(__GLEW_IBM_cull_vertex) + +#endif /* GL_IBM_cull_vertex */ + +/* ---------------------- GL_IBM_multimode_draw_arrays --------------------- */ + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const GLvoid * const *indices, GLsizei primcount, GLint modestride); + +#define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM) +#define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM) + +#define GLEW_IBM_multimode_draw_arrays GLEW_GET_VAR(__GLEW_IBM_multimode_draw_arrays) + +#endif /* GL_IBM_multimode_draw_arrays */ + +/* ------------------------- GL_IBM_rasterpos_clip ------------------------- */ + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 + +#define GL_RASTER_POSITION_UNCLIPPED_IBM 103010 + +#define GLEW_IBM_rasterpos_clip GLEW_GET_VAR(__GLEW_IBM_rasterpos_clip) + +#endif /* GL_IBM_rasterpos_clip */ + +/* --------------------------- GL_IBM_static_data -------------------------- */ + +#ifndef GL_IBM_static_data +#define GL_IBM_static_data 1 + +#define GL_ALL_STATIC_DATA_IBM 103060 +#define GL_STATIC_VERTEX_ARRAY_IBM 103061 + +#define GLEW_IBM_static_data GLEW_GET_VAR(__GLEW_IBM_static_data) + +#endif /* GL_IBM_static_data */ + +/* --------------------- GL_IBM_texture_mirrored_repeat -------------------- */ + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_IBM_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_IBM 0x8370 + +#define GLEW_IBM_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_IBM_texture_mirrored_repeat) + +#endif /* GL_IBM_texture_mirrored_repeat */ + +/* ----------------------- GL_IBM_vertex_array_lists ----------------------- */ + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 + +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); + +#define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM) +#define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM) +#define glFogCoordPointerListIBM GLEW_GET_FUN(__glewFogCoordPointerListIBM) +#define glIndexPointerListIBM GLEW_GET_FUN(__glewIndexPointerListIBM) +#define glNormalPointerListIBM GLEW_GET_FUN(__glewNormalPointerListIBM) +#define glSecondaryColorPointerListIBM GLEW_GET_FUN(__glewSecondaryColorPointerListIBM) +#define glTexCoordPointerListIBM GLEW_GET_FUN(__glewTexCoordPointerListIBM) +#define glVertexPointerListIBM GLEW_GET_FUN(__glewVertexPointerListIBM) + +#define GLEW_IBM_vertex_array_lists GLEW_GET_VAR(__GLEW_IBM_vertex_array_lists) + +#endif /* GL_IBM_vertex_array_lists */ + +/* -------------------------- GL_INGR_color_clamp -------------------------- */ + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 + +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 + +#define GLEW_INGR_color_clamp GLEW_GET_VAR(__GLEW_INGR_color_clamp) + +#endif /* GL_INGR_color_clamp */ + +/* ------------------------- GL_INGR_interlace_read ------------------------ */ + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 + +#define GL_INTERLACE_READ_INGR 0x8568 + +#define GLEW_INGR_interlace_read GLEW_GET_VAR(__GLEW_INGR_interlace_read) + +#endif /* GL_INGR_interlace_read */ + +/* -------------------------- GL_INTEL_map_texture ------------------------- */ + +#ifndef GL_INTEL_map_texture +#define GL_INTEL_map_texture 1 + +#define GL_LAYOUT_DEFAULT_INTEL 0 +#define GL_LAYOUT_LINEAR_INTEL 1 +#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 +#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF + +typedef GLvoid * (GLAPIENTRY * PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint* stride, GLenum *layout); +typedef void (GLAPIENTRY * PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); + +#define glMapTexture2DINTEL GLEW_GET_FUN(__glewMapTexture2DINTEL) +#define glSyncTextureINTEL GLEW_GET_FUN(__glewSyncTextureINTEL) +#define glUnmapTexture2DINTEL GLEW_GET_FUN(__glewUnmapTexture2DINTEL) + +#define GLEW_INTEL_map_texture GLEW_GET_VAR(__GLEW_INTEL_map_texture) + +#endif /* GL_INTEL_map_texture */ + +/* ------------------------ GL_INTEL_parallel_arrays ----------------------- */ + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 + +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); + +#define glColorPointervINTEL GLEW_GET_FUN(__glewColorPointervINTEL) +#define glNormalPointervINTEL GLEW_GET_FUN(__glewNormalPointervINTEL) +#define glTexCoordPointervINTEL GLEW_GET_FUN(__glewTexCoordPointervINTEL) +#define glVertexPointervINTEL GLEW_GET_FUN(__glewVertexPointervINTEL) + +#define GLEW_INTEL_parallel_arrays GLEW_GET_VAR(__GLEW_INTEL_parallel_arrays) + +#endif /* GL_INTEL_parallel_arrays */ + +/* ------------------------ GL_INTEL_texture_scissor ----------------------- */ + +#ifndef GL_INTEL_texture_scissor +#define GL_INTEL_texture_scissor 1 + +typedef void (GLAPIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc); +typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh); + +#define glTexScissorFuncINTEL GLEW_GET_FUN(__glewTexScissorFuncINTEL) +#define glTexScissorINTEL GLEW_GET_FUN(__glewTexScissorINTEL) + +#define GLEW_INTEL_texture_scissor GLEW_GET_VAR(__GLEW_INTEL_texture_scissor) + +#endif /* GL_INTEL_texture_scissor */ + +/* ------------------------------ GL_KHR_debug ----------------------------- */ + +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 + +#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 +#define GL_DEBUG_SOURCE_API 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION 0x824A +#define GL_DEBUG_SOURCE_OTHER 0x824B +#define GL_DEBUG_TYPE_ERROR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 +#define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_DEBUG_TYPE_MARKER 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D +#define GL_BUFFER 0x82E0 +#define GL_SHADER 0x82E1 +#define GL_PROGRAM 0x82E2 +#define GL_QUERY 0x82E3 +#define GL_PROGRAM_PIPELINE 0x82E4 +#define GL_SAMPLER 0x82E6 +#define GL_DISPLAY_LIST 0x82E7 +#define GL_MAX_LABEL_LENGTH 0x82E8 +#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES 0x9145 +#define GL_DEBUG_SEVERITY_HIGH 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 +#define GL_DEBUG_SEVERITY_LOW 0x9148 +#define GL_DEBUG_OUTPUT 0x92E0 + +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const GLvoid *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPTRLABELPROC) (void* ptr, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLOBJECTPTRLABELPROC) (void* ptr, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLPOPDEBUGGROUPPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar * message); + +#define glDebugMessageCallback GLEW_GET_FUN(__glewDebugMessageCallback) +#define glDebugMessageControl GLEW_GET_FUN(__glewDebugMessageControl) +#define glDebugMessageInsert GLEW_GET_FUN(__glewDebugMessageInsert) +#define glGetDebugMessageLog GLEW_GET_FUN(__glewGetDebugMessageLog) +#define glGetObjectLabel GLEW_GET_FUN(__glewGetObjectLabel) +#define glGetObjectPtrLabel GLEW_GET_FUN(__glewGetObjectPtrLabel) +#define glObjectLabel GLEW_GET_FUN(__glewObjectLabel) +#define glObjectPtrLabel GLEW_GET_FUN(__glewObjectPtrLabel) +#define glPopDebugGroup GLEW_GET_FUN(__glewPopDebugGroup) +#define glPushDebugGroup GLEW_GET_FUN(__glewPushDebugGroup) + +#define GLEW_KHR_debug GLEW_GET_VAR(__GLEW_KHR_debug) + +#endif /* GL_KHR_debug */ + +/* ------------------ GL_KHR_texture_compression_astc_ldr ------------------ */ + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 + +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD + +#define GLEW_KHR_texture_compression_astc_ldr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_ldr) + +#endif /* GL_KHR_texture_compression_astc_ldr */ + +/* -------------------------- GL_KTX_buffer_region ------------------------- */ + +#ifndef GL_KTX_buffer_region +#define GL_KTX_buffer_region 1 + +#define GL_KTX_FRONT_REGION 0x0 +#define GL_KTX_BACK_REGION 0x1 +#define GL_KTX_Z_REGION 0x2 +#define GL_KTX_STENCIL_REGION 0x3 + +typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (void); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); +typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled) +#define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion) +#define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion) +#define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion) +#define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion) + +#define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region) + +#endif /* GL_KTX_buffer_region */ + +/* ------------------------- GL_MESAX_texture_stack ------------------------ */ + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 + +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E + +#define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack) + +#endif /* GL_MESAX_texture_stack */ + +/* -------------------------- GL_MESA_pack_invert -------------------------- */ + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 + +#define GL_PACK_INVERT_MESA 0x8758 + +#define GLEW_MESA_pack_invert GLEW_GET_VAR(__GLEW_MESA_pack_invert) + +#endif /* GL_MESA_pack_invert */ + +/* ------------------------- GL_MESA_resize_buffers ------------------------ */ + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 + +typedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); + +#define glResizeBuffersMESA GLEW_GET_FUN(__glewResizeBuffersMESA) + +#define GLEW_MESA_resize_buffers GLEW_GET_VAR(__GLEW_MESA_resize_buffers) + +#endif /* GL_MESA_resize_buffers */ + +/* --------------------------- GL_MESA_window_pos -------------------------- */ + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p); + +#define glWindowPos2dMESA GLEW_GET_FUN(__glewWindowPos2dMESA) +#define glWindowPos2dvMESA GLEW_GET_FUN(__glewWindowPos2dvMESA) +#define glWindowPos2fMESA GLEW_GET_FUN(__glewWindowPos2fMESA) +#define glWindowPos2fvMESA GLEW_GET_FUN(__glewWindowPos2fvMESA) +#define glWindowPos2iMESA GLEW_GET_FUN(__glewWindowPos2iMESA) +#define glWindowPos2ivMESA GLEW_GET_FUN(__glewWindowPos2ivMESA) +#define glWindowPos2sMESA GLEW_GET_FUN(__glewWindowPos2sMESA) +#define glWindowPos2svMESA GLEW_GET_FUN(__glewWindowPos2svMESA) +#define glWindowPos3dMESA GLEW_GET_FUN(__glewWindowPos3dMESA) +#define glWindowPos3dvMESA GLEW_GET_FUN(__glewWindowPos3dvMESA) +#define glWindowPos3fMESA GLEW_GET_FUN(__glewWindowPos3fMESA) +#define glWindowPos3fvMESA GLEW_GET_FUN(__glewWindowPos3fvMESA) +#define glWindowPos3iMESA GLEW_GET_FUN(__glewWindowPos3iMESA) +#define glWindowPos3ivMESA GLEW_GET_FUN(__glewWindowPos3ivMESA) +#define glWindowPos3sMESA GLEW_GET_FUN(__glewWindowPos3sMESA) +#define glWindowPos3svMESA GLEW_GET_FUN(__glewWindowPos3svMESA) +#define glWindowPos4dMESA GLEW_GET_FUN(__glewWindowPos4dMESA) +#define glWindowPos4dvMESA GLEW_GET_FUN(__glewWindowPos4dvMESA) +#define glWindowPos4fMESA GLEW_GET_FUN(__glewWindowPos4fMESA) +#define glWindowPos4fvMESA GLEW_GET_FUN(__glewWindowPos4fvMESA) +#define glWindowPos4iMESA GLEW_GET_FUN(__glewWindowPos4iMESA) +#define glWindowPos4ivMESA GLEW_GET_FUN(__glewWindowPos4ivMESA) +#define glWindowPos4sMESA GLEW_GET_FUN(__glewWindowPos4sMESA) +#define glWindowPos4svMESA GLEW_GET_FUN(__glewWindowPos4svMESA) + +#define GLEW_MESA_window_pos GLEW_GET_VAR(__GLEW_MESA_window_pos) + +#endif /* GL_MESA_window_pos */ + +/* ------------------------- GL_MESA_ycbcr_texture ------------------------- */ + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 + +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 + +#define GLEW_MESA_ycbcr_texture GLEW_GET_VAR(__GLEW_MESA_ycbcr_texture) + +#endif /* GL_MESA_ycbcr_texture */ + +/* ----------------------- GL_NVX_conditional_render ----------------------- */ + +#ifndef GL_NVX_conditional_render +#define GL_NVX_conditional_render 1 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVXPROC) (void); + +#define glBeginConditionalRenderNVX GLEW_GET_FUN(__glewBeginConditionalRenderNVX) +#define glEndConditionalRenderNVX GLEW_GET_FUN(__glewEndConditionalRenderNVX) + +#define GLEW_NVX_conditional_render GLEW_GET_VAR(__GLEW_NVX_conditional_render) + +#endif /* GL_NVX_conditional_render */ + +/* ------------------------- GL_NVX_gpu_memory_info ------------------------ */ + +#ifndef GL_NVX_gpu_memory_info +#define GL_NVX_gpu_memory_info 1 + +#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 +#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 +#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 +#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A +#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B + +#define GLEW_NVX_gpu_memory_info GLEW_GET_VAR(__GLEW_NVX_gpu_memory_info) + +#endif /* GL_NVX_gpu_memory_info */ + +/* ------------------- GL_NV_bindless_multi_draw_indirect ------------------ */ + +#ifndef GL_NV_bindless_multi_draw_indirect +#define GL_NV_bindless_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const GLvoid *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); + +#define glMultiDrawArraysIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessNV) +#define glMultiDrawElementsIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessNV) + +#define GLEW_NV_bindless_multi_draw_indirect GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect) + +#endif /* GL_NV_bindless_multi_draw_indirect */ + +/* ------------------------- GL_NV_bindless_texture ------------------------ */ + +#ifndef GL_NV_bindless_texture +#define GL_NV_bindless_texture 1 + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64* value); + +#define glGetImageHandleNV GLEW_GET_FUN(__glewGetImageHandleNV) +#define glGetTextureHandleNV GLEW_GET_FUN(__glewGetTextureHandleNV) +#define glGetTextureSamplerHandleNV GLEW_GET_FUN(__glewGetTextureSamplerHandleNV) +#define glIsImageHandleResidentNV GLEW_GET_FUN(__glewIsImageHandleResidentNV) +#define glIsTextureHandleResidentNV GLEW_GET_FUN(__glewIsTextureHandleResidentNV) +#define glMakeImageHandleNonResidentNV GLEW_GET_FUN(__glewMakeImageHandleNonResidentNV) +#define glMakeImageHandleResidentNV GLEW_GET_FUN(__glewMakeImageHandleResidentNV) +#define glMakeTextureHandleNonResidentNV GLEW_GET_FUN(__glewMakeTextureHandleNonResidentNV) +#define glMakeTextureHandleResidentNV GLEW_GET_FUN(__glewMakeTextureHandleResidentNV) +#define glProgramUniformHandleui64NV GLEW_GET_FUN(__glewProgramUniformHandleui64NV) +#define glProgramUniformHandleui64vNV GLEW_GET_FUN(__glewProgramUniformHandleui64vNV) +#define glUniformHandleui64NV GLEW_GET_FUN(__glewUniformHandleui64NV) +#define glUniformHandleui64vNV GLEW_GET_FUN(__glewUniformHandleui64vNV) + +#define GLEW_NV_bindless_texture GLEW_GET_VAR(__GLEW_NV_bindless_texture) + +#endif /* GL_NV_bindless_texture */ + +/* --------------------- GL_NV_blend_equation_advanced --------------------- */ + +#ifndef GL_NV_blend_equation_advanced +#define GL_NV_blend_equation_advanced 1 + +#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 +#define GL_BLEND_OVERLAP_NV 0x9281 +#define GL_UNCORRELATED_NV 0x9282 +#define GL_DISJOINT_NV 0x9283 +#define GL_CONJOINT_NV 0x9284 +#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 +#define GL_SRC_NV 0x9286 +#define GL_DST_NV 0x9287 +#define GL_SRC_OVER_NV 0x9288 +#define GL_DST_OVER_NV 0x9289 +#define GL_SRC_IN_NV 0x928A +#define GL_DST_IN_NV 0x928B +#define GL_SRC_OUT_NV 0x928C +#define GL_DST_OUT_NV 0x928D +#define GL_SRC_ATOP_NV 0x928E +#define GL_DST_ATOP_NV 0x928F +#define GL_PLUS_NV 0x9291 +#define GL_PLUS_DARKER_NV 0x9292 +#define GL_MULTIPLY_NV 0x9294 +#define GL_SCREEN_NV 0x9295 +#define GL_OVERLAY_NV 0x9296 +#define GL_DARKEN_NV 0x9297 +#define GL_LIGHTEN_NV 0x9298 +#define GL_COLORDODGE_NV 0x9299 +#define GL_COLORBURN_NV 0x929A +#define GL_HARDLIGHT_NV 0x929B +#define GL_SOFTLIGHT_NV 0x929C +#define GL_DIFFERENCE_NV 0x929E +#define GL_MINUS_NV 0x929F +#define GL_EXCLUSION_NV 0x92A0 +#define GL_CONTRAST_NV 0x92A1 +#define GL_INVERT_RGB_NV 0x92A3 +#define GL_LINEARDODGE_NV 0x92A4 +#define GL_LINEARBURN_NV 0x92A5 +#define GL_VIVIDLIGHT_NV 0x92A6 +#define GL_LINEARLIGHT_NV 0x92A7 +#define GL_PINLIGHT_NV 0x92A8 +#define GL_HARDMIX_NV 0x92A9 +#define GL_HSL_HUE_NV 0x92AD +#define GL_HSL_SATURATION_NV 0x92AE +#define GL_HSL_COLOR_NV 0x92AF +#define GL_HSL_LUMINOSITY_NV 0x92B0 +#define GL_PLUS_CLAMPED_NV 0x92B1 +#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 +#define GL_MINUS_CLAMPED_NV 0x92B3 +#define GL_INVERT_OVG_NV 0x92B4 + +typedef void (GLAPIENTRY * PFNGLBLENDBARRIERNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); + +#define glBlendBarrierNV GLEW_GET_FUN(__glewBlendBarrierNV) +#define glBlendParameteriNV GLEW_GET_FUN(__glewBlendParameteriNV) + +#define GLEW_NV_blend_equation_advanced GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced) + +#endif /* GL_NV_blend_equation_advanced */ + +/* ----------------- GL_NV_blend_equation_advanced_coherent ---------------- */ + +#ifndef GL_NV_blend_equation_advanced_coherent +#define GL_NV_blend_equation_advanced_coherent 1 + +#define GLEW_NV_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced_coherent) + +#endif /* GL_NV_blend_equation_advanced_coherent */ + +/* --------------------------- GL_NV_blend_square -------------------------- */ + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 + +#define GLEW_NV_blend_square GLEW_GET_VAR(__GLEW_NV_blend_square) + +#endif /* GL_NV_blend_square */ + +/* ------------------------- GL_NV_compute_program5 ------------------------ */ + +#ifndef GL_NV_compute_program5 +#define GL_NV_compute_program5 1 + +#define GL_COMPUTE_PROGRAM_NV 0x90FB +#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC + +#define GLEW_NV_compute_program5 GLEW_GET_VAR(__GLEW_NV_compute_program5) + +#endif /* GL_NV_compute_program5 */ + +/* ------------------------ GL_NV_conditional_render ----------------------- */ + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 + +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void); + +#define glBeginConditionalRenderNV GLEW_GET_FUN(__glewBeginConditionalRenderNV) +#define glEndConditionalRenderNV GLEW_GET_FUN(__glewEndConditionalRenderNV) + +#define GLEW_NV_conditional_render GLEW_GET_VAR(__GLEW_NV_conditional_render) + +#endif /* GL_NV_conditional_render */ + +/* ----------------------- GL_NV_copy_depth_to_color ----------------------- */ + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 + +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F + +#define GLEW_NV_copy_depth_to_color GLEW_GET_VAR(__GLEW_NV_copy_depth_to_color) + +#endif /* GL_NV_copy_depth_to_color */ + +/* ---------------------------- GL_NV_copy_image --------------------------- */ + +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define glCopyImageSubDataNV GLEW_GET_FUN(__glewCopyImageSubDataNV) + +#define GLEW_NV_copy_image GLEW_GET_VAR(__GLEW_NV_copy_image) + +#endif /* GL_NV_copy_image */ + +/* -------------------------- GL_NV_deep_texture3D ------------------------- */ + +#ifndef GL_NV_deep_texture3D +#define GL_NV_deep_texture3D 1 + +#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 +#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 + +#define GLEW_NV_deep_texture3D GLEW_GET_VAR(__GLEW_NV_deep_texture3D) + +#endif /* GL_NV_deep_texture3D */ + +/* ------------------------ GL_NV_depth_buffer_float ----------------------- */ + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 + +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); + +#define glClearDepthdNV GLEW_GET_FUN(__glewClearDepthdNV) +#define glDepthBoundsdNV GLEW_GET_FUN(__glewDepthBoundsdNV) +#define glDepthRangedNV GLEW_GET_FUN(__glewDepthRangedNV) + +#define GLEW_NV_depth_buffer_float GLEW_GET_VAR(__GLEW_NV_depth_buffer_float) + +#endif /* GL_NV_depth_buffer_float */ + +/* --------------------------- GL_NV_depth_clamp --------------------------- */ + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 + +#define GL_DEPTH_CLAMP_NV 0x864F + +#define GLEW_NV_depth_clamp GLEW_GET_VAR(__GLEW_NV_depth_clamp) + +#endif /* GL_NV_depth_clamp */ + +/* ---------------------- GL_NV_depth_range_unclamped ---------------------- */ + +#ifndef GL_NV_depth_range_unclamped +#define GL_NV_depth_range_unclamped 1 + +#define GL_SAMPLE_COUNT_BITS_NV 0x8864 +#define GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865 +#define GL_QUERY_RESULT_NV 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_NV 0x8867 +#define GL_SAMPLE_COUNT_NV 0x8914 + +#define GLEW_NV_depth_range_unclamped GLEW_GET_VAR(__GLEW_NV_depth_range_unclamped) + +#endif /* GL_NV_depth_range_unclamped */ + +/* --------------------------- GL_NV_draw_texture -------------------------- */ + +#ifndef GL_NV_draw_texture +#define GL_NV_draw_texture 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); + +#define glDrawTextureNV GLEW_GET_FUN(__glewDrawTextureNV) + +#define GLEW_NV_draw_texture GLEW_GET_VAR(__GLEW_NV_draw_texture) + +#endif /* GL_NV_draw_texture */ + +/* ---------------------------- GL_NV_evaluators --------------------------- */ + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 + +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 + +typedef void (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glEvalMapsNV GLEW_GET_FUN(__glewEvalMapsNV) +#define glGetMapAttribParameterfvNV GLEW_GET_FUN(__glewGetMapAttribParameterfvNV) +#define glGetMapAttribParameterivNV GLEW_GET_FUN(__glewGetMapAttribParameterivNV) +#define glGetMapControlPointsNV GLEW_GET_FUN(__glewGetMapControlPointsNV) +#define glGetMapParameterfvNV GLEW_GET_FUN(__glewGetMapParameterfvNV) +#define glGetMapParameterivNV GLEW_GET_FUN(__glewGetMapParameterivNV) +#define glMapControlPointsNV GLEW_GET_FUN(__glewMapControlPointsNV) +#define glMapParameterfvNV GLEW_GET_FUN(__glewMapParameterfvNV) +#define glMapParameterivNV GLEW_GET_FUN(__glewMapParameterivNV) + +#define GLEW_NV_evaluators GLEW_GET_VAR(__GLEW_NV_evaluators) + +#endif /* GL_NV_evaluators */ + +/* ----------------------- GL_NV_explicit_multisample ---------------------- */ + +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 + +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); + +#define glGetMultisamplefvNV GLEW_GET_FUN(__glewGetMultisamplefvNV) +#define glSampleMaskIndexedNV GLEW_GET_FUN(__glewSampleMaskIndexedNV) +#define glTexRenderbufferNV GLEW_GET_FUN(__glewTexRenderbufferNV) + +#define GLEW_NV_explicit_multisample GLEW_GET_VAR(__GLEW_NV_explicit_multisample) + +#endif /* GL_NV_explicit_multisample */ + +/* ------------------------------ GL_NV_fence ------------------------------ */ + +#ifndef GL_NV_fence +#define GL_NV_fence 1 + +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint* fences); +typedef void (GLAPIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); + +#define glDeleteFencesNV GLEW_GET_FUN(__glewDeleteFencesNV) +#define glFinishFenceNV GLEW_GET_FUN(__glewFinishFenceNV) +#define glGenFencesNV GLEW_GET_FUN(__glewGenFencesNV) +#define glGetFenceivNV GLEW_GET_FUN(__glewGetFenceivNV) +#define glIsFenceNV GLEW_GET_FUN(__glewIsFenceNV) +#define glSetFenceNV GLEW_GET_FUN(__glewSetFenceNV) +#define glTestFenceNV GLEW_GET_FUN(__glewTestFenceNV) + +#define GLEW_NV_fence GLEW_GET_VAR(__GLEW_NV_fence) + +#endif /* GL_NV_fence */ + +/* --------------------------- GL_NV_float_buffer -------------------------- */ + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 + +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E + +#define GLEW_NV_float_buffer GLEW_GET_VAR(__GLEW_NV_float_buffer) + +#endif /* GL_NV_float_buffer */ + +/* --------------------------- GL_NV_fog_distance -------------------------- */ + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 + +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C + +#define GLEW_NV_fog_distance GLEW_GET_VAR(__GLEW_NV_fog_distance) + +#endif /* GL_NV_fog_distance */ + +/* ------------------------- GL_NV_fragment_program ------------------------ */ + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 + +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]); + +#define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV) +#define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV) +#define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV) +#define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV) +#define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV) +#define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV) + +#define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program) + +#endif /* GL_NV_fragment_program */ + +/* ------------------------ GL_NV_fragment_program2 ------------------------ */ + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 + +#define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2) + +#endif /* GL_NV_fragment_program2 */ + +/* ------------------------ GL_NV_fragment_program4 ------------------------ */ + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 + +#define GLEW_NV_fragment_program4 GLEW_GET_VAR(__GLEW_NV_fragment_program4) + +#endif /* GL_NV_fragment_program4 */ + +/* --------------------- GL_NV_fragment_program_option --------------------- */ + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 + +#define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option) + +#endif /* GL_NV_fragment_program_option */ + +/* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */ + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 + +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleCoverageNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleCoverageNV) + +#define GLEW_NV_framebuffer_multisample_coverage GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample_coverage) + +#endif /* GL_NV_framebuffer_multisample_coverage */ + +/* ------------------------ GL_NV_geometry_program4 ------------------------ */ + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 + +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 + +typedef void (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); + +#define glProgramVertexLimitNV GLEW_GET_FUN(__glewProgramVertexLimitNV) + +#define GLEW_NV_geometry_program4 GLEW_GET_VAR(__GLEW_NV_geometry_program4) + +#endif /* GL_NV_geometry_program4 */ + +/* ------------------------- GL_NV_geometry_shader4 ------------------------ */ + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 + +#define GLEW_NV_geometry_shader4 GLEW_GET_VAR(__GLEW_NV_geometry_shader4) + +#endif /* GL_NV_geometry_shader4 */ + +/* --------------------------- GL_NV_gpu_program4 -------------------------- */ + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 + +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 + +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); + +#define glProgramEnvParameterI4iNV GLEW_GET_FUN(__glewProgramEnvParameterI4iNV) +#define glProgramEnvParameterI4ivNV GLEW_GET_FUN(__glewProgramEnvParameterI4ivNV) +#define glProgramEnvParameterI4uiNV GLEW_GET_FUN(__glewProgramEnvParameterI4uiNV) +#define glProgramEnvParameterI4uivNV GLEW_GET_FUN(__glewProgramEnvParameterI4uivNV) +#define glProgramEnvParametersI4ivNV GLEW_GET_FUN(__glewProgramEnvParametersI4ivNV) +#define glProgramEnvParametersI4uivNV GLEW_GET_FUN(__glewProgramEnvParametersI4uivNV) +#define glProgramLocalParameterI4iNV GLEW_GET_FUN(__glewProgramLocalParameterI4iNV) +#define glProgramLocalParameterI4ivNV GLEW_GET_FUN(__glewProgramLocalParameterI4ivNV) +#define glProgramLocalParameterI4uiNV GLEW_GET_FUN(__glewProgramLocalParameterI4uiNV) +#define glProgramLocalParameterI4uivNV GLEW_GET_FUN(__glewProgramLocalParameterI4uivNV) +#define glProgramLocalParametersI4ivNV GLEW_GET_FUN(__glewProgramLocalParametersI4ivNV) +#define glProgramLocalParametersI4uivNV GLEW_GET_FUN(__glewProgramLocalParametersI4uivNV) + +#define GLEW_NV_gpu_program4 GLEW_GET_VAR(__GLEW_NV_gpu_program4) + +#endif /* GL_NV_gpu_program4 */ + +/* --------------------------- GL_NV_gpu_program5 -------------------------- */ + +#ifndef GL_NV_gpu_program5 +#define GL_NV_gpu_program5 1 + +#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C +#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F + +#define GLEW_NV_gpu_program5 GLEW_GET_VAR(__GLEW_NV_gpu_program5) + +#endif /* GL_NV_gpu_program5 */ + +/* -------------------- GL_NV_gpu_program5_mem_extended -------------------- */ + +#ifndef GL_NV_gpu_program5_mem_extended +#define GL_NV_gpu_program5_mem_extended 1 + +#define GLEW_NV_gpu_program5_mem_extended GLEW_GET_VAR(__GLEW_NV_gpu_program5_mem_extended) + +#endif /* GL_NV_gpu_program5_mem_extended */ + +/* ------------------------- GL_NV_gpu_program_fp64 ------------------------ */ + +#ifndef GL_NV_gpu_program_fp64 +#define GL_NV_gpu_program_fp64 1 + +#define GLEW_NV_gpu_program_fp64 GLEW_GET_VAR(__GLEW_NV_gpu_program_fp64) + +#endif /* GL_NV_gpu_program_fp64 */ + +/* --------------------------- GL_NV_gpu_shader5 --------------------------- */ + +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetUniformi64vNV GLEW_GET_FUN(__glewGetUniformi64vNV) +#define glGetUniformui64vNV GLEW_GET_FUN(__glewGetUniformui64vNV) +#define glProgramUniform1i64NV GLEW_GET_FUN(__glewProgramUniform1i64NV) +#define glProgramUniform1i64vNV GLEW_GET_FUN(__glewProgramUniform1i64vNV) +#define glProgramUniform1ui64NV GLEW_GET_FUN(__glewProgramUniform1ui64NV) +#define glProgramUniform1ui64vNV GLEW_GET_FUN(__glewProgramUniform1ui64vNV) +#define glProgramUniform2i64NV GLEW_GET_FUN(__glewProgramUniform2i64NV) +#define glProgramUniform2i64vNV GLEW_GET_FUN(__glewProgramUniform2i64vNV) +#define glProgramUniform2ui64NV GLEW_GET_FUN(__glewProgramUniform2ui64NV) +#define glProgramUniform2ui64vNV GLEW_GET_FUN(__glewProgramUniform2ui64vNV) +#define glProgramUniform3i64NV GLEW_GET_FUN(__glewProgramUniform3i64NV) +#define glProgramUniform3i64vNV GLEW_GET_FUN(__glewProgramUniform3i64vNV) +#define glProgramUniform3ui64NV GLEW_GET_FUN(__glewProgramUniform3ui64NV) +#define glProgramUniform3ui64vNV GLEW_GET_FUN(__glewProgramUniform3ui64vNV) +#define glProgramUniform4i64NV GLEW_GET_FUN(__glewProgramUniform4i64NV) +#define glProgramUniform4i64vNV GLEW_GET_FUN(__glewProgramUniform4i64vNV) +#define glProgramUniform4ui64NV GLEW_GET_FUN(__glewProgramUniform4ui64NV) +#define glProgramUniform4ui64vNV GLEW_GET_FUN(__glewProgramUniform4ui64vNV) +#define glUniform1i64NV GLEW_GET_FUN(__glewUniform1i64NV) +#define glUniform1i64vNV GLEW_GET_FUN(__glewUniform1i64vNV) +#define glUniform1ui64NV GLEW_GET_FUN(__glewUniform1ui64NV) +#define glUniform1ui64vNV GLEW_GET_FUN(__glewUniform1ui64vNV) +#define glUniform2i64NV GLEW_GET_FUN(__glewUniform2i64NV) +#define glUniform2i64vNV GLEW_GET_FUN(__glewUniform2i64vNV) +#define glUniform2ui64NV GLEW_GET_FUN(__glewUniform2ui64NV) +#define glUniform2ui64vNV GLEW_GET_FUN(__glewUniform2ui64vNV) +#define glUniform3i64NV GLEW_GET_FUN(__glewUniform3i64NV) +#define glUniform3i64vNV GLEW_GET_FUN(__glewUniform3i64vNV) +#define glUniform3ui64NV GLEW_GET_FUN(__glewUniform3ui64NV) +#define glUniform3ui64vNV GLEW_GET_FUN(__glewUniform3ui64vNV) +#define glUniform4i64NV GLEW_GET_FUN(__glewUniform4i64NV) +#define glUniform4i64vNV GLEW_GET_FUN(__glewUniform4i64vNV) +#define glUniform4ui64NV GLEW_GET_FUN(__glewUniform4ui64NV) +#define glUniform4ui64vNV GLEW_GET_FUN(__glewUniform4ui64vNV) + +#define GLEW_NV_gpu_shader5 GLEW_GET_VAR(__GLEW_NV_gpu_shader5) + +#endif /* GL_NV_gpu_shader5 */ + +/* ---------------------------- GL_NV_half_float --------------------------- */ + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 + +#define GL_HALF_FLOAT_NV 0x140B + +typedef unsigned short GLhalf; + +typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha); +typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz); +typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); + +#define glColor3hNV GLEW_GET_FUN(__glewColor3hNV) +#define glColor3hvNV GLEW_GET_FUN(__glewColor3hvNV) +#define glColor4hNV GLEW_GET_FUN(__glewColor4hNV) +#define glColor4hvNV GLEW_GET_FUN(__glewColor4hvNV) +#define glFogCoordhNV GLEW_GET_FUN(__glewFogCoordhNV) +#define glFogCoordhvNV GLEW_GET_FUN(__glewFogCoordhvNV) +#define glMultiTexCoord1hNV GLEW_GET_FUN(__glewMultiTexCoord1hNV) +#define glMultiTexCoord1hvNV GLEW_GET_FUN(__glewMultiTexCoord1hvNV) +#define glMultiTexCoord2hNV GLEW_GET_FUN(__glewMultiTexCoord2hNV) +#define glMultiTexCoord2hvNV GLEW_GET_FUN(__glewMultiTexCoord2hvNV) +#define glMultiTexCoord3hNV GLEW_GET_FUN(__glewMultiTexCoord3hNV) +#define glMultiTexCoord3hvNV GLEW_GET_FUN(__glewMultiTexCoord3hvNV) +#define glMultiTexCoord4hNV GLEW_GET_FUN(__glewMultiTexCoord4hNV) +#define glMultiTexCoord4hvNV GLEW_GET_FUN(__glewMultiTexCoord4hvNV) +#define glNormal3hNV GLEW_GET_FUN(__glewNormal3hNV) +#define glNormal3hvNV GLEW_GET_FUN(__glewNormal3hvNV) +#define glSecondaryColor3hNV GLEW_GET_FUN(__glewSecondaryColor3hNV) +#define glSecondaryColor3hvNV GLEW_GET_FUN(__glewSecondaryColor3hvNV) +#define glTexCoord1hNV GLEW_GET_FUN(__glewTexCoord1hNV) +#define glTexCoord1hvNV GLEW_GET_FUN(__glewTexCoord1hvNV) +#define glTexCoord2hNV GLEW_GET_FUN(__glewTexCoord2hNV) +#define glTexCoord2hvNV GLEW_GET_FUN(__glewTexCoord2hvNV) +#define glTexCoord3hNV GLEW_GET_FUN(__glewTexCoord3hNV) +#define glTexCoord3hvNV GLEW_GET_FUN(__glewTexCoord3hvNV) +#define glTexCoord4hNV GLEW_GET_FUN(__glewTexCoord4hNV) +#define glTexCoord4hvNV GLEW_GET_FUN(__glewTexCoord4hvNV) +#define glVertex2hNV GLEW_GET_FUN(__glewVertex2hNV) +#define glVertex2hvNV GLEW_GET_FUN(__glewVertex2hvNV) +#define glVertex3hNV GLEW_GET_FUN(__glewVertex3hNV) +#define glVertex3hvNV GLEW_GET_FUN(__glewVertex3hvNV) +#define glVertex4hNV GLEW_GET_FUN(__glewVertex4hNV) +#define glVertex4hvNV GLEW_GET_FUN(__glewVertex4hvNV) +#define glVertexAttrib1hNV GLEW_GET_FUN(__glewVertexAttrib1hNV) +#define glVertexAttrib1hvNV GLEW_GET_FUN(__glewVertexAttrib1hvNV) +#define glVertexAttrib2hNV GLEW_GET_FUN(__glewVertexAttrib2hNV) +#define glVertexAttrib2hvNV GLEW_GET_FUN(__glewVertexAttrib2hvNV) +#define glVertexAttrib3hNV GLEW_GET_FUN(__glewVertexAttrib3hNV) +#define glVertexAttrib3hvNV GLEW_GET_FUN(__glewVertexAttrib3hvNV) +#define glVertexAttrib4hNV GLEW_GET_FUN(__glewVertexAttrib4hNV) +#define glVertexAttrib4hvNV GLEW_GET_FUN(__glewVertexAttrib4hvNV) +#define glVertexAttribs1hvNV GLEW_GET_FUN(__glewVertexAttribs1hvNV) +#define glVertexAttribs2hvNV GLEW_GET_FUN(__glewVertexAttribs2hvNV) +#define glVertexAttribs3hvNV GLEW_GET_FUN(__glewVertexAttribs3hvNV) +#define glVertexAttribs4hvNV GLEW_GET_FUN(__glewVertexAttribs4hvNV) +#define glVertexWeighthNV GLEW_GET_FUN(__glewVertexWeighthNV) +#define glVertexWeighthvNV GLEW_GET_FUN(__glewVertexWeighthvNV) + +#define GLEW_NV_half_float GLEW_GET_VAR(__GLEW_NV_half_float) + +#endif /* GL_NV_half_float */ + +/* ------------------------ GL_NV_light_max_exponent ----------------------- */ + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 + +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 + +#define GLEW_NV_light_max_exponent GLEW_GET_VAR(__GLEW_NV_light_max_exponent) + +#endif /* GL_NV_light_max_exponent */ + +/* ----------------------- GL_NV_multisample_coverage ---------------------- */ + +#ifndef GL_NV_multisample_coverage +#define GL_NV_multisample_coverage 1 + +#define GL_COLOR_SAMPLES_NV 0x8E20 + +#define GLEW_NV_multisample_coverage GLEW_GET_VAR(__GLEW_NV_multisample_coverage) + +#endif /* GL_NV_multisample_coverage */ + +/* --------------------- GL_NV_multisample_filter_hint --------------------- */ + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 + +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 + +#define GLEW_NV_multisample_filter_hint GLEW_GET_VAR(__GLEW_NV_multisample_filter_hint) + +#endif /* GL_NV_multisample_filter_hint */ + +/* ------------------------- GL_NV_occlusion_query ------------------------- */ + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 + +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 + +typedef void (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); + +#define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV) +#define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV) +#define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV) +#define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV) +#define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV) +#define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV) +#define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV) + +#define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query) + +#endif /* GL_NV_occlusion_query */ + +/* ----------------------- GL_NV_packed_depth_stencil ---------------------- */ + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA + +#define GLEW_NV_packed_depth_stencil GLEW_GET_VAR(__GLEW_NV_packed_depth_stencil) + +#endif /* GL_NV_packed_depth_stencil */ + +/* --------------------- GL_NV_parameter_buffer_object --------------------- */ + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 + +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 + +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); + +#define glProgramBufferParametersIivNV GLEW_GET_FUN(__glewProgramBufferParametersIivNV) +#define glProgramBufferParametersIuivNV GLEW_GET_FUN(__glewProgramBufferParametersIuivNV) +#define glProgramBufferParametersfvNV GLEW_GET_FUN(__glewProgramBufferParametersfvNV) + +#define GLEW_NV_parameter_buffer_object GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object) + +#endif /* GL_NV_parameter_buffer_object */ + +/* --------------------- GL_NV_parameter_buffer_object2 -------------------- */ + +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 + +#define GLEW_NV_parameter_buffer_object2 GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object2) + +#endif /* GL_NV_parameter_buffer_object2 */ + +/* -------------------------- GL_NV_path_rendering ------------------------- */ + +#ifndef GL_NV_path_rendering +#define GL_NV_path_rendering 1 + +#define GL_CLOSE_PATH_NV 0x00 +#define GL_BOLD_BIT_NV 0x01 +#define GL_GLYPH_WIDTH_BIT_NV 0x01 +#define GL_GLYPH_HEIGHT_BIT_NV 0x02 +#define GL_ITALIC_BIT_NV 0x02 +#define GL_MOVE_TO_NV 0x02 +#define GL_RELATIVE_MOVE_TO_NV 0x03 +#define GL_LINE_TO_NV 0x04 +#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 +#define GL_RELATIVE_LINE_TO_NV 0x05 +#define GL_HORIZONTAL_LINE_TO_NV 0x06 +#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 +#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 +#define GL_VERTICAL_LINE_TO_NV 0x08 +#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 +#define GL_QUADRATIC_CURVE_TO_NV 0x0A +#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B +#define GL_CUBIC_CURVE_TO_NV 0x0C +#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D +#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E +#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F +#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 +#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 +#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 +#define GL_SMALL_CCW_ARC_TO_NV 0x12 +#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 +#define GL_SMALL_CW_ARC_TO_NV 0x14 +#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 +#define GL_LARGE_CCW_ARC_TO_NV 0x16 +#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 +#define GL_LARGE_CW_ARC_TO_NV 0x18 +#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 +#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 +#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 +#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 +#define GL_RESTART_PATH_NV 0xF0 +#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 +#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 +#define GL_RECT_NV 0xF6 +#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 +#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA +#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC +#define GL_ARC_TO_NV 0xFE +#define GL_RELATIVE_ARC_TO_NV 0xFF +#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PATH_FORMAT_SVG_NV 0x9070 +#define GL_PATH_FORMAT_PS_NV 0x9071 +#define GL_STANDARD_FONT_NAME_NV 0x9072 +#define GL_SYSTEM_FONT_NAME_NV 0x9073 +#define GL_FILE_NAME_NV 0x9074 +#define GL_PATH_STROKE_WIDTH_NV 0x9075 +#define GL_PATH_END_CAPS_NV 0x9076 +#define GL_PATH_INITIAL_END_CAP_NV 0x9077 +#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 +#define GL_PATH_JOIN_STYLE_NV 0x9079 +#define GL_PATH_MITER_LIMIT_NV 0x907A +#define GL_PATH_DASH_CAPS_NV 0x907B +#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C +#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D +#define GL_PATH_DASH_OFFSET_NV 0x907E +#define GL_PATH_CLIENT_LENGTH_NV 0x907F +#define GL_PATH_FILL_MODE_NV 0x9080 +#define GL_PATH_FILL_MASK_NV 0x9081 +#define GL_PATH_FILL_COVER_MODE_NV 0x9082 +#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 +#define GL_PATH_STROKE_MASK_NV 0x9084 +#define GL_COUNT_UP_NV 0x9088 +#define GL_COUNT_DOWN_NV 0x9089 +#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A +#define GL_CONVEX_HULL_NV 0x908B +#define GL_BOUNDING_BOX_NV 0x908D +#define GL_TRANSLATE_X_NV 0x908E +#define GL_TRANSLATE_Y_NV 0x908F +#define GL_TRANSLATE_2D_NV 0x9090 +#define GL_TRANSLATE_3D_NV 0x9091 +#define GL_AFFINE_2D_NV 0x9092 +#define GL_AFFINE_3D_NV 0x9094 +#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 +#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 +#define GL_UTF8_NV 0x909A +#define GL_UTF16_NV 0x909B +#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C +#define GL_PATH_COMMAND_COUNT_NV 0x909D +#define GL_PATH_COORD_COUNT_NV 0x909E +#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F +#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 +#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 +#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 +#define GL_SQUARE_NV 0x90A3 +#define GL_ROUND_NV 0x90A4 +#define GL_TRIANGULAR_NV 0x90A5 +#define GL_BEVEL_NV 0x90A6 +#define GL_MITER_REVERT_NV 0x90A7 +#define GL_MITER_TRUNCATE_NV 0x90A8 +#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 +#define GL_USE_MISSING_GLYPH_NV 0x90AA +#define GL_PATH_ERROR_POSITION_NV 0x90AB +#define GL_PATH_FOG_GEN_MODE_NV 0x90AC +#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD +#define GL_ADJACENT_PAIRS_NV 0x90AE +#define GL_FIRST_TO_REST_NV 0x90AF +#define GL_PATH_GEN_MODE_NV 0x90B0 +#define GL_PATH_GEN_COEFF_NV 0x90B1 +#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 +#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 +#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 +#define GL_MOVE_TO_RESETS_NV 0x90B5 +#define GL_MOVE_TO_CONTINUES_NV 0x90B6 +#define GL_PATH_STENCIL_FUNC_NV 0x90B7 +#define GL_PATH_STENCIL_REF_NV 0x90B8 +#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 +#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD +#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE +#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF +#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 +#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 +#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 +#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 +#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 +#define GL_FONT_ASCENDER_BIT_NV 0x00200000 +#define GL_FONT_DESCENDER_BIT_NV 0x00400000 +#define GL_FONT_HEIGHT_BIT_NV 0x00800000 +#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 +#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 +#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 +#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 +#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 + +typedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint name, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); +typedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint name, GLubyte* commands); +typedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint name, GLfloat* coords); +typedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint name, GLfloat* dashArray); +typedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint fistPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint name, GLenum param, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint name, GLenum param, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +typedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); +typedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords); +typedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void* coords); +typedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc); +typedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray); +typedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void* pathString); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void* coords); +typedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); +typedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); +typedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); +typedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]); + +#define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV) +#define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV) +#define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV) +#define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV) +#define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV) +#define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV) +#define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV) +#define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV) +#define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV) +#define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV) +#define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV) +#define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV) +#define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV) +#define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV) +#define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV) +#define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV) +#define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV) +#define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV) +#define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV) +#define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV) +#define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV) +#define glIsPathNV GLEW_GET_FUN(__glewIsPathNV) +#define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV) +#define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV) +#define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV) +#define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV) +#define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV) +#define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV) +#define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV) +#define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV) +#define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV) +#define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV) +#define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV) +#define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV) +#define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV) +#define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV) +#define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV) +#define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV) +#define glPathStringNV GLEW_GET_FUN(__glewPathStringNV) +#define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV) +#define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV) +#define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV) +#define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV) +#define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV) +#define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV) +#define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV) +#define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV) +#define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV) +#define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV) + +#define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering) + +#endif /* GL_NV_path_rendering */ + +/* ------------------------- GL_NV_pixel_data_range ------------------------ */ + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 + +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D + +typedef void (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); + +#define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV) +#define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV) + +#define GLEW_NV_pixel_data_range GLEW_GET_VAR(__GLEW_NV_pixel_data_range) + +#endif /* GL_NV_pixel_data_range */ + +/* --------------------------- GL_NV_point_sprite -------------------------- */ + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 + +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint* params); + +#define glPointParameteriNV GLEW_GET_FUN(__glewPointParameteriNV) +#define glPointParameterivNV GLEW_GET_FUN(__glewPointParameterivNV) + +#define GLEW_NV_point_sprite GLEW_GET_VAR(__GLEW_NV_point_sprite) + +#endif /* GL_NV_point_sprite */ + +/* -------------------------- GL_NV_present_video -------------------------- */ + +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 + +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B + +typedef void (GLAPIENTRY * PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); + +#define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV) +#define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV) +#define glGetVideoui64vNV GLEW_GET_FUN(__glewGetVideoui64vNV) +#define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV) +#define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV) +#define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV) + +#define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video) + +#endif /* GL_NV_present_video */ + +/* ------------------------ GL_NV_primitive_restart ------------------------ */ + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 + +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 + +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void); + +#define glPrimitiveRestartIndexNV GLEW_GET_FUN(__glewPrimitiveRestartIndexNV) +#define glPrimitiveRestartNV GLEW_GET_FUN(__glewPrimitiveRestartNV) + +#define GLEW_NV_primitive_restart GLEW_GET_VAR(__GLEW_NV_primitive_restart) + +#endif /* GL_NV_primitive_restart */ + +/* ------------------------ GL_NV_register_combiners ----------------------- */ + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 + +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 + +typedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params); + +#define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV) +#define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV) +#define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV) +#define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV) +#define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV) +#define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV) +#define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV) +#define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV) +#define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV) +#define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV) +#define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV) +#define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV) +#define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV) + +#define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners) + +#endif /* GL_NV_register_combiners */ + +/* ----------------------- GL_NV_register_combiners2 ----------------------- */ + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 + +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 + +typedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params); + +#define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV) +#define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV) + +#define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2) + +#endif /* GL_NV_register_combiners2 */ + +/* ---------------------- GL_NV_shader_atomic_counters --------------------- */ + +#ifndef GL_NV_shader_atomic_counters +#define GL_NV_shader_atomic_counters 1 + +#define GLEW_NV_shader_atomic_counters GLEW_GET_VAR(__GLEW_NV_shader_atomic_counters) + +#endif /* GL_NV_shader_atomic_counters */ + +/* ----------------------- GL_NV_shader_atomic_float ----------------------- */ + +#ifndef GL_NV_shader_atomic_float +#define GL_NV_shader_atomic_float 1 + +#define GLEW_NV_shader_atomic_float GLEW_GET_VAR(__GLEW_NV_shader_atomic_float) + +#endif /* GL_NV_shader_atomic_float */ + +/* ------------------------ GL_NV_shader_buffer_load ----------------------- */ + +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 + +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 + +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT* result); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetBufferParameterui64vNV GLEW_GET_FUN(__glewGetBufferParameterui64vNV) +#define glGetIntegerui64vNV GLEW_GET_FUN(__glewGetIntegerui64vNV) +#define glGetNamedBufferParameterui64vNV GLEW_GET_FUN(__glewGetNamedBufferParameterui64vNV) +#define glIsBufferResidentNV GLEW_GET_FUN(__glewIsBufferResidentNV) +#define glIsNamedBufferResidentNV GLEW_GET_FUN(__glewIsNamedBufferResidentNV) +#define glMakeBufferNonResidentNV GLEW_GET_FUN(__glewMakeBufferNonResidentNV) +#define glMakeBufferResidentNV GLEW_GET_FUN(__glewMakeBufferResidentNV) +#define glMakeNamedBufferNonResidentNV GLEW_GET_FUN(__glewMakeNamedBufferNonResidentNV) +#define glMakeNamedBufferResidentNV GLEW_GET_FUN(__glewMakeNamedBufferResidentNV) +#define glProgramUniformui64NV GLEW_GET_FUN(__glewProgramUniformui64NV) +#define glProgramUniformui64vNV GLEW_GET_FUN(__glewProgramUniformui64vNV) +#define glUniformui64NV GLEW_GET_FUN(__glewUniformui64NV) +#define glUniformui64vNV GLEW_GET_FUN(__glewUniformui64vNV) + +#define GLEW_NV_shader_buffer_load GLEW_GET_VAR(__GLEW_NV_shader_buffer_load) + +#endif /* GL_NV_shader_buffer_load */ + +/* ------------------- GL_NV_shader_storage_buffer_object ------------------ */ + +#ifndef GL_NV_shader_storage_buffer_object +#define GL_NV_shader_storage_buffer_object 1 + +#define GLEW_NV_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_NV_shader_storage_buffer_object) + +#endif /* GL_NV_shader_storage_buffer_object */ + +/* ---------------------- GL_NV_tessellation_program5 ---------------------- */ + +#ifndef GL_NV_tessellation_program5 +#define GL_NV_tessellation_program5 1 + +#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 +#define GL_TESS_CONTROL_PROGRAM_NV 0x891E +#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F +#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 +#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 + +#define GLEW_NV_tessellation_program5 GLEW_GET_VAR(__GLEW_NV_tessellation_program5) + +#endif /* GL_NV_tessellation_program5 */ + +/* -------------------------- GL_NV_texgen_emboss -------------------------- */ + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 + +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F + +#define GLEW_NV_texgen_emboss GLEW_GET_VAR(__GLEW_NV_texgen_emboss) + +#endif /* GL_NV_texgen_emboss */ + +/* ------------------------ GL_NV_texgen_reflection ------------------------ */ + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 + +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 + +#define GLEW_NV_texgen_reflection GLEW_GET_VAR(__GLEW_NV_texgen_reflection) + +#endif /* GL_NV_texgen_reflection */ + +/* ------------------------- GL_NV_texture_barrier ------------------------- */ + +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 + +typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void); + +#define glTextureBarrierNV GLEW_GET_FUN(__glewTextureBarrierNV) + +#define GLEW_NV_texture_barrier GLEW_GET_VAR(__GLEW_NV_texture_barrier) + +#endif /* GL_NV_texture_barrier */ + +/* --------------------- GL_NV_texture_compression_vtc --------------------- */ + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 + +#define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc) + +#endif /* GL_NV_texture_compression_vtc */ + +/* ----------------------- GL_NV_texture_env_combine4 ---------------------- */ + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 + +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B + +#define GLEW_NV_texture_env_combine4 GLEW_GET_VAR(__GLEW_NV_texture_env_combine4) + +#endif /* GL_NV_texture_env_combine4 */ + +/* ---------------------- GL_NV_texture_expand_normal ---------------------- */ + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 + +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F + +#define GLEW_NV_texture_expand_normal GLEW_GET_VAR(__GLEW_NV_texture_expand_normal) + +#endif /* GL_NV_texture_expand_normal */ + +/* ----------------------- GL_NV_texture_multisample ----------------------- */ + +#ifndef GL_NV_texture_multisample +#define GL_NV_texture_multisample 1 + +#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 +#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); + +#define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV) +#define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV) +#define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV) +#define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV) +#define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV) +#define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV) + +#define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample) + +#endif /* GL_NV_texture_multisample */ + +/* ------------------------ GL_NV_texture_rectangle ------------------------ */ + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 + +#define GLEW_NV_texture_rectangle GLEW_GET_VAR(__GLEW_NV_texture_rectangle) + +#endif /* GL_NV_texture_rectangle */ + +/* -------------------------- GL_NV_texture_shader ------------------------- */ + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 + +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F + +#define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader) + +#endif /* GL_NV_texture_shader */ + +/* ------------------------- GL_NV_texture_shader2 ------------------------- */ + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 + +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D + +#define GLEW_NV_texture_shader2 GLEW_GET_VAR(__GLEW_NV_texture_shader2) + +#endif /* GL_NV_texture_shader2 */ + +/* ------------------------- GL_NV_texture_shader3 ------------------------- */ + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 + +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 + +#define GLEW_NV_texture_shader3 GLEW_GET_VAR(__GLEW_NV_texture_shader3) + +#endif /* GL_NV_texture_shader3 */ + +/* ------------------------ GL_NV_transform_feedback ----------------------- */ + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 + +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F + +typedef void (GLAPIENTRY * PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +typedef GLint (GLAPIENTRY * PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); + +#define glActiveVaryingNV GLEW_GET_FUN(__glewActiveVaryingNV) +#define glBeginTransformFeedbackNV GLEW_GET_FUN(__glewBeginTransformFeedbackNV) +#define glBindBufferBaseNV GLEW_GET_FUN(__glewBindBufferBaseNV) +#define glBindBufferOffsetNV GLEW_GET_FUN(__glewBindBufferOffsetNV) +#define glBindBufferRangeNV GLEW_GET_FUN(__glewBindBufferRangeNV) +#define glEndTransformFeedbackNV GLEW_GET_FUN(__glewEndTransformFeedbackNV) +#define glGetActiveVaryingNV GLEW_GET_FUN(__glewGetActiveVaryingNV) +#define glGetTransformFeedbackVaryingNV GLEW_GET_FUN(__glewGetTransformFeedbackVaryingNV) +#define glGetVaryingLocationNV GLEW_GET_FUN(__glewGetVaryingLocationNV) +#define glTransformFeedbackAttribsNV GLEW_GET_FUN(__glewTransformFeedbackAttribsNV) +#define glTransformFeedbackVaryingsNV GLEW_GET_FUN(__glewTransformFeedbackVaryingsNV) + +#define GLEW_NV_transform_feedback GLEW_GET_VAR(__GLEW_NV_transform_feedback) + +#endif /* GL_NV_transform_feedback */ + +/* ----------------------- GL_NV_transform_feedback2 ----------------------- */ + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); + +#define glBindTransformFeedbackNV GLEW_GET_FUN(__glewBindTransformFeedbackNV) +#define glDeleteTransformFeedbacksNV GLEW_GET_FUN(__glewDeleteTransformFeedbacksNV) +#define glDrawTransformFeedbackNV GLEW_GET_FUN(__glewDrawTransformFeedbackNV) +#define glGenTransformFeedbacksNV GLEW_GET_FUN(__glewGenTransformFeedbacksNV) +#define glIsTransformFeedbackNV GLEW_GET_FUN(__glewIsTransformFeedbackNV) +#define glPauseTransformFeedbackNV GLEW_GET_FUN(__glewPauseTransformFeedbackNV) +#define glResumeTransformFeedbackNV GLEW_GET_FUN(__glewResumeTransformFeedbackNV) + +#define GLEW_NV_transform_feedback2 GLEW_GET_VAR(__GLEW_NV_transform_feedback2) + +#endif /* GL_NV_transform_feedback2 */ + +/* -------------------------- GL_NV_vdpau_interop -------------------------- */ + +#ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 + +#define GL_SURFACE_STATE_NV 0x86EB +#define GL_SURFACE_REGISTERED_NV 0x86FD +#define GL_SURFACE_MAPPED_NV 0x8700 +#define GL_WRITE_DISCARD_NV 0x88BE + +typedef GLintptr GLvdpauSurfaceNV; + +typedef void (GLAPIENTRY * PFNGLVDPAUFININVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); +typedef void (GLAPIENTRY * PFNGLVDPAUINITNVPROC) (const void* vdpDevice, const GLvoid*getProcAddress); +typedef void (GLAPIENTRY * PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (GLAPIENTRY * PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); +typedef void (GLAPIENTRY * PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces); +typedef void (GLAPIENTRY * PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); + +#define glVDPAUFiniNV GLEW_GET_FUN(__glewVDPAUFiniNV) +#define glVDPAUGetSurfaceivNV GLEW_GET_FUN(__glewVDPAUGetSurfaceivNV) +#define glVDPAUInitNV GLEW_GET_FUN(__glewVDPAUInitNV) +#define glVDPAUIsSurfaceNV GLEW_GET_FUN(__glewVDPAUIsSurfaceNV) +#define glVDPAUMapSurfacesNV GLEW_GET_FUN(__glewVDPAUMapSurfacesNV) +#define glVDPAURegisterOutputSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterOutputSurfaceNV) +#define glVDPAURegisterVideoSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterVideoSurfaceNV) +#define glVDPAUSurfaceAccessNV GLEW_GET_FUN(__glewVDPAUSurfaceAccessNV) +#define glVDPAUUnmapSurfacesNV GLEW_GET_FUN(__glewVDPAUUnmapSurfacesNV) +#define glVDPAUUnregisterSurfaceNV GLEW_GET_FUN(__glewVDPAUUnregisterSurfaceNV) + +#define GLEW_NV_vdpau_interop GLEW_GET_VAR(__GLEW_NV_vdpau_interop) + +#endif /* GL_NV_vdpau_interop */ + +/* ------------------------ GL_NV_vertex_array_range ----------------------- */ + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, GLvoid *pointer); + +#define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV) +#define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV) + +#define GLEW_NV_vertex_array_range GLEW_GET_VAR(__GLEW_NV_vertex_array_range) + +#endif /* GL_NV_vertex_array_range */ + +/* ----------------------- GL_NV_vertex_array_range2 ----------------------- */ + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 + +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 + +#define GLEW_NV_vertex_array_range2 GLEW_GET_VAR(__GLEW_NV_vertex_array_range2) + +#endif /* GL_NV_vertex_array_range2 */ + +/* ------------------- GL_NV_vertex_attrib_integer_64bit ------------------- */ + +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); + +#define glGetVertexAttribLi64vNV GLEW_GET_FUN(__glewGetVertexAttribLi64vNV) +#define glGetVertexAttribLui64vNV GLEW_GET_FUN(__glewGetVertexAttribLui64vNV) +#define glVertexAttribL1i64NV GLEW_GET_FUN(__glewVertexAttribL1i64NV) +#define glVertexAttribL1i64vNV GLEW_GET_FUN(__glewVertexAttribL1i64vNV) +#define glVertexAttribL1ui64NV GLEW_GET_FUN(__glewVertexAttribL1ui64NV) +#define glVertexAttribL1ui64vNV GLEW_GET_FUN(__glewVertexAttribL1ui64vNV) +#define glVertexAttribL2i64NV GLEW_GET_FUN(__glewVertexAttribL2i64NV) +#define glVertexAttribL2i64vNV GLEW_GET_FUN(__glewVertexAttribL2i64vNV) +#define glVertexAttribL2ui64NV GLEW_GET_FUN(__glewVertexAttribL2ui64NV) +#define glVertexAttribL2ui64vNV GLEW_GET_FUN(__glewVertexAttribL2ui64vNV) +#define glVertexAttribL3i64NV GLEW_GET_FUN(__glewVertexAttribL3i64NV) +#define glVertexAttribL3i64vNV GLEW_GET_FUN(__glewVertexAttribL3i64vNV) +#define glVertexAttribL3ui64NV GLEW_GET_FUN(__glewVertexAttribL3ui64NV) +#define glVertexAttribL3ui64vNV GLEW_GET_FUN(__glewVertexAttribL3ui64vNV) +#define glVertexAttribL4i64NV GLEW_GET_FUN(__glewVertexAttribL4i64NV) +#define glVertexAttribL4i64vNV GLEW_GET_FUN(__glewVertexAttribL4i64vNV) +#define glVertexAttribL4ui64NV GLEW_GET_FUN(__glewVertexAttribL4ui64NV) +#define glVertexAttribL4ui64vNV GLEW_GET_FUN(__glewVertexAttribL4ui64vNV) +#define glVertexAttribLFormatNV GLEW_GET_FUN(__glewVertexAttribLFormatNV) + +#define GLEW_NV_vertex_attrib_integer_64bit GLEW_GET_VAR(__GLEW_NV_vertex_attrib_integer_64bit) + +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +/* ------------------- GL_NV_vertex_buffer_unified_memory ------------------ */ + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 + +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 +#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 +#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 + +typedef void (GLAPIENTRY * PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT result[]); +typedef void (GLAPIENTRY * PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); + +#define glBufferAddressRangeNV GLEW_GET_FUN(__glewBufferAddressRangeNV) +#define glColorFormatNV GLEW_GET_FUN(__glewColorFormatNV) +#define glEdgeFlagFormatNV GLEW_GET_FUN(__glewEdgeFlagFormatNV) +#define glFogCoordFormatNV GLEW_GET_FUN(__glewFogCoordFormatNV) +#define glGetIntegerui64i_vNV GLEW_GET_FUN(__glewGetIntegerui64i_vNV) +#define glIndexFormatNV GLEW_GET_FUN(__glewIndexFormatNV) +#define glNormalFormatNV GLEW_GET_FUN(__glewNormalFormatNV) +#define glSecondaryColorFormatNV GLEW_GET_FUN(__glewSecondaryColorFormatNV) +#define glTexCoordFormatNV GLEW_GET_FUN(__glewTexCoordFormatNV) +#define glVertexAttribFormatNV GLEW_GET_FUN(__glewVertexAttribFormatNV) +#define glVertexAttribIFormatNV GLEW_GET_FUN(__glewVertexAttribIFormatNV) +#define glVertexFormatNV GLEW_GET_FUN(__glewVertexFormatNV) + +#define GLEW_NV_vertex_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_vertex_buffer_unified_memory) + +#endif /* GL_NV_vertex_buffer_unified_memory */ + +/* -------------------------- GL_NV_vertex_program ------------------------- */ + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 + +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F + +typedef GLboolean (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v); + +#define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV) +#define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV) +#define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV) +#define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV) +#define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV) +#define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV) +#define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV) +#define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV) +#define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV) +#define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV) +#define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV) +#define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV) +#define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV) +#define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV) +#define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV) +#define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV) +#define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV) +#define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV) +#define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV) +#define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV) +#define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV) +#define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV) +#define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV) +#define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV) +#define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV) +#define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV) +#define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV) +#define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV) +#define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV) +#define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV) +#define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV) +#define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV) +#define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV) +#define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV) +#define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV) +#define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV) +#define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV) +#define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV) +#define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV) +#define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV) +#define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV) +#define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV) +#define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV) +#define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV) +#define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV) +#define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV) +#define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV) +#define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV) +#define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV) +#define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV) +#define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV) +#define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV) +#define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV) +#define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV) +#define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV) +#define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV) +#define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV) +#define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV) +#define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV) +#define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV) +#define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV) +#define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV) +#define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV) +#define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV) + +#define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program) + +#endif /* GL_NV_vertex_program */ + +/* ------------------------ GL_NV_vertex_program1_1 ------------------------ */ + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 + +#define GLEW_NV_vertex_program1_1 GLEW_GET_VAR(__GLEW_NV_vertex_program1_1) + +#endif /* GL_NV_vertex_program1_1 */ + +/* ------------------------- GL_NV_vertex_program2 ------------------------- */ + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 + +#define GLEW_NV_vertex_program2 GLEW_GET_VAR(__GLEW_NV_vertex_program2) + +#endif /* GL_NV_vertex_program2 */ + +/* ---------------------- GL_NV_vertex_program2_option --------------------- */ + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 + +#define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option) + +#endif /* GL_NV_vertex_program2_option */ + +/* ------------------------- GL_NV_vertex_program3 ------------------------- */ + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 + +#define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C + +#define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3) + +#endif /* GL_NV_vertex_program3 */ + +/* ------------------------- GL_NV_vertex_program4 ------------------------- */ + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 + +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD + +#define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4) + +#endif /* GL_NV_vertex_program4 */ + +/* -------------------------- GL_NV_video_capture -------------------------- */ + +#ifndef GL_NV_video_capture +#define GL_NV_video_capture 1 + +#define GL_VIDEO_BUFFER_NV 0x9020 +#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 +#define GL_FIELD_UPPER_NV 0x9022 +#define GL_FIELD_LOWER_NV 0x9023 +#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 +#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 +#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 +#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 +#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 +#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 +#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A +#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B +#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C +#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D +#define GL_PARTIAL_SUCCESS_NV 0x902E +#define GL_SUCCESS_NV 0x902F +#define GL_FAILURE_NV 0x9030 +#define GL_YCBYCR8_422_NV 0x9031 +#define GL_YCBAYCR8A_4224_NV 0x9032 +#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 +#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 +#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 +#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 +#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 +#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 +#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 +#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A +#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B +#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C + +typedef void (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params); + +#define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV) +#define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV) +#define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV) +#define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV) +#define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV) +#define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV) +#define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV) +#define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV) +#define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV) +#define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV) +#define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV) +#define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV) + +#define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture) + +#endif /* GL_NV_video_capture */ + +/* ------------------------ GL_OES_byte_coordinates ------------------------ */ + +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 + +#define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates) + +#endif /* GL_OES_byte_coordinates */ + +/* ------------------- GL_OES_compressed_paletted_texture ------------------ */ + +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 + +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 + +#define GLEW_OES_compressed_paletted_texture GLEW_GET_VAR(__GLEW_OES_compressed_paletted_texture) + +#endif /* GL_OES_compressed_paletted_texture */ + +/* --------------------------- GL_OES_read_format -------------------------- */ + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 + +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B + +#define GLEW_OES_read_format GLEW_GET_VAR(__GLEW_OES_read_format) + +#endif /* GL_OES_read_format */ + +/* ------------------------ GL_OES_single_precision ------------------------ */ + +#ifndef GL_OES_single_precision +#define GL_OES_single_precision 1 + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFOESPROC) (GLclampd depth); +typedef void (GLAPIENTRY * PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); +typedef void (GLAPIENTRY * PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); + +#define glClearDepthfOES GLEW_GET_FUN(__glewClearDepthfOES) +#define glClipPlanefOES GLEW_GET_FUN(__glewClipPlanefOES) +#define glDepthRangefOES GLEW_GET_FUN(__glewDepthRangefOES) +#define glFrustumfOES GLEW_GET_FUN(__glewFrustumfOES) +#define glGetClipPlanefOES GLEW_GET_FUN(__glewGetClipPlanefOES) +#define glOrthofOES GLEW_GET_FUN(__glewOrthofOES) + +#define GLEW_OES_single_precision GLEW_GET_VAR(__GLEW_OES_single_precision) + +#endif /* GL_OES_single_precision */ + +/* ---------------------------- GL_OML_interlace --------------------------- */ + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 + +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 + +#define GLEW_OML_interlace GLEW_GET_VAR(__GLEW_OML_interlace) + +#endif /* GL_OML_interlace */ + +/* ---------------------------- GL_OML_resample ---------------------------- */ + +#ifndef GL_OML_resample +#define GL_OML_resample 1 + +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 + +#define GLEW_OML_resample GLEW_GET_VAR(__GLEW_OML_resample) + +#endif /* GL_OML_resample */ + +/* ---------------------------- GL_OML_subsample --------------------------- */ + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 + +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 + +#define GLEW_OML_subsample GLEW_GET_VAR(__GLEW_OML_subsample) + +#endif /* GL_OML_subsample */ + +/* --------------------------- GL_PGI_misc_hints --------------------------- */ + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 + +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 +#define GL_CONSERVE_MEMORY_HINT_PGI 107005 +#define GL_RECLAIM_MEMORY_HINT_PGI 107006 +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 +#define GL_ALWAYS_FAST_HINT_PGI 107020 +#define GL_ALWAYS_SOFT_HINT_PGI 107021 +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 +#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 +#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 +#define GL_STRICT_LIGHTING_HINT_PGI 107031 +#define GL_STRICT_SCISSOR_HINT_PGI 107032 +#define GL_FULL_STIPPLE_HINT_PGI 107033 +#define GL_CLIP_NEAR_HINT_PGI 107040 +#define GL_CLIP_FAR_HINT_PGI 107041 +#define GL_WIDE_LINE_HINT_PGI 107042 +#define GL_BACK_NORMALS_HINT_PGI 107043 + +#define GLEW_PGI_misc_hints GLEW_GET_VAR(__GLEW_PGI_misc_hints) + +#endif /* GL_PGI_misc_hints */ + +/* -------------------------- GL_PGI_vertex_hints -------------------------- */ + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 + +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_VERTEX_DATA_HINT_PGI 107050 +#define GL_VERTEX_CONSISTENT_HINT_PGI 107051 +#define GL_MATERIAL_SIDE_HINT_PGI 107052 +#define GL_MAX_VERTEX_HINT_PGI 107053 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 + +#define GLEW_PGI_vertex_hints GLEW_GET_VAR(__GLEW_PGI_vertex_hints) + +#endif /* GL_PGI_vertex_hints */ + +/* ---------------------- GL_REGAL_ES1_0_compatibility --------------------- */ + +#ifndef GL_REGAL_ES1_0_compatibility +#define GL_REGAL_ES1_0_compatibility 1 + +typedef int GLclampx; + +typedef void (GLAPIENTRY * PFNGLALPHAFUNCXPROC) (GLenum func, GLclampx ref); +typedef void (GLAPIENTRY * PFNGLCLEARCOLORXPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHXPROC) (GLclampx depth); +typedef void (GLAPIENTRY * PFNGLCOLOR4XPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEXPROC) (GLclampx zNear, GLclampx zFar); +typedef void (GLAPIENTRY * PFNGLFOGXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLFOGXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLFRUSTUMFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GLAPIENTRY * PFNGLFRUSTUMXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GLAPIENTRY * PFNGLLIGHTMODELXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLLIGHTMODELXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLLIGHTXPROC) (GLenum light, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLLIGHTXVPROC) (GLenum light, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLLINEWIDTHXPROC) (GLfixed width); +typedef void (GLAPIENTRY * PFNGLLOADMATRIXXPROC) (const GLfixed* m); +typedef void (GLAPIENTRY * PFNGLMATERIALXPROC) (GLenum face, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLMATERIALXVPROC) (GLenum face, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLMULTMATRIXXPROC) (const GLfixed* m); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4XPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +typedef void (GLAPIENTRY * PFNGLNORMAL3XPROC) (GLfixed nx, GLfixed ny, GLfixed nz); +typedef void (GLAPIENTRY * PFNGLORTHOFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GLAPIENTRY * PFNGLORTHOXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GLAPIENTRY * PFNGLPOINTSIZEXPROC) (GLfixed size); +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETXPROC) (GLfixed factor, GLfixed units); +typedef void (GLAPIENTRY * PFNGLROTATEXPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEXPROC) (GLclampx value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSCALEXPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (GLAPIENTRY * PFNGLTEXENVXPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLTEXENVXVPROC) (GLenum target, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLTRANSLATEXPROC) (GLfixed x, GLfixed y, GLfixed z); + +#define glAlphaFuncx GLEW_GET_FUN(__glewAlphaFuncx) +#define glClearColorx GLEW_GET_FUN(__glewClearColorx) +#define glClearDepthx GLEW_GET_FUN(__glewClearDepthx) +#define glColor4x GLEW_GET_FUN(__glewColor4x) +#define glDepthRangex GLEW_GET_FUN(__glewDepthRangex) +#define glFogx GLEW_GET_FUN(__glewFogx) +#define glFogxv GLEW_GET_FUN(__glewFogxv) +#define glFrustumf GLEW_GET_FUN(__glewFrustumf) +#define glFrustumx GLEW_GET_FUN(__glewFrustumx) +#define glLightModelx GLEW_GET_FUN(__glewLightModelx) +#define glLightModelxv GLEW_GET_FUN(__glewLightModelxv) +#define glLightx GLEW_GET_FUN(__glewLightx) +#define glLightxv GLEW_GET_FUN(__glewLightxv) +#define glLineWidthx GLEW_GET_FUN(__glewLineWidthx) +#define glLoadMatrixx GLEW_GET_FUN(__glewLoadMatrixx) +#define glMaterialx GLEW_GET_FUN(__glewMaterialx) +#define glMaterialxv GLEW_GET_FUN(__glewMaterialxv) +#define glMultMatrixx GLEW_GET_FUN(__glewMultMatrixx) +#define glMultiTexCoord4x GLEW_GET_FUN(__glewMultiTexCoord4x) +#define glNormal3x GLEW_GET_FUN(__glewNormal3x) +#define glOrthof GLEW_GET_FUN(__glewOrthof) +#define glOrthox GLEW_GET_FUN(__glewOrthox) +#define glPointSizex GLEW_GET_FUN(__glewPointSizex) +#define glPolygonOffsetx GLEW_GET_FUN(__glewPolygonOffsetx) +#define glRotatex GLEW_GET_FUN(__glewRotatex) +#define glSampleCoveragex GLEW_GET_FUN(__glewSampleCoveragex) +#define glScalex GLEW_GET_FUN(__glewScalex) +#define glTexEnvx GLEW_GET_FUN(__glewTexEnvx) +#define glTexEnvxv GLEW_GET_FUN(__glewTexEnvxv) +#define glTexParameterx GLEW_GET_FUN(__glewTexParameterx) +#define glTranslatex GLEW_GET_FUN(__glewTranslatex) + +#define GLEW_REGAL_ES1_0_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_0_compatibility) + +#endif /* GL_REGAL_ES1_0_compatibility */ + +/* ---------------------- GL_REGAL_ES1_1_compatibility --------------------- */ + +#ifndef GL_REGAL_ES1_1_compatibility +#define GL_REGAL_ES1_1_compatibility 1 + +typedef void (GLAPIENTRY * PFNGLCLIPPLANEFPROC) (GLenum plane, const GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLCLIPPLANEXPROC) (GLenum plane, const GLfixed* equation); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFPROC) (GLenum pname, GLfloat eqn[4]); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEXPROC) (GLenum pname, GLfixed eqn[4]); +typedef void (GLAPIENTRY * PFNGLGETFIXEDVPROC) (GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETLIGHTXVPROC) (GLenum light, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETMATERIALXVPROC) (GLenum face, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETTEXENVXVPROC) (GLenum env, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERXVPROC) (GLenum target, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLPOINTSIZEPOINTEROESPROC) (GLenum type, GLsizei stride, const GLvoid* pointer); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXVPROC) (GLenum target, GLenum pname, const GLfixed* params); + +#define glClipPlanef GLEW_GET_FUN(__glewClipPlanef) +#define glClipPlanex GLEW_GET_FUN(__glewClipPlanex) +#define glGetClipPlanef GLEW_GET_FUN(__glewGetClipPlanef) +#define glGetClipPlanex GLEW_GET_FUN(__glewGetClipPlanex) +#define glGetFixedv GLEW_GET_FUN(__glewGetFixedv) +#define glGetLightxv GLEW_GET_FUN(__glewGetLightxv) +#define glGetMaterialxv GLEW_GET_FUN(__glewGetMaterialxv) +#define glGetTexEnvxv GLEW_GET_FUN(__glewGetTexEnvxv) +#define glGetTexParameterxv GLEW_GET_FUN(__glewGetTexParameterxv) +#define glPointParameterx GLEW_GET_FUN(__glewPointParameterx) +#define glPointParameterxv GLEW_GET_FUN(__glewPointParameterxv) +#define glPointSizePointerOES GLEW_GET_FUN(__glewPointSizePointerOES) +#define glTexParameterxv GLEW_GET_FUN(__glewTexParameterxv) + +#define GLEW_REGAL_ES1_1_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_1_compatibility) + +#endif /* GL_REGAL_ES1_1_compatibility */ + +/* ---------------------------- GL_REGAL_enable ---------------------------- */ + +#ifndef GL_REGAL_enable +#define GL_REGAL_enable 1 + +#define GL_ERROR_REGAL 0x9322 +#define GL_DEBUG_REGAL 0x9323 +#define GL_LOG_REGAL 0x9324 +#define GL_EMULATION_REGAL 0x9325 +#define GL_DRIVER_REGAL 0x9326 +#define GL_MISSING_REGAL 0x9360 +#define GL_TRACE_REGAL 0x9361 +#define GL_CACHE_REGAL 0x9362 +#define GL_CODE_REGAL 0x9363 +#define GL_STATISTICS_REGAL 0x9364 + +#define GLEW_REGAL_enable GLEW_GET_VAR(__GLEW_REGAL_enable) + +#endif /* GL_REGAL_enable */ + +/* ------------------------- GL_REGAL_error_string ------------------------- */ + +#ifndef GL_REGAL_error_string +#define GL_REGAL_error_string 1 + +typedef const GLchar* (GLAPIENTRY * PFNGLERRORSTRINGREGALPROC) (GLenum error); + +#define glErrorStringREGAL GLEW_GET_FUN(__glewErrorStringREGAL) + +#define GLEW_REGAL_error_string GLEW_GET_VAR(__GLEW_REGAL_error_string) + +#endif /* GL_REGAL_error_string */ + +/* ------------------------ GL_REGAL_extension_query ----------------------- */ + +#ifndef GL_REGAL_extension_query +#define GL_REGAL_extension_query 1 + +typedef GLboolean (GLAPIENTRY * PFNGLGETEXTENSIONREGALPROC) (const GLchar* ext); +typedef GLboolean (GLAPIENTRY * PFNGLISSUPPORTEDREGALPROC) (const GLchar* ext); + +#define glGetExtensionREGAL GLEW_GET_FUN(__glewGetExtensionREGAL) +#define glIsSupportedREGAL GLEW_GET_FUN(__glewIsSupportedREGAL) + +#define GLEW_REGAL_extension_query GLEW_GET_VAR(__GLEW_REGAL_extension_query) + +#endif /* GL_REGAL_extension_query */ + +/* ------------------------------ GL_REGAL_log ----------------------------- */ + +#ifndef GL_REGAL_log +#define GL_REGAL_log 1 + +#define GL_LOG_ERROR_REGAL 0x9319 +#define GL_LOG_WARNING_REGAL 0x931A +#define GL_LOG_INFO_REGAL 0x931B +#define GL_LOG_APP_REGAL 0x931C +#define GL_LOG_DRIVER_REGAL 0x931D +#define GL_LOG_INTERNAL_REGAL 0x931E +#define GL_LOG_DEBUG_REGAL 0x931F +#define GL_LOG_STATUS_REGAL 0x9320 +#define GL_LOG_HTTP_REGAL 0x9321 + +typedef void (APIENTRY *GLLOGPROCREGAL)(GLenum stream, GLsizei length, const GLchar *message, GLvoid *context); + +typedef void (GLAPIENTRY * PFNGLLOGMESSAGECALLBACKREGALPROC) (GLLOGPROCREGAL callback); + +#define glLogMessageCallbackREGAL GLEW_GET_FUN(__glewLogMessageCallbackREGAL) + +#define GLEW_REGAL_log GLEW_GET_VAR(__GLEW_REGAL_log) + +#endif /* GL_REGAL_log */ + +/* ----------------------- GL_REND_screen_coordinates ---------------------- */ + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 + +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 + +#define GLEW_REND_screen_coordinates GLEW_GET_VAR(__GLEW_REND_screen_coordinates) + +#endif /* GL_REND_screen_coordinates */ + +/* ------------------------------- GL_S3_s3tc ------------------------------ */ + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 + +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#define GL_RGBA_DXT5_S3TC 0x83A4 +#define GL_RGBA4_DXT5_S3TC 0x83A5 + +#define GLEW_S3_s3tc GLEW_GET_VAR(__GLEW_S3_s3tc) + +#endif /* GL_S3_s3tc */ + +/* -------------------------- GL_SGIS_color_range -------------------------- */ + +#ifndef GL_SGIS_color_range +#define GL_SGIS_color_range 1 + +#define GL_EXTENDED_RANGE_SGIS 0x85A5 +#define GL_MIN_RED_SGIS 0x85A6 +#define GL_MAX_RED_SGIS 0x85A7 +#define GL_MIN_GREEN_SGIS 0x85A8 +#define GL_MAX_GREEN_SGIS 0x85A9 +#define GL_MIN_BLUE_SGIS 0x85AA +#define GL_MAX_BLUE_SGIS 0x85AB +#define GL_MIN_ALPHA_SGIS 0x85AC +#define GL_MAX_ALPHA_SGIS 0x85AD + +#define GLEW_SGIS_color_range GLEW_GET_VAR(__GLEW_SGIS_color_range) + +#endif /* GL_SGIS_color_range */ + +/* ------------------------- GL_SGIS_detail_texture ------------------------ */ + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 + +typedef void (GLAPIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat* points); + +#define glDetailTexFuncSGIS GLEW_GET_FUN(__glewDetailTexFuncSGIS) +#define glGetDetailTexFuncSGIS GLEW_GET_FUN(__glewGetDetailTexFuncSGIS) + +#define GLEW_SGIS_detail_texture GLEW_GET_VAR(__GLEW_SGIS_detail_texture) + +#endif /* GL_SGIS_detail_texture */ + +/* -------------------------- GL_SGIS_fog_function ------------------------- */ + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 + +typedef void (GLAPIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points); + +#define glFogFuncSGIS GLEW_GET_FUN(__glewFogFuncSGIS) +#define glGetFogFuncSGIS GLEW_GET_FUN(__glewGetFogFuncSGIS) + +#define GLEW_SGIS_fog_function GLEW_GET_VAR(__GLEW_SGIS_fog_function) + +#endif /* GL_SGIS_fog_function */ + +/* ------------------------ GL_SGIS_generate_mipmap ------------------------ */ + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 + +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 + +#define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap) + +#endif /* GL_SGIS_generate_mipmap */ + +/* -------------------------- GL_SGIS_multisample -------------------------- */ + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 + +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); + +#define glSampleMaskSGIS GLEW_GET_FUN(__glewSampleMaskSGIS) +#define glSamplePatternSGIS GLEW_GET_FUN(__glewSamplePatternSGIS) + +#define GLEW_SGIS_multisample GLEW_GET_VAR(__GLEW_SGIS_multisample) + +#endif /* GL_SGIS_multisample */ + +/* ------------------------- GL_SGIS_pixel_texture ------------------------- */ + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 + +#define GLEW_SGIS_pixel_texture GLEW_GET_VAR(__GLEW_SGIS_pixel_texture) + +#endif /* GL_SGIS_pixel_texture */ + +/* ----------------------- GL_SGIS_point_line_texgen ----------------------- */ + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 + +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 + +#define GLEW_SGIS_point_line_texgen GLEW_GET_VAR(__GLEW_SGIS_point_line_texgen) + +#endif /* GL_SGIS_point_line_texgen */ + +/* ------------------------ GL_SGIS_sharpen_texture ------------------------ */ + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 + +typedef void (GLAPIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat* points); +typedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); + +#define glGetSharpenTexFuncSGIS GLEW_GET_FUN(__glewGetSharpenTexFuncSGIS) +#define glSharpenTexFuncSGIS GLEW_GET_FUN(__glewSharpenTexFuncSGIS) + +#define GLEW_SGIS_sharpen_texture GLEW_GET_VAR(__GLEW_SGIS_sharpen_texture) + +#endif /* GL_SGIS_sharpen_texture */ + +/* --------------------------- GL_SGIS_texture4D --------------------------- */ + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const GLvoid *pixels); + +#define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS) +#define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS) + +#define GLEW_SGIS_texture4D GLEW_GET_VAR(__GLEW_SGIS_texture4D) + +#endif /* GL_SGIS_texture4D */ + +/* ---------------------- GL_SGIS_texture_border_clamp --------------------- */ + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_SGIS 0x812D + +#define GLEW_SGIS_texture_border_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_border_clamp) + +#endif /* GL_SGIS_texture_border_clamp */ + +/* ----------------------- GL_SGIS_texture_edge_clamp ---------------------- */ + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_SGIS 0x812F + +#define GLEW_SGIS_texture_edge_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_edge_clamp) + +#endif /* GL_SGIS_texture_edge_clamp */ + +/* ------------------------ GL_SGIS_texture_filter4 ------------------------ */ + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 + +typedef void (GLAPIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat* weights); +typedef void (GLAPIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights); + +#define glGetTexFilterFuncSGIS GLEW_GET_FUN(__glewGetTexFilterFuncSGIS) +#define glTexFilterFuncSGIS GLEW_GET_FUN(__glewTexFilterFuncSGIS) + +#define GLEW_SGIS_texture_filter4 GLEW_GET_VAR(__GLEW_SGIS_texture_filter4) + +#endif /* GL_SGIS_texture_filter4 */ + +/* -------------------------- GL_SGIS_texture_lod -------------------------- */ + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 + +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D + +#define GLEW_SGIS_texture_lod GLEW_GET_VAR(__GLEW_SGIS_texture_lod) + +#endif /* GL_SGIS_texture_lod */ + +/* ------------------------- GL_SGIS_texture_select ------------------------ */ + +#ifndef GL_SGIS_texture_select +#define GL_SGIS_texture_select 1 + +#define GLEW_SGIS_texture_select GLEW_GET_VAR(__GLEW_SGIS_texture_select) + +#endif /* GL_SGIS_texture_select */ + +/* ----------------------------- GL_SGIX_async ----------------------------- */ + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 + +#define GL_ASYNC_MARKER_SGIX 0x8329 + +typedef void (GLAPIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef void (GLAPIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLint (GLAPIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint* markerp); +typedef GLuint (GLAPIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef GLboolean (GLAPIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); + +#define glAsyncMarkerSGIX GLEW_GET_FUN(__glewAsyncMarkerSGIX) +#define glDeleteAsyncMarkersSGIX GLEW_GET_FUN(__glewDeleteAsyncMarkersSGIX) +#define glFinishAsyncSGIX GLEW_GET_FUN(__glewFinishAsyncSGIX) +#define glGenAsyncMarkersSGIX GLEW_GET_FUN(__glewGenAsyncMarkersSGIX) +#define glIsAsyncMarkerSGIX GLEW_GET_FUN(__glewIsAsyncMarkerSGIX) +#define glPollAsyncSGIX GLEW_GET_FUN(__glewPollAsyncSGIX) + +#define GLEW_SGIX_async GLEW_GET_VAR(__GLEW_SGIX_async) + +#endif /* GL_SGIX_async */ + +/* ------------------------ GL_SGIX_async_histogram ------------------------ */ + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 + +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D + +#define GLEW_SGIX_async_histogram GLEW_GET_VAR(__GLEW_SGIX_async_histogram) + +#endif /* GL_SGIX_async_histogram */ + +/* -------------------------- GL_SGIX_async_pixel -------------------------- */ + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 + +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 + +#define GLEW_SGIX_async_pixel GLEW_GET_VAR(__GLEW_SGIX_async_pixel) + +#endif /* GL_SGIX_async_pixel */ + +/* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */ + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 + +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 + +#define GLEW_SGIX_blend_alpha_minmax GLEW_GET_VAR(__GLEW_SGIX_blend_alpha_minmax) + +#endif /* GL_SGIX_blend_alpha_minmax */ + +/* ---------------------------- GL_SGIX_clipmap ---------------------------- */ + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 + +#define GLEW_SGIX_clipmap GLEW_GET_VAR(__GLEW_SGIX_clipmap) + +#endif /* GL_SGIX_clipmap */ + +/* ---------------------- GL_SGIX_convolution_accuracy --------------------- */ + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 + +#define GL_CONVOLUTION_HINT_SGIX 0x8316 + +#define GLEW_SGIX_convolution_accuracy GLEW_GET_VAR(__GLEW_SGIX_convolution_accuracy) + +#endif /* GL_SGIX_convolution_accuracy */ + +/* ------------------------- GL_SGIX_depth_texture ------------------------- */ + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 + +#define GLEW_SGIX_depth_texture GLEW_GET_VAR(__GLEW_SGIX_depth_texture) + +#endif /* GL_SGIX_depth_texture */ + +/* -------------------------- GL_SGIX_flush_raster ------------------------- */ + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 + +typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); + +#define glFlushRasterSGIX GLEW_GET_FUN(__glewFlushRasterSGIX) + +#define GLEW_SGIX_flush_raster GLEW_GET_VAR(__GLEW_SGIX_flush_raster) + +#endif /* GL_SGIX_flush_raster */ + +/* --------------------------- GL_SGIX_fog_offset -------------------------- */ + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 + +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 + +#define GLEW_SGIX_fog_offset GLEW_GET_VAR(__GLEW_SGIX_fog_offset) + +#endif /* GL_SGIX_fog_offset */ + +/* -------------------------- GL_SGIX_fog_texture -------------------------- */ + +#ifndef GL_SGIX_fog_texture +#define GL_SGIX_fog_texture 1 + +#define GL_TEXTURE_FOG_SGIX 0 +#define GL_FOG_PATCHY_FACTOR_SGIX 0 +#define GL_FRAGMENT_FOG_SGIX 0 + +typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname); + +#define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX) + +#define GLEW_SGIX_fog_texture GLEW_GET_VAR(__GLEW_SGIX_fog_texture) + +#endif /* GL_SGIX_fog_texture */ + +/* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */ + +#ifndef GL_SGIX_fragment_specular_lighting +#define GL_SGIX_fragment_specular_lighting 1 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, GLint* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data); + +#define glFragmentColorMaterialSGIX GLEW_GET_FUN(__glewFragmentColorMaterialSGIX) +#define glFragmentLightModelfSGIX GLEW_GET_FUN(__glewFragmentLightModelfSGIX) +#define glFragmentLightModelfvSGIX GLEW_GET_FUN(__glewFragmentLightModelfvSGIX) +#define glFragmentLightModeliSGIX GLEW_GET_FUN(__glewFragmentLightModeliSGIX) +#define glFragmentLightModelivSGIX GLEW_GET_FUN(__glewFragmentLightModelivSGIX) +#define glFragmentLightfSGIX GLEW_GET_FUN(__glewFragmentLightfSGIX) +#define glFragmentLightfvSGIX GLEW_GET_FUN(__glewFragmentLightfvSGIX) +#define glFragmentLightiSGIX GLEW_GET_FUN(__glewFragmentLightiSGIX) +#define glFragmentLightivSGIX GLEW_GET_FUN(__glewFragmentLightivSGIX) +#define glFragmentMaterialfSGIX GLEW_GET_FUN(__glewFragmentMaterialfSGIX) +#define glFragmentMaterialfvSGIX GLEW_GET_FUN(__glewFragmentMaterialfvSGIX) +#define glFragmentMaterialiSGIX GLEW_GET_FUN(__glewFragmentMaterialiSGIX) +#define glFragmentMaterialivSGIX GLEW_GET_FUN(__glewFragmentMaterialivSGIX) +#define glGetFragmentLightfvSGIX GLEW_GET_FUN(__glewGetFragmentLightfvSGIX) +#define glGetFragmentLightivSGIX GLEW_GET_FUN(__glewGetFragmentLightivSGIX) +#define glGetFragmentMaterialfvSGIX GLEW_GET_FUN(__glewGetFragmentMaterialfvSGIX) +#define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX) + +#define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting) + +#endif /* GL_SGIX_fragment_specular_lighting */ + +/* --------------------------- GL_SGIX_framezoom --------------------------- */ + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 + +typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); + +#define glFrameZoomSGIX GLEW_GET_FUN(__glewFrameZoomSGIX) + +#define GLEW_SGIX_framezoom GLEW_GET_VAR(__GLEW_SGIX_framezoom) + +#endif /* GL_SGIX_framezoom */ + +/* --------------------------- GL_SGIX_interlace --------------------------- */ + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 + +#define GL_INTERLACE_SGIX 0x8094 + +#define GLEW_SGIX_interlace GLEW_GET_VAR(__GLEW_SGIX_interlace) + +#endif /* GL_SGIX_interlace */ + +/* ------------------------- GL_SGIX_ir_instrument1 ------------------------ */ + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 + +#define GLEW_SGIX_ir_instrument1 GLEW_GET_VAR(__GLEW_SGIX_ir_instrument1) + +#endif /* GL_SGIX_ir_instrument1 */ + +/* ------------------------- GL_SGIX_list_priority ------------------------- */ + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 + +#define GLEW_SGIX_list_priority GLEW_GET_VAR(__GLEW_SGIX_list_priority) + +#endif /* GL_SGIX_list_priority */ + +/* ------------------------- GL_SGIX_pixel_texture ------------------------- */ + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 + +typedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); + +#define glPixelTexGenSGIX GLEW_GET_FUN(__glewPixelTexGenSGIX) + +#define GLEW_SGIX_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_pixel_texture) + +#endif /* GL_SGIX_pixel_texture */ + +/* ----------------------- GL_SGIX_pixel_texture_bits ---------------------- */ + +#ifndef GL_SGIX_pixel_texture_bits +#define GL_SGIX_pixel_texture_bits 1 + +#define GLEW_SGIX_pixel_texture_bits GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_bits) + +#endif /* GL_SGIX_pixel_texture_bits */ + +/* ------------------------ GL_SGIX_reference_plane ------------------------ */ + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 + +typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equation); + +#define glReferencePlaneSGIX GLEW_GET_FUN(__glewReferencePlaneSGIX) + +#define GLEW_SGIX_reference_plane GLEW_GET_VAR(__GLEW_SGIX_reference_plane) + +#endif /* GL_SGIX_reference_plane */ + +/* ---------------------------- GL_SGIX_resample --------------------------- */ + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 + +#define GL_PACK_RESAMPLE_SGIX 0x842E +#define GL_UNPACK_RESAMPLE_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 + +#define GLEW_SGIX_resample GLEW_GET_VAR(__GLEW_SGIX_resample) + +#endif /* GL_SGIX_resample */ + +/* ----------------------------- GL_SGIX_shadow ---------------------------- */ + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 + +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D + +#define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow) + +#endif /* GL_SGIX_shadow */ + +/* ------------------------- GL_SGIX_shadow_ambient ------------------------ */ + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 + +#define GL_SHADOW_AMBIENT_SGIX 0x80BF + +#define GLEW_SGIX_shadow_ambient GLEW_GET_VAR(__GLEW_SGIX_shadow_ambient) + +#endif /* GL_SGIX_shadow_ambient */ + +/* ----------------------------- GL_SGIX_sprite ---------------------------- */ + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 + +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* params); + +#define glSpriteParameterfSGIX GLEW_GET_FUN(__glewSpriteParameterfSGIX) +#define glSpriteParameterfvSGIX GLEW_GET_FUN(__glewSpriteParameterfvSGIX) +#define glSpriteParameteriSGIX GLEW_GET_FUN(__glewSpriteParameteriSGIX) +#define glSpriteParameterivSGIX GLEW_GET_FUN(__glewSpriteParameterivSGIX) + +#define GLEW_SGIX_sprite GLEW_GET_VAR(__GLEW_SGIX_sprite) + +#endif /* GL_SGIX_sprite */ + +/* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */ + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 + +typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); + +#define glTagSampleBufferSGIX GLEW_GET_FUN(__glewTagSampleBufferSGIX) + +#define GLEW_SGIX_tag_sample_buffer GLEW_GET_VAR(__GLEW_SGIX_tag_sample_buffer) + +#endif /* GL_SGIX_tag_sample_buffer */ + +/* ------------------------ GL_SGIX_texture_add_env ------------------------ */ + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 + +#define GLEW_SGIX_texture_add_env GLEW_GET_VAR(__GLEW_SGIX_texture_add_env) + +#endif /* GL_SGIX_texture_add_env */ + +/* -------------------- GL_SGIX_texture_coordinate_clamp ------------------- */ + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 + +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B + +#define GLEW_SGIX_texture_coordinate_clamp GLEW_GET_VAR(__GLEW_SGIX_texture_coordinate_clamp) + +#endif /* GL_SGIX_texture_coordinate_clamp */ + +/* ------------------------ GL_SGIX_texture_lod_bias ----------------------- */ + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 + +#define GLEW_SGIX_texture_lod_bias GLEW_GET_VAR(__GLEW_SGIX_texture_lod_bias) + +#endif /* GL_SGIX_texture_lod_bias */ + +/* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */ + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 + +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E + +#define GLEW_SGIX_texture_multi_buffer GLEW_GET_VAR(__GLEW_SGIX_texture_multi_buffer) + +#endif /* GL_SGIX_texture_multi_buffer */ + +/* ------------------------- GL_SGIX_texture_range ------------------------- */ + +#ifndef GL_SGIX_texture_range +#define GL_SGIX_texture_range 1 + +#define GL_RGB_SIGNED_SGIX 0x85E0 +#define GL_RGBA_SIGNED_SGIX 0x85E1 +#define GL_ALPHA_SIGNED_SGIX 0x85E2 +#define GL_LUMINANCE_SIGNED_SGIX 0x85E3 +#define GL_INTENSITY_SIGNED_SGIX 0x85E4 +#define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 +#define GL_RGB16_SIGNED_SGIX 0x85E6 +#define GL_RGBA16_SIGNED_SGIX 0x85E7 +#define GL_ALPHA16_SIGNED_SGIX 0x85E8 +#define GL_LUMINANCE16_SIGNED_SGIX 0x85E9 +#define GL_INTENSITY16_SIGNED_SGIX 0x85EA +#define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB +#define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC +#define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED +#define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE +#define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF +#define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 +#define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 +#define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 +#define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 +#define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 +#define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 +#define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 +#define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 +#define GL_MIN_LUMINANCE_SGIS 0x85F8 +#define GL_MAX_LUMINANCE_SGIS 0x85F9 +#define GL_MIN_INTENSITY_SGIS 0x85FA +#define GL_MAX_INTENSITY_SGIS 0x85FB + +#define GLEW_SGIX_texture_range GLEW_GET_VAR(__GLEW_SGIX_texture_range) + +#endif /* GL_SGIX_texture_range */ + +/* ----------------------- GL_SGIX_texture_scale_bias ---------------------- */ + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 + +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C + +#define GLEW_SGIX_texture_scale_bias GLEW_GET_VAR(__GLEW_SGIX_texture_scale_bias) + +#endif /* GL_SGIX_texture_scale_bias */ + +/* ------------------------- GL_SGIX_vertex_preclip ------------------------ */ + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip) + +#endif /* GL_SGIX_vertex_preclip */ + +/* ---------------------- GL_SGIX_vertex_preclip_hint ---------------------- */ + +#ifndef GL_SGIX_vertex_preclip_hint +#define GL_SGIX_vertex_preclip_hint 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip_hint GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip_hint) + +#endif /* GL_SGIX_vertex_preclip_hint */ + +/* ----------------------------- GL_SGIX_ycrcb ----------------------------- */ + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 + +#define GLEW_SGIX_ycrcb GLEW_GET_VAR(__GLEW_SGIX_ycrcb) + +#endif /* GL_SGIX_ycrcb */ + +/* -------------------------- GL_SGI_color_matrix -------------------------- */ + +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 + +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB + +#define GLEW_SGI_color_matrix GLEW_GET_VAR(__GLEW_SGI_color_matrix) + +#endif /* GL_SGI_color_matrix */ + +/* --------------------------- GL_SGI_color_table -------------------------- */ + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 + +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); + +#define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI) +#define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI) +#define glColorTableSGI GLEW_GET_FUN(__glewColorTableSGI) +#define glCopyColorTableSGI GLEW_GET_FUN(__glewCopyColorTableSGI) +#define glGetColorTableParameterfvSGI GLEW_GET_FUN(__glewGetColorTableParameterfvSGI) +#define glGetColorTableParameterivSGI GLEW_GET_FUN(__glewGetColorTableParameterivSGI) +#define glGetColorTableSGI GLEW_GET_FUN(__glewGetColorTableSGI) + +#define GLEW_SGI_color_table GLEW_GET_VAR(__GLEW_SGI_color_table) + +#endif /* GL_SGI_color_table */ + +/* ----------------------- GL_SGI_texture_color_table ---------------------- */ + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 + +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD + +#define GLEW_SGI_texture_color_table GLEW_GET_VAR(__GLEW_SGI_texture_color_table) + +#endif /* GL_SGI_texture_color_table */ + +/* ------------------------- GL_SUNX_constant_data ------------------------- */ + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 + +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 + +typedef void (GLAPIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); + +#define glFinishTextureSUNX GLEW_GET_FUN(__glewFinishTextureSUNX) + +#define GLEW_SUNX_constant_data GLEW_GET_VAR(__GLEW_SUNX_constant_data) + +#endif /* GL_SUNX_constant_data */ + +/* -------------------- GL_SUN_convolution_border_modes -------------------- */ + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 + +#define GL_WRAP_BORDER_SUN 0x81D4 + +#define GLEW_SUN_convolution_border_modes GLEW_GET_VAR(__GLEW_SUN_convolution_border_modes) + +#endif /* GL_SUN_convolution_border_modes */ + +/* -------------------------- GL_SUN_global_alpha -------------------------- */ + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 + +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA + +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); + +#define glGlobalAlphaFactorbSUN GLEW_GET_FUN(__glewGlobalAlphaFactorbSUN) +#define glGlobalAlphaFactordSUN GLEW_GET_FUN(__glewGlobalAlphaFactordSUN) +#define glGlobalAlphaFactorfSUN GLEW_GET_FUN(__glewGlobalAlphaFactorfSUN) +#define glGlobalAlphaFactoriSUN GLEW_GET_FUN(__glewGlobalAlphaFactoriSUN) +#define glGlobalAlphaFactorsSUN GLEW_GET_FUN(__glewGlobalAlphaFactorsSUN) +#define glGlobalAlphaFactorubSUN GLEW_GET_FUN(__glewGlobalAlphaFactorubSUN) +#define glGlobalAlphaFactoruiSUN GLEW_GET_FUN(__glewGlobalAlphaFactoruiSUN) +#define glGlobalAlphaFactorusSUN GLEW_GET_FUN(__glewGlobalAlphaFactorusSUN) + +#define GLEW_SUN_global_alpha GLEW_GET_VAR(__GLEW_SUN_global_alpha) + +#endif /* GL_SUN_global_alpha */ + +/* --------------------------- GL_SUN_mesh_array --------------------------- */ + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 + +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 + +#define GLEW_SUN_mesh_array GLEW_GET_VAR(__GLEW_SUN_mesh_array) + +#endif /* GL_SUN_mesh_array */ + +/* ------------------------ GL_SUN_read_video_pixels ----------------------- */ + +#ifndef GL_SUN_read_video_pixels +#define GL_SUN_read_video_pixels 1 + +typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); + +#define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN) + +#define GLEW_SUN_read_video_pixels GLEW_GET_VAR(__GLEW_SUN_read_video_pixels) + +#endif /* GL_SUN_read_video_pixels */ + +/* --------------------------- GL_SUN_slice_accum -------------------------- */ + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 + +#define GL_SLICE_ACCUM_SUN 0x85CC + +#define GLEW_SUN_slice_accum GLEW_GET_VAR(__GLEW_SUN_slice_accum) + +#endif /* GL_SUN_slice_accum */ + +/* -------------------------- GL_SUN_triangle_list ------------------------- */ + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 + +#define GL_RESTART_SUN 0x01 +#define GL_REPLACE_MIDDLE_SUN 0x02 +#define GL_REPLACE_OLDEST_SUN 0x03 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB + +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort* code); + +#define glReplacementCodePointerSUN GLEW_GET_FUN(__glewReplacementCodePointerSUN) +#define glReplacementCodeubSUN GLEW_GET_FUN(__glewReplacementCodeubSUN) +#define glReplacementCodeubvSUN GLEW_GET_FUN(__glewReplacementCodeubvSUN) +#define glReplacementCodeuiSUN GLEW_GET_FUN(__glewReplacementCodeuiSUN) +#define glReplacementCodeuivSUN GLEW_GET_FUN(__glewReplacementCodeuivSUN) +#define glReplacementCodeusSUN GLEW_GET_FUN(__glewReplacementCodeusSUN) +#define glReplacementCodeusvSUN GLEW_GET_FUN(__glewReplacementCodeusvSUN) + +#define GLEW_SUN_triangle_list GLEW_GET_VAR(__GLEW_SUN_triangle_list) + +#endif /* GL_SUN_triangle_list */ + +/* ----------------------------- GL_SUN_vertex ----------------------------- */ + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 + +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint* rc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat* tc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *v); + +#define glColor3fVertex3fSUN GLEW_GET_FUN(__glewColor3fVertex3fSUN) +#define glColor3fVertex3fvSUN GLEW_GET_FUN(__glewColor3fVertex3fvSUN) +#define glColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fSUN) +#define glColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fvSUN) +#define glColor4ubVertex2fSUN GLEW_GET_FUN(__glewColor4ubVertex2fSUN) +#define glColor4ubVertex2fvSUN GLEW_GET_FUN(__glewColor4ubVertex2fvSUN) +#define glColor4ubVertex3fSUN GLEW_GET_FUN(__glewColor4ubVertex3fSUN) +#define glColor4ubVertex3fvSUN GLEW_GET_FUN(__glewColor4ubVertex3fvSUN) +#define glNormal3fVertex3fSUN GLEW_GET_FUN(__glewNormal3fVertex3fSUN) +#define glNormal3fVertex3fvSUN GLEW_GET_FUN(__glewNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fSUN) +#define glReplacementCodeuiColor3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fvSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor4ubVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fSUN) +#define glReplacementCodeuiColor4ubVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fvSUN) +#define glReplacementCodeuiNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fSUN) +#define glReplacementCodeuiNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fvSUN) +#define glReplacementCodeuiVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fSUN) +#define glReplacementCodeuiVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fvSUN) +#define glTexCoord2fColor3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fSUN) +#define glTexCoord2fColor3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fvSUN) +#define glTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fSUN) +#define glTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glTexCoord2fColor4ubVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fSUN) +#define glTexCoord2fColor4ubVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fvSUN) +#define glTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fSUN) +#define glTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fvSUN) +#define glTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fSUN) +#define glTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fvSUN) +#define glTexCoord4fColor4fNormal3fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fSUN) +#define glTexCoord4fColor4fNormal3fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fvSUN) +#define glTexCoord4fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fSUN) +#define glTexCoord4fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fvSUN) + +#define GLEW_SUN_vertex GLEW_GET_VAR(__GLEW_SUN_vertex) + +#endif /* GL_SUN_vertex */ + +/* -------------------------- GL_WIN_phong_shading ------------------------- */ + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 + +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB + +#define GLEW_WIN_phong_shading GLEW_GET_VAR(__GLEW_WIN_phong_shading) + +#endif /* GL_WIN_phong_shading */ + +/* -------------------------- GL_WIN_specular_fog -------------------------- */ + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 + +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC + +#define GLEW_WIN_specular_fog GLEW_GET_VAR(__GLEW_WIN_specular_fog) + +#endif /* GL_WIN_specular_fog */ + +/* ---------------------------- GL_WIN_swap_hint --------------------------- */ + +#ifndef GL_WIN_swap_hint +#define GL_WIN_swap_hint 1 + +typedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); + +#define glAddSwapHintRectWIN GLEW_GET_FUN(__glewAddSwapHintRectWIN) + +#define GLEW_WIN_swap_hint GLEW_GET_VAR(__GLEW_WIN_swap_hint) + +#endif /* GL_WIN_swap_hint */ + +/* ------------------------------------------------------------------------- */ + +#if defined(GLEW_MX) && defined(_WIN32) +#define GLEW_FUN_EXPORT +#else +#define GLEW_FUN_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#if defined(GLEW_MX) +#define GLEW_VAR_EXPORT +#else +#define GLEW_VAR_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#if defined(GLEW_MX) && defined(_WIN32) +struct GLEWContextStruct +{ +#endif /* GLEW_MX */ + +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage; + +GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer; +GLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv; +GLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv; +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIPROC __glewPointParameteri; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery; +GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer; +GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries; +GLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery; +GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers; +GLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv; +GLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv; +GLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer; +GLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery; +GLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer; + +GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader; +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram; +GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader; +GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform; +GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv; +GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource; +GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram; +GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource; +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate; +GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv; +GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv; +GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv; +GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv; +GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv; +GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv; +GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv; +GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer; + +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback; +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation; +GLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFVPROC __glewClearBufferfv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERIVPROC __glewClearBufferiv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv; +GLEW_FUN_EXPORT PFNGLCOLORMASKIPROC __glewColorMaski; +GLEW_FUN_EXPORT PFNGLDISABLEIPROC __glewDisablei; +GLEW_FUN_EXPORT PFNGLENABLEIPROC __glewEnablei; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback; +GLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation; +GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv; +GLEW_FUN_EXPORT PFNGLISENABLEDIPROC __glewIsEnabledi; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIPROC __glewUniform1ui; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVPROC __glewUniform1uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIPROC __glewUniform2ui; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVPROC __glewUniform2uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIPROC __glewUniform3ui; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVPROC __glewUniform3uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIPROC __glewUniform4ui; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVPROC __glewUniform4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex; +GLEW_FUN_EXPORT PFNGLTEXBUFFERPROC __glewTexBuffer; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v; +GLEW_FUN_EXPORT PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIPROC __glewBlendEquationi; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIPROC __glewBlendFunci; +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading; + +GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD; + +GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD; +GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD; +GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD; + +GLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD; +GLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD; + +GLEW_FUN_EXPORT PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD; + +GLEW_FUN_EXPORT PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD; + +GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD; +GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE; +GLEW_FUN_EXPORT PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE; +GLEW_FUN_EXPORT PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE; +GLEW_FUN_EXPORT PFNGLISQUERYANGLEPROC __glewIsQueryANGLE; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE; + +GLEW_FUN_EXPORT PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE; +GLEW_FUN_EXPORT PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE; +GLEW_FUN_EXPORT PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE; +GLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE; + +GLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE; + +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE; +GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef; +GLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat; +GLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler; +GLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed; +GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEPROC __glewBufferStorage; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB; + +GLEW_FUN_EXPORT PFNGLCLEARBUFFERDATAPROC __glewClearBufferData; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT; + +GLEW_FUN_EXPORT PFNGLCLEARTEXIMAGEPROC __glewClearTexImage; +GLEW_FUN_EXPORT PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage; + +GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB; + +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute; +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect; + +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB; + +GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer; +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMBINARYPROC __glewProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv; +GLEW_FUN_EXPORT PFNGLUNIFORM1DPROC __glewUniform1d; +GLEW_FUN_EXPORT PFNGLUNIFORM1DVPROC __glewUniform1dv; +GLEW_FUN_EXPORT PFNGLUNIFORM2DPROC __glewUniform2d; +GLEW_FUN_EXPORT PFNGLUNIFORM2DVPROC __glewUniform2dv; +GLEW_FUN_EXPORT PFNGLUNIFORM3DPROC __glewUniform3d; +GLEW_FUN_EXPORT PFNGLUNIFORM3DVPROC __glewUniform3dv; +GLEW_FUN_EXPORT PFNGLUNIFORM4DPROC __glewUniform4d; +GLEW_FUN_EXPORT PFNGLUNIFORM4DVPROC __glewUniform4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPROC __glewGetColorTable; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPROC __glewGetHistogram; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPROC __glewGetMinmax; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter; +GLEW_FUN_EXPORT PFNGLHISTOGRAMPROC __glewHistogram; +GLEW_FUN_EXPORT PFNGLMINMAXPROC __glewMinmax; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram; +GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v; + +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData; +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData; +GLEW_FUN_EXPORT PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage; + +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange; +GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange; + +GLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange; +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures; +GLEW_FUN_EXPORT PFNGLBINDSAMPLERSPROC __glewBindSamplers; +GLEW_FUN_EXPORT PFNGLBINDTEXTURESPROC __glewBindTextures; +GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB; +GLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB; +GLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB; +GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex; + +GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB; +GLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB; +GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB; +GLEW_FUN_EXPORT PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB; +GLEW_FUN_EXPORT PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPIVARBPROC __glewGetnMapivARB; +GLEW_FUN_EXPORT PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB; +GLEW_FUN_EXPORT PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB; +GLEW_FUN_EXPORT PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB; +GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB; +GLEW_FUN_EXPORT PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB; + +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB; + +GLEW_FUN_EXPORT PFNGLBINDSAMPLERPROC __glewBindSampler; +GLEW_FUN_EXPORT PFNGLDELETESAMPLERSPROC __glewDeleteSamplers; +GLEW_FUN_EXPORT PFNGLGENSAMPLERSPROC __glewGenSamplers; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv; +GLEW_FUN_EXPORT PFNGLISSAMPLERPROC __glewIsSampler; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv; + +GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines; +GLEW_FUN_EXPORT PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline; + +GLEW_FUN_EXPORT PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier; + +GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB; +GLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB; +GLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB; +GLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB; +GLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB; +GLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB; +GLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB; + +GLEW_FUN_EXPORT PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding; + +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv; +GLEW_FUN_EXPORT PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv; + +GLEW_FUN_EXPORT PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB; +GLEW_FUN_EXPORT PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB; +GLEW_FUN_EXPORT PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB; +GLEW_FUN_EXPORT PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB; + +GLEW_FUN_EXPORT PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB; +GLEW_FUN_EXPORT PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT; + +GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync; +GLEW_FUN_EXPORT PFNGLDELETESYNCPROC __glewDeleteSync; +GLEW_FUN_EXPORT PFNGLFENCESYNCPROC __glewFenceSync; +GLEW_FUN_EXPORT PFNGLGETINTEGER64VPROC __glewGetInteger64v; +GLEW_FUN_EXPORT PFNGLGETSYNCIVPROC __glewGetSynciv; +GLEW_FUN_EXPORT PFNGLISSYNCPROC __glewIsSync; +GLEW_FUN_EXPORT PFNGLWAITSYNCPROC __glewWaitSync; + +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv; +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERIPROC __glewPatchParameteri; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT; + +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski; +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DPROC __glewTexStorage1D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLTEXTUREVIEWPROC __glewTextureView; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream; +GLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed; +GLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv; + +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced; + +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv; +GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v; +GLEW_FUN_EXPORT PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex; +GLEW_FUN_EXPORT PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices; +GLEW_FUN_EXPORT PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat; +GLEW_FUN_EXPORT PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor; + +GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB; +GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB; +GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTDVARBPROC __glewWeightdvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTFVARBPROC __glewWeightfvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTIVARBPROC __glewWeightivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTSVARBPROC __glewWeightsvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUBVARBPROC __glewWeightubvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUIVARBPROC __glewWeightuivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUSVARBPROC __glewWeightusvARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB; +GLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB; +GLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB; +GLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB; + +GLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB; +GLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB; + +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB; + +GLEW_FUN_EXPORT PFNGLCOLORP3UIPROC __glewColorP3ui; +GLEW_FUN_EXPORT PFNGLCOLORP3UIVPROC __glewColorP3uiv; +GLEW_FUN_EXPORT PFNGLCOLORP4UIPROC __glewColorP4ui; +GLEW_FUN_EXPORT PFNGLCOLORP4UIVPROC __glewColorP4uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLNORMALP3UIPROC __glewNormalP3ui; +GLEW_FUN_EXPORT PFNGLNORMALP3UIVPROC __glewNormalP3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIPROC __glewVertexP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIVPROC __glewVertexP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIPROC __glewVertexP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIVPROC __glewVertexP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIPROC __glewVertexP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIVPROC __glewVertexP4uiv; + +GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VPROC __glewGetFloati_v; +GLEW_FUN_EXPORT PFNGLSCISSORARRAYVPROC __glewScissorArrayv; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDPROC __glewScissorIndexed; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv; +GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI; + +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI; + +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI; +GLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI; +GLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI; +GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI; + +GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI; + +GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI; +GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI; + +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI; + +GLEW_FUN_EXPORT PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI; +GLEW_FUN_EXPORT PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI; +GLEW_FUN_EXPORT PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI; +GLEW_FUN_EXPORT PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT; +GLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT; + +GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT; + +GLEW_FUN_EXPORT PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT; +GLEW_FUN_EXPORT PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT; + +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT; + +GLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT; + +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT; +GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT; +GLEW_FUN_EXPORT PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT; +GLEW_FUN_EXPORT PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT; + +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT; + +GLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT; +GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT; +GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT; +GLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT; + +GLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT; +GLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT; + +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT; + +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT; + +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT; +GLEW_FUN_EXPORT PFNGLHISTOGRAMEXTPROC __glewHistogramEXT; +GLEW_FUN_EXPORT PFNGLMINMAXEXTPROC __glewMinmaxEXT; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT; +GLEW_FUN_EXPORT PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT; + +GLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT; + +GLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT; + +GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT; +GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT; + +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT; + +GLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT; +GLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT; + +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT; + +GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT; +GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT; + +GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT; + +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT; + +GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT; + +GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT; +GLEW_FUN_EXPORT PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT; + +GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT; +GLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT; +GLEW_FUN_EXPORT PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT; +GLEW_FUN_EXPORT PFNGLISTEXTUREEXTPROC __glewIsTextureEXT; +GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT; + +GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT; + +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT; + +GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT; +GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT; +GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT; +GLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT; +GLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT; + +GLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT; +GLEW_FUN_EXPORT PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT; +GLEW_FUN_EXPORT PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT; +GLEW_FUN_EXPORT PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT; +GLEW_FUN_EXPORT PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT; +GLEW_FUN_EXPORT PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT; +GLEW_FUN_EXPORT PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT; +GLEW_FUN_EXPORT PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT; +GLEW_FUN_EXPORT PFNGLSWIZZLEEXTPROC __glewSwizzleEXT; +GLEW_FUN_EXPORT PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT; +GLEW_FUN_EXPORT PFNGLVARIANTBVEXTPROC __glewVariantbvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTDVEXTPROC __glewVariantdvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTFVEXTPROC __glewVariantfvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTIVEXTPROC __glewVariantivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTSVEXTPROC __glewVariantsvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT; +GLEW_FUN_EXPORT PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT; + +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT; + +GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY; + +GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY; + +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP; + +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM; +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM; + +GLEW_FUN_EXPORT PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL; +GLEW_FUN_EXPORT PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL; +GLEW_FUN_EXPORT PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL; + +GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL; +GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog; +GLEW_FUN_EXPORT PFNGLGETOBJECTLABELPROC __glewGetObjectLabel; +GLEW_FUN_EXPORT PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLOBJECTLABELPROC __glewObjectLabel; +GLEW_FUN_EXPORT PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup; +GLEW_FUN_EXPORT PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup; + +GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion; +GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion; +GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion; + +GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV; + +GLEW_FUN_EXPORT PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV; +GLEW_FUN_EXPORT PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV; +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV; + +GLEW_FUN_EXPORT PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV; + +GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV; +GLEW_FUN_EXPORT PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV; +GLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV; +GLEW_FUN_EXPORT PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV; +GLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV; +GLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV; +GLEW_FUN_EXPORT PFNGLGETFENCEIVNVPROC __glewGetFenceivNV; +GLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV; +GLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV; +GLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV; + +GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV; +GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HVNVPROC __glewColor4hvNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHNVPROC __glewFogCoordhNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HNVPROC __glewNormal3hNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HVNVPROC __glewNormal3hvNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HNVPROC __glewVertex2hNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HVNVPROC __glewVertex2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HNVPROC __glewVertex3hNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HVNVPROC __glewVertex3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HNVPROC __glewVertex4hNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HVNVPROC __glewVertex4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV; + +GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV; +GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV; + +GLEW_FUN_EXPORT PFNGLCOPYPATHNVPROC __glewCopyPathNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV; +GLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV; +GLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV; +GLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV; +GLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV; +GLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV; +GLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV; +GLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV; +GLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV; +GLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV; +GLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV; +GLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV; +GLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV; + +GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV; +GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV; + +GLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV; + +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV; +GLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV; +GLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV; + +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV; +GLEW_FUN_EXPORT PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64NVPROC __glewUniformui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV; + +GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV; + +GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV; +GLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV; + +GLEW_FUN_EXPORT PFNGLVDPAUFININVPROC __glewVDPAUFiniNV; +GLEW_FUN_EXPORT PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV; +GLEW_FUN_EXPORT PFNGLVDPAUINITNVPROC __glewVDPAUInitNV; +GLEW_FUN_EXPORT PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV; + +GLEW_FUN_EXPORT PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV; +GLEW_FUN_EXPORT PFNGLCOLORFORMATNVPROC __glewColorFormatNV; +GLEW_FUN_EXPORT PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV; +GLEW_FUN_EXPORT PFNGLINDEXFORMATNVPROC __glewIndexFormatNV; +GLEW_FUN_EXPORT PFNGLNORMALFORMATNVPROC __glewNormalFormatNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV; +GLEW_FUN_EXPORT PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV; + +GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV; +GLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV; +GLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV; +GLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV; +GLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV; +GLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV; +GLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV; + +GLEW_FUN_EXPORT PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV; +GLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES; +GLEW_FUN_EXPORT PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES; +GLEW_FUN_EXPORT PFNGLFRUSTUMFOESPROC __glewFrustumfOES; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES; +GLEW_FUN_EXPORT PFNGLORTHOFOESPROC __glewOrthofOES; + +GLEW_FUN_EXPORT PFNGLALPHAFUNCXPROC __glewAlphaFuncx; +GLEW_FUN_EXPORT PFNGLCLEARCOLORXPROC __glewClearColorx; +GLEW_FUN_EXPORT PFNGLCLEARDEPTHXPROC __glewClearDepthx; +GLEW_FUN_EXPORT PFNGLCOLOR4XPROC __glewColor4x; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEXPROC __glewDepthRangex; +GLEW_FUN_EXPORT PFNGLFOGXPROC __glewFogx; +GLEW_FUN_EXPORT PFNGLFOGXVPROC __glewFogxv; +GLEW_FUN_EXPORT PFNGLFRUSTUMFPROC __glewFrustumf; +GLEW_FUN_EXPORT PFNGLFRUSTUMXPROC __glewFrustumx; +GLEW_FUN_EXPORT PFNGLLIGHTMODELXPROC __glewLightModelx; +GLEW_FUN_EXPORT PFNGLLIGHTMODELXVPROC __glewLightModelxv; +GLEW_FUN_EXPORT PFNGLLIGHTXPROC __glewLightx; +GLEW_FUN_EXPORT PFNGLLIGHTXVPROC __glewLightxv; +GLEW_FUN_EXPORT PFNGLLINEWIDTHXPROC __glewLineWidthx; +GLEW_FUN_EXPORT PFNGLLOADMATRIXXPROC __glewLoadMatrixx; +GLEW_FUN_EXPORT PFNGLMATERIALXPROC __glewMaterialx; +GLEW_FUN_EXPORT PFNGLMATERIALXVPROC __glewMaterialxv; +GLEW_FUN_EXPORT PFNGLMULTMATRIXXPROC __glewMultMatrixx; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x; +GLEW_FUN_EXPORT PFNGLNORMAL3XPROC __glewNormal3x; +GLEW_FUN_EXPORT PFNGLORTHOFPROC __glewOrthof; +GLEW_FUN_EXPORT PFNGLORTHOXPROC __glewOrthox; +GLEW_FUN_EXPORT PFNGLPOINTSIZEXPROC __glewPointSizex; +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx; +GLEW_FUN_EXPORT PFNGLROTATEXPROC __glewRotatex; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex; +GLEW_FUN_EXPORT PFNGLSCALEXPROC __glewScalex; +GLEW_FUN_EXPORT PFNGLTEXENVXPROC __glewTexEnvx; +GLEW_FUN_EXPORT PFNGLTEXENVXVPROC __glewTexEnvxv; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERXPROC __glewTexParameterx; +GLEW_FUN_EXPORT PFNGLTRANSLATEXPROC __glewTranslatex; + +GLEW_FUN_EXPORT PFNGLCLIPPLANEFPROC __glewClipPlanef; +GLEW_FUN_EXPORT PFNGLCLIPPLANEXPROC __glewClipPlanex; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex; +GLEW_FUN_EXPORT PFNGLGETFIXEDVPROC __glewGetFixedv; +GLEW_FUN_EXPORT PFNGLGETLIGHTXVPROC __glewGetLightxv; +GLEW_FUN_EXPORT PFNGLGETMATERIALXVPROC __glewGetMaterialxv; +GLEW_FUN_EXPORT PFNGLGETTEXENVXVPROC __glewGetTexEnvxv; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXPROC __glewPointParameterx; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv; +GLEW_FUN_EXPORT PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERXVPROC __glewTexParameterxv; + +GLEW_FUN_EXPORT PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL; + +GLEW_FUN_EXPORT PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL; +GLEW_FUN_EXPORT PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL; + +GLEW_FUN_EXPORT PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL; + +GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS; + +GLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS; + +GLEW_FUN_EXPORT PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS; +GLEW_FUN_EXPORT PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS; + +GLEW_FUN_EXPORT PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX; +GLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX; + +GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX; + +GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX; + +GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX; + +GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX; + +GLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX; + +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX; + +GLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI; + +GLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX; + +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN; + +GLEW_FUN_EXPORT PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN; + +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN; + +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN; + +GLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN; + +#if defined(GLEW_MX) && !defined(_WIN32) +struct GLEWContextStruct +{ +#endif /* GLEW_MX */ + +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_4; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_blend_minmax_factor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_interleaved_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_pinned_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_trinary_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_stencil_operation_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_layer; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_viewport_index; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_pack_reverse_row_order; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt3; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt5; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_usage; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_translated_shader_source; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_object_purgeable; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_rgb_422; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_row_bytes; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_arrays_of_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_buffer_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_variable_group_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_elements_base_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_enhanced_layouts; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_uniform_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_layer_viewport; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_no_attachments; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_indirect_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_invalidate_subdata; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_bind; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_program_interface_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robust_buffer_access_behavior; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_application_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_share_group_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_draw_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_group_vote; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_stencil_texturing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object_rgb32; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_bptc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_levels; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_stencil8; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_view; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_binding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_10f_11f_11f_rev; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_viewport_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_vertex_shader_output_point_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_meminfo; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_decode; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_snorm; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_occlusion_test; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_texture_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_multimode_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_rasterpos_clip; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_static_data; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_map_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_debug; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_ldr; +GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region; +GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced_coherent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_compute_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_deep_texture3D; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5_mem_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_tessellation_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vdpau_interop; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_attrib_integer_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_buffer_unified_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_video_capture; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_compressed_paletted_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_read_format; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_single_precision; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_0_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_1_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_enable; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_error_string; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_extension_query; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_log; +GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_filter4; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_global_alpha; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_mesh_array; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_read_video_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint; + +#ifdef GLEW_MX +}; /* GLEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + +/* error codes */ +#define GLEW_OK 0 +#define GLEW_NO_ERROR 0 +#define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ +#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ +#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ + +/* string codes */ +#define GLEW_VERSION 1 +#define GLEW_VERSION_MAJOR 2 +#define GLEW_VERSION_MINOR 3 +#define GLEW_VERSION_MICRO 4 + +/* API */ +#ifdef GLEW_MX + +typedef struct GLEWContextStruct GLEWContext; +GLEWAPI GLenum GLEWAPIENTRY glewContextInit (GLEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext *ctx, const char *name); + +#define glewInit() glewContextInit(glewGetContext()) +#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x) +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#define GLEW_GET_VAR(x) (*(const GLboolean*)&(glewGetContext()->x)) +#ifdef _WIN32 +# define GLEW_GET_FUN(x) glewGetContext()->x +#else +# define GLEW_GET_FUN(x) x +#endif + +#else /* GLEW_MX */ + +GLEWAPI GLenum GLEWAPIENTRY glewInit (void); +GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name); +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#define GLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define GLEW_GET_FUN(x) x + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean glewExperimental; +GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name); + +#ifdef __cplusplus +} +#endif + +#ifdef GLEW_APIENTRY_DEFINED +#undef GLEW_APIENTRY_DEFINED +#undef APIENTRY +#undef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifdef GLEW_CALLBACK_DEFINED +#undef GLEW_CALLBACK_DEFINED +#undef CALLBACK +#endif + +#ifdef GLEW_WINGDIAPI_DEFINED +#undef GLEW_WINGDIAPI_DEFINED +#undef WINGDIAPI +#endif + +#undef GLAPI +/* #undef GLEWAPI */ + +#endif /* __glew_h__ */ diff --git a/external/steamworks/steamworksexample/GL/glxew.h b/external/steamworks/steamworksexample/GL/glxew.h new file mode 100644 index 0000000..015cc32 --- /dev/null +++ b/external/steamworks/steamworksexample/GL/glxew.h @@ -0,0 +1,1669 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __glxew_h__ +#define __glxew_h__ +#define __GLXEW_H__ + +#ifdef __glxext_h_ +#error glxext.h included before glxew.h +#endif + +#if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__) +#error glx.h included before glxew.h +#endif + +#define __glxext_h_ + +#define GLX_H +#define __GLX_glx_h__ +#define __glx_h__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ---------------------------- GLX_VERSION_1_0 --------------------------- */ + +#ifndef GLX_VERSION_1_0 +#define GLX_VERSION_1_0 1 + +#define GLX_USE_GL 1 +#define GLX_BUFFER_SIZE 2 +#define GLX_LEVEL 3 +#define GLX_RGBA 4 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 +#define GLX_BAD_SCREEN 1 +#define GLX_BAD_ATTRIBUTE 2 +#define GLX_NO_EXTENSION 3 +#define GLX_BAD_VISUAL 4 +#define GLX_BAD_CONTEXT 5 +#define GLX_BAD_VALUE 6 +#define GLX_BAD_ENUM 7 + +typedef XID GLXDrawable; +typedef XID GLXPixmap; +#ifdef __sun +typedef struct __glXContextRec *GLXContext; +#else +typedef struct __GLXcontextRec *GLXContext; +#endif + +typedef unsigned int GLXVideoDeviceNV; + +extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase); +extern Bool glXQueryVersion (Display *dpy, int *major, int *minor); +extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value); +extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList); +extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap); +extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix); +extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); +extern void glXDestroyContext (Display *dpy, GLXContext ctx); +extern Bool glXIsDirect (Display *dpy, GLXContext ctx); +extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask); +extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx); +extern GLXContext glXGetCurrentContext (void); +extern GLXDrawable glXGetCurrentDrawable (void); +extern void glXWaitGL (void); +extern void glXWaitX (void); +extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable); +extern void glXUseXFont (Font font, int first, int count, int listBase); + +#define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0) + +#endif /* GLX_VERSION_1_0 */ + +/* ---------------------------- GLX_VERSION_1_1 --------------------------- */ + +#ifndef GLX_VERSION_1_1 +#define GLX_VERSION_1_1 + +#define GLX_VENDOR 0x1 +#define GLX_VERSION 0x2 +#define GLX_EXTENSIONS 0x3 + +extern const char* glXQueryExtensionsString (Display *dpy, int screen); +extern const char* glXGetClientString (Display *dpy, int name); +extern const char* glXQueryServerString (Display *dpy, int screen, int name); + +#define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1) + +#endif /* GLX_VERSION_1_1 */ + +/* ---------------------------- GLX_VERSION_1_2 ---------------------------- */ + +#ifndef GLX_VERSION_1_2 +#define GLX_VERSION_1_2 1 + +typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void); + +#define glXGetCurrentDisplay GLXEW_GET_FUN(__glewXGetCurrentDisplay) + +#define GLXEW_VERSION_1_2 GLXEW_GET_VAR(__GLXEW_VERSION_1_2) + +#endif /* GLX_VERSION_1_2 */ + +/* ---------------------------- GLX_VERSION_1_3 ---------------------------- */ + +#ifndef GLX_VERSION_1_3 +#define GLX_VERSION_1_3 1 + +#define GLX_RGBA_BIT 0x00000001 +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 +#define GLX_DONT_CARE 0xFFFFFFFF + +typedef XID GLXFBConfigID; +typedef XID GLXPbuffer; +typedef XID GLXWindow; +typedef struct __GLXFBConfigRec *GLXFBConfig; + +typedef struct { + int event_type; + int draw_type; + unsigned long serial; + Bool send_event; + Display *display; + GLXDrawable drawable; + unsigned int buffer_mask; + unsigned int aux_buffer; + int x, y; + int width, height; + int count; +} GLXPbufferClobberEvent; +typedef union __GLXEvent { + GLXPbufferClobberEvent glxpbufferclobber; + long pad[24]; +} GLXEvent; + +typedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); +typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); +typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); +typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void); +typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); +typedef GLXFBConfig* ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); +typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); +typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); +typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); +typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); + +#define glXChooseFBConfig GLXEW_GET_FUN(__glewXChooseFBConfig) +#define glXCreateNewContext GLXEW_GET_FUN(__glewXCreateNewContext) +#define glXCreatePbuffer GLXEW_GET_FUN(__glewXCreatePbuffer) +#define glXCreatePixmap GLXEW_GET_FUN(__glewXCreatePixmap) +#define glXCreateWindow GLXEW_GET_FUN(__glewXCreateWindow) +#define glXDestroyPbuffer GLXEW_GET_FUN(__glewXDestroyPbuffer) +#define glXDestroyPixmap GLXEW_GET_FUN(__glewXDestroyPixmap) +#define glXDestroyWindow GLXEW_GET_FUN(__glewXDestroyWindow) +#define glXGetCurrentReadDrawable GLXEW_GET_FUN(__glewXGetCurrentReadDrawable) +#define glXGetFBConfigAttrib GLXEW_GET_FUN(__glewXGetFBConfigAttrib) +#define glXGetFBConfigs GLXEW_GET_FUN(__glewXGetFBConfigs) +#define glXGetSelectedEvent GLXEW_GET_FUN(__glewXGetSelectedEvent) +#define glXGetVisualFromFBConfig GLXEW_GET_FUN(__glewXGetVisualFromFBConfig) +#define glXMakeContextCurrent GLXEW_GET_FUN(__glewXMakeContextCurrent) +#define glXQueryContext GLXEW_GET_FUN(__glewXQueryContext) +#define glXQueryDrawable GLXEW_GET_FUN(__glewXQueryDrawable) +#define glXSelectEvent GLXEW_GET_FUN(__glewXSelectEvent) + +#define GLXEW_VERSION_1_3 GLXEW_GET_VAR(__GLXEW_VERSION_1_3) + +#endif /* GLX_VERSION_1_3 */ + +/* ---------------------------- GLX_VERSION_1_4 ---------------------------- */ + +#ifndef GLX_VERSION_1_4 +#define GLX_VERSION_1_4 1 + +#define GLX_SAMPLE_BUFFERS 100000 +#define GLX_SAMPLES 100001 + +extern void ( * glXGetProcAddress (const GLubyte *procName)) (void); + +#define GLXEW_VERSION_1_4 GLXEW_GET_VAR(__GLXEW_VERSION_1_4) + +#endif /* GLX_VERSION_1_4 */ + +/* -------------------------- GLX_3DFX_multisample ------------------------- */ + +#ifndef GLX_3DFX_multisample +#define GLX_3DFX_multisample 1 + +#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 +#define GLX_SAMPLES_3DFX 0x8051 + +#define GLXEW_3DFX_multisample GLXEW_GET_VAR(__GLXEW_3DFX_multisample) + +#endif /* GLX_3DFX_multisample */ + +/* ------------------------ GLX_AMD_gpu_association ------------------------ */ + +#ifndef GLX_AMD_gpu_association +#define GLX_AMD_gpu_association 1 + +#define GLX_GPU_VENDOR_AMD 0x1F00 +#define GLX_GPU_RENDERER_STRING_AMD 0x1F01 +#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define GLX_GPU_RAM_AMD 0x21A3 +#define GLX_GPU_CLOCK_AMD 0x21A4 +#define GLX_GPU_NUM_PIPES_AMD 0x21A5 +#define GLX_GPU_NUM_SIMD_AMD 0x21A6 +#define GLX_GPU_NUM_RB_AMD 0x21A7 +#define GLX_GPU_NUM_SPI_AMD 0x21A8 + +typedef void ( * PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC) (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC) (unsigned int id, GLXContext share_list); +typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (unsigned int id, GLXContext share_context, const int* attribList); +typedef Bool ( * PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC) (GLXContext ctx); +typedef unsigned int ( * PFNGLXGETCONTEXTGPUIDAMDPROC) (GLXContext ctx); +typedef GLXContext ( * PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef unsigned int ( * PFNGLXGETGPUIDSAMDPROC) (unsigned int maxCount, unsigned int* ids); +typedef int ( * PFNGLXGETGPUINFOAMDPROC) (unsigned int id, int property, GLenum dataType, unsigned int size, void* data); +typedef Bool ( * PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (GLXContext ctx); + +#define glXBlitContextFramebufferAMD GLXEW_GET_FUN(__glewXBlitContextFramebufferAMD) +#define glXCreateAssociatedContextAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAMD) +#define glXCreateAssociatedContextAttribsAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAttribsAMD) +#define glXDeleteAssociatedContextAMD GLXEW_GET_FUN(__glewXDeleteAssociatedContextAMD) +#define glXGetContextGPUIDAMD GLXEW_GET_FUN(__glewXGetContextGPUIDAMD) +#define glXGetCurrentAssociatedContextAMD GLXEW_GET_FUN(__glewXGetCurrentAssociatedContextAMD) +#define glXGetGPUIDsAMD GLXEW_GET_FUN(__glewXGetGPUIDsAMD) +#define glXGetGPUInfoAMD GLXEW_GET_FUN(__glewXGetGPUInfoAMD) +#define glXMakeAssociatedContextCurrentAMD GLXEW_GET_FUN(__glewXMakeAssociatedContextCurrentAMD) + +#define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association) + +#endif /* GLX_AMD_gpu_association */ + +/* ------------------------- GLX_ARB_create_context ------------------------ */ + +#ifndef GLX_ARB_create_context +#define GLX_ARB_create_context 1 + +#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define GLX_CONTEXT_FLAGS_ARB 0x2094 + +typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); + +#define glXCreateContextAttribsARB GLXEW_GET_FUN(__glewXCreateContextAttribsARB) + +#define GLXEW_ARB_create_context GLXEW_GET_VAR(__GLXEW_ARB_create_context) + +#endif /* GLX_ARB_create_context */ + +/* --------------------- GLX_ARB_create_context_profile -------------------- */ + +#ifndef GLX_ARB_create_context_profile +#define GLX_ARB_create_context_profile 1 + +#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 + +#define GLXEW_ARB_create_context_profile GLXEW_GET_VAR(__GLXEW_ARB_create_context_profile) + +#endif /* GLX_ARB_create_context_profile */ + +/* ------------------- GLX_ARB_create_context_robustness ------------------- */ + +#ifndef GLX_ARB_create_context_robustness +#define GLX_ARB_create_context_robustness 1 + +#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 + +#define GLXEW_ARB_create_context_robustness GLXEW_GET_VAR(__GLXEW_ARB_create_context_robustness) + +#endif /* GLX_ARB_create_context_robustness */ + +/* ------------------------- GLX_ARB_fbconfig_float ------------------------ */ + +#ifndef GLX_ARB_fbconfig_float +#define GLX_ARB_fbconfig_float 1 + +#define GLX_RGBA_FLOAT_BIT 0x00000004 +#define GLX_RGBA_FLOAT_TYPE 0x20B9 + +#define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float) + +#endif /* GLX_ARB_fbconfig_float */ + +/* ------------------------ GLX_ARB_framebuffer_sRGB ----------------------- */ + +#ifndef GLX_ARB_framebuffer_sRGB +#define GLX_ARB_framebuffer_sRGB 1 + +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2 + +#define GLXEW_ARB_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_ARB_framebuffer_sRGB) + +#endif /* GLX_ARB_framebuffer_sRGB */ + +/* ------------------------ GLX_ARB_get_proc_address ----------------------- */ + +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 + +extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); + +#define GLXEW_ARB_get_proc_address GLXEW_GET_VAR(__GLXEW_ARB_get_proc_address) + +#endif /* GLX_ARB_get_proc_address */ + +/* -------------------------- GLX_ARB_multisample -------------------------- */ + +#ifndef GLX_ARB_multisample +#define GLX_ARB_multisample 1 + +#define GLX_SAMPLE_BUFFERS_ARB 100000 +#define GLX_SAMPLES_ARB 100001 + +#define GLXEW_ARB_multisample GLXEW_GET_VAR(__GLXEW_ARB_multisample) + +#endif /* GLX_ARB_multisample */ + +/* ---------------- GLX_ARB_robustness_application_isolation --------------- */ + +#ifndef GLX_ARB_robustness_application_isolation +#define GLX_ARB_robustness_application_isolation 1 + +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define GLXEW_ARB_robustness_application_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_application_isolation) + +#endif /* GLX_ARB_robustness_application_isolation */ + +/* ---------------- GLX_ARB_robustness_share_group_isolation --------------- */ + +#ifndef GLX_ARB_robustness_share_group_isolation +#define GLX_ARB_robustness_share_group_isolation 1 + +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define GLXEW_ARB_robustness_share_group_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_share_group_isolation) + +#endif /* GLX_ARB_robustness_share_group_isolation */ + +/* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */ + +#ifndef GLX_ARB_vertex_buffer_object +#define GLX_ARB_vertex_buffer_object 1 + +#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095 + +#define GLXEW_ARB_vertex_buffer_object GLXEW_GET_VAR(__GLXEW_ARB_vertex_buffer_object) + +#endif /* GLX_ARB_vertex_buffer_object */ + +/* ----------------------- GLX_ATI_pixel_format_float ---------------------- */ + +#ifndef GLX_ATI_pixel_format_float +#define GLX_ATI_pixel_format_float 1 + +#define GLX_RGBA_FLOAT_ATI_BIT 0x00000100 + +#define GLXEW_ATI_pixel_format_float GLXEW_GET_VAR(__GLXEW_ATI_pixel_format_float) + +#endif /* GLX_ATI_pixel_format_float */ + +/* ------------------------- GLX_ATI_render_texture ------------------------ */ + +#ifndef GLX_ATI_render_texture +#define GLX_ATI_render_texture 1 + +#define GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 +#define GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 +#define GLX_TEXTURE_FORMAT_ATI 0x9802 +#define GLX_TEXTURE_TARGET_ATI 0x9803 +#define GLX_MIPMAP_TEXTURE_ATI 0x9804 +#define GLX_TEXTURE_RGB_ATI 0x9805 +#define GLX_TEXTURE_RGBA_ATI 0x9806 +#define GLX_NO_TEXTURE_ATI 0x9807 +#define GLX_TEXTURE_CUBE_MAP_ATI 0x9808 +#define GLX_TEXTURE_1D_ATI 0x9809 +#define GLX_TEXTURE_2D_ATI 0x980A +#define GLX_MIPMAP_LEVEL_ATI 0x980B +#define GLX_CUBE_MAP_FACE_ATI 0x980C +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810 +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811 +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812 +#define GLX_FRONT_LEFT_ATI 0x9813 +#define GLX_FRONT_RIGHT_ATI 0x9814 +#define GLX_BACK_LEFT_ATI 0x9815 +#define GLX_BACK_RIGHT_ATI 0x9816 +#define GLX_AUX0_ATI 0x9817 +#define GLX_AUX1_ATI 0x9818 +#define GLX_AUX2_ATI 0x9819 +#define GLX_AUX3_ATI 0x981A +#define GLX_AUX4_ATI 0x981B +#define GLX_AUX5_ATI 0x981C +#define GLX_AUX6_ATI 0x981D +#define GLX_AUX7_ATI 0x981E +#define GLX_AUX8_ATI 0x981F +#define GLX_AUX9_ATI 0x9820 +#define GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821 +#define GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822 + +typedef void ( * PFNGLXBINDTEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); +typedef void ( * PFNGLXDRAWABLEATTRIBATIPROC) (Display *dpy, GLXDrawable draw, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); + +#define glXBindTexImageATI GLXEW_GET_FUN(__glewXBindTexImageATI) +#define glXDrawableAttribATI GLXEW_GET_FUN(__glewXDrawableAttribATI) +#define glXReleaseTexImageATI GLXEW_GET_FUN(__glewXReleaseTexImageATI) + +#define GLXEW_ATI_render_texture GLXEW_GET_VAR(__GLXEW_ATI_render_texture) + +#endif /* GLX_ATI_render_texture */ + +/* --------------------------- GLX_EXT_buffer_age -------------------------- */ + +#ifndef GLX_EXT_buffer_age +#define GLX_EXT_buffer_age 1 + +#define GLX_BACK_BUFFER_AGE_EXT 0x20F4 + +#define GLXEW_EXT_buffer_age GLXEW_GET_VAR(__GLXEW_EXT_buffer_age) + +#endif /* GLX_EXT_buffer_age */ + +/* ------------------- GLX_EXT_create_context_es2_profile ------------------ */ + +#ifndef GLX_EXT_create_context_es2_profile +#define GLX_EXT_create_context_es2_profile 1 + +#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 + +#define GLXEW_EXT_create_context_es2_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es2_profile) + +#endif /* GLX_EXT_create_context_es2_profile */ + +/* ------------------- GLX_EXT_create_context_es_profile ------------------- */ + +#ifndef GLX_EXT_create_context_es_profile +#define GLX_EXT_create_context_es_profile 1 + +#define GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 + +#define GLXEW_EXT_create_context_es_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es_profile) + +#endif /* GLX_EXT_create_context_es_profile */ + +/* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */ + +#ifndef GLX_EXT_fbconfig_packed_float +#define GLX_EXT_fbconfig_packed_float 1 + +#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 +#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 + +#define GLXEW_EXT_fbconfig_packed_float GLXEW_GET_VAR(__GLXEW_EXT_fbconfig_packed_float) + +#endif /* GLX_EXT_fbconfig_packed_float */ + +/* ------------------------ GLX_EXT_framebuffer_sRGB ----------------------- */ + +#ifndef GLX_EXT_framebuffer_sRGB +#define GLX_EXT_framebuffer_sRGB 1 + +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 + +#define GLXEW_EXT_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_EXT_framebuffer_sRGB) + +#endif /* GLX_EXT_framebuffer_sRGB */ + +/* ------------------------- GLX_EXT_import_context ------------------------ */ + +#ifndef GLX_EXT_import_context +#define GLX_EXT_import_context 1 + +#define GLX_SHARE_CONTEXT_EXT 0x800A +#define GLX_VISUAL_ID_EXT 0x800B +#define GLX_SCREEN_EXT 0x800C + +typedef XID GLXContextID; + +typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display* dpy, GLXContext context); +typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); +typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display* dpy, GLXContextID contextID); +typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context, int attribute,int *value); + +#define glXFreeContextEXT GLXEW_GET_FUN(__glewXFreeContextEXT) +#define glXGetContextIDEXT GLXEW_GET_FUN(__glewXGetContextIDEXT) +#define glXImportContextEXT GLXEW_GET_FUN(__glewXImportContextEXT) +#define glXQueryContextInfoEXT GLXEW_GET_FUN(__glewXQueryContextInfoEXT) + +#define GLXEW_EXT_import_context GLXEW_GET_VAR(__GLXEW_EXT_import_context) + +#endif /* GLX_EXT_import_context */ + +/* -------------------------- GLX_EXT_scene_marker ------------------------- */ + +#ifndef GLX_EXT_scene_marker +#define GLX_EXT_scene_marker 1 + +#define GLXEW_EXT_scene_marker GLXEW_GET_VAR(__GLXEW_EXT_scene_marker) + +#endif /* GLX_EXT_scene_marker */ + +/* -------------------------- GLX_EXT_swap_control ------------------------- */ + +#ifndef GLX_EXT_swap_control +#define GLX_EXT_swap_control 1 + +#define GLX_SWAP_INTERVAL_EXT 0x20F1 +#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 + +typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable, int interval); + +#define glXSwapIntervalEXT GLXEW_GET_FUN(__glewXSwapIntervalEXT) + +#define GLXEW_EXT_swap_control GLXEW_GET_VAR(__GLXEW_EXT_swap_control) + +#endif /* GLX_EXT_swap_control */ + +/* ----------------------- GLX_EXT_swap_control_tear ----------------------- */ + +#ifndef GLX_EXT_swap_control_tear +#define GLX_EXT_swap_control_tear 1 + +#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3 + +#define GLXEW_EXT_swap_control_tear GLXEW_GET_VAR(__GLXEW_EXT_swap_control_tear) + +#endif /* GLX_EXT_swap_control_tear */ + +/* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */ + +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_EXT_texture_from_pixmap 1 + +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 +#define GLX_TEXTURE_FORMAT_EXT 0x20D5 +#define GLX_TEXTURE_TARGET_EXT 0x20D6 +#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 +#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 +#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 +#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA +#define GLX_TEXTURE_1D_EXT 0x20DB +#define GLX_TEXTURE_2D_EXT 0x20DC +#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD +#define GLX_FRONT_LEFT_EXT 0x20DE +#define GLX_FRONT_RIGHT_EXT 0x20DF +#define GLX_BACK_LEFT_EXT 0x20E0 +#define GLX_BACK_RIGHT_EXT 0x20E1 +#define GLX_AUX0_EXT 0x20E2 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX6_EXT 0x20E8 +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX9_EXT 0x20EB + +typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer); + +#define glXBindTexImageEXT GLXEW_GET_FUN(__glewXBindTexImageEXT) +#define glXReleaseTexImageEXT GLXEW_GET_FUN(__glewXReleaseTexImageEXT) + +#define GLXEW_EXT_texture_from_pixmap GLXEW_GET_VAR(__GLXEW_EXT_texture_from_pixmap) + +#endif /* GLX_EXT_texture_from_pixmap */ + +/* -------------------------- GLX_EXT_visual_info -------------------------- */ + +#ifndef GLX_EXT_visual_info +#define GLX_EXT_visual_info 1 + +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 +#define GLX_NONE_EXT 0x8000 +#define GLX_TRUE_COLOR_EXT 0x8002 +#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_PSEUDO_COLOR_EXT 0x8004 +#define GLX_STATIC_COLOR_EXT 0x8005 +#define GLX_GRAY_SCALE_EXT 0x8006 +#define GLX_STATIC_GRAY_EXT 0x8007 +#define GLX_TRANSPARENT_RGB_EXT 0x8008 +#define GLX_TRANSPARENT_INDEX_EXT 0x8009 + +#define GLXEW_EXT_visual_info GLXEW_GET_VAR(__GLXEW_EXT_visual_info) + +#endif /* GLX_EXT_visual_info */ + +/* ------------------------- GLX_EXT_visual_rating ------------------------- */ + +#ifndef GLX_EXT_visual_rating +#define GLX_EXT_visual_rating 1 + +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#define GLX_SLOW_VISUAL_EXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D + +#define GLXEW_EXT_visual_rating GLXEW_GET_VAR(__GLXEW_EXT_visual_rating) + +#endif /* GLX_EXT_visual_rating */ + +/* -------------------------- GLX_INTEL_swap_event ------------------------- */ + +#ifndef GLX_INTEL_swap_event +#define GLX_INTEL_swap_event 1 + +#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180 +#define GLX_COPY_COMPLETE_INTEL 0x8181 +#define GLX_FLIP_COMPLETE_INTEL 0x8182 +#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000 + +#define GLXEW_INTEL_swap_event GLXEW_GET_VAR(__GLXEW_INTEL_swap_event) + +#endif /* GLX_INTEL_swap_event */ + +/* -------------------------- GLX_MESA_agp_offset -------------------------- */ + +#ifndef GLX_MESA_agp_offset +#define GLX_MESA_agp_offset 1 + +typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void* pointer); + +#define glXGetAGPOffsetMESA GLXEW_GET_FUN(__glewXGetAGPOffsetMESA) + +#define GLXEW_MESA_agp_offset GLXEW_GET_VAR(__GLXEW_MESA_agp_offset) + +#endif /* GLX_MESA_agp_offset */ + +/* ------------------------ GLX_MESA_copy_sub_buffer ----------------------- */ + +#ifndef GLX_MESA_copy_sub_buffer +#define GLX_MESA_copy_sub_buffer 1 + +typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height); + +#define glXCopySubBufferMESA GLXEW_GET_FUN(__glewXCopySubBufferMESA) + +#define GLXEW_MESA_copy_sub_buffer GLXEW_GET_VAR(__GLXEW_MESA_copy_sub_buffer) + +#endif /* GLX_MESA_copy_sub_buffer */ + +/* ------------------------ GLX_MESA_pixmap_colormap ----------------------- */ + +#ifndef GLX_MESA_pixmap_colormap +#define GLX_MESA_pixmap_colormap 1 + +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); + +#define glXCreateGLXPixmapMESA GLXEW_GET_FUN(__glewXCreateGLXPixmapMESA) + +#define GLXEW_MESA_pixmap_colormap GLXEW_GET_VAR(__GLXEW_MESA_pixmap_colormap) + +#endif /* GLX_MESA_pixmap_colormap */ + +/* ------------------------ GLX_MESA_release_buffers ----------------------- */ + +#ifndef GLX_MESA_release_buffers +#define GLX_MESA_release_buffers 1 + +typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display* dpy, GLXDrawable d); + +#define glXReleaseBuffersMESA GLXEW_GET_FUN(__glewXReleaseBuffersMESA) + +#define GLXEW_MESA_release_buffers GLXEW_GET_VAR(__GLXEW_MESA_release_buffers) + +#endif /* GLX_MESA_release_buffers */ + +/* ------------------------- GLX_MESA_set_3dfx_mode ------------------------ */ + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_MESA_set_3dfx_mode 1 + +#define GLX_3DFX_WINDOW_MODE_MESA 0x1 +#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 + +typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode); + +#define glXSet3DfxModeMESA GLXEW_GET_FUN(__glewXSet3DfxModeMESA) + +#define GLXEW_MESA_set_3dfx_mode GLXEW_GET_VAR(__GLXEW_MESA_set_3dfx_mode) + +#endif /* GLX_MESA_set_3dfx_mode */ + +/* ------------------------- GLX_MESA_swap_control ------------------------- */ + +#ifndef GLX_MESA_swap_control +#define GLX_MESA_swap_control 1 + +typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void); +typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval); + +#define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA) +#define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA) + +#define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control) + +#endif /* GLX_MESA_swap_control */ + +/* --------------------------- GLX_NV_copy_image --------------------------- */ + +#ifndef GLX_NV_copy_image +#define GLX_NV_copy_image 1 + +typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define glXCopyImageSubDataNV GLXEW_GET_FUN(__glewXCopyImageSubDataNV) + +#define GLXEW_NV_copy_image GLXEW_GET_VAR(__GLXEW_NV_copy_image) + +#endif /* GLX_NV_copy_image */ + +/* -------------------------- GLX_NV_float_buffer -------------------------- */ + +#ifndef GLX_NV_float_buffer +#define GLX_NV_float_buffer 1 + +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 + +#define GLXEW_NV_float_buffer GLXEW_GET_VAR(__GLXEW_NV_float_buffer) + +#endif /* GLX_NV_float_buffer */ + +/* ---------------------- GLX_NV_multisample_coverage ---------------------- */ + +#ifndef GLX_NV_multisample_coverage +#define GLX_NV_multisample_coverage 1 + +#define GLX_COLOR_SAMPLES_NV 0x20B3 +#define GLX_COVERAGE_SAMPLES_NV 100001 + +#define GLXEW_NV_multisample_coverage GLXEW_GET_VAR(__GLXEW_NV_multisample_coverage) + +#endif /* GLX_NV_multisample_coverage */ + +/* -------------------------- GLX_NV_present_video ------------------------- */ + +#ifndef GLX_NV_present_video +#define GLX_NV_present_video 1 + +#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0 + +typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list); +typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements); + +#define glXBindVideoDeviceNV GLXEW_GET_FUN(__glewXBindVideoDeviceNV) +#define glXEnumerateVideoDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoDevicesNV) + +#define GLXEW_NV_present_video GLXEW_GET_VAR(__GLXEW_NV_present_video) + +#endif /* GLX_NV_present_video */ + +/* --------------------------- GLX_NV_swap_group --------------------------- */ + +#ifndef GLX_NV_swap_group +#define GLX_NV_swap_group 1 + +typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display* dpy, GLuint group, GLuint barrier); +typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint group); +typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display* dpy, int screen, GLuint *count); +typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers); +typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier); +typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display* dpy, int screen); + +#define glXBindSwapBarrierNV GLXEW_GET_FUN(__glewXBindSwapBarrierNV) +#define glXJoinSwapGroupNV GLXEW_GET_FUN(__glewXJoinSwapGroupNV) +#define glXQueryFrameCountNV GLXEW_GET_FUN(__glewXQueryFrameCountNV) +#define glXQueryMaxSwapGroupsNV GLXEW_GET_FUN(__glewXQueryMaxSwapGroupsNV) +#define glXQuerySwapGroupNV GLXEW_GET_FUN(__glewXQuerySwapGroupNV) +#define glXResetFrameCountNV GLXEW_GET_FUN(__glewXResetFrameCountNV) + +#define GLXEW_NV_swap_group GLXEW_GET_VAR(__GLXEW_NV_swap_group) + +#endif /* GLX_NV_swap_group */ + +/* ----------------------- GLX_NV_vertex_array_range ----------------------- */ + +#ifndef GLX_NV_vertex_array_range +#define GLX_NV_vertex_array_range 1 + +typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); +typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer); + +#define glXAllocateMemoryNV GLXEW_GET_FUN(__glewXAllocateMemoryNV) +#define glXFreeMemoryNV GLXEW_GET_FUN(__glewXFreeMemoryNV) + +#define GLXEW_NV_vertex_array_range GLXEW_GET_VAR(__GLXEW_NV_vertex_array_range) + +#endif /* GLX_NV_vertex_array_range */ + +/* -------------------------- GLX_NV_video_capture ------------------------- */ + +#ifndef GLX_NV_video_capture +#define GLX_NV_video_capture 1 + +#define GLX_DEVICE_ID_NV 0x20CD +#define GLX_UNIQUE_ID_NV 0x20CE +#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + +typedef XID GLXVideoCaptureDeviceNV; + +typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device); +typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements); +typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); +typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value); +typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); + +#define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV) +#define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV) +#define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV) +#define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV) +#define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV) + +#define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture) + +#endif /* GLX_NV_video_capture */ + +/* -------------------------- GLX_NV_video_output -------------------------- */ + +#ifndef GLX_NV_video_output +#define GLX_NV_video_output 1 + +#define GLX_VIDEO_OUT_COLOR_NV 0x20C3 +#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 +#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5 +#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define GLX_VIDEO_OUT_FRAME_NV 0x20C8 +#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 +#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA +#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB +#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC + +typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer); +typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice); +typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice); +typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display* dpy, GLXPbuffer pbuf); +typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock); + +#define glXBindVideoImageNV GLXEW_GET_FUN(__glewXBindVideoImageNV) +#define glXGetVideoDeviceNV GLXEW_GET_FUN(__glewXGetVideoDeviceNV) +#define glXGetVideoInfoNV GLXEW_GET_FUN(__glewXGetVideoInfoNV) +#define glXReleaseVideoDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoDeviceNV) +#define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV) +#define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV) + +#define GLXEW_NV_video_output GLXEW_GET_VAR(__GLXEW_NV_video_output) + +#endif /* GLX_NV_video_output */ + +/* -------------------------- GLX_OML_swap_method -------------------------- */ + +#ifndef GLX_OML_swap_method +#define GLX_OML_swap_method 1 + +#define GLX_SWAP_METHOD_OML 0x8060 +#define GLX_SWAP_EXCHANGE_OML 0x8061 +#define GLX_SWAP_COPY_OML 0x8062 +#define GLX_SWAP_UNDEFINED_OML 0x8063 + +#define GLXEW_OML_swap_method GLXEW_GET_VAR(__GLXEW_OML_swap_method) + +#endif /* GLX_OML_swap_method */ + +/* -------------------------- GLX_OML_sync_control ------------------------- */ + +#ifndef GLX_OML_sync_control +#define GLX_OML_sync_control 1 + +typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator); +typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc); +typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); +typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc); +typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc); + +#define glXGetMscRateOML GLXEW_GET_FUN(__glewXGetMscRateOML) +#define glXGetSyncValuesOML GLXEW_GET_FUN(__glewXGetSyncValuesOML) +#define glXSwapBuffersMscOML GLXEW_GET_FUN(__glewXSwapBuffersMscOML) +#define glXWaitForMscOML GLXEW_GET_FUN(__glewXWaitForMscOML) +#define glXWaitForSbcOML GLXEW_GET_FUN(__glewXWaitForSbcOML) + +#define GLXEW_OML_sync_control GLXEW_GET_VAR(__GLXEW_OML_sync_control) + +#endif /* GLX_OML_sync_control */ + +/* ------------------------ GLX_SGIS_blended_overlay ----------------------- */ + +#ifndef GLX_SGIS_blended_overlay +#define GLX_SGIS_blended_overlay 1 + +#define GLX_BLENDED_RGBA_SGIS 0x8025 + +#define GLXEW_SGIS_blended_overlay GLXEW_GET_VAR(__GLXEW_SGIS_blended_overlay) + +#endif /* GLX_SGIS_blended_overlay */ + +/* -------------------------- GLX_SGIS_color_range ------------------------- */ + +#ifndef GLX_SGIS_color_range +#define GLX_SGIS_color_range 1 + +#define GLXEW_SGIS_color_range GLXEW_GET_VAR(__GLXEW_SGIS_color_range) + +#endif /* GLX_SGIS_color_range */ + +/* -------------------------- GLX_SGIS_multisample ------------------------- */ + +#ifndef GLX_SGIS_multisample +#define GLX_SGIS_multisample 1 + +#define GLX_SAMPLE_BUFFERS_SGIS 100000 +#define GLX_SAMPLES_SGIS 100001 + +#define GLXEW_SGIS_multisample GLXEW_GET_VAR(__GLXEW_SGIS_multisample) + +#endif /* GLX_SGIS_multisample */ + +/* ---------------------- GLX_SGIS_shared_multisample ---------------------- */ + +#ifndef GLX_SGIS_shared_multisample +#define GLX_SGIS_shared_multisample 1 + +#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 +#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 + +#define GLXEW_SGIS_shared_multisample GLXEW_GET_VAR(__GLXEW_SGIS_shared_multisample) + +#endif /* GLX_SGIS_shared_multisample */ + +/* --------------------------- GLX_SGIX_fbconfig --------------------------- */ + +#ifndef GLX_SGIX_fbconfig +#define GLX_SGIX_fbconfig 1 + +#define GLX_WINDOW_BIT_SGIX 0x00000001 +#define GLX_RGBA_BIT_SGIX 0x00000001 +#define GLX_PIXMAP_BIT_SGIX 0x00000002 +#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 +#define GLX_SCREEN_EXT 0x800C +#define GLX_DRAWABLE_TYPE_SGIX 0x8010 +#define GLX_RENDER_TYPE_SGIX 0x8011 +#define GLX_X_RENDERABLE_SGIX 0x8012 +#define GLX_FBCONFIG_ID_SGIX 0x8013 +#define GLX_RGBA_TYPE_SGIX 0x8014 +#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 + +typedef XID GLXFBConfigIDSGIX; +typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; + +typedef GLXFBConfigSGIX* ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, Pixmap pixmap); +typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value); +typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display* dpy, XVisualInfo *vis); +typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfig config); + +#define glXChooseFBConfigSGIX GLXEW_GET_FUN(__glewXChooseFBConfigSGIX) +#define glXCreateContextWithConfigSGIX GLXEW_GET_FUN(__glewXCreateContextWithConfigSGIX) +#define glXCreateGLXPixmapWithConfigSGIX GLXEW_GET_FUN(__glewXCreateGLXPixmapWithConfigSGIX) +#define glXGetFBConfigAttribSGIX GLXEW_GET_FUN(__glewXGetFBConfigAttribSGIX) +#define glXGetFBConfigFromVisualSGIX GLXEW_GET_FUN(__glewXGetFBConfigFromVisualSGIX) +#define glXGetVisualFromFBConfigSGIX GLXEW_GET_FUN(__glewXGetVisualFromFBConfigSGIX) + +#define GLXEW_SGIX_fbconfig GLXEW_GET_VAR(__GLXEW_SGIX_fbconfig) + +#endif /* GLX_SGIX_fbconfig */ + +/* --------------------------- GLX_SGIX_hyperpipe -------------------------- */ + +#ifndef GLX_SGIX_hyperpipe +#define GLX_SGIX_hyperpipe 1 + +#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 +#define GLX_PIPE_RECT_SGIX 0x00000001 +#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 +#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 +#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 +#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 +#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 +#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 +#define GLX_BAD_HYPERPIPE_SGIX 92 +#define GLX_HYPERPIPE_ID_SGIX 0x8030 + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int networkId; +} GLXHyperpipeNetworkSGIX; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int XOrigin; + int YOrigin; + int maxHeight; + int maxWidth; +} GLXPipeRectLimits; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int channel; + unsigned int participationType; + int timeSlice; +} GLXHyperpipeConfigSGIX; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int srcXOrigin; + int srcYOrigin; + int srcWidth; + int srcHeight; + int destXOrigin; + int destYOrigin; + int destWidth; + int destHeight; +} GLXPipeRect; + +typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList); +typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId); +typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList); +typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList); +typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes); +typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes); + +#define glXBindHyperpipeSGIX GLXEW_GET_FUN(__glewXBindHyperpipeSGIX) +#define glXDestroyHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXDestroyHyperpipeConfigSGIX) +#define glXHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXHyperpipeAttribSGIX) +#define glXHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXHyperpipeConfigSGIX) +#define glXQueryHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeAttribSGIX) +#define glXQueryHyperpipeBestAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeBestAttribSGIX) +#define glXQueryHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeConfigSGIX) +#define glXQueryHyperpipeNetworkSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeNetworkSGIX) + +#define GLXEW_SGIX_hyperpipe GLXEW_GET_VAR(__GLXEW_SGIX_hyperpipe) + +#endif /* GLX_SGIX_hyperpipe */ + +/* ---------------------------- GLX_SGIX_pbuffer --------------------------- */ + +#ifndef GLX_SGIX_pbuffer +#define GLX_SGIX_pbuffer 1 + +#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 +#define GLX_PBUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 +#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 +#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 +#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 +#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 +#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 +#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 +#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 +#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 +#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A +#define GLX_PRESERVED_CONTENTS_SGIX 0x801B +#define GLX_LARGEST_PBUFFER_SGIX 0x801C +#define GLX_WIDTH_SGIX 0x801D +#define GLX_HEIGHT_SGIX 0x801E +#define GLX_EVENT_MASK_SGIX 0x801F +#define GLX_DAMAGED_SGIX 0x8020 +#define GLX_SAVED_SGIX 0x8021 +#define GLX_WINDOW_SGIX 0x8022 +#define GLX_PBUFFER_SGIX 0x8023 +#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 + +typedef XID GLXPbufferSGIX; +typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX; + +typedef GLXPbuffer ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list); +typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long *mask); +typedef void ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long mask); + +#define glXCreateGLXPbufferSGIX GLXEW_GET_FUN(__glewXCreateGLXPbufferSGIX) +#define glXDestroyGLXPbufferSGIX GLXEW_GET_FUN(__glewXDestroyGLXPbufferSGIX) +#define glXGetSelectedEventSGIX GLXEW_GET_FUN(__glewXGetSelectedEventSGIX) +#define glXQueryGLXPbufferSGIX GLXEW_GET_FUN(__glewXQueryGLXPbufferSGIX) +#define glXSelectEventSGIX GLXEW_GET_FUN(__glewXSelectEventSGIX) + +#define GLXEW_SGIX_pbuffer GLXEW_GET_VAR(__GLXEW_SGIX_pbuffer) + +#endif /* GLX_SGIX_pbuffer */ + +/* ------------------------- GLX_SGIX_swap_barrier ------------------------- */ + +#ifndef GLX_SGIX_swap_barrier +#define GLX_SGIX_swap_barrier 1 + +typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier); +typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max); + +#define glXBindSwapBarrierSGIX GLXEW_GET_FUN(__glewXBindSwapBarrierSGIX) +#define glXQueryMaxSwapBarriersSGIX GLXEW_GET_FUN(__glewXQueryMaxSwapBarriersSGIX) + +#define GLXEW_SGIX_swap_barrier GLXEW_GET_VAR(__GLXEW_SGIX_swap_barrier) + +#endif /* GLX_SGIX_swap_barrier */ + +/* -------------------------- GLX_SGIX_swap_group -------------------------- */ + +#ifndef GLX_SGIX_swap_group +#define GLX_SGIX_swap_group 1 + +typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); + +#define glXJoinSwapGroupSGIX GLXEW_GET_FUN(__glewXJoinSwapGroupSGIX) + +#define GLXEW_SGIX_swap_group GLXEW_GET_VAR(__GLXEW_SGIX_swap_group) + +#endif /* GLX_SGIX_swap_group */ + +/* ------------------------- GLX_SGIX_video_resize ------------------------- */ + +#ifndef GLX_SGIX_video_resize +#define GLX_SGIX_video_resize 1 + +#define GLX_SYNC_FRAME_SGIX 0x00000000 +#define GLX_SYNC_SWAP_SGIX 0x00000001 + +typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display* display, int screen, int channel, Window window); +typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int x, int y, int w, int h); +typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display* display, int screen, int channel, GLenum synctype); +typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display* display, int screen, int channel, int *x, int *y, int *w, int *h); +typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); + +#define glXBindChannelToWindowSGIX GLXEW_GET_FUN(__glewXBindChannelToWindowSGIX) +#define glXChannelRectSGIX GLXEW_GET_FUN(__glewXChannelRectSGIX) +#define glXChannelRectSyncSGIX GLXEW_GET_FUN(__glewXChannelRectSyncSGIX) +#define glXQueryChannelDeltasSGIX GLXEW_GET_FUN(__glewXQueryChannelDeltasSGIX) +#define glXQueryChannelRectSGIX GLXEW_GET_FUN(__glewXQueryChannelRectSGIX) + +#define GLXEW_SGIX_video_resize GLXEW_GET_VAR(__GLXEW_SGIX_video_resize) + +#endif /* GLX_SGIX_video_resize */ + +/* ---------------------- GLX_SGIX_visual_select_group --------------------- */ + +#ifndef GLX_SGIX_visual_select_group +#define GLX_SGIX_visual_select_group 1 + +#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 + +#define GLXEW_SGIX_visual_select_group GLXEW_GET_VAR(__GLXEW_SGIX_visual_select_group) + +#endif /* GLX_SGIX_visual_select_group */ + +/* ---------------------------- GLX_SGI_cushion ---------------------------- */ + +#ifndef GLX_SGI_cushion +#define GLX_SGI_cushion 1 + +typedef void ( * PFNGLXCUSHIONSGIPROC) (Display* dpy, Window window, float cushion); + +#define glXCushionSGI GLXEW_GET_FUN(__glewXCushionSGI) + +#define GLXEW_SGI_cushion GLXEW_GET_VAR(__GLXEW_SGI_cushion) + +#endif /* GLX_SGI_cushion */ + +/* ----------------------- GLX_SGI_make_current_read ----------------------- */ + +#ifndef GLX_SGI_make_current_read +#define GLX_SGI_make_current_read 1 + +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); +typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); + +#define glXGetCurrentReadDrawableSGI GLXEW_GET_FUN(__glewXGetCurrentReadDrawableSGI) +#define glXMakeCurrentReadSGI GLXEW_GET_FUN(__glewXMakeCurrentReadSGI) + +#define GLXEW_SGI_make_current_read GLXEW_GET_VAR(__GLXEW_SGI_make_current_read) + +#endif /* GLX_SGI_make_current_read */ + +/* -------------------------- GLX_SGI_swap_control ------------------------- */ + +#ifndef GLX_SGI_swap_control +#define GLX_SGI_swap_control 1 + +typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); + +#define glXSwapIntervalSGI GLXEW_GET_FUN(__glewXSwapIntervalSGI) + +#define GLXEW_SGI_swap_control GLXEW_GET_VAR(__GLXEW_SGI_swap_control) + +#endif /* GLX_SGI_swap_control */ + +/* --------------------------- GLX_SGI_video_sync -------------------------- */ + +#ifndef GLX_SGI_video_sync +#define GLX_SGI_video_sync 1 + +typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int* count); +typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count); + +#define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI) +#define glXWaitVideoSyncSGI GLXEW_GET_FUN(__glewXWaitVideoSyncSGI) + +#define GLXEW_SGI_video_sync GLXEW_GET_VAR(__GLXEW_SGI_video_sync) + +#endif /* GLX_SGI_video_sync */ + +/* --------------------- GLX_SUN_get_transparent_index --------------------- */ + +#ifndef GLX_SUN_get_transparent_index +#define GLX_SUN_get_transparent_index 1 + +typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex); + +#define glXGetTransparentIndexSUN GLXEW_GET_FUN(__glewXGetTransparentIndexSUN) + +#define GLXEW_SUN_get_transparent_index GLXEW_GET_VAR(__GLXEW_SUN_get_transparent_index) + +#endif /* GLX_SUN_get_transparent_index */ + +/* -------------------------- GLX_SUN_video_resize ------------------------- */ + +#ifndef GLX_SUN_video_resize +#define GLX_SUN_video_resize 1 + +#define GLX_VIDEO_RESIZE_SUN 0x8171 +#define GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD + +typedef int ( * PFNGLXGETVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float* factor); +typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float factor); + +#define glXGetVideoResizeSUN GLXEW_GET_FUN(__glewXGetVideoResizeSUN) +#define glXVideoResizeSUN GLXEW_GET_FUN(__glewXVideoResizeSUN) + +#define GLXEW_SUN_video_resize GLXEW_GET_VAR(__GLXEW_SUN_video_resize) + +#endif /* GLX_SUN_video_resize */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX +#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT +#define GLXEW_VAR_EXPORT +#else +#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT +#define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT +#endif /* GLEW_MX */ + +GLXEW_FUN_EXPORT PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay; + +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig; +GLXEW_FUN_EXPORT PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext; +GLXEW_FUN_EXPORT PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer; +GLXEW_FUN_EXPORT PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap; +GLXEW_FUN_EXPORT PFNGLXCREATEWINDOWPROC __glewXCreateWindow; +GLXEW_FUN_EXPORT PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer; +GLXEW_FUN_EXPORT PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap; +GLXEW_FUN_EXPORT PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow; +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs; +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent; +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig; +GLXEW_FUN_EXPORT PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent; +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTPROC __glewXQueryContext; +GLXEW_FUN_EXPORT PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable; +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTPROC __glewXSelectEvent; + +GLXEW_FUN_EXPORT PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC __glewXBlitContextFramebufferAMD; +GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC __glewXCreateAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __glewXCreateAssociatedContextAttribsAMD; +GLXEW_FUN_EXPORT PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC __glewXDeleteAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXGETCONTEXTGPUIDAMDPROC __glewXGetContextGPUIDAMD; +GLXEW_FUN_EXPORT PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC __glewXGetCurrentAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXGETGPUIDSAMDPROC __glewXGetGPUIDsAMD; +GLXEW_FUN_EXPORT PFNGLXGETGPUINFOAMDPROC __glewXGetGPUInfoAMD; +GLXEW_FUN_EXPORT PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __glewXMakeAssociatedContextCurrentAMD; + +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB; + +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI; +GLXEW_FUN_EXPORT PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI; +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI; + +GLXEW_FUN_EXPORT PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT; +GLXEW_FUN_EXPORT PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT; +GLXEW_FUN_EXPORT PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT; +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT; + +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT; + +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT; +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT; + +GLXEW_FUN_EXPORT PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA; + +GLXEW_FUN_EXPORT PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA; + +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA; + +GLXEW_FUN_EXPORT PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA; + +GLXEW_FUN_EXPORT PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA; + +GLXEW_FUN_EXPORT PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA; +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA; + +GLXEW_FUN_EXPORT PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV; + +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV; +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV; +GLXEW_FUN_EXPORT PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV; +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV; +GLXEW_FUN_EXPORT PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV; +GLXEW_FUN_EXPORT PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV; + +GLXEW_FUN_EXPORT PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV; +GLXEW_FUN_EXPORT PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV; +GLXEW_FUN_EXPORT PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV; +GLXEW_FUN_EXPORT PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV; +GLXEW_FUN_EXPORT PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV; + +GLXEW_FUN_EXPORT PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML; +GLXEW_FUN_EXPORT PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML; +GLXEW_FUN_EXPORT PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML; +GLXEW_FUN_EXPORT PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML; +GLXEW_FUN_EXPORT PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML; + +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX; +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX; +GLXEW_FUN_EXPORT PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX; + +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX; + +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX; +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX; +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX; + +GLXEW_FUN_EXPORT PFNGLXCUSHIONSGIPROC __glewXCushionSGI; + +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI; +GLXEW_FUN_EXPORT PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI; + +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI; + +GLXEW_FUN_EXPORT PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI; +GLXEW_FUN_EXPORT PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI; + +GLXEW_FUN_EXPORT PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN; + +GLXEW_FUN_EXPORT PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN; +GLXEW_FUN_EXPORT PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN; + +#if defined(GLEW_MX) +struct GLXEWContextStruct +{ +#endif /* GLEW_MX */ + +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_3; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_4; +GLXEW_VAR_EXPORT GLboolean __GLXEW_3DFX_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_AMD_gpu_association; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_robustness; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_fbconfig_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_get_proc_address; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_application_isolation; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_share_group_isolation; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_pixel_format_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_render_texture; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_buffer_age; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_import_context; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_scene_marker; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control_tear; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_info; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_rating; +GLXEW_VAR_EXPORT GLboolean __GLXEW_INTEL_swap_event; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_agp_offset; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_release_buffers; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_image; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_float_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_multisample_coverage; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_present_video; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_swap_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_vertex_array_range; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_capture; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_output; +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_swap_method; +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_sync_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_blended_overlay; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_color_range; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_shared_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_fbconfig; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_hyperpipe; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_pbuffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_barrier; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_video_resize; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_visual_select_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_cushion; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_make_current_read; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_video_sync; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_get_transparent_index; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_video_resize; + +#ifdef GLEW_MX +}; /* GLXEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------ */ + +#ifdef GLEW_MX + +typedef struct GLXEWContextStruct GLXEWContext; +GLEWAPI GLenum GLEWAPIENTRY glxewContextInit (GLXEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY glxewContextIsSupported (const GLXEWContext *ctx, const char *name); + +#define glxewInit() glxewContextInit(glxewGetContext()) +#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x) + +#define GLXEW_GET_VAR(x) (*(const GLboolean*)&(glxewGetContext()->x)) +#define GLXEW_GET_FUN(x) x + +#else /* GLEW_MX */ + +#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x) +#define GLXEW_GET_FUN(x) x + +GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name); + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#endif /* __glxew_h__ */ diff --git a/external/steamworks/steamworksexample/GL/wglew.h b/external/steamworks/steamworksexample/GL/wglew.h new file mode 100644 index 0000000..1e77920 --- /dev/null +++ b/external/steamworks/steamworksexample/GL/wglew.h @@ -0,0 +1,1421 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __wglew_h__ +#define __wglew_h__ +#define __WGLEW_H__ + +#ifdef __wglext_h_ +#error wglext.h included before wglew.h +#endif + +#define __wglext_h_ + +#if !defined(WINAPI) +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN 1 +# endif +#include +# undef WIN32_LEAN_AND_MEAN +#endif + +/* + * GLEW_STATIC needs to be set when using the static version. + * GLEW_BUILD is set when building the DLL version. + */ +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* -------------------------- WGL_3DFX_multisample ------------------------- */ + +#ifndef WGL_3DFX_multisample +#define WGL_3DFX_multisample 1 + +#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 +#define WGL_SAMPLES_3DFX 0x2061 + +#define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample) + +#endif /* WGL_3DFX_multisample */ + +/* ------------------------- WGL_3DL_stereo_control ------------------------ */ + +#ifndef WGL_3DL_stereo_control +#define WGL_3DL_stereo_control 1 + +#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 +#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 +#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 +#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 + +typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); + +#define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL) + +#define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control) + +#endif /* WGL_3DL_stereo_control */ + +/* ------------------------ WGL_AMD_gpu_association ------------------------ */ + +#ifndef WGL_AMD_gpu_association +#define WGL_AMD_gpu_association 1 + +#define WGL_GPU_VENDOR_AMD 0x1F00 +#define WGL_GPU_RENDERER_STRING_AMD 0x1F01 +#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define WGL_GPU_RAM_AMD 0x21A3 +#define WGL_GPU_CLOCK_AMD 0x21A4 +#define WGL_GPU_NUM_PIPES_AMD 0x21A5 +#define WGL_GPU_NUM_SIMD_AMD 0x21A6 +#define WGL_GPU_NUM_RB_AMD 0x21A7 +#define WGL_GPU_NUM_SPI_AMD 0x21A8 + +typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList); +typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); +typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); +typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids); +typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data); +typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); + +#define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD) +#define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD) +#define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD) +#define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD) +#define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD) +#define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD) +#define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD) +#define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD) +#define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD) + +#define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association) + +#endif /* WGL_AMD_gpu_association */ + +/* ------------------------- WGL_ARB_buffer_region ------------------------- */ + +#ifndef WGL_ARB_buffer_region +#define WGL_ARB_buffer_region 1 + +#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 +#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 +#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 +#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 + +typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); +typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); +typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); + +#define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB) +#define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB) +#define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB) +#define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB) + +#define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region) + +#endif /* WGL_ARB_buffer_region */ + +/* ------------------------- WGL_ARB_create_context ------------------------ */ + +#ifndef WGL_ARB_create_context +#define WGL_ARB_create_context 1 + +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define ERROR_INVALID_VERSION_ARB 0x2095 +#define ERROR_INVALID_PROFILE_ARB 0x2096 + +typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList); + +#define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB) + +#define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context) + +#endif /* WGL_ARB_create_context */ + +/* --------------------- WGL_ARB_create_context_profile -------------------- */ + +#ifndef WGL_ARB_create_context_profile +#define WGL_ARB_create_context_profile 1 + +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 + +#define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile) + +#endif /* WGL_ARB_create_context_profile */ + +/* ------------------- WGL_ARB_create_context_robustness ------------------- */ + +#ifndef WGL_ARB_create_context_robustness +#define WGL_ARB_create_context_robustness 1 + +#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 + +#define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness) + +#endif /* WGL_ARB_create_context_robustness */ + +/* ----------------------- WGL_ARB_extensions_string ----------------------- */ + +#ifndef WGL_ARB_extensions_string +#define WGL_ARB_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); + +#define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB) + +#define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string) + +#endif /* WGL_ARB_extensions_string */ + +/* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */ + +#ifndef WGL_ARB_framebuffer_sRGB +#define WGL_ARB_framebuffer_sRGB 1 + +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 + +#define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB) + +#endif /* WGL_ARB_framebuffer_sRGB */ + +/* ----------------------- WGL_ARB_make_current_read ----------------------- */ + +#ifndef WGL_ARB_make_current_read +#define WGL_ARB_make_current_read 1 + +#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 +#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB) +#define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB) + +#define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read) + +#endif /* WGL_ARB_make_current_read */ + +/* -------------------------- WGL_ARB_multisample -------------------------- */ + +#ifndef WGL_ARB_multisample +#define WGL_ARB_multisample 1 + +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 + +#define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample) + +#endif /* WGL_ARB_multisample */ + +/* ---------------------------- WGL_ARB_pbuffer ---------------------------- */ + +#ifndef WGL_ARB_pbuffer +#define WGL_ARB_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_ARB 0x202D +#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E +#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 +#define WGL_PBUFFER_LARGEST_ARB 0x2033 +#define WGL_PBUFFER_WIDTH_ARB 0x2034 +#define WGL_PBUFFER_HEIGHT_ARB 0x2035 +#define WGL_PBUFFER_LOST_ARB 0x2036 + +DECLARE_HANDLE(HPBUFFERARB); + +typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); + +#define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB) +#define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB) +#define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB) +#define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB) +#define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB) + +#define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer) + +#endif /* WGL_ARB_pbuffer */ + +/* -------------------------- WGL_ARB_pixel_format ------------------------- */ + +#ifndef WGL_ARB_pixel_format +#define WGL_ARB_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NEED_PALETTE_ARB 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 +#define WGL_TRANSPARENT_ARB 0x200A +#define WGL_SHARE_DEPTH_ARB 0x200C +#define WGL_SHARE_STENCIL_ARB 0x200D +#define WGL_SHARE_ACCUM_ARB 0x200E +#define WGL_SUPPORT_GDI_ARB 0x200F +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_STEREO_ARB 0x2012 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201A +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_ALPHA_SHIFT_ARB 0x201C +#define WGL_ACCUM_BITS_ARB 0x201D +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_SWAP_EXCHANGE_ARB 0x2028 +#define WGL_SWAP_COPY_ARB 0x2029 +#define WGL_SWAP_UNDEFINED_ARB 0x202A +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues); + +#define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB) +#define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB) +#define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB) + +#define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format) + +#endif /* WGL_ARB_pixel_format */ + +/* ----------------------- WGL_ARB_pixel_format_float ---------------------- */ + +#ifndef WGL_ARB_pixel_format_float +#define WGL_ARB_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 + +#define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float) + +#endif /* WGL_ARB_pixel_format_float */ + +/* ------------------------- WGL_ARB_render_texture ------------------------ */ + +#ifndef WGL_ARB_render_texture +#define WGL_ARB_render_texture 1 + +#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 +#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 +#define WGL_TEXTURE_FORMAT_ARB 0x2072 +#define WGL_TEXTURE_TARGET_ARB 0x2073 +#define WGL_MIPMAP_TEXTURE_ARB 0x2074 +#define WGL_TEXTURE_RGB_ARB 0x2075 +#define WGL_TEXTURE_RGBA_ARB 0x2076 +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 +#define WGL_TEXTURE_1D_ARB 0x2079 +#define WGL_TEXTURE_2D_ARB 0x207A +#define WGL_MIPMAP_LEVEL_ARB 0x207B +#define WGL_CUBE_MAP_FACE_ARB 0x207C +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 +#define WGL_FRONT_LEFT_ARB 0x2083 +#define WGL_FRONT_RIGHT_ARB 0x2084 +#define WGL_BACK_LEFT_ARB 0x2085 +#define WGL_BACK_RIGHT_ARB 0x2086 +#define WGL_AUX0_ARB 0x2087 +#define WGL_AUX1_ARB 0x2088 +#define WGL_AUX2_ARB 0x2089 +#define WGL_AUX3_ARB 0x208A +#define WGL_AUX4_ARB 0x208B +#define WGL_AUX5_ARB 0x208C +#define WGL_AUX6_ARB 0x208D +#define WGL_AUX7_ARB 0x208E +#define WGL_AUX8_ARB 0x208F +#define WGL_AUX9_ARB 0x2090 + +typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList); + +#define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB) +#define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB) +#define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB) + +#define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture) + +#endif /* WGL_ARB_render_texture */ + +/* ---------------- WGL_ARB_robustness_application_isolation --------------- */ + +#ifndef WGL_ARB_robustness_application_isolation +#define WGL_ARB_robustness_application_isolation 1 + +#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define WGLEW_ARB_robustness_application_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_application_isolation) + +#endif /* WGL_ARB_robustness_application_isolation */ + +/* ---------------- WGL_ARB_robustness_share_group_isolation --------------- */ + +#ifndef WGL_ARB_robustness_share_group_isolation +#define WGL_ARB_robustness_share_group_isolation 1 + +#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define WGLEW_ARB_robustness_share_group_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_share_group_isolation) + +#endif /* WGL_ARB_robustness_share_group_isolation */ + +/* ----------------------- WGL_ATI_pixel_format_float ---------------------- */ + +#ifndef WGL_ATI_pixel_format_float +#define WGL_ATI_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 +#define GL_RGBA_FLOAT_MODE_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 + +#define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float) + +#endif /* WGL_ATI_pixel_format_float */ + +/* -------------------- WGL_ATI_render_texture_rectangle ------------------- */ + +#ifndef WGL_ATI_render_texture_rectangle +#define WGL_ATI_render_texture_rectangle 1 + +#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5 + +#define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle) + +#endif /* WGL_ATI_render_texture_rectangle */ + +/* ------------------- WGL_EXT_create_context_es2_profile ------------------ */ + +#ifndef WGL_EXT_create_context_es2_profile +#define WGL_EXT_create_context_es2_profile 1 + +#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile) + +#endif /* WGL_EXT_create_context_es2_profile */ + +/* ------------------- WGL_EXT_create_context_es_profile ------------------- */ + +#ifndef WGL_EXT_create_context_es_profile +#define WGL_EXT_create_context_es_profile 1 + +#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es_profile) + +#endif /* WGL_EXT_create_context_es_profile */ + +/* -------------------------- WGL_EXT_depth_float -------------------------- */ + +#ifndef WGL_EXT_depth_float +#define WGL_EXT_depth_float 1 + +#define WGL_DEPTH_FLOAT_EXT 0x2040 + +#define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float) + +#endif /* WGL_EXT_depth_float */ + +/* ---------------------- WGL_EXT_display_color_table ---------------------- */ + +#ifndef WGL_EXT_display_color_table +#define WGL_EXT_display_color_table 1 + +typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length); + +#define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT) +#define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT) +#define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT) +#define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT) + +#define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table) + +#endif /* WGL_EXT_display_color_table */ + +/* ----------------------- WGL_EXT_extensions_string ----------------------- */ + +#ifndef WGL_EXT_extensions_string +#define WGL_EXT_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); + +#define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT) + +#define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string) + +#endif /* WGL_EXT_extensions_string */ + +/* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */ + +#ifndef WGL_EXT_framebuffer_sRGB +#define WGL_EXT_framebuffer_sRGB 1 + +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 + +#define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB) + +#endif /* WGL_EXT_framebuffer_sRGB */ + +/* ----------------------- WGL_EXT_make_current_read ----------------------- */ + +#ifndef WGL_EXT_make_current_read +#define WGL_EXT_make_current_read 1 + +#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT) +#define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT) + +#define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read) + +#endif /* WGL_EXT_make_current_read */ + +/* -------------------------- WGL_EXT_multisample -------------------------- */ + +#ifndef WGL_EXT_multisample +#define WGL_EXT_multisample 1 + +#define WGL_SAMPLE_BUFFERS_EXT 0x2041 +#define WGL_SAMPLES_EXT 0x2042 + +#define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample) + +#endif /* WGL_EXT_multisample */ + +/* ---------------------------- WGL_EXT_pbuffer ---------------------------- */ + +#ifndef WGL_EXT_pbuffer +#define WGL_EXT_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_EXT 0x202D +#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E +#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 +#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 +#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 +#define WGL_PBUFFER_LARGEST_EXT 0x2033 +#define WGL_PBUFFER_WIDTH_EXT 0x2034 +#define WGL_PBUFFER_HEIGHT_EXT 0x2035 + +DECLARE_HANDLE(HPBUFFEREXT); + +typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); + +#define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT) +#define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT) +#define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT) +#define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT) +#define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT) + +#define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer) + +#endif /* WGL_EXT_pbuffer */ + +/* -------------------------- WGL_EXT_pixel_format ------------------------- */ + +#ifndef WGL_EXT_pixel_format +#define WGL_EXT_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 +#define WGL_DRAW_TO_WINDOW_EXT 0x2001 +#define WGL_DRAW_TO_BITMAP_EXT 0x2002 +#define WGL_ACCELERATION_EXT 0x2003 +#define WGL_NEED_PALETTE_EXT 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 +#define WGL_SWAP_METHOD_EXT 0x2007 +#define WGL_NUMBER_OVERLAYS_EXT 0x2008 +#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 +#define WGL_TRANSPARENT_EXT 0x200A +#define WGL_TRANSPARENT_VALUE_EXT 0x200B +#define WGL_SHARE_DEPTH_EXT 0x200C +#define WGL_SHARE_STENCIL_EXT 0x200D +#define WGL_SHARE_ACCUM_EXT 0x200E +#define WGL_SUPPORT_GDI_EXT 0x200F +#define WGL_SUPPORT_OPENGL_EXT 0x2010 +#define WGL_DOUBLE_BUFFER_EXT 0x2011 +#define WGL_STEREO_EXT 0x2012 +#define WGL_PIXEL_TYPE_EXT 0x2013 +#define WGL_COLOR_BITS_EXT 0x2014 +#define WGL_RED_BITS_EXT 0x2015 +#define WGL_RED_SHIFT_EXT 0x2016 +#define WGL_GREEN_BITS_EXT 0x2017 +#define WGL_GREEN_SHIFT_EXT 0x2018 +#define WGL_BLUE_BITS_EXT 0x2019 +#define WGL_BLUE_SHIFT_EXT 0x201A +#define WGL_ALPHA_BITS_EXT 0x201B +#define WGL_ALPHA_SHIFT_EXT 0x201C +#define WGL_ACCUM_BITS_EXT 0x201D +#define WGL_ACCUM_RED_BITS_EXT 0x201E +#define WGL_ACCUM_GREEN_BITS_EXT 0x201F +#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 +#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 +#define WGL_DEPTH_BITS_EXT 0x2022 +#define WGL_STENCIL_BITS_EXT 0x2023 +#define WGL_AUX_BUFFERS_EXT 0x2024 +#define WGL_NO_ACCELERATION_EXT 0x2025 +#define WGL_GENERIC_ACCELERATION_EXT 0x2026 +#define WGL_FULL_ACCELERATION_EXT 0x2027 +#define WGL_SWAP_EXCHANGE_EXT 0x2028 +#define WGL_SWAP_COPY_EXT 0x2029 +#define WGL_SWAP_UNDEFINED_EXT 0x202A +#define WGL_TYPE_RGBA_EXT 0x202B +#define WGL_TYPE_COLORINDEX_EXT 0x202C + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues); + +#define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT) +#define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT) +#define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT) + +#define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format) + +#endif /* WGL_EXT_pixel_format */ + +/* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */ + +#ifndef WGL_EXT_pixel_format_packed_float +#define WGL_EXT_pixel_format_packed_float 1 + +#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 + +#define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float) + +#endif /* WGL_EXT_pixel_format_packed_float */ + +/* -------------------------- WGL_EXT_swap_control ------------------------- */ + +#ifndef WGL_EXT_swap_control +#define WGL_EXT_swap_control 1 + +typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); +typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); + +#define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT) +#define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT) + +#define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control) + +#endif /* WGL_EXT_swap_control */ + +/* ----------------------- WGL_EXT_swap_control_tear ----------------------- */ + +#ifndef WGL_EXT_swap_control_tear +#define WGL_EXT_swap_control_tear 1 + +#define WGLEW_EXT_swap_control_tear WGLEW_GET_VAR(__WGLEW_EXT_swap_control_tear) + +#endif /* WGL_EXT_swap_control_tear */ + +/* --------------------- WGL_I3D_digital_video_control --------------------- */ + +#ifndef WGL_I3D_digital_video_control +#define WGL_I3D_digital_video_control 1 + +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 +#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 +#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 + +typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D) +#define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D) + +#define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control) + +#endif /* WGL_I3D_digital_video_control */ + +/* ----------------------------- WGL_I3D_gamma ----------------------------- */ + +#ifndef WGL_I3D_gamma +#define WGL_I3D_gamma 1 + +#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E +#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F + +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D) +#define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D) +#define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D) +#define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D) + +#define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma) + +#endif /* WGL_I3D_gamma */ + +/* ---------------------------- WGL_I3D_genlock ---------------------------- */ + +#ifndef WGL_I3D_genlock +#define WGL_I3D_genlock 1 + +#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 +#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045 +#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046 +#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047 +#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 +#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 +#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A +#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B +#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C + +typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource); +typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay); + +#define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D) +#define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D) +#define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D) +#define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D) +#define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D) +#define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D) +#define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D) +#define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D) +#define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D) +#define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D) +#define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D) +#define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D) + +#define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock) + +#endif /* WGL_I3D_genlock */ + +/* -------------------------- WGL_I3D_image_buffer ------------------------- */ + +#ifndef WGL_I3D_image_buffer +#define WGL_I3D_image_buffer 1 + +#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 +#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 + +typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count); +typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); +typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); +typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count); + +#define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D) +#define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D) +#define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D) +#define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D) + +#define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer) + +#endif /* WGL_I3D_image_buffer */ + +/* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */ + +#ifndef WGL_I3D_swap_frame_lock +#define WGL_I3D_swap_frame_lock 1 + +typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag); + +#define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D) +#define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D) +#define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D) +#define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D) + +#define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock) + +#endif /* WGL_I3D_swap_frame_lock */ + +/* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */ + +#ifndef WGL_I3D_swap_frame_usage +#define WGL_I3D_swap_frame_usage 1 + +typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); + +#define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D) +#define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D) +#define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D) +#define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D) + +#define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage) + +#endif /* WGL_I3D_swap_frame_usage */ + +/* --------------------------- WGL_NV_DX_interop --------------------------- */ + +#ifndef WGL_NV_DX_interop +#define WGL_NV_DX_interop 1 + +#define WGL_ACCESS_READ_ONLY_NV 0x0000 +#define WGL_ACCESS_READ_WRITE_NV 0x0001 +#define WGL_ACCESS_WRITE_DISCARD_NV 0x0002 + +typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice); +typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access); +typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice); +typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access); +typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle); +typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject); + +#define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV) +#define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV) +#define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV) +#define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV) +#define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV) +#define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV) +#define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV) +#define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV) + +#define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop) + +#endif /* WGL_NV_DX_interop */ + +/* --------------------------- WGL_NV_DX_interop2 -------------------------- */ + +#ifndef WGL_NV_DX_interop2 +#define WGL_NV_DX_interop2 1 + +#define WGLEW_NV_DX_interop2 WGLEW_GET_VAR(__WGLEW_NV_DX_interop2) + +#endif /* WGL_NV_DX_interop2 */ + +/* --------------------------- WGL_NV_copy_image --------------------------- */ + +#ifndef WGL_NV_copy_image +#define WGL_NV_copy_image 1 + +typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV) + +#define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image) + +#endif /* WGL_NV_copy_image */ + +/* -------------------------- WGL_NV_float_buffer -------------------------- */ + +#ifndef WGL_NV_float_buffer +#define WGL_NV_float_buffer 1 + +#define WGL_FLOAT_COMPONENTS_NV 0x20B0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 +#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 +#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 +#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 +#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 + +#define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer) + +#endif /* WGL_NV_float_buffer */ + +/* -------------------------- WGL_NV_gpu_affinity -------------------------- */ + +#ifndef WGL_NV_gpu_affinity +#define WGL_NV_gpu_affinity 1 + +#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 +#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 + +DECLARE_HANDLE(HGPUNV); +typedef struct _GPU_DEVICE { + DWORD cb; + CHAR DeviceName[32]; + CHAR DeviceString[128]; + DWORD Flags; + RECT rcVirtualScreen; +} GPU_DEVICE, *PGPU_DEVICE; + +typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); +typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc); +typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); +typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); +typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); + +#define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV) +#define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV) +#define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV) +#define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV) +#define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV) + +#define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity) + +#endif /* WGL_NV_gpu_affinity */ + +/* ---------------------- WGL_NV_multisample_coverage ---------------------- */ + +#ifndef WGL_NV_multisample_coverage +#define WGL_NV_multisample_coverage 1 + +#define WGL_COVERAGE_SAMPLES_NV 0x2042 +#define WGL_COLOR_SAMPLES_NV 0x20B9 + +#define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage) + +#endif /* WGL_NV_multisample_coverage */ + +/* -------------------------- WGL_NV_present_video ------------------------- */ + +#ifndef WGL_NV_present_video +#define WGL_NV_present_video 1 + +#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 + +DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList); +typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList); +typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue); + +#define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV) +#define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV) +#define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV) + +#define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video) + +#endif /* WGL_NV_present_video */ + +/* ---------------------- WGL_NV_render_depth_texture ---------------------- */ + +#ifndef WGL_NV_render_depth_texture +#define WGL_NV_render_depth_texture 1 + +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 +#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 +#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 +#define WGL_DEPTH_COMPONENT_NV 0x20A7 + +#define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture) + +#endif /* WGL_NV_render_depth_texture */ + +/* -------------------- WGL_NV_render_texture_rectangle -------------------- */ + +#ifndef WGL_NV_render_texture_rectangle +#define WGL_NV_render_texture_rectangle 1 + +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 +#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 + +#define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle) + +#endif /* WGL_NV_render_texture_rectangle */ + +/* --------------------------- WGL_NV_swap_group --------------------------- */ + +#ifndef WGL_NV_swap_group +#define WGL_NV_swap_group 1 + +typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); +typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count); +typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers); +typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier); +typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); + +#define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV) +#define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV) +#define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV) +#define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV) +#define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV) +#define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV) + +#define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group) + +#endif /* WGL_NV_swap_group */ + +/* ----------------------- WGL_NV_vertex_array_range ----------------------- */ + +#ifndef WGL_NV_vertex_array_range +#define WGL_NV_vertex_array_range 1 + +typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); +typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); + +#define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV) +#define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV) + +#define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range) + +#endif /* WGL_NV_vertex_array_range */ + +/* -------------------------- WGL_NV_video_capture ------------------------- */ + +#ifndef WGL_NV_video_capture +#define WGL_NV_video_capture 1 + +#define WGL_UNIQUE_ID_NV 0x20CE +#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + +DECLARE_HANDLE(HVIDEOINPUTDEVICENV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList); +typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); + +#define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV) +#define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV) +#define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV) +#define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV) +#define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV) + +#define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture) + +#endif /* WGL_NV_video_capture */ + +/* -------------------------- WGL_NV_video_output -------------------------- */ + +#ifndef WGL_NV_video_output +#define WGL_NV_video_output 1 + +#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 +#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 +#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 +#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 +#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 +#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 +#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define WGL_VIDEO_OUT_FRAME 0x20C8 +#define WGL_VIDEO_OUT_FIELD_1 0x20C9 +#define WGL_VIDEO_OUT_FIELD_2 0x20CA +#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB +#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC + +DECLARE_HANDLE(HPVIDEODEV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice); +typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock); + +#define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV) +#define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV) +#define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV) +#define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV) +#define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV) +#define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV) + +#define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output) + +#endif /* WGL_NV_video_output */ + +/* -------------------------- WGL_OML_sync_control ------------------------- */ + +#ifndef WGL_OML_sync_control +#define WGL_OML_sync_control 1 + +typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator); +typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc); +typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc); +typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc); + +#define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML) +#define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML) +#define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML) +#define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML) +#define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML) +#define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML) + +#define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control) + +#endif /* WGL_OML_sync_control */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX +#define WGLEW_FUN_EXPORT +#define WGLEW_VAR_EXPORT +#else +#define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT +#define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT +#endif /* GLEW_MX */ + +#ifdef GLEW_MX +struct WGLEWContextStruct +{ +#endif /* GLEW_MX */ + +WGLEW_FUN_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; + +WGLEW_FUN_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD; +WGLEW_FUN_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD; +WGLEW_FUN_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD; +WGLEW_FUN_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD; + +WGLEW_FUN_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB; + +WGLEW_FUN_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB; + +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB; + +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB; + +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB; + +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB; + +WGLEW_FUN_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB; +WGLEW_FUN_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB; +WGLEW_FUN_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB; + +WGLEW_FUN_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT; + +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT; + +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT; + +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT; + +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT; + +WGLEW_FUN_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT; +WGLEW_FUN_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT; + +WGLEW_FUN_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D; + +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D; + +WGLEW_FUN_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D; + +WGLEW_FUN_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D; +WGLEW_FUN_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D; + +WGLEW_FUN_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D; + +WGLEW_FUN_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D; + +WGLEW_FUN_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV; +WGLEW_FUN_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV; +WGLEW_FUN_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV; +WGLEW_FUN_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV; + +WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV; + +WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV; +WGLEW_FUN_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV; + +WGLEW_FUN_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV; +WGLEW_FUN_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV; +WGLEW_FUN_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV; +WGLEW_FUN_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV; + +WGLEW_FUN_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV; +WGLEW_FUN_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV; +WGLEW_FUN_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV; + +WGLEW_FUN_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML; +WGLEW_FUN_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML; +WGLEW_FUN_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_render_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_application_isolation; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_share_group_isolation; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_depth_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_display_color_table; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control_tear; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_digital_video_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_gamma; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_genlock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_image_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_present_video; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_depth_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_swap_group; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_vertex_array_range; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_capture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_output; +WGLEW_VAR_EXPORT GLboolean __WGLEW_OML_sync_control; + +#ifdef GLEW_MX +}; /* WGLEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX + +typedef struct WGLEWContextStruct WGLEWContext; +GLEWAPI GLenum GLEWAPIENTRY wglewContextInit (WGLEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext *ctx, const char *name); + +#define wglewInit() wglewContextInit(wglewGetContext()) +#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x) + +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x)) +#define WGLEW_GET_FUN(x) wglewGetContext()->x + +#else /* GLEW_MX */ + +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define WGLEW_GET_FUN(x) x + +GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name); + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#undef GLEWAPI + +#endif /* __wglew_h__ */ diff --git a/external/steamworks/steamworksexample/GameEngine.h b/external/steamworks/steamworksexample/GameEngine.h new file mode 100644 index 0000000..67dfa4a --- /dev/null +++ b/external/steamworks/steamworksexample/GameEngine.h @@ -0,0 +1,224 @@ +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Main class for the game engine +// +// $NoKeywords: $ +//============================================================================= + +#ifndef GAMEENGINE_H +#define GAMEENGINE_H + +#include +#include + +// Typedef for font handles +typedef int HGAMEFONT; + +// Typedef for vertex buffer handles +typedef int HGAMEVERTBUF; + +// Typedef for texture handles +typedef int HGAMETEXTURE; + + +// Typedef for voice channels +typedef int HGAMEVOICECHANNEL; + +// BDrawText position flags +#define TEXTPOS_TOP 0x00000000 +#define TEXTPOS_LEFT 0x00000000 +#define TEXTPOS_CENTER 0x00000001 +#define TEXTPOS_RIGHT 0x00000002 +#define TEXTPOS_VCENTER 0x00000004 +#define TEXTPOS_BOTTOM 0x00000008 + + +#define VOICE_OUTPUT_SAMPLE_RATE 11000 // real sample rate is 11025 but for XAudio2 it must be a multiple of XAUDIO2_QUANTUM_DENOMINATOR +#define VOICE_OUTPUT_SAMPLE_RATE_IDEAL 11025 +#define BYTES_PER_SAMPLE 2 + +// Texture formats we support for upload to textures +enum ETEXTUREFORMAT +{ + eTextureFormat_RGBA, // 8 bits per channel + eTextureFormat_BGRA, // 8 bits per channel + eTextureFormat_BGRA16, // 16 bits per channel +}; + +#define MAX_CONTROLLERS 4 + +enum ECONTROLLERDIGITALACTION +{ + eControllerDigitalAction_TurnLeft, + eControllerDigitalAction_TurnRight, + eControllerDigitalAction_ForwardThrust, + eControllerDigitalAction_ReverseThrust, + eControllerDigitalAction_FireLasers, + eControllerDigitalAction_PauseMenu, + + eControllerDigitalAction_MenuUp, + eControllerDigitalAction_MenuDown, + eControllerDigitalAction_MenuLeft, + eControllerDigitalAction_MenuRight, + eControllerDigitalAction_MenuSelect, + eControllerDigitalAction_MenuCancel, + + eControllerDigitalAction_NumActions +}; + +enum ECONTROLLERANALOGACTION +{ + eControllerAnalogAction_AnalogControls, + + eControllerAnalogAction_NumActions +}; + +enum ECONTROLLERACTIONSET +{ + eControllerActionSet_ShipControls, + eControllerActionSet_MenuControls, + eControllerActionSet_Layer_Thrust, + + eControllerActionSet_NumSets +}; + +// used for VR support +namespace vr { class IVRSystem; } + +// +// Interface that needs to be implemented for game engines on all platforms +// +class IGameEngine +{ +public: + + // Just here to stop warnings on non-virtual destructor in gcc builds + virtual ~IGameEngine() {}; + + // Check if the game engine is initialized ok and ready for use + virtual bool BReadyForUse() = 0; + + // Check if the engine is shutting down + virtual bool BShuttingDown() = 0; + + // Set the background color + virtual void SetBackgroundColor( short a, short r, short g, short b ) = 0; + + // Start a frame, clear(), beginscene(), etc + virtual bool StartFrame() = 0; + + // Finish a frame, endscene(), present(), etc. + virtual void EndFrame() = 0; + + // Shutdown the game engine + virtual void Shutdown() = 0; + + // Pump messages from the OS + virtual void MessagePump() = 0; + + // Accessors for game screen size + virtual int32 GetViewportWidth() = 0; + virtual int32 GetViewportHeight() = 0; + + // Function for drawing text to the screen, dwFormat is a combination of flags like DT_LEFT, TEXTPOS_VCENTER etc... + virtual bool BDrawString( HGAMEFONT hFont, RECT rect, DWORD dwColor, DWORD dwFormat, const char *pchText ) = 0; + + // Create a new font returning our internal handle value for it (0 means failure) + virtual HGAMEFONT HCreateFont( int nHeight, int nFontWeight, bool bItalic, const char * pchFont ) = 0; + + // Create a new texture returning our internal handle value for it (0 means failure), texture type specifies the type of data contained in pData + virtual HGAMETEXTURE HCreateTexture( byte *pData, uint32 uWidth, uint32 uHeight, ETEXTUREFORMAT eTextureFormat = eTextureFormat_RGBA ) = 0; + + // update an existing texture, texture type specifies the type of data contained in pData + virtual bool UpdateTexture( HGAMETEXTURE texture, byte *pData, uint32 uWidth, uint32 uHeight, ETEXTUREFORMAT eTextureFormat = eTextureFormat_RGBA ) = 0; + + // Draw a line, the engine itself will manage batching these (although you can explicitly flush if you need to) + virtual bool BDrawLine( float xPos0, float yPos0, DWORD dwColor0, float xPos1, float yPos1, DWORD dwColor1 ) = 0; + + // Flush the line buffer + virtual bool BFlushLineBuffer() = 0; + + // Draw a point, the engine itself will manage batching these (although you can explicitly flush if you need to) + virtual bool BDrawPoint( float xPos, float yPos, DWORD dwColor ) = 0; + + // Flush the point buffer + virtual bool BFlushPointBuffer() = 0; + + // Draw a filled quad + virtual bool BDrawFilledRect( float xPos0, float yPos0, float xPos1, float yPos1, DWORD dwColor ) = 0; + + // Draw a textured rectangle + virtual bool BDrawTexturedRect( float xPos0, float yPos0, float xPos1, float yPos1, + float u0, float v0, float u1, float v1, DWORD dwColor, HGAMETEXTURE hTexture ) = 0; + + // Draw a textured arbitrary quad + virtual bool BDrawTexturedQuad( float xPos0, float yPos0, float xPos1, float yPos1, float xPos2, float yPos2, float xPos3, float yPos3, + float u0, float v0, float u1, float v1, DWORD dwColor, HGAMETEXTURE hTexture ) = 0; + + // Flush any still cached quad buffers + virtual bool BFlushQuadBuffer() = 0; + + // Get the current state of a key + virtual bool BIsKeyDown( DWORD dwVK ) = 0; + + // Get the first (in some arbitrary order) key down, if any + virtual bool BGetFirstKeyDown( DWORD *pdwVK ) = 0; + + // Return true if there is an active Steam Controller + virtual bool BIsSteamInputDeviceActive() = 0; + + // Get the current state of a controller action + virtual bool BIsControllerActionActive( ECONTROLLERDIGITALACTION dwAction ) = 0; + + // Find an active Steam controller + virtual void FindActiveSteamInputDevice() = 0; + + // Get the current state of a controller analog action + virtual void GetControllerAnalogAction( ECONTROLLERANALOGACTION dwAction, float *x, float *y ) = 0; + + // Set the current Steam Controller Action set + virtual void SetSteamControllerActionSet( ECONTROLLERACTIONSET dwActionSet ) = 0; + + // Set an Action Set Layer for Steam Input + virtual void ActivateSteamControllerActionSetLayer( ECONTROLLERACTIONSET dwActionSet ) = 0; + virtual void DeactivateSteamControllerActionSetLayer( ECONTROLLERACTIONSET dwActionSet ) = 0; + + // Returns whether a given action set layer is active + virtual bool BIsActionSetLayerActive( ECONTROLLERACTIONSET dwActionSetLayer ) = 0; + + // These calls return a string describing which controller button the action is currently bound to + virtual const char *GetTextStringForControllerOriginDigital( ECONTROLLERACTIONSET dwActionSet, ECONTROLLERDIGITALACTION dwDigitalAction ) = 0; + virtual const char *GetTextStringForControllerOriginAnalog( ECONTROLLERACTIONSET dwActionSet, ECONTROLLERANALOGACTION dwDigitalAction ) = 0; + + virtual void SetControllerColor( uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ) = 0; + virtual void SetTriggerEffect( bool bEnabled ) = 0; + virtual void TriggerControllerVibration( unsigned short nLeftSpeed, unsigned short nRightSpeed ) = 0; + virtual void TriggerControllerHaptics( ESteamControllerPad ePad, unsigned short usOnMicroSec, unsigned short usOffMicroSec, unsigned short usRepeat ) = 0; + + // Get current tick count for the game engine + virtual uint64 GetGameTickCount() = 0; + + // Tell the game engine to update current tick count + virtual void UpdateGameTickCount() = 0; + + // Tell the game engine to sleep for a bit if needed to limit frame rate. Returns + // true if you need to keep calling it to sleep more to reach your limit, returns + // false when you should proceed to the next frame. + virtual bool BSleepForFrameRateLimit( uint32 ulMaxFrameRate ) = 0; + + // Get the tick count elapsed since the previous frame + // bugbug - We use this time to compute things like thrust and acceleration in the game, + // so it's important in doesn't jump ahead by large increments... Need a better + // way to handle that. + virtual uint64 GetGameTicksFrameDelta() = 0; + + // Check if the game engine hwnd currently has focus (and a working d3d device) + virtual bool BGameEngineHasFocus() = 0; + + // Voice chat functions + virtual HGAMEVOICECHANNEL HCreateVoiceChannel() = 0; + virtual void DestroyVoiceChannel( HGAMEVOICECHANNEL hChannel ) = 0; + virtual bool AddVoiceData( HGAMEVOICECHANNEL hChannel, const uint8 *pVoiceData, uint32 uLength ) = 0; +}; + +#endif // GAMEENGINE_H diff --git a/external/steamworks/steamworksexample/Inventory.cpp b/external/steamworks/steamworksexample/Inventory.cpp new file mode 100644 index 0000000..a21797d --- /dev/null +++ b/external/steamworks/steamworksexample/Inventory.cpp @@ -0,0 +1,363 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for tracking inventory +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" +#include "Inventory.h" +#include "SpaceWarClient.h" + + +//----------------------------------------------------------------------------- +// Purpose: singleton instance of CSpaceWarLocalInventory +//----------------------------------------------------------------------------- +CSpaceWarLocalInventory *SpaceWarLocalInventory() +{ + static CSpaceWarLocalInventory inv; + return &inv; +} + +CSpaceWarLocalInventory::CSpaceWarLocalInventory() +: m_SteamInventoryResult( this, &CSpaceWarLocalInventory::OnSteamInventoryResult ), + m_SteamInventoryFullUpdate( this, &CSpaceWarLocalInventory::OnSteamInventoryFullUpdate ) +{ + m_hPlaytimeRequestResult = k_SteamInventoryResultInvalid; + m_hPromoRequestResult = k_SteamInventoryResultInvalid; + m_hLastFullUpdate = k_SteamInventoryResultInvalid; + m_hExchangeRequestResult = k_SteamInventoryResultInvalid; + + m_LastDropInstanceID = k_SteamItemInstanceIDInvalid; + + // Indicate that this game has a use for item definition properties (we look up "name"). + // If your game hardcodes the complete set of items, then you can probably skip this call. + SteamInventory()->LoadItemDefinitions(); + + // If there are any promotional items which your game offers (or may offer in the future) + // then this is the call that will grant them. Promotional items are a result of meeting + // some external criteria like owning another specific game. These criteria are specified + // in your Steamworks item definitions. + SteamInventory()->GrantPromoItems( &m_hPromoRequestResult ); + +#ifdef _DEBUG + GrantTestItems(); +#endif + + // We could pass a variable to receive the result handle, for + // comparison to the handle in SteamInventoryResultReady_t, + // but this simple example does not bother to keep track of + // multiple in-flight API calls. + SteamInventory()->GetAllItems( NULL ); // this will fire off FullUpdate and then ResultReady +} + +//----------------------------------------------------------------------------- +// Purpose: Handles notification that GetAllItems has refreshed the local inventory +//----------------------------------------------------------------------------- +void CSpaceWarLocalInventory::OnSteamInventoryFullUpdate( SteamInventoryFullUpdate_t *callback ) +{ + // This callback triggers immediately before the ResultReady callback. We shouldn't + // free the result handle here, as we wil always free it at the end of ResultReady. + + bool bGotResult = false; + std::vector vecDetails; + uint32 count = 0; + if ( SteamInventory()->GetResultItems( callback->m_handle, NULL, &count ) ) + { + vecDetails.resize( count ); + bGotResult = SteamInventory()->GetResultItems( callback->m_handle, vecDetails.data(), &count ); + } + + if ( bGotResult ) + { + // For everything already in the inventory, check for update (exists in result) or removal (does not exist) + std::list::iterator iter; + for ( iter = m_listPlayerItems.begin(); iter != m_listPlayerItems.end(); /*incr at end of loop*/ ) + { + bool bFound = false; + for ( size_t i = 0; i < vecDetails.size(); i++ ) + { + if ( (*iter)->GetItemId() == vecDetails[i].m_itemId ) + { + // Update item with matching item id + (*iter)->m_Details = vecDetails[i]; + + // Remove elements from the result vector as we process updates (fast swap-and-pop removal) + if ( i < vecDetails.size() - 1 ) + vecDetails[i] = vecDetails.back(); + vecDetails.pop_back(); + + bFound = true; + break; + } + } + + if ( !bFound ) + { + // No items in the full update match the existing item. Delete current iterator and advance. + delete *iter; + iter = m_listPlayerItems.erase( iter ); + } + else + { + // Increment iterator without deleting. + ++iter; + } + } + + // Anything remaining in the result vector is a new item, since we removed all the updates. + for ( size_t i = 0; i < vecDetails.size(); ++i ) + { + CSpaceWarItem *item = new CSpaceWarItem(); + item->m_Details = vecDetails[i]; + m_listPlayerItems.push_back( item ); + } + } + + // Remember that we just processed this full update to avoid doing work in ResultReady + m_hLastFullUpdate = callback->m_handle; +} + +//----------------------------------------------------------------------------- +// Purpose: Handles notification that the inventory is updated +//----------------------------------------------------------------------------- +void CSpaceWarLocalInventory::OnSteamInventoryResult( SteamInventoryResultReady_t *callback ) +{ + // Ignore results that belong to some other SteamID - this normally won't happen, unless you start + // calling SerializeResult/DeserializeResult, but it is better to be safe. Also ignore anything that + // we just processed in OnSteamInventoryFullUpdate to avoid duplicate work. + if ( callback->m_result == k_EResultOK && m_hLastFullUpdate != callback->m_handle && + SteamInventory()->CheckResultSteamID( callback->m_handle, SpaceWarClient()->GetLocalSteamID() ) ) + { + bool bGotResult = false; + std::vector vecDetails; + uint32 count = 0; + if ( SteamInventory()->GetResultItems( callback->m_handle, NULL, &count ) ) + { + vecDetails.resize( count ); + bGotResult = SteamInventory()->GetResultItems( callback->m_handle, vecDetails.data(), &count ); + } + + if ( bGotResult ) + { + // For everything already in the inventory, check for update or removal + std::list::iterator iter; + for ( iter = m_listPlayerItems.begin(); iter != m_listPlayerItems.end(); /*incr at end of loop*/ ) + { + bool bDestroy = false; + for ( size_t i = 0; i < vecDetails.size(); i++ ) + { + if ( (*iter)->GetItemId() == vecDetails[i].m_itemId ) + { + // If flagged for removal by a partial update, remove it + if ( vecDetails[i].m_unFlags & k_ESteamItemRemoved ) + { + bDestroy = true; + } + else + { + (*iter)->m_Details = vecDetails[i]; + } + + // Remove elements from the result vector as we process updates (fast swap-and-pop removal) + if ( i < vecDetails.size() - 1 ) + vecDetails[i] = vecDetails.back(); + vecDetails.pop_back(); + + break; + } + } + + if ( bDestroy ) + { + // Delete list element at current iterator and advance. + delete *iter; + iter = m_listPlayerItems.erase( iter ); + } + else + { + // Increment iterator without deleting. + ++iter; + } + } + + // Anything remaining in the result vector is a new item, unless flagged for removal by an operation result. + for ( size_t i = 0; i < vecDetails.size(); ++i ) + { + if ( !( vecDetails[i].m_unFlags & k_ESteamItemRemoved ) ) + { + CSpaceWarItem *item = new CSpaceWarItem(); + item->m_Details = vecDetails[i]; + m_listPlayerItems.push_back( item ); + } + } + } + } + + // Clear out any pending handles. + if ( callback->m_handle == m_hPlaytimeRequestResult ) + m_hPlaytimeRequestResult = -1; + if ( callback->m_handle == m_hExchangeRequestResult ) + m_hExchangeRequestResult = -1; + if ( callback->m_handle == m_hPromoRequestResult ) + m_hPromoRequestResult = -1; + if ( callback->m_handle == m_hLastFullUpdate ) + m_hLastFullUpdate = -1; + + // We're not hanging on the the result after processing it. + SteamInventory()->DestroyResult( callback->m_handle ); +} + +void CSpaceWarLocalInventory::CheckForItemDrops() +{ + SteamInventory()->TriggerItemDrop( &m_hPlaytimeRequestResult, k_SpaceWarItem_TimedDropList ); +} + +void CSpaceWarLocalInventory::ModifyItemProperties() +{ + const CSpaceWarItem *item100 = GetInstanceOf( k_SpaceWarItem_ShipDecoration1 ); + if ( item100 ) + { + SteamInventoryUpdateHandle_t updateHandle = SteamInventory()->StartUpdateProperties(); + SteamInventory()->SetProperty( updateHandle, item100->GetItemId(), "string_value", "blah" ); + SteamInventory()->SetProperty( updateHandle, item100->GetItemId(), "bool_value", true ); + SteamInventory()->SetProperty( updateHandle, item100->GetItemId(), "int64_value", (int64)55 ); + SteamInventory()->SetProperty( updateHandle, item100->GetItemId(), "float_value", 123.456f ); + SteamInventoryResult_t resultHandle; + SteamInventory()->SubmitUpdateProperties( updateHandle, &resultHandle ); + } +} + +void CSpaceWarLocalInventory::DoExchange() +{ + const CSpaceWarItem *item100 = GetInstanceOf( k_SpaceWarItem_ShipDecoration1 ); + const CSpaceWarItem *item101 = GetInstanceOf( k_SpaceWarItem_ShipDecoration2 ); + const CSpaceWarItem *item102 = GetInstanceOf( k_SpaceWarItem_ShipDecoration3 ); + const CSpaceWarItem *item103 = GetInstanceOf( k_SpaceWarItem_ShipDecoration4 ); + if ( item100 && item101 && item102 && item103 ) + { + SteamItemInstanceID_t inputItems[4]; + uint32 inputQuantities[4]; + inputItems[0] = item100->GetItemId(); + inputQuantities[0] = 1; + inputItems[1] = item101->GetItemId(); + inputQuantities[1] = 1; + inputItems[2] = item102->GetItemId(); + inputQuantities[2] = 1; + inputItems[3] = item103->GetItemId(); + inputQuantities[3] = 1; + SteamItemDef_t outputItems[1]; + outputItems[0] = 110; + uint32 outputQuantity[1]; + outputQuantity[0] = 1; + SteamInventory()->ExchangeItems( &m_hExchangeRequestResult, outputItems, outputQuantity, 1, inputItems, inputQuantities, 4 ); + } +} + +void CSpaceWarLocalInventory::GrantTestItems() +{ + std::vector newItems; + newItems.push_back( k_SpaceWarItem_ShipDecoration1 ); + newItems.push_back( k_SpaceWarItem_ShipDecoration2 ); + SteamInventory()->GenerateItems( NULL, newItems.data(), NULL, (uint32) newItems.size() ); +} + +const CSpaceWarItem * CSpaceWarLocalInventory::GetItem( SteamItemInstanceID_t nItemId ) const +{ + std::list::const_iterator iter; + for ( iter = m_listPlayerItems.begin(); iter != m_listPlayerItems.end(); ++iter ) + { + if ( (*iter)->GetItemId() == nItemId ) + return (*iter); + } + return NULL; +} + +bool CSpaceWarLocalInventory::HasInstanceOf( SteamItemDef_t nDefinition ) const +{ + std::list::const_iterator iter; + for ( iter = m_listPlayerItems.begin(); iter != m_listPlayerItems.end(); ++iter ) + { + if ( ( *iter )->GetDefinition() == nDefinition ) + return true; + } + return false; +} + +uint32 CSpaceWarLocalInventory::GetNumOf( SteamItemDef_t nDefinition ) const +{ + uint32 unQuantity = 0; + std::list::const_iterator iter; + for ( iter = m_listPlayerItems.begin(); iter != m_listPlayerItems.end(); ++iter ) + { + if ( ( *iter )->GetDefinition() == nDefinition ) + { + unQuantity += (*iter)->GetQuantity(); + } + } + return unQuantity; +} + +const CSpaceWarItem * CSpaceWarLocalInventory::GetInstanceOf( SteamItemDef_t nDefinition ) const +{ + std::list::const_iterator iter; + for ( iter = m_listPlayerItems.begin(); iter != m_listPlayerItems.end(); ++iter ) + { + if ( ( *iter )->GetDefinition() == nDefinition ) + return (*iter); + } + return NULL; +} + +void CSpaceWarLocalInventory::RefreshFromServer() +{ + // This will trigger the SteamInventoryResultReady_t callback, + // and possibly the SteamInventoryFullUpdate_t callback first. + + // We could pass a variable to receive the result handle, for + // comparison to the handle in SteamInventoryResultReady_t, + // but this simple example does not bother to keep track of + // multiple in-flight API calls. + SteamInventory()->GetAllItems( NULL ); +} + + +std::string CSpaceWarItem::GetLocalizedName() const +{ + std::string ret; + char buf[512]; + uint32 bufSize = sizeof(buf); + if ( SteamInventory()->GetItemDefinitionProperty( GetDefinition(), "name", buf, &bufSize ) && bufSize <= sizeof(buf) ) + { + ret = buf; + } + else + { + ret = "(unknown)"; + } + return ret; +} + +std::string CSpaceWarItem::GetLocalizedDescription() const +{ + std::string ret; + char buf[2048]; + uint32 bufSize = sizeof(buf); + if ( SteamInventory()->GetItemDefinitionProperty( GetDefinition(), "description", buf, &bufSize ) && bufSize <= sizeof(buf) ) + { + ret = buf; + } + return ret; +} + +std::string CSpaceWarItem::GetIconURL() const +{ + std::string ret; + char buf[512]; + uint32 bufSize = sizeof(buf); + if ( SteamInventory()->GetItemDefinitionProperty( GetDefinition(), "icon_url", buf, &bufSize ) && bufSize <= sizeof(buf) ) + { + ret = buf; + } + return ret; +} diff --git a/external/steamworks/steamworksexample/Inventory.h b/external/steamworks/steamworksexample/Inventory.h new file mode 100644 index 0000000..61f798e --- /dev/null +++ b/external/steamworks/steamworksexample/Inventory.h @@ -0,0 +1,87 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for tracking stats and achievements +// +// $NoKeywords: $ +//============================================================================= + +#ifndef INVENTORY_H +#define INVENTORY_H + +#include "SpaceWar.h" +#include "GameEngine.h" +#include +#include + +class CSpaceWarItem; + +// These are hardcoded in the game and match the item definition IDs which were uploaded to Steam. +enum ESpaceWarItemDefIDs +{ + k_SpaceWarItem_TimedDropList = 10, + k_SpaceWarItem_ShipDecoration1 = 100, + k_SpaceWarItem_ShipDecoration2 = 101, + k_SpaceWarItem_ShipDecoration3 = 102, + k_SpaceWarItem_ShipDecoration4 = 103, + k_SpaceWarItem_ShipWeapon1 = 110, + k_SpaceWarItem_ShipWeapon2 = 111, + k_SpaceWarItem_ShipSpecial1 = 120, + k_SpaceWarItem_ShipSpecial2 = 121 +}; + + +class CSpaceWarLocalInventory +{ +public: + void RefreshFromServer(); + + void GrantTestItems(); + void CheckForItemDrops(); + void DoExchange(); + void ModifyItemProperties(); + + const std::list& GetItemList() const { return m_listPlayerItems; } + const CSpaceWarItem * GetItem( SteamItemInstanceID_t nItemId ) const; + const CSpaceWarItem * GetInstanceOf( SteamItemDef_t nDefinition ) const; + bool HasInstanceOf( SteamItemDef_t nDefinition ) const; + uint32 GetNumOf( SteamItemDef_t nDefinition ) const; + + bool IsWaitingForDropResults() const { return m_hPlaytimeRequestResult != k_SteamInventoryResultInvalid; } + const CSpaceWarItem * GetLastDroppedItem() const { return GetItem( m_LastDropInstanceID ); } + +private: + friend CSpaceWarLocalInventory *SpaceWarLocalInventory(); + CSpaceWarLocalInventory(); + STEAM_CALLBACK( CSpaceWarLocalInventory, OnSteamInventoryResult, SteamInventoryResultReady_t, m_SteamInventoryResult ); + STEAM_CALLBACK( CSpaceWarLocalInventory, OnSteamInventoryFullUpdate, SteamInventoryFullUpdate_t, m_SteamInventoryFullUpdate ); + +private: + SteamInventoryResult_t m_hPlaytimeRequestResult; + SteamInventoryResult_t m_hPromoRequestResult; + SteamInventoryResult_t m_hLastFullUpdate; + SteamInventoryResult_t m_hExchangeRequestResult; + + std::list m_listPlayerItems; + SteamItemInstanceID_t m_LastDropInstanceID; +}; + +CSpaceWarLocalInventory *SpaceWarLocalInventory(); + + +class CSpaceWarItem +{ +public: + SteamItemInstanceID_t GetItemId() const { return m_Details.m_itemId; } + SteamItemDef_t GetDefinition() const { return m_Details.m_iDefinition; } + uint16 GetQuantity() const { return m_Details.m_unQuantity; } + std::string GetLocalizedName() const; + std::string GetLocalizedDescription() const; + std::string GetIconURL() const; +private: + friend class CSpaceWarLocalInventory; + SteamItemDetails_t m_Details; +}; + + + +#endif // INVENTORY_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/ItemStore.cpp b/external/steamworks/steamworksexample/ItemStore.cpp new file mode 100644 index 0000000..fab08c0 --- /dev/null +++ b/external/steamworks/steamworksexample/ItemStore.cpp @@ -0,0 +1,158 @@ +//========= Copyright © Valve LLC, All rights reserved. ============ +// +// Purpose: Class for interacting with the Item Store +// +//============================================================================= + +#include "stdafx.h" +#include "ItemStore.h" +#include "BaseMenu.h" +#include +#include +#include + + +//----------------------------------------------------------------------------- +// Purpose: Menu that shows purchaseable items +//----------------------------------------------------------------------------- +class CItemStoreMenu : public CBaseMenu +{ +public: + + //----------------------------------------------------------------------------- + // Purpose: Constructor + //----------------------------------------------------------------------------- + CItemStoreMenu( IGameEngine *pGameEngine, CItemStore *pItemStore ) : CBaseMenu( pGameEngine ), m_pItemStore( pItemStore ) + { + + } + + //----------------------------------------------------------------------------- + // Purpose: Creates menu + //----------------------------------------------------------------------------- + void Rebuild() + { + PushSelectedItem(); + ClearMenuItems(); + + const std::vector &vecPurchaseableItems = m_pItemStore->GetPurchaseableItems(); + for ( uint32 i = 0; i < vecPurchaseableItems.size(); ++i ) + { + const PurchaseableItem_t &t = vecPurchaseableItems[i]; + AddItemToMenu( t ); + } + + PurchaseableItem_t menuItemBack = { 0, 0 }; + AddMenuItem( CItemStoreMenu::MenuItem_t( "Return to main menu", menuItemBack ) ); + + PopSelectedItem(); + } + +private: + + void AddItemToMenu( const PurchaseableItem_t &item ) + { + char bufName[512]; + uint32 bufNameSize = sizeof( bufName ); + if ( !SteamInventory()->GetItemDefinitionProperty( item.m_nItemDefID, "name", bufName, &bufNameSize ) && bufNameSize <= sizeof( bufName ) ) + { + return; + } + uint32 unQuantity = SpaceWarLocalInventory()->GetNumOf( item.m_nItemDefID ); + + char rgchBuffer[1024]; + sprintf_safe( rgchBuffer, "%u. Purchase %-25s %s %0.2f (own %u)", item.m_nItemDefID, bufName, m_pItemStore->GetCurrency(), float( item.m_ulPrice ) / 100, unQuantity ); + + AddMenuItem( CItemStoreMenu::MenuItem_t( rgchBuffer, item ) ); + } + + CItemStore *m_pItemStore; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CItemStore::CItemStore( IGameEngine *pGameEngine ) : m_pGameEngine( pGameEngine ) +{ + m_pItemStoreMenu = new CItemStoreMenu( pGameEngine, this ); + + Show(); +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CItemStore::RunFrame() +{ + m_pItemStoreMenu->RunFrame(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles menu actions when viewing purchaseable items +//----------------------------------------------------------------------------- +void CItemStore::OnMenuSelection( PurchaseableItem_t selection ) +{ + if ( selection.m_nItemDefID == 0 ) + { + SpaceWarClient()->SetGameState( k_EClientGameMenu ); + return; + } + + uint32 rgQuantity[1] = {1}; + SteamInventory()->StartPurchase( &selection.m_nItemDefID, rgQuantity, 1 ); +} + + +//----------------------------------------------------------------------------- +// Purpose: load all all purchaseable items +//----------------------------------------------------------------------------- +void CItemStore::LoadItemsWithPrices() +{ + m_vecPurchaseableItems.clear(); + + SteamAPICall_t hSteamAPICall = SteamInventory()->RequestPrices(); + m_SteamCallResultRequestPrices.Set( hSteamAPICall, this, &CItemStore::OnRequestPricesResult ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Request prices from the Steam Inventory Service +//----------------------------------------------------------------------------- +void CItemStore::OnRequestPricesResult( SteamInventoryRequestPricesResult_t *pParam, bool bIOFailure ) +{ + if ( pParam->m_result == k_EResultOK ) + { + strncpy( m_rgchCurrency, pParam->m_rgchCurrency, sizeof( m_rgchCurrency ) ); + + uint32 unItems = SteamInventory()->GetNumItemsWithPrices(); + std::vector vecItemDefs; + vecItemDefs.resize( unItems ); + std::vector vecPrices; + vecPrices.resize( unItems ); + + if ( SteamInventory()->GetItemsWithPrices( vecItemDefs.data(), vecPrices.data(), NULL, unItems ) ) + { + m_vecPurchaseableItems.reserve( unItems ); + for ( uint32 i = 0; i < unItems; ++i ) + { + PurchaseableItem_t t; + t.m_nItemDefID = vecItemDefs[i]; + t.m_ulPrice = vecPrices[i]; + m_vecPurchaseableItems.push_back( t ); + } + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Shows / Refreshes the friends list +//----------------------------------------------------------------------------- +void CItemStore::Show() +{ + m_pItemStoreMenu->Rebuild(); +} + diff --git a/external/steamworks/steamworksexample/ItemStore.h b/external/steamworks/steamworksexample/ItemStore.h new file mode 100644 index 0000000..9b8f734 --- /dev/null +++ b/external/steamworks/steamworksexample/ItemStore.h @@ -0,0 +1,53 @@ +//========= Copyright © Valve LLC, All rights reserved. ============ +// +// Purpose: Class for interacting with in-game store +// +//============================================================================= + +#ifndef ITEMSTORE_H +#define ITEMSTORE_H + +#include "SpaceWar.h" +#include "GameEngine.h" +#include "SpaceWarClient.h" + + +class CSpaceWarClient; +class CItemStoreMenu; + +class CItemStore +{ +public: + // Constructor + CItemStore( IGameEngine *pGameEngine ); + + // Run a frame + void RunFrame(); + + // shows / refreshes item store + void Show(); + + // handles input from item store menu + void OnMenuSelection( PurchaseableItem_t selection ); + + // ask the inventory service for things to purchase + void LoadItemsWithPrices(); + + const std::vector &GetPurchaseableItems() const { return m_vecPurchaseableItems; } + + const char *GetCurrency() const { return m_rgchCurrency; } + +private: + // callback when we ask the Inventory Service for prices + void OnRequestPricesResult( SteamInventoryRequestPricesResult_t *pParam, bool bIOFailure ); + CCallResult m_SteamCallResultRequestPrices; + char m_rgchCurrency[4]; + std::vector m_vecPurchaseableItems; + + // Engine + IGameEngine *m_pGameEngine; + + CItemStoreMenu *m_pItemStoreMenu; +}; + +#endif // ITEMSTORE_H diff --git a/external/steamworks/steamworksexample/Leaderboards.cpp b/external/steamworks/steamworksexample/Leaderboards.cpp new file mode 100644 index 0000000..0c56ae7 --- /dev/null +++ b/external/steamworks/steamworksexample/Leaderboards.cpp @@ -0,0 +1,321 @@ +//========= Copyright � 1996-2009, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for tracking leaderboards +// +//============================================================================= + +#include "stdafx.h" +#include "Leaderboards.h" +#include "BaseMenu.h" +#include + +//----------------------------------------------------------------------------- +// Purpose: Menu that shows a leaderboard +//----------------------------------------------------------------------------- +class CLeaderboardMenu : public CBaseMenu +{ + static const int k_nMaxLeaderboardEntries = 10; // maximum number of leaderboard entries we can display + LeaderboardEntry_t m_leaderboardEntries[k_nMaxLeaderboardEntries]; // leaderboard entries we received from DownloadLeaderboardEntries + int m_nLeaderboardEntries; // number of leaderboard entries we received + + SteamLeaderboard_t m_hSteamLeaderboard; // handle to the leaderboard we are displaying + ELeaderboardDataRequest m_eLeaderboardData; // type of data we are displaying + bool m_bLoading; // waiting to receive leaderboard results + bool m_bIOFailure; // last attempt to retrieve the leaderboard failed + + CCallResult m_callResultDownloadEntries; + +public: + + //----------------------------------------------------------------------------- + // Purpose: Constructor + //----------------------------------------------------------------------------- + CLeaderboardMenu( IGameEngine *pGameEngine ) : CBaseMenu( pGameEngine ) + { + m_hSteamLeaderboard = 0; + m_nLeaderboardEntries = 0; + m_bLoading = false; + m_bIOFailure = false; + } + + //----------------------------------------------------------------------------- + // Purpose: Menu that shows a leaderboard + //----------------------------------------------------------------------------- + void ShowLeaderboard( SteamLeaderboard_t hLeaderboard, ELeaderboardDataRequest eLeaderboardData, int offset ) + { + m_hSteamLeaderboard = hLeaderboard; + m_eLeaderboardData = eLeaderboardData; + m_bLoading = true; + m_bIOFailure = false; + + if ( hLeaderboard ) + { + // load the specified leaderboard data. We only display k_nMaxLeaderboardEntries entries at a time + SteamAPICall_t hSteamAPICall = SteamUserStats()->DownloadLeaderboardEntries( hLeaderboard, eLeaderboardData, + offset, offset + k_nMaxLeaderboardEntries ); + + // Register for the async callback + m_callResultDownloadEntries.Set( hSteamAPICall, this, &CLeaderboardMenu::OnLeaderboardDownloadedEntries ); + } + + Rebuild(); + } + + //----------------------------------------------------------------------------- + // Purpose: Creates leaderboard menu + //----------------------------------------------------------------------------- + void Rebuild() + { + PushSelectedItem(); + ClearMenuItems(); + + LeaderboardMenuItem_t menuItemBack = { true, false }; + LeaderboardMenuItem_t menuItemNextLeaderboard = { false, true }; + LeaderboardMenuItem_t menuItemEmpty = { 0 }; + + if ( m_hSteamLeaderboard ) + { + // create a header for the leaderboard + + std::string strName = "Leaderboard: "; + strName += SteamUserStats()->GetLeaderboardName( m_hSteamLeaderboard ); + + if ( m_eLeaderboardData == k_ELeaderboardDataRequestGlobal ) + strName += ", Top 10"; + else if ( m_eLeaderboardData == k_ELeaderboardDataRequestGlobalAroundUser ) + strName += ", Around User"; + else if ( m_eLeaderboardData == k_ELeaderboardDataRequestFriends ) + strName += ", Friends of User"; + + AddMenuItem( CLeaderboardMenu::MenuItem_t( strName, menuItemEmpty ) ); + } + + // create leaderboard + if ( !m_hSteamLeaderboard || m_bLoading ) + { + AddMenuItem( CLeaderboardMenu::MenuItem_t( "Loading...", menuItemEmpty ) ); + } + else if ( m_bIOFailure ) + { + AddMenuItem( CLeaderboardMenu::MenuItem_t( "Network failure!", menuItemEmpty ) ); + } + else + { + if ( m_nLeaderboardEntries == 0 ) + { + // Requesting for global scores around the user will return successfully with 0 results if the + // user does not have an entry on the leaderboard + + std::string strText; + if ( m_eLeaderboardData != k_ELeaderboardDataRequestGlobalAroundUser ) + { + strText = "No scores for this leaderboard"; + } + else + { + strText = SteamFriends()->GetPersonaName(); + strText += " does not have a score for this leaderboard"; + } + + AddMenuItem( CLeaderboardMenu::MenuItem_t( strText, menuItemEmpty ) ); + } + + for ( int index = 0; index < m_nLeaderboardEntries; index++ ) + { + char rgchMenuText[256]; + const char *pchName = SteamFriends()->GetFriendPersonaName( m_leaderboardEntries[index].m_steamIDUser ); + sprintf_safe( rgchMenuText, "(%d) %s - %d", m_leaderboardEntries[index].m_nGlobalRank, + pchName, m_leaderboardEntries[index].m_nScore ); + + AddMenuItem( MenuItem_t( std::string( rgchMenuText ), menuItemEmpty ) ); + } + } + + // navigation buttons + AddMenuItem( CLeaderboardMenu::MenuItem_t( "Next leaderboard", menuItemNextLeaderboard ) ); + AddMenuItem( CLeaderboardMenu::MenuItem_t( "Return to main menu", menuItemBack ) ); + + PopSelectedItem(); + } + + //----------------------------------------------------------------------------- + // Purpose: Called when SteamUserStats()->DownloadLeaderboardEntries() returns asynchronously + //----------------------------------------------------------------------------- + void OnLeaderboardDownloadedEntries( LeaderboardScoresDownloaded_t *pLeaderboardScoresDownloaded, bool bIOFailure ) + { + m_bLoading = false; + m_bIOFailure = bIOFailure; + + // leaderboard entries handle will be invalid once we return from this function. Copy all data now. + m_nLeaderboardEntries = MIN( pLeaderboardScoresDownloaded->m_cEntryCount, k_nMaxLeaderboardEntries ); + for ( int index = 0; index < m_nLeaderboardEntries; index++ ) + { + SteamUserStats()->GetDownloadedLeaderboardEntry( pLeaderboardScoresDownloaded->m_hSteamLeaderboardEntries, + index, &m_leaderboardEntries[ index ], NULL, 0 ); + } + + // show our new data + Rebuild(); + } +}; + + + + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CLeaderboards::CLeaderboards( IGameEngine *pGameEngine ) : m_pGameEngine( pGameEngine ) +{ + m_hQuickestWinLeaderboard = 0; + m_hFeetTraveledLeaderboard = 0; + m_nCurrentLeaderboard = 0; + + m_bLoading = false; + m_pLeaderboardMenu = new CLeaderboardMenu( pGameEngine ); + + FindLeaderboards(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Run a frame for the CLeaderboards +//----------------------------------------------------------------------------- +void CLeaderboards::RunFrame() +{ + m_pLeaderboardMenu->RunFrame(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles menu actions when viewing a leaderboard +//----------------------------------------------------------------------------- +void CLeaderboards::OnMenuSelection( LeaderboardMenuItem_t selection ) +{ + if ( selection.m_bBack ) + { + SpaceWarClient()->SetGameState( k_EClientGameMenu ); + } + else if ( selection.m_bNextLeaderboard ) + { + m_nCurrentLeaderboard = (m_nCurrentLeaderboard+1) % 2; + Show(); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Shows / Refreshes the leaderboard +//----------------------------------------------------------------------------- +void CLeaderboards::Show() +{ + if ( m_nCurrentLeaderboard == 0 ) + { + // we want to show the top 10. To do so, we request global score data beginning at 0 + m_pLeaderboardMenu->ShowLeaderboard( m_hQuickestWinLeaderboard, k_ELeaderboardDataRequestGlobal, 0 ); + } + else if ( m_nCurrentLeaderboard == 1 ) + { + // we want to show the 10 users around us + m_pLeaderboardMenu->ShowLeaderboard( m_hFeetTraveledLeaderboard, k_ELeaderboardDataRequestGlobalAroundUser, -5 ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Gets handles for our leaderboards. If the leaderboards don't exist, creates them. +// Each time this is called, we look up another leaderboard. +//----------------------------------------------------------------------------- +void CLeaderboards::FindLeaderboards() +{ + if ( m_bLoading ) + return; + + SteamAPICall_t hSteamAPICall = 0; + + if ( !m_hQuickestWinLeaderboard ) + { + // find/create a leaderboard for the quickest win + hSteamAPICall = SteamUserStats()->FindOrCreateLeaderboard( LEADERBOARD_QUICKEST_WIN, + k_ELeaderboardSortMethodAscending, k_ELeaderboardDisplayTypeTimeSeconds ); + } + else if ( !m_hFeetTraveledLeaderboard ) + { + // find/create a leaderboard for the most feet traveled in 1 round + hSteamAPICall = SteamUserStats()->FindOrCreateLeaderboard( LEADERBOARD_FEET_TRAVELED, + k_ELeaderboardSortMethodDescending, k_ELeaderboardDisplayTypeNumeric ); + } + + if ( hSteamAPICall != 0 ) + { + // set the function to call when this API call has completed + m_SteamCallResultCreateLeaderboard.Set( hSteamAPICall, this, &CLeaderboards::OnFindLeaderboard ); + m_bLoading = true; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Called when SteamUserStats()->FindOrCreateLeaderboard() returns asynchronously +//----------------------------------------------------------------------------- +void CLeaderboards::OnFindLeaderboard( LeaderboardFindResult_t *pFindLeaderboardResult, bool bIOFailure ) +{ + m_bLoading = false; + + // see if we encountered an error during the call + if ( !pFindLeaderboardResult->m_bLeaderboardFound || bIOFailure ) + return; + + // check to see which leaderboard handle we just retrieved + const char *pchName = SteamUserStats()->GetLeaderboardName( pFindLeaderboardResult->m_hSteamLeaderboard ); + if ( strcmp( pchName, LEADERBOARD_QUICKEST_WIN ) == 0 ) + m_hQuickestWinLeaderboard = pFindLeaderboardResult->m_hSteamLeaderboard; + else if ( strcmp( pchName, LEADERBOARD_FEET_TRAVELED ) == 0 ) + m_hFeetTraveledLeaderboard = pFindLeaderboardResult->m_hSteamLeaderboard; + + // look up any other leaderboards + FindLeaderboards(); + + // if the user is currently looking at a leaderboard, it might be one we didn't have a handle for yet. Update the leaderboard. + if ( SpaceWarClient()->GetGameState() == k_EClientLeaderboards ) + Show(); +} + + + +//----------------------------------------------------------------------------- +// Purpose: Updates leaderboards with stats from our just finished game +//----------------------------------------------------------------------------- +void CLeaderboards::UpdateLeaderboards( CStatsAndAchievements *pStats ) +{ + // if the user won, update the leaderboard with the time it took. If the user's previous time was faster, this time will be thrown out. + if ( m_hQuickestWinLeaderboard && SpaceWarClient()->BLocalPlayerWonLastGame() ) + { + SteamAPICall_t hSteamAPICall = SteamUserStats()->UploadLeaderboardScore( m_hQuickestWinLeaderboard, k_ELeaderboardUploadScoreMethodKeepBest, (int)pStats->GetGameDurationSeconds(), NULL, 0 ); + m_SteamCallResultUploadScore.Set( hSteamAPICall, this, &CLeaderboards::OnUploadScore ); + } + + // update the leaderboard for the most feet traveled in 1 round. If the user previously traveled farther in a round than this one, + // this value will be thrown out + if ( m_hFeetTraveledLeaderboard ) + { + SteamUserStats()->UploadLeaderboardScore( m_hFeetTraveledLeaderboard, k_ELeaderboardUploadScoreMethodKeepBest, (int)pStats->GetGameFeetTraveled(), NULL, 0 ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Called when SteamUserStats()->UploadLeaderboardScore() returns asynchronously +//----------------------------------------------------------------------------- +void CLeaderboards::OnUploadScore( LeaderboardScoreUploaded_t *pScoreUploadedResult, bool bIOFailure ) +{ + if ( !pScoreUploadedResult->m_bSuccess ) + { + // error + } + + if ( pScoreUploadedResult->m_bScoreChanged ) + { + // could display new rank + } +} diff --git a/external/steamworks/steamworksexample/Leaderboards.h b/external/steamworks/steamworksexample/Leaderboards.h new file mode 100644 index 0000000..7473c7e --- /dev/null +++ b/external/steamworks/steamworksexample/Leaderboards.h @@ -0,0 +1,64 @@ +//========= Copyright © 1996-2009, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for tracking leaderboards +// +//============================================================================= + +#ifndef LEADERBOARDS_H +#define LEADERBOARDS_H + +#include "SpaceWar.h" +#include "GameEngine.h" +#include "StatsAndAchievements.h" +#include "SpaceWarClient.h" + + +class ISteamUser; +class CSpaceWarClient; +class CLeaderboardMenu; + +class CLeaderboards +{ +public: + // Constructor + CLeaderboards( IGameEngine *pGameEngine ); + + // Run a frame + void RunFrame(); + + // shows / refreshes leaderboard + void Show(); + + // Updates leaderboards with stats from our just finished game + void UpdateLeaderboards( CStatsAndAchievements *pStats ); + + // handles input from leaderboard menu + void OnMenuSelection( LeaderboardMenuItem_t selection ); + +private: + void FindLeaderboards(); + + // Engine + IGameEngine *m_pGameEngine; + + // Called when SteamUserStats()->FindOrCreateLeaderboard() returns asynchronously + void OnFindLeaderboard( LeaderboardFindResult_t *pFindLearderboardResult, bool bIOFailure ); + CCallResult m_SteamCallResultCreateLeaderboard; + + // Called when SteamUserStats()->UploadLeaderboardScore() returns asynchronously + void OnUploadScore( LeaderboardScoreUploaded_t *pFindLearderboardResult, bool bIOFailure ); + CCallResult m_SteamCallResultUploadScore; + + // handles to our leaderboards + SteamLeaderboard_t m_hQuickestWinLeaderboard; + SteamLeaderboard_t m_hFeetTraveledLeaderboard; + + int m_bLoading; // true if we looking up a leaderboard handle + + + CLeaderboardMenu *m_pLeaderboardMenu; // Displays the current leaderboard + int m_nCurrentLeaderboard; // Index for leaderboard the user is currently viewing + +}; + +#endif // LEADERBOARDS_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/Lobby.cpp b/external/steamworks/steamworksexample/Lobby.cpp new file mode 100644 index 0000000..b0aeb0c --- /dev/null +++ b/external/steamworks/steamworksexample/Lobby.cpp @@ -0,0 +1,382 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for handling finding & creating lobbies, getting their details, +// and seeing other users in the current lobby +// +//============================================================================= + +#include "stdafx.h" +#include "Lobby.h" +#include "SpaceWarClient.h" +#include "p2pauth.h" + + +//----------------------------------------------------------------------------- +// Purpose: Menu that shows a list of other users in a lobby +//----------------------------------------------------------------------------- +class CLobbyMenu : public CBaseMenu +{ +public: + // Constructor + CLobbyMenu( IGameEngine *pGameEngine ) : CBaseMenu( pGameEngine ) {} + + void Rebuild( const CSteamID &steamIDLobby ) + { + PushSelectedItem(); + ClearMenuItems(); + + if ( !steamIDLobby.IsValid() ) + { + LobbyMenuItem_t menuItem = { CSteamID(), LobbyMenuItem_t::k_ELobbyMenuItemLeaveLobby }; + AddMenuItem( CLobbyMenu::MenuItem_t( "Lobby Disconnected - Return to main menu", menuItem ) ); + return; + } + + // list of users in lobby + // iterate all the users in the lobby and show their details + int cLobbyMembers = SteamMatchmaking()->GetNumLobbyMembers( steamIDLobby ); + for ( int i = 0; i < cLobbyMembers; i++ ) + { + CSteamID steamIDLobbyMember = SteamMatchmaking()->GetLobbyMemberByIndex( steamIDLobby, i ) ; + + // we get the details of a user from the ISteamFriends interface + const char *pchName = SteamFriends()->GetFriendPersonaName( steamIDLobbyMember ); + // we may not know the name of the other users in the lobby immediately; but we'll receive + // a PersonaStateUpdate_t callback when they do, and we'll rebuild the list then + if ( pchName && *pchName ) + { + const char *pchReady = SteamMatchmaking()->GetLobbyMemberData( steamIDLobby, steamIDLobbyMember, "ready" ); + bool bReady = ( pchReady && atoi( pchReady ) == 1); + LobbyMenuItem_t menuItem = { steamIDLobbyMember, LobbyMenuItem_t::k_ELobbyMenuItemUser }; + + char rgchMenuText[256]; + sprintf_safe( rgchMenuText, "%s %s", pchName, bReady ? "(READY)" : "" ); + AddMenuItem( MenuItem_t( std::string( rgchMenuText ), menuItem ) ); + } + } + + + // ready/not ready toggle + { + const char *pchReady = SteamMatchmaking()->GetLobbyMemberData( steamIDLobby, SteamUser()->GetSteamID(), "ready" ); + bool bReady = ( pchReady && atoi( pchReady ) == 1 ); + LobbyMenuItem_t menuItem = { CSteamID(), LobbyMenuItem_t::k_ELobbyMenuItemToggleReadState }; + if ( bReady ) + AddMenuItem( CLobbyMenu::MenuItem_t( "Set myself as Not Ready", menuItem ) ); + else + AddMenuItem( CLobbyMenu::MenuItem_t( "Set myself as Ready", menuItem ) ); + } + + // see if the local user is the owner of this lobby + bool bLobbyOwner = false; + if ( SteamUser()->GetSteamID() == SteamMatchmaking()->GetLobbyOwner( steamIDLobby ) ) + { + bLobbyOwner = true; + } + + // start game + if ( bLobbyOwner ) + { + LobbyMenuItem_t menuItem = { CSteamID(), LobbyMenuItem_t::k_ELobbyMenuItemStartGame }; + AddMenuItem( CLobbyMenu::MenuItem_t( "Start game", menuItem ) ); + } + + // invite friend + { + LobbyMenuItem_t menuItem = { CSteamID(), LobbyMenuItem_t::k_ELobbyMenuItemInviteToLobby, steamIDLobby }; + AddMenuItem( CLobbyMenu::MenuItem_t( "Invite Friend", menuItem ) ); + } + + + // exit lobby + { + LobbyMenuItem_t menuItem = { CSteamID(), LobbyMenuItem_t::k_ELobbyMenuItemLeaveLobby }; + AddMenuItem( CLobbyMenu::MenuItem_t( "Return to main menu", menuItem ) ); + } + + // reset selection + PopSelectedItem(); + } +}; + + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CLobby::CLobby( IGameEngine *pGameEngine ) : + m_pGameEngine( pGameEngine ), + m_CallbackPersonaStateChange( this, &CLobby::OnPersonaStateChange ), + m_CallbackLobbyDataUpdate( this, &CLobby::OnLobbyDataUpdate ), + m_CallbackChatDataUpdate( this, &CLobby::OnLobbyChatUpdate ) +{ + m_pMenu = new CLobbyMenu( pGameEngine ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Destructor +//----------------------------------------------------------------------------- +CLobby::~CLobby() +{ + +} + + +//----------------------------------------------------------------------------- +// Purpose: Sets the ID of the lobby to display +//----------------------------------------------------------------------------- +void CLobby::SetLobbySteamID( const CSteamID &steamIDLobby ) +{ + m_steamIDLobby = steamIDLobby; + m_pMenu->Rebuild( m_steamIDLobby ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Draws the lobby +//----------------------------------------------------------------------------- +void CLobby::RunFrame() +{ + m_pMenu->RunFrame(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles a user in the lobby changing their name or details +// ( note: joining and leaving is handled below by CLobby::OnLobbyChatUpdate() ) +//----------------------------------------------------------------------------- +void CLobby::OnPersonaStateChange( PersonaStateChange_t *pCallback ) +{ + // callbacks are broadcast to all listeners, so we'll get this for every friend who changes state + // so make sure the user is in the lobby before acting + if ( !SteamFriends()->IsUserInSource( pCallback->m_ulSteamID, m_steamIDLobby ) ) + return; + + // rebuild the menu + m_pMenu->Rebuild( m_steamIDLobby ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles lobby data changing +//----------------------------------------------------------------------------- +void CLobby::OnLobbyDataUpdate( LobbyDataUpdate_t *pCallback ) +{ + // callbacks are broadcast to all listeners, so we'll get this for every lobby we're requesting + if ( m_steamIDLobby != pCallback->m_ulSteamIDLobby ) + return; + + // set the heading + m_pMenu->SetHeading( SteamMatchmaking()->GetLobbyData( m_steamIDLobby, "name" ) ); + + // rebuild the menu + m_pMenu->Rebuild( m_steamIDLobby ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles users in the lobby joining or leaving +//----------------------------------------------------------------------------- +void CLobby::OnLobbyChatUpdate( LobbyChatUpdate_t *pCallback ) +{ + // callbacks are broadcast to all listeners, so we'll get this for every lobby we're requesting + if ( m_steamIDLobby != pCallback->m_ulSteamIDLobby ) + return; + + if ( pCallback->m_ulSteamIDUserChanged == SteamUser()->GetSteamID().ConvertToUint64() && + ( pCallback->m_rgfChatMemberStateChange & + ( k_EChatMemberStateChangeLeft| + k_EChatMemberStateChangeDisconnected| + k_EChatMemberStateChangeKicked| + k_EChatMemberStateChangeBanned ) ) ) + { + // we've left the lobby, so it is now invalid + m_steamIDLobby = CSteamID(); + } + + // rebuild the menu + m_pMenu->Rebuild( m_steamIDLobby ); + + + int cLobbyMembers = SteamMatchmaking()->GetNumLobbyMembers( m_steamIDLobby ); + for ( int i = 0; i < cLobbyMembers; i++ ) + { + CSteamID steamIDLobbyMember = SteamMatchmaking()->GetLobbyMemberByIndex( m_steamIDLobby, i ) ; + + // ignore yourself. + if ( SteamUser()->GetSteamID() == steamIDLobbyMember ) + continue; + + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Menu that shows a list of lobbies to choose from +//----------------------------------------------------------------------------- +class CLobbyBrowserMenu : public CBaseMenu +{ +public: + // Constructor + CLobbyBrowserMenu( IGameEngine *pGameEngine ) : CBaseMenu( pGameEngine ) {} + + void ShowSearching() + { + PushSelectedItem(); + ClearMenuItems(); + + LobbyBrowserMenuItem_t data; + data.m_eStateToTransitionTo = k_EClientGameMenu; + AddMenuItem( CLobbyBrowserMenu::MenuItem_t( "Searching...", data ) ); + + data.m_eStateToTransitionTo = k_EClientGameMenu; + AddMenuItem( CLobbyBrowserMenu::MenuItem_t( "Return to main menu", data ) ); + + PopSelectedItem(); + } + + void Rebuild( std::list &listLobbies ) + { + PushSelectedItem(); + ClearMenuItems(); + + LobbyBrowserMenuItem_t data; + std::list::iterator iter; + + for( iter = listLobbies.begin(); iter != listLobbies.end(); ++iter ) + { + data.m_eStateToTransitionTo = k_EClientJoiningLobby; + data.m_steamIDLobby = iter->m_steamIDLobby; + if ( iter->m_rgchName[0] ) + { + AddMenuItem( MenuItem_t( std::string( iter->m_rgchName ), data ) ); + } + } + + data.m_eStateToTransitionTo = k_EClientGameMenu; + AddMenuItem( CLobbyBrowserMenu::MenuItem_t( "Return to main menu", data ) ); + + // reset selection + PopSelectedItem(); + } +}; + + +//----------------------------------------------------------------------------- +// Purpose: Constructor +// just initializes base data +//----------------------------------------------------------------------------- +CLobbyBrowser::CLobbyBrowser( IGameEngine *pGameEngine ) + : m_CallbackLobbyDataUpdated( this, &CLobbyBrowser::OnLobbyDataUpdatedCallback ) +{ + m_pGameEngine = pGameEngine; + m_pMenu = new CLobbyBrowserMenu( pGameEngine ); + m_pMenu->Rebuild( m_ListLobbies ); + m_pMenu->SetHeading( "Lobby browser" ); + m_bRequestingLobbies = false; +} + + +//----------------------------------------------------------------------------- +// Purpose: Destructor +//----------------------------------------------------------------------------- +CLobbyBrowser::~CLobbyBrowser() +{ + delete m_pMenu; +} + + +//----------------------------------------------------------------------------- +// Purpose: Run a frame (to handle KB input and such as well as render) +//----------------------------------------------------------------------------- +void CLobbyBrowser::RunFrame() +{ + m_pMenu->RunFrame(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Starts rebuilding the lobby list +//----------------------------------------------------------------------------- +void CLobbyBrowser::Refresh() +{ + if ( !m_bRequestingLobbies ) + { + m_bRequestingLobbies = true; + // request all lobbies for this game + SteamAPICall_t hSteamAPICall = SteamMatchmaking()->RequestLobbyList(); + // set the function to call when this API call has completed + m_SteamCallResultLobbyMatchList.Set( hSteamAPICall, this, &CLobbyBrowser::OnLobbyMatchListCallback ); + m_pMenu->ShowSearching(); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Callback, on a list of lobbies being received from the Steam back-end +//----------------------------------------------------------------------------- +void CLobbyBrowser::OnLobbyMatchListCallback( LobbyMatchList_t *pCallback, bool bIOFailure ) +{ + m_ListLobbies.clear(); + m_bRequestingLobbies = false; + + if ( bIOFailure ) + { + // we had a Steam I/O failure - we probably timed out talking to the Steam back-end servers + // doesn't matter in this case, we can just act if no lobbies were received + } + + // lobbies are returned in order of closeness to the user, so add them to the list in that order + for ( uint32 iLobby = 0; iLobby < pCallback->m_nLobbiesMatching; iLobby++ ) + { + CSteamID steamIDLobby = SteamMatchmaking()->GetLobbyByIndex( iLobby ); + + // add the lobby to the list + Lobby_t lobby; + lobby.m_steamIDLobby = steamIDLobby; + // pull the name from the lobby metadata + const char *pchLobbyName = SteamMatchmaking()->GetLobbyData( steamIDLobby, "name" ); + if ( pchLobbyName && pchLobbyName[0] ) + { + // set the lobby name + sprintf_safe( lobby.m_rgchName, "%s", pchLobbyName ); + } + else + { + // we don't have info about the lobby yet, request it + SteamMatchmaking()->RequestLobbyData( steamIDLobby ); + // results will be returned via LobbyDataUpdate_t callback + sprintf_safe( lobby.m_rgchName, "Lobby %d", steamIDLobby.GetAccountID() ); + } + + m_ListLobbies.push_back( lobby ); + } + + m_pMenu->Rebuild( m_ListLobbies ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Callback, on a list of lobbies being received from the Steam back-end +//----------------------------------------------------------------------------- +void CLobbyBrowser::OnLobbyDataUpdatedCallback( LobbyDataUpdate_t *pCallback ) +{ + // find the lobby in our local list + std::list::iterator iter; + for( iter = m_ListLobbies.begin(); iter != m_ListLobbies.end(); ++iter ) + { + // update the name of the lobby + if ( iter->m_steamIDLobby == pCallback->m_ulSteamIDLobby ) + { + // extract the display name from the lobby metadata + const char *pchLobbyName = SteamMatchmaking()->GetLobbyData( iter->m_steamIDLobby, "name" ); + if ( pchLobbyName[0] ) + { + sprintf_safe( iter->m_rgchName, "%s", pchLobbyName ); + // update the menu + m_pMenu->Rebuild( m_ListLobbies ); + } + return; + } + } +} diff --git a/external/steamworks/steamworksexample/Lobby.h b/external/steamworks/steamworksexample/Lobby.h new file mode 100644 index 0000000..1b75386 --- /dev/null +++ b/external/steamworks/steamworksexample/Lobby.h @@ -0,0 +1,95 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for handling finding & creating lobbies, getting their details, +// and seeing other users in the current lobby +// +//============================================================================= + +#ifndef LOBBY_H +#define LOBBY_H + +#include "SpaceWar.h" +#include "GameEngine.h" +#include "BaseMenu.h" +#include + +class CSpaceWarClient; +class CLobbyBrowserMenu; +class CLobbyMenu; + + +//----------------------------------------------------------------------------- +// Purpose: Displays the other users in a lobby and allows the game to be started +//----------------------------------------------------------------------------- +class CLobby +{ +public: + CLobby( IGameEngine *pGameEngine ); + ~CLobby(); + + // sets which lobby to display + void SetLobbySteamID( const CSteamID &steamIDLobby ); + + // Run a frame (to handle KB input and such as well as render) + void RunFrame(); + +private: + CSteamID m_steamIDLobby; + + // Pointer to engine instance (so we can draw stuff) + IGameEngine *m_pGameEngine; + + // Menu object + CLobbyMenu *m_pMenu; + + // user state change handler + STEAM_CALLBACK( CLobby, OnPersonaStateChange, PersonaStateChange_t, m_CallbackPersonaStateChange ); + + // lobby state change handler + STEAM_CALLBACK( CLobby, OnLobbyDataUpdate, LobbyDataUpdate_t, m_CallbackLobbyDataUpdate ); + STEAM_CALLBACK( CLobby, OnLobbyChatUpdate, LobbyChatUpdate_t, m_CallbackChatDataUpdate ); +}; + + +// an item in the list of lobbies we've found to display +struct Lobby_t +{ + CSteamID m_steamIDLobby; + char m_rgchName[256]; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Displaying and allows selection from a list of lobbies +//----------------------------------------------------------------------------- +class CLobbyBrowser +{ +public: + CLobbyBrowser( IGameEngine *pGameEngine ); + ~CLobbyBrowser(); + + // rebuild the list + void Refresh(); + + // Run a frame (to handle KB input and such as well as render) + void RunFrame(); + +private: + // Pointer to engine instance (so we can draw stuff) + IGameEngine *m_pGameEngine; + + // Track whether we are in the middle of a refresh or not + bool m_bRequestingLobbies; + + // Menu object + CLobbyBrowserMenu *m_pMenu; + + CCallResult m_SteamCallResultLobbyMatchList; + void OnLobbyMatchListCallback( LobbyMatchList_t *pLobbyMatchList, bool bIOFailure ); + STEAM_CALLBACK( CLobbyBrowser, OnLobbyDataUpdatedCallback, LobbyDataUpdate_t, m_CallbackLobbyDataUpdated ); + + std::list< Lobby_t > m_ListLobbies; +}; + + +#endif //LOBBY_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/Main.cpp b/external/steamworks/steamworksexample/Main.cpp new file mode 100644 index 0000000..a1bf4bc --- /dev/null +++ b/external/steamworks/steamworksexample/Main.cpp @@ -0,0 +1,377 @@ +//====== Copyright � 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: Main file for the SteamworksExample app +// +//============================================================================= + +#include "stdafx.h" +#include "steam/steam_api.h" +#ifdef WIN32 +#include +#else +#define MAX_PATH PATH_MAX +#include +#define _getcwd getcwd +#define _snprintf snprintf +#endif + +#if defined(WIN32) + #include "gameenginewin32.h" + #define atoll _atoi64 +#elif defined(OSX) + #include "GameEngine.h" + extern IGameEngine *CreateGameEngineOSX(); +#elif defined(SDL) + #include "GameEngine.h" + extern IGameEngine *CreateGameEngineSDL(); +#endif + +#include "SpaceWarClient.h" + +//----------------------------------------------------------------------------- +// Purpose: Wrapper around SteamAPI_WriteMiniDump which can be used directly +// as a se translator +//----------------------------------------------------------------------------- +#ifdef _WIN32 +void MiniDumpFunction( unsigned int nExceptionCode, EXCEPTION_POINTERS *pException ) +{ + MessageBox( nullptr, "Spacewar is crashing now!", "Unhandled Exception", MB_OK ); + + // You can build and set an arbitrary comment to embed in the minidump here, + // maybe you want to put what level the user was playing, how many players on the server, + // how much memory is free, etc... + SteamAPI_SetMiniDumpComment( "Minidump comment: SteamworksExample.exe\n" ); + + // The 0 here is a build ID, we don't set it + SteamAPI_WriteMiniDump( nExceptionCode, pException, 0 ); +} +#endif + + +//----------------------------------------------------------------------------- +// Purpose: Helper to display critical errors +//----------------------------------------------------------------------------- +int Alert( const char *lpCaption, const char *lpText ) +{ +#ifndef _WIN32 + fprintf( stderr, "Message: '%s', Detail: '%s'\n", lpCaption, lpText ); + return 0; +#else + return ::MessageBox( NULL, lpText, lpCaption, MB_OK ); +#endif +} + +//----------------------------------------------------------------------------- +// Purpose: callback hook for debug text emitted from the Steam API +//----------------------------------------------------------------------------- +extern "C" void __cdecl SteamAPIDebugTextHook( int nSeverity, const char *pchDebugText ) +{ + // if you're running in the debugger, only warnings (nSeverity >= 1) will be sent + // if you add -debug_steamapi to the command-line, a lot of extra informational messages will also be sent + ::OutputDebugString( pchDebugText ); + + if ( nSeverity >= 1 ) + { + // place to set a breakpoint for catching API errors + int x = 3; + (void)x; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Extracts some feature from the command line +//----------------------------------------------------------------------------- +bool ParseCommandLine( const char *pchCmdLine, const char **ppchServerAddress, const char **ppchLobbyID ) +{ + // Look for the +connect ipaddress:port parameter in the command line, + // Steam will pass this when a user has used the Steam Server browser to find + // a server for our game and is trying to join it. + const char *pchConnectParam = "+connect "; + const char *pchConnect = strstr( pchCmdLine, pchConnectParam ); + *ppchServerAddress = NULL; + if ( pchConnect && strlen( pchCmdLine ) > (pchConnect - pchCmdLine) + strlen( pchConnectParam ) ) + { + // Address should be right after the +connect + *ppchServerAddress = pchCmdLine + ( pchConnect - pchCmdLine ) + strlen( pchConnectParam ); + } + + // look for +connect_lobby lobbyid paramter on the command line + // Steam will pass this in if a user taken up an invite to a lobby + const char *pchConnectLobbyParam = "+connect_lobby "; + const char *pchConnectLobby = strstr( pchCmdLine, pchConnectLobbyParam ); + *ppchLobbyID = NULL; + if ( pchConnectLobby && strlen( pchCmdLine ) > (pchConnectLobby - pchCmdLine) + strlen( pchConnectLobbyParam ) ) + { + // lobby ID should be right after the +connect_lobby + *ppchLobbyID = pchCmdLine + ( pchConnectLobby - pchCmdLine ) + strlen( pchConnectLobbyParam ); + } + + return *ppchServerAddress || *ppchLobbyID; + +} + + +//----------------------------------------------------------------------------- +// Purpose: Main loop code shared between all platforms +//----------------------------------------------------------------------------- +void RunGameLoop( IGameEngine *pGameEngine, const char *pchServerAddress, const char *pchLobbyID, bool bShowTimer ) +{ + // Make sure it initialized ok + if ( pGameEngine->BReadyForUse() ) + { + // Initialize the game + CSpaceWarClient *pGameClient = new CSpaceWarClient( pGameEngine ); + + pGameClient->SetShowTimer( bShowTimer ); + + // Black background + pGameEngine->SetBackgroundColor( 0, 0, 0, 0 ); + + // If +connect was used to specify a server address, connect now + pGameClient->ExecCommandLineConnect( pchServerAddress, pchLobbyID ); + + // test a user specific secret before entering main loop + Steamworks_TestSecret(); + + pGameClient->RetrieveEncryptedAppTicket(); + + while( !pGameEngine->BShuttingDown() ) + { + if ( pGameEngine->StartFrame() ) + { + pGameEngine->UpdateGameTickCount(); + + // Run a game frame + pGameClient->RunFrame(); + pGameEngine->EndFrame(); + + // Sleep to limit frame rate + while( pGameEngine->BSleepForFrameRateLimit( MAX_CLIENT_AND_SERVER_FPS ) ) + { + // Keep running the network on the client at a faster rate than the FPS limit + pGameClient->ReceiveNetworkData(); + } + } + } + + delete pGameClient; + } + + // Cleanup the game engine + delete pGameEngine; +} + + +//----------------------------------------------------------------------------- +// Purpose: Real main entry point for the program +//----------------------------------------------------------------------------- +static int RealMain( const char *pchCmdLine, HINSTANCE hInstance, int nCmdShow ) +{ + if ( SteamAPI_RestartAppIfNecessary( k_uAppIdInvalid ) ) + { + // if Steam is not running or the game wasn't started through Steam, SteamAPI_RestartAppIfNecessary starts the + // local Steam client and also launches this game again. + + // Once you get a public Steam AppID assigned for this game, you need to replace k_uAppIdInvalid with it and + // removed steam_appid.txt from the game depot. + + return EXIT_FAILURE; + } + + // Init Steam CEG + if ( !Steamworks_InitCEGLibrary() ) + { + OutputDebugString( "Steamworks_InitCEGLibrary() failed\n" ); + Alert( "Fatal Error", "Steam must be running to play this game (InitDrmLibrary() failed).\n" ); + return EXIT_FAILURE; + } + + // Initialize SteamAPI, if this fails we bail out since we depend on Steam for lots of stuff. + // You don't necessarily have to though if you write your code to check whether all the Steam + // interfaces are NULL before using them and provide alternate paths when they are unavailable. + // + // This will also load the in-game steam overlay dll into your process. That dll is normally + // injected by steam when it launches games, but by calling this you cause it to always load, + // even when not launched via steam. + SteamErrMsg errMsg = { 0 }; + if ( SteamAPI_InitEx( &errMsg ) != k_ESteamAPIInitResult_OK ) + { + OutputDebugString( "SteamAPI_Init() failed: " ); + OutputDebugString( errMsg ); + OutputDebugString( "\n" ); + + Alert( "Fatal Error", "Steam must be running to play this game (SteamAPI_Init() failed).\n" ); + return EXIT_FAILURE; + } + + // set our debug handler + SteamClient()->SetWarningMessageHook( &SteamAPIDebugTextHook ); + + // Ensure that the user has logged into Steam. This will always return true if the game is launched + // from Steam, but if Steam is at the login prompt when you run your game from the debugger, it + // will return false. + if ( !SteamUser()->BLoggedOn() ) + { + OutputDebugString( "Steam user is not logged in\n" ); + Alert( "Fatal Error", "Steam user must be logged in to play this game (SteamUser()->BLoggedOn() returned false).\n" ); + return EXIT_FAILURE; + } + + const char *pchServerAddress, *pchLobbyID; + if ( !ParseCommandLine( pchCmdLine, &pchServerAddress, &pchLobbyID ) ) + { + // no connect string on process command line. If app was launched via a Steam URL, the extra command line parameters in that URL + // get be retrieved with GetLaunchCommandLine. This way an attacker can't put malicious parameters in the process command line + // which might allow much more functionality then indented. + + char szCommandLine[1024] = {}; + + if ( SteamApps()->GetLaunchCommandLine( szCommandLine, sizeof( szCommandLine ) ) > 0 ) + { + ParseCommandLine( szCommandLine, &pchServerAddress, &pchLobbyID ); + } + } + + bool bShowTimer = !!strstr( pchCmdLine, "-timer" ); + + // do a DRM self check + Steamworks_SelfCheck(); + + // Construct a new instance of the game engine + // bugbug jmccaskey - make screen resolution dynamic, maybe take it on command line? + IGameEngine *pGameEngine = +#if defined(_WIN32) + new CGameEngineWin32( hInstance, nCmdShow, 1024, 768 ); +#elif defined(OSX) + CreateGameEngineOSX(); +#elif defined(SDL) + CreateGameEngineSDL( ); +#else +#error Need CreateGameEngine() +#endif + + if ( !SteamInput()->Init( false ) ) + { + OutputDebugString( "SteamInput()->Init failed.\n" ); + Alert( "Fatal Error", "SteamInput()->Init failed.\n" ); + return EXIT_FAILURE; + } + char rgchCWD[1024]; + if ( !_getcwd( rgchCWD, sizeof( rgchCWD ) ) ) + { + strcpy( rgchCWD, "." ); + } + + char rgchFullPath[1024]; +#if defined(OSX) + // hack for now, because we do not have utility functions available for finding the resource path + // alternatively we could disable the SteamController init on OS X + _snprintf( rgchFullPath, sizeof( rgchFullPath ), "%s/steamworksexample.app/Contents/Resources/%s", rgchCWD, "steam_input_manifest.vdf" ); +#else + _snprintf( rgchFullPath, sizeof( rgchFullPath ), "%s\\%s", rgchCWD, "steam_input_manifest.vdf" ); +#endif + + SteamInput()->SetInputActionManifestFilePath( rgchFullPath ); + + // This call will block and run until the game exits + RunGameLoop( pGameEngine, pchServerAddress, pchLobbyID, bShowTimer ); + + // Shutdown the SteamAPI + SteamAPI_Shutdown(); + + // Shutdown Steam CEG + Steamworks_TermCEGLibrary(); + + // exit + return EXIT_SUCCESS; +} + + +//----------------------------------------------------------------------------- +// Purpose: Main entry point for the program -- win32 +//----------------------------------------------------------------------------- +#ifdef WIN32 +int APIENTRY WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPSTR lpCmdLine, + int nCmdShow) +{ + // All we do here is call the real main function after setting up our se translator + // this allows us to catch exceptions and report errors to Steam. + // + // Note that you must set your compiler flags correctly to enable structured exception + // handling in order for this particular setup method to work. + + if ( IsDebuggerPresent() ) + { + // We don't want to mask exceptions (or report them to Steam!) when debugging. + // If you would like to step through the exception handler, attach a debugger + // after running the game outside of the debugger. + return RealMain( lpCmdLine, hInstance, nCmdShow ); + } + + _set_se_translator( MiniDumpFunction ); + try // this try block allows the SE translator to work + { + return RealMain( lpCmdLine, hInstance, nCmdShow ); + } + catch( ... ) + { + return -1; + } +} +#endif + +#ifdef OSX +int main(int argc, const char **argv) +{ + char szCmdLine[1024]; + char *pszStart = szCmdLine; + char * const pszEnd = szCmdLine + V_ARRAYSIZE(szCmdLine); + + *szCmdLine = '\0'; + + for ( int i = 1; i < argc; i++ ) + { + const char *parm = argv[i]; + while ( *parm && (pszStart < pszEnd) ) + { + *pszStart++ = *parm++; + } + + if ( pszStart >= pszEnd ) + break; + + if ( i < argc-1 ) + *pszStart++ = ' '; + } + + szCmdLine[V_ARRAYSIZE(szCmdLine) - 1] = '\0'; + + return RealMain( szCmdLine, 0, 0 ); +} +#endif +#ifdef SDL +int main(int argc, const char **argv) +{ + char szCmdLine[1024]; + char *pszStart = szCmdLine; + char * const pszEnd = szCmdLine + V_ARRAYSIZE(szCmdLine); + *szCmdLine = '\0'; + for ( int i = 1; i < argc; i++ ) + { + const char *parm = argv[i]; + while ( *parm && (pszStart < pszEnd) ) + { + *pszStart++ = *parm++; + } + if ( pszStart >= pszEnd ) + break; + if ( i < argc-1 ) + *pszStart++ = ' '; + } + szCmdLine[V_ARRAYSIZE(szCmdLine) - 1] = '\0'; + return RealMain( szCmdLine, 0, 0 ); +} +#endif diff --git a/external/steamworks/steamworksexample/MainMenu.cpp b/external/steamworks/steamworksexample/MainMenu.cpp new file mode 100644 index 0000000..7a8f3ca --- /dev/null +++ b/external/steamworks/steamworksexample/MainMenu.cpp @@ -0,0 +1,82 @@ +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class to define the main game menu +// +// $NoKeywords: $ +//============================================================================= + + +#include "stdafx.h" +#include "MainMenu.h" +#include "SpaceWar.h" + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CMainMenu::CMainMenu( IGameEngine *pGameEngine ) : CBaseMenu( pGameEngine ) +{ + SetupMenu(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Add relevant menu entries, honoring parental settings +//----------------------------------------------------------------------------- +void CMainMenu::SetupMenu() +{ + ISteamParentalSettings *pSettings = SteamParentalSettings(); + + AddMenuItem( MenuItem_t( "Start New Server", k_EClientGameStartServer ) ); + AddMenuItem( MenuItem_t( "Find LAN Servers", k_EClientFindLANServers ) ); + AddMenuItem( MenuItem_t( "Find Internet Servers", k_EClientFindInternetServers ) ); + AddMenuItem( MenuItem_t( "Create Lobby", k_EClientCreatingLobby ) ); + AddMenuItem( MenuItem_t( "Find Lobby", k_EClientFindLobby ) ); + AddMenuItem( MenuItem_t( "Instructions", k_EClientGameInstructions ) ); + if ( !pSettings->BIsFeatureBlocked( k_EFeatureProfile ) ) + { + AddMenuItem( MenuItem_t( "Stats and Achievements", k_EClientStatsAchievements ) ); + } + AddMenuItem( MenuItem_t( "Leaderboards", k_EClientLeaderboards ) ); + + if ( !pSettings->BIsFeatureBlocked( k_EFeatureFriends ) ) + { + AddMenuItem( MenuItem_t( "Friends List", k_EClientFriendsList ) ); + AddMenuItem( MenuItem_t( "Group chat room", k_EClientClanChatRoom ) ); + } + AddMenuItem( MenuItem_t( "Remote Play Invite", k_EClientRemotePlayInvite ) ); + AddMenuItem( MenuItem_t( "Remote Play Sessions", k_EClientRemotePlaySessions ) ); + AddMenuItem( MenuItem_t( "Remote Storage", k_EClientRemoteStorage ) ); + AddMenuItem( MenuItem_t( "Write Minidump", k_EClientMinidump ) ); + + if ( !pSettings->BIsFeatureBlocked( k_EFeatureBrowser ) ) + { + AddMenuItem( MenuItem_t( "Web Callback", k_EClientWebCallback ) ); + } + + AddMenuItem( MenuItem_t( "Music Player", k_EClientMusic ) ); + if ( !pSettings->BIsFeatureBlocked( k_EFeatureCommunity ) ) + { + AddMenuItem( MenuItem_t( "Workshop Items", k_EClientWorkshop ) ); + } + + if ( !pSettings->BIsFeatureBlocked( k_EFeatureBrowser ) ) + { + AddMenuItem( MenuItem_t( "HTML Page", k_EClientHTMLSurface ) ); + } + + AddMenuItem( MenuItem_t( "In-game Store", k_EClientInGameStore ) ); + + AddMenuItem( MenuItem_t( "OverlayAPI", k_EClientOverlayAPI ) ); + + AddMenuItem( MenuItem_t( "Exit Game", k_EClientGameExiting ) ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Callback for a change in parental settings. Rebuild menu. +//----------------------------------------------------------------------------- +void CMainMenu::OnParentalSettingsChanged( SteamParentalSettingsChanged_t *pParam ) +{ + ClearMenuItems(); + SetupMenu(); +} diff --git a/external/steamworks/steamworksexample/MainMenu.h b/external/steamworks/steamworksexample/MainMenu.h new file mode 100644 index 0000000..6da0d43 --- /dev/null +++ b/external/steamworks/steamworksexample/MainMenu.h @@ -0,0 +1,30 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class to define the main game menu +// +// $NoKeywords: $ +//============================================================================= + +#ifndef MAINMENU_H +#define MAINMENU_H + +#include +#include +#include "GameEngine.h" +#include "SpaceWar.h" +#include "BaseMenu.h" +#include "SpaceWarClient.h" + +class CMainMenu : public CBaseMenu +{ +public: + // Constructor + CMainMenu( IGameEngine *pGameEngine ); + + void SetupMenu(); + +private: + STEAM_CALLBACK( CMainMenu, OnParentalSettingsChanged, SteamParentalSettingsChanged_t ); +}; + +#endif // MAINMENU_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/Makefile b/external/steamworks/steamworksexample/Makefile new file mode 100644 index 0000000..248c6c7 --- /dev/null +++ b/external/steamworks/steamworksexample/Makefile @@ -0,0 +1,186 @@ +SOURCEFILES := \ + BaseMenu.cpp \ + Friends.cpp \ + Inventory.cpp \ + ItemStore.cpp \ + Leaderboards.cpp \ + Lobby.cpp \ + Main.cpp \ + MainMenu.cpp \ + OverlayExamples.cpp \ + PhotonBeam.cpp \ + QuitMenu.cpp \ + RemotePlay.cpp \ + RemoteStorage.cpp \ + ServerBrowser.cpp \ + Ship.cpp \ + SimpleProtobuf.cpp \ + SpaceWarClient.cpp \ + SpaceWarEntity.cpp \ + SpaceWarServer.cpp \ + StarField.cpp \ + StatsAndAchievements.cpp \ + Sun.cpp \ + timeline.cpp \ + VectorEntity.cpp \ + clanchatroom.cpp \ + gameenginesdl.cpp \ + htmlsurface.cpp \ + musicplayer.cpp \ + p2pauth.cpp \ + stdafx.cpp \ + voicechat.cpp \ + glew.c + +TARGETNAME := SteamworksExampleLinux +#TARGETTYPE can be APP, STATIC or SHARED +TARGETTYPE := APP + +include flags.mak + +CONFIG ?= RELEASE + +ALL_MACROS := $(COMMON_MACROS) + +ifeq ($(CONFIG),DEBUG) + BINARYDIR = debug + CFLAGS += $(DEBUG_CFLAGS) + CXXFLAGS += $(DEBUG_CXXFLAGS) + LDFLAGS += $(DEBUG_LDFLAGS) + ALL_MACROS += $(DEBUG_MACROS) +endif + +ifeq ($(CONFIG),RELEASE) + BINARYDIR = release + CFLAGS += $(RELEASE_CFLAGS) + CXXFLAGS += $(RELEASE_CXXFLAGS) + LDFLAGS += $(RELEASE_LDFLAGS) + ALL_MACROS += $(RELEASE_MACROS) +endif + +ifeq ($(BINARYDIR),) +error: + $(error Please specify CONFIG=DEBUG/RELEASE) +endif + +ARCH ?= 64 +ifeq ($(ARCH), 32) + CFLAGS += -m32 + CXXFLAGS += -m32 + LDFLAGS += -m32 +else + ifneq ($(ARCH), 64) + $(error Please specify ARCH=32/64) + endif +endif + +EXTERNAL_LIBS := +EXTERNAL_LIBS_COPIED := $(foreach lib, $(EXTERNAL_LIBS),$(BINARYDIR)/$(notdir $(lib))) + +CXXFLAGS += -Wno-invalid-offsetof + +CFLAGS += $(addprefix -I,$(INCLUDE_DIRS)) +CXXFLAGS += $(addprefix -I,$(INCLUDE_DIRS)) + +CFLAGS += $(addprefix -D,$(ALL_MACROS)) +CXXFLAGS += $(addprefix -D,$(ALL_MACROS)) + +CXXFLAGS += $(addprefix -framework ,$(MACOS_FRAMEWORKS)) +CFLAGS += $(addprefix -framework ,$(MACOS_FRAMEWORKS)) +LDFLAGS += $(addprefix -framework ,$(MACOS_FRAMEWORKS)) + +LDFLAGS += $(addprefix -L,$(LIBRARY_DIRS)) + +LIBRARY_LDFLAGS = $(addprefix -l,$(LIBRARY_NAMES)) + +ifeq ($(IS_LINUX_PROJECT),1) + RPATH_PREFIX := -Wl,--rpath='$$ORIGIN/../ + LIBRARY_LDFLAGS += $(EXTERNAL_LIBS) + LIBRARY_LDFLAGS += -Wl,--rpath='$$ORIGIN' + LIBRARY_LDFLAGS += $(addsuffix ',$(addprefix $(RPATH_PREFIX),$(dir $(EXTERNAL_LIBS)))) + + ifeq ($(TARGETTYPE),SHARED) + LIBRARY_LDFLAGS += -Wl,-soname,$(TARGETNAME) + endif + +else + LIBRARY_LDFLAGS += $(EXTERNAL_LIBS) +endif + + +CFLAGS += $(MCUFLAGS) +CXXFLAGS += $(MCUFLAGS) +LDFLAGS += $(MCUFLAGS) + +all_make_files := Makefile flags.mak $(ADDITIONAL_MAKE_FILES) + +ifeq ($(STARTUPFILES),) + all_source_files := $(SOURCEFILES) +else + all_source_files := $(STARTUPFILES) $(filter-out $(STARTUPFILES),$(SOURCEFILES)) +endif + +source_obj1 := $(all_source_files:.cpp=.o) +source_obj2 := $(source_obj1:.c=.o) +source_objs := $(source_obj2:.S=.o) + +all_objs := $(addprefix $(BINARYDIR)/, $(notdir $(source_objs))) + +ifeq ($(GENERATE_BIN_FILE),1) +all: $(BINARYDIR)/$(basename $(TARGETNAME)).bin + +$(BINARYDIR)/$(basename $(TARGETNAME)).bin: $(BINARYDIR)/$(TARGETNAME) + $(OBJCOPY) -O binary $< $@ + +else +all: $(BINARYDIR)/$(TARGETNAME) +endif + +ifeq ($(TARGETTYPE),APP) +$(BINARYDIR)/$(TARGETNAME): $(all_objs) $(EXTERNAL_LIBS) $(BINARYDIR)/$(STEAM_API) $(BINARYDIR)/SteamworksExample.sh $(BINARYDIR)/DejaVuSans.ttf + $(LD) -o $@ $(START_GROUP) $(all_objs) $(LIBRARY_LDFLAGS) $(LDFLAGS) $(END_GROUP) + @echo "You can start the game by running $(BINARYDIR)/SteamworksExample.sh" +endif + +ifeq ($(TARGETTYPE),SHARED) +$(BINARYDIR)/$(TARGETNAME): $(all_objs) $(EXTERNAL_LIBS) + $(LD) -shared -o $@ $(START_GROUP) $(all_objs) $(LIBRARY_LDFLAGS) $(LDFLAGS) $(END_GROUP) +endif + +ifeq ($(TARGETTYPE),STATIC) +$(BINARYDIR)/$(TARGETNAME): $(all_objs) + $(AR) -r $@ $^ +endif + +-include $(all_objs:.o=.dep) + +clean: +ifeq ($(USE_DEL_TO_CLEAN),1) + del /S /Q $(BINARYDIR) +else + rm -f $(BINARYDIR)/*.o $(BINARYDIR)/*.dep $(BINARYDIR)/$(TARGETNAME) $(BINARYDIR)/SteamworksExample.sh +endif + +$(BINARYDIR): + mkdir $(BINARYDIR) + +$(BINARYDIR)/$(STEAM_API): $(LIBRARY_DIRS)/$(STEAM_API) + chmod +w $@ || true + cp -v $< $@ + chmod +x $@ + +$(BINARYDIR)/SteamworksExample.sh: SteamworksExample.sh + cp -v $< $@ + chmod +x $@ + +$(BINARYDIR)/DejaVuSans.ttf: DejaVuSans.ttf + cp -v $< $@ + +$(BINARYDIR)/%.o : %.cpp $(all_make_files) |$(BINARYDIR) + $(CXX) $(CXXFLAGS) -c $< -o $@ -MD -MF $(@:.o=.dep) + +$(BINARYDIR)/%.o : %.c $(all_make_files) |$(BINARYDIR) + $(CC) $(CFLAGS) -c $< -o $@ -MD -MF $(@:.o=.dep) + +$(BINARYDIR)/%.o : %.S $(all_make_files) |$(BINARYDIR) + $(CC) $(CFLAGS) $(ASFLAGS) -c $< -o $@ -MD -MF $(@:.o=.dep) diff --git a/external/steamworks/steamworksexample/Messages.h b/external/steamworks/steamworksexample/Messages.h new file mode 100644 index 0000000..d0b0c73 --- /dev/null +++ b/external/steamworks/steamworksexample/Messages.h @@ -0,0 +1,224 @@ +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Defines the wire protocol for the game +// +// $NoKeywords: $ +//============================================================================= + +#ifndef MESSAGES_H +#define MESSAGES_H + +#include + +#pragma pack( push, 1 ) + +// Network message types +enum EMessage +{ + // Server messages + k_EMsgServerBegin = 0, + k_EMsgServerSendInfo = k_EMsgServerBegin+1, + k_EMsgServerFailAuthentication = k_EMsgServerBegin+2, + k_EMsgServerPassAuthentication = k_EMsgServerBegin+3, + k_EMsgServerUpdateWorld = k_EMsgServerBegin+4, + k_EMsgServerExiting = k_EMsgServerBegin+5, + k_EMsgServerPingResponse = k_EMsgServerBegin+6, + k_EMsgServerPlayerHitSun = k_EMsgServerBegin+7, + + // Client messages + k_EMsgClientBegin = 500, + k_EMsgClientBeginAuthentication = k_EMsgClientBegin+2, + k_EMsgClientSendLocalUpdate = k_EMsgClientBegin+3, + + // P2P authentication messages + k_EMsgP2PBegin = 600, + k_EMsgP2PSendingTicket = k_EMsgP2PBegin+1, + + // voice chat messages + k_EMsgVoiceChatBegin = 700, + //k_EMsgVoiceChatPing = k_EMsgVoiceChatBegin+1, // deprecated keep alive message + k_EMsgVoiceChatData = k_EMsgVoiceChatBegin+2, // voice data from another player + + + + // force 32-bit size enum so the wire protocol doesn't get outgrown later + k_EForceDWORD = 0x7fffffff, +}; + +// enums for use in +enum EDisconnectReason +{ + k_EDRClientDisconnect = k_ESteamNetConnectionEnd_App_Min + 1, + k_EDRServerClosed = k_ESteamNetConnectionEnd_App_Min + 2, + k_EDRServerReject = k_ESteamNetConnectionEnd_App_Min + 3, + k_EDRServerFull = k_ESteamNetConnectionEnd_App_Min + 4, + k_EDRClientKicked = k_ESteamNetConnectionEnd_App_Min + 5 +}; + + +// Msg from the server to the client which is sent right after communications are established +// and tells the client what SteamID the game server is using as well as whether the server is secure +struct MsgServerSendInfo_t +{ + MsgServerSendInfo_t() : m_dwMessageType( LittleDWord( k_EMsgServerSendInfo ) ) {} + DWORD GetMessageType() { return LittleDWord( m_dwMessageType ); } + + void SetSteamIDServer( uint64 SteamID ) { m_ulSteamIDServer = LittleQWord( SteamID ); } + uint64 GetSteamIDServer() { return LittleQWord( m_ulSteamIDServer ); } + + void SetSecure( bool bSecure ) { m_bIsVACSecure = bSecure; } + bool GetSecure() { return m_bIsVACSecure; } + + void SetServerName( const char *pchName ) { strncpy_safe( m_rgchServerName, pchName, sizeof( m_rgchServerName ) ); } + const char *GetServerName() { return m_rgchServerName; } + +private: + const DWORD m_dwMessageType; + uint64 m_ulSteamIDServer; + bool m_bIsVACSecure; + char m_rgchServerName[128]; +}; + +// Msg from the server to the client when refusing a connection +struct MsgServerFailAuthentication_t +{ + MsgServerFailAuthentication_t() : m_dwMessageType( LittleDWord( k_EMsgServerFailAuthentication ) ) {} + DWORD GetMessageType() { return LittleDWord( m_dwMessageType ); } +private: + const DWORD m_dwMessageType; +}; + +// Msg from the server to client when accepting a pending connection +struct MsgServerPassAuthentication_t +{ + MsgServerPassAuthentication_t() : m_dwMessageType( LittleDWord( k_EMsgServerPassAuthentication ) ) {} + DWORD GetMessageType() { return LittleDWord( m_dwMessageType ); } + + void SetPlayerPosition ( uint32 pos ) { m_uPlayerPosition = LittleDWord( pos ); } + uint32 GetPlayerPosition() { return LittleDWord( m_uPlayerPosition ); } + +private: + const DWORD m_dwMessageType; + uint32 m_uPlayerPosition; +}; + +// Msg from the server to clients when updating the world state +struct MsgServerUpdateWorld_t +{ + MsgServerUpdateWorld_t() : m_dwMessageType( LittleDWord( k_EMsgServerUpdateWorld ) ) {} + DWORD GetMessageType() { return LittleDWord( m_dwMessageType ); } + + ServerSpaceWarUpdateData_t *AccessUpdateData() { return &m_ServerUpdateData; } + +private: + const DWORD m_dwMessageType; + ServerSpaceWarUpdateData_t m_ServerUpdateData; +}; + +// Msg from server to clients when it is exiting +struct MsgServerExiting_t +{ + MsgServerExiting_t() : m_dwMessageType( LittleDWord( k_EMsgServerExiting ) ) {} + DWORD GetMessageType() { return LittleDWord( m_dwMessageType ); } + +private: + const DWORD m_dwMessageType; +}; + +// Msg from client to server when initiating authentication +struct MsgClientBeginAuthentication_t +{ + MsgClientBeginAuthentication_t() : m_dwMessageType( LittleDWord( k_EMsgClientBeginAuthentication ) ) {} + DWORD GetMessageType() { return LittleDWord( m_dwMessageType ); } + + void SetToken( const char *pchToken, uint32 unLen ) { m_uTokenLen = LittleDWord( unLen ); memcpy( m_rgchToken, pchToken, MIN( unLen, sizeof( m_rgchToken ) ) ); } + uint32 GetTokenLen() { return LittleDWord( m_uTokenLen ); } + const char *GetTokenPtr() { return m_rgchToken; } + + void SetSteamID( uint64 ulSteamID ) { m_ulSteamID = LittleQWord( ulSteamID ); } + uint64 GetSteamID() { return LittleQWord( m_ulSteamID ); } + +private: + const DWORD m_dwMessageType; + + uint32 m_uTokenLen; +#ifdef USE_GS_AUTH_API + char m_rgchToken[1024]; +#endif + uint64 m_ulSteamID; +}; + +// Msg from client to server when sending state update +struct MsgClientSendLocalUpdate_t +{ + MsgClientSendLocalUpdate_t() : m_dwMessageType( LittleDWord( k_EMsgClientSendLocalUpdate ) ) {} + DWORD GetMessageType() { return LittleDWord( m_dwMessageType ); } + + void SetShipPosition( uint32 uPos ) { m_uShipPosition = LittleDWord( uPos ); } + ClientSpaceWarUpdateData_t *AccessUpdateData() { return &m_ClientUpdateData; } + +private: + const DWORD m_dwMessageType; + + uint32 m_uShipPosition; + ClientSpaceWarUpdateData_t m_ClientUpdateData; +}; + +// Message sent from one peer to another, so peers authenticate directly with each other. +// (In this example, the server is responsible for relaying the messages, but peers +// are directly authenticating each other.) +struct MsgP2PSendingTicket_t +{ + MsgP2PSendingTicket_t() : m_dwMessageType( LittleDWord( k_EMsgP2PSendingTicket ) ) {} + DWORD GetMessageType() { return LittleDWord( m_dwMessageType ); } + + void SetToken( const void *pToken, uint32 unLen ) { m_uTokenLen = LittleDWord( unLen ); memcpy( m_rgchToken, pToken, MIN( unLen, sizeof( m_rgchToken ) ) ); } + uint32 GetTokenLen() const { return LittleDWord( m_uTokenLen ); } + const char *GetTokenPtr() const { return m_rgchToken; } + + // Sender or receiver (depending on context) + void SetSteamID( uint64 ulSteamID ) { m_ulSteamID = LittleQWord( ulSteamID ); } + uint64 GetSteamID() const { return LittleQWord( m_ulSteamID ); } + +private: + DWORD m_dwMessageType; + uint32 m_uTokenLen; + char m_rgchToken[1024]; + uint64 m_ulSteamID; +}; + +// voice chat data. This is relayed through the server +struct MsgVoiceChatData_t +{ + MsgVoiceChatData_t() : m_dwMessageType( LittleDWord( k_EMsgVoiceChatData ) ) {} + DWORD GetMessageType() const { return LittleDWord( m_dwMessageType ); } + + void SetDataLength( uint32 unLength ) { m_uDataLength = LittleDWord( unLength ); } + uint32 GetDataLength() const { return LittleDWord( m_uDataLength ); } + + void SetSteamID(CSteamID steamID) { from_steamID = steamID; } + CSteamID GetSteamID() const { return from_steamID; } + +private: + const DWORD m_dwMessageType; + uint32 m_uDataLength; + CSteamID from_steamID; +}; + +// A notification to the client that this player collided with the sun +struct MsgServerPlayerHitSun_t +{ + MsgServerPlayerHitSun_t() : m_dwMessageType( LittleDWord( k_EMsgServerPlayerHitSun ) ) {} + DWORD GetMessageType() const { return LittleDWord( m_dwMessageType ); } + + void SetSteamID( CSteamID steamID ) { from_steamID = steamID; } + CSteamID GetSteamID() const { return from_steamID; } + +private: + const DWORD m_dwMessageType; + CSteamID from_steamID; +}; + +#pragma pack( pop ) + +#endif // MESSAGES_H diff --git a/external/steamworks/steamworksexample/NEU/SpaceWar.gdf.xml b/external/steamworks/steamworksexample/NEU/SpaceWar.gdf.xml new file mode 100644 index 0000000..0e30c2a Binary files /dev/null and b/external/steamworks/steamworksexample/NEU/SpaceWar.gdf.xml differ diff --git a/external/steamworks/steamworksexample/NEU/boxart_NEU.png b/external/steamworks/steamworksexample/NEU/boxart_NEU.png new file mode 100644 index 0000000..f8ed04a Binary files /dev/null and b/external/steamworks/steamworksexample/NEU/boxart_NEU.png differ diff --git a/external/steamworks/steamworksexample/NEU/gameicon_NEU.ico b/external/steamworks/steamworksexample/NEU/gameicon_NEU.ico new file mode 100644 index 0000000..6e7042f Binary files /dev/null and b/external/steamworks/steamworksexample/NEU/gameicon_NEU.ico differ diff --git a/external/steamworks/steamworksexample/OverlayExamples.cpp b/external/steamworks/steamworksexample/OverlayExamples.cpp new file mode 100644 index 0000000..bfd0b95 --- /dev/null +++ b/external/steamworks/steamworksexample/OverlayExamples.cpp @@ -0,0 +1,289 @@ +//========= Copyright � Valve LLC, All rights reserved. ============ +// +// Purpose: Examples for interacting with Overlay +// +//============================================================================= + +#include "stdafx.h" +#include "OverlayExamples.h" +#include "BaseMenu.h" +#include +#include +#include + + +//----------------------------------------------------------------------------- +// Purpose: Menu that shows your friends +//----------------------------------------------------------------------------- +class COverlayExamplesMenu : public CBaseMenu +{ +public: + + //----------------------------------------------------------------------------- + // Purpose: Constructor + //----------------------------------------------------------------------------- + COverlayExamplesMenu( IGameEngine *pGameEngine, COverlayExamples *pOverlayExamples ) : CBaseMenu( pGameEngine ), m_pOverlayExamples( pOverlayExamples ) + { + + } + + //----------------------------------------------------------------------------- + // Purpose: Creates menu + //----------------------------------------------------------------------------- + void Rebuild() + { + PushSelectedItem(); + ClearMenuItems(); + + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlay - Friends", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlay, "Friends" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlay - Community", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlay, "Community" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlay - Settings", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlay, "Settings" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlay - LobbyInvite", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlay, "LobbyInvite" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlay - OfficialGameGroup", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlay, "OfficialGameGroup" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlay - Leaderboards", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlay, "Leaderboards" } ) ); + + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToUser - steamid", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToUser, "steamid" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToUser - chat", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToUser, "chat" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToUser - jointrade", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToUser, "jointrade" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToUser - stats", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToUser, "stats" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToUser - achievements", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToUser, "achievements" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToUser - friendadd", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToUser, "friendadd" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToUser - friendremove", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToUser, "friendremove" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToUser - friendrequestaccept", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToUser, "friendrequestaccept" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToUser - friendrequestignore", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToUser, "friendrequestignore" } ) ); + + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToWebPage", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToWebPage, "https://steamcommunity.com/" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToWebPageModal", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToWebPageModal, "https://steamcommunity.com/" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToStore", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToStore, "" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToStore - Add to Cart", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToStore, "addtocart" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToStore - Add to Cart & Show", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToStore, "addtocartandshow" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayInviteDialogConnectString", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayInviteDialogConnectString, NULL } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( SteamScreenshots()->IsScreenshotsHooked() ? "Screenshots Hooked!" : "Hook Screenshots", { OverlayExample_t::k_EOverlayExampleItem_HookScreenshots, NULL } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Request Keyboard", { OverlayExample_t::k_EOverlayExampleItem_RequestKeyboard, NULL } ) ); + + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Set Notification Inset", { OverlayExample_t::k_EOverlayExampleItem_Notification_SetInset, "100" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Reset Notification Inset", { OverlayExample_t::k_EOverlayExampleItem_Notification_SetInset, "0" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Set Notification Position: Top Left", { OverlayExample_t::k_EOverlayExampleItem_Notification_SetPosition, "0" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Set Notification Position: Top Right", { OverlayExample_t::k_EOverlayExampleItem_Notification_SetPosition, "1" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Set Notification Position: Bottom Left", { OverlayExample_t::k_EOverlayExampleItem_Notification_SetPosition, "2" } ) ); + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Set Notification Position: Bottom Right", { OverlayExample_t::k_EOverlayExampleItem_Notification_SetPosition, "3" } ) ); + + if ( m_pOverlayExamples->BHasLastGamePhase() ) + { + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Show last match", { OverlayExample_t::k_EOverlayExampleItem_Timeline_OpenOverlayToGamePhase } ) ); + } + if ( m_pOverlayExamples->BHasLastTimelineEvent() ) + { + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Show last crash into sun", { OverlayExample_t::k_EOverlayExampleItem_Timeline_OpenOverlayToTimelineEvent } ) ); + } + + AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Return to main menu", { OverlayExample_t::k_EOverlayExampleItem_BackToMenu, NULL } ) ); + + PopSelectedItem(); + } + +private: + + COverlayExamples *m_pOverlayExamples; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +COverlayExamples::COverlayExamples( IGameEngine *pGameEngine ) + : m_pGameEngine( pGameEngine ) +{ + m_pMenu = new COverlayExamplesMenu( pGameEngine, this ); + m_delayedCommand = { OverlayExample_t::k_EOverlayExampleItem_Invalid, NULL }; + + Show(); +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void COverlayExamples::RunFrame() +{ + m_pMenu->RunFrame(); + + if ( !m_pGameEngine->BIsKeyDown( VK_RETURN ) && !m_pGameEngine->BIsControllerActionActive( eControllerDigitalAction_MenuSelect ) ) + { + switch ( m_delayedCommand.m_eItem ) + { + case OverlayExample_t::k_EOverlayExampleItem_BackToMenu: + { + SpaceWarClient()->SetGameState( k_EClientGameMenu ); + } + break; + + case OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlay: + { + SteamFriends()->ActivateGameOverlay( m_delayedCommand.m_pchExtraCommandData ); + } + break; + + case OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToUser: + { + // pick first friend + if ( SteamFriends()->GetFriendCount( k_EFriendFlagImmediate ) != 0 ) + { + CSteamID steamID = SteamFriends()->GetFriendByIndex( 0, k_EFriendFlagImmediate ); + SteamFriends()->ActivateGameOverlayToUser( m_delayedCommand.m_pchExtraCommandData, steamID ); + } + } + break; + + case OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToWebPage: + { + SteamFriends()->ActivateGameOverlayToWebPage( m_delayedCommand.m_pchExtraCommandData ); + } + break; + + case OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToWebPageModal: + { + SteamFriends()->ActivateGameOverlayToWebPage( m_delayedCommand.m_pchExtraCommandData, k_EActivateGameOverlayToWebPageMode_Modal ); + } + break; + + case OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToStore: + { + if ( !strcmp( m_delayedCommand.m_pchExtraCommandData, "addtocart" ) ) + { + SteamFriends()->ActivateGameOverlayToStore( 440, k_EOverlayToStoreFlag_AddToCart ); + } + else if ( !strcmp( m_delayedCommand.m_pchExtraCommandData, "addtocartandshow" ) ) + { + SteamFriends()->ActivateGameOverlayToStore( 440, k_EOverlayToStoreFlag_AddToCartAndShow ); + } + else + { + SteamFriends()->ActivateGameOverlayToStore( 440, k_EOverlayToStoreFlag_None ); + } + } + break; + + /* + case OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayRemotePlayTogetherInviteDialog: + { + SteamFriends()->ActivateGameOverlayRemotePlayTogetherInviteDialog( steamIDLobby ); + } + break; + */ + + case OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayInviteDialogConnectString: + { + const char *pConnectString = SteamFriends()->GetFriendRichPresence( SteamUser()->GetSteamID(), "connect" ); + SteamFriends()->ActivateGameOverlayInviteDialogConnectString( pConnectString ); + } + break; + + case OverlayExample_t::k_EOverlayExampleItem_HookScreenshots: + { + SteamScreenshots()->HookScreenshots( !SteamScreenshots()->IsScreenshotsHooked() ); + m_pMenu->Rebuild(); + } + break; + + case OverlayExample_t::k_EOverlayExampleItem_RequestKeyboard: + { + EGamepadTextInputMode eInputMode = k_EGamepadTextInputModeNormal; + EGamepadTextInputLineMode eLineInputMode = k_EGamepadTextInputLineModeSingleLine; + const char *pchDescription = "Enter Text Here"; + uint32 unCharMax = 20; + const char *pchExistingText = "Placeholder"; + SteamUtils()->ShowGamepadTextInput( eInputMode , eLineInputMode, pchDescription, unCharMax, pchExistingText ); + } + break; + + case OverlayExample_t::k_EOverlayExampleItem_Notification_SetInset: + SteamUtils()->SetOverlayNotificationInset( atoi( m_delayedCommand.m_pchExtraCommandData ), atoi( m_delayedCommand.m_pchExtraCommandData ) ); + break; + case OverlayExample_t::k_EOverlayExampleItem_Notification_SetPosition: + SteamUtils()->SetOverlayNotificationPosition( (ENotificationPosition)atoi( m_delayedCommand.m_pchExtraCommandData ) ); + break; + + case OverlayExample_t::k_EOverlayExampleItem_Timeline_OpenOverlayToGamePhase: + SteamTimeline()->OpenOverlayToGamePhase( m_strLastGamePhaseIDToShow.c_str() ); + break; + case OverlayExample_t::k_EOverlayExampleItem_Timeline_OpenOverlayToTimelineEvent: + SteamTimeline()->OpenOverlayToTimelineEvent( m_ulLastCrashIntoSunEventIDToShow ); + break; + + default: + break; + } + + m_delayedCommand.m_eItem = OverlayExample_t::k_EOverlayExampleItem_Invalid; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles menu actions when viewing a friends list +//----------------------------------------------------------------------------- +void COverlayExamples::OnMenuSelection( OverlayExample_t selection ) +{ + m_delayedCommand = selection; +} + + +//----------------------------------------------------------------------------- +// Purpose: Shows / Refreshes the friends list +//----------------------------------------------------------------------------- +void COverlayExamples::Show() +{ + + if ( SpaceWarClient()->GetLastGamePhaseID() ) + { + SteamAPICall_t hSteamAPICall = SteamTimeline()->DoesGamePhaseRecordingExist( std::to_string( SpaceWarClient()->GetLastGamePhaseID() ).c_str() ); + m_SteamCallResultDoesGamePhaseRecordingExist.Set( hSteamAPICall, this, &COverlayExamples::OnDoesGamePhaseRecordingExist ); + } + m_strLastGamePhaseIDToShow.erase(); + + if ( SpaceWarClient()->GetLastCrashIntoSunEvent() ) + { + SteamAPICall_t hSteamAPICall = SteamTimeline()->DoesEventRecordingExist( SpaceWarClient()->GetLastCrashIntoSunEvent() ); + m_SteamCallResultDoesEventRecordingExist.Set( hSteamAPICall, this, &COverlayExamples::OnDoesEventRecordingExist ); + } + + m_pMenu->Rebuild(); +} + +void COverlayExamples::OnScreenshotRequested( ScreenshotRequested_t *pCallback ) +{ + SteamFriends()->ActivateGameOverlayToWebPage( "google.com" ); +} + +void COverlayExamples::OnSteamScreenshotReady( ScreenshotReady_t *pCallback ) +{ + +} + +void COverlayExamples::OnDoesEventRecordingExist( SteamTimelineEventRecordingExists_t *pCallback, bool bIOFailure ) +{ + if ( bIOFailure || !pCallback->m_bRecordingExists ) + { + // nothing to do here. We didn't show these items when showing the menu + return; + } + + m_ulLastCrashIntoSunEventIDToShow = pCallback->m_ulEventID; + m_pMenu->Rebuild(); +} + + +void COverlayExamples::OnDoesGamePhaseRecordingExist( SteamTimelineGamePhaseRecordingExists_t *pCallback, bool bIOFailure ) +{ + if ( bIOFailure || ( pCallback->m_ulRecordingMS == 0 && pCallback->m_unClipCount == 0 ) ) + { + // nothing to do here. We didn't show these items when showing the menu + return; + } + + m_strLastGamePhaseIDToShow = pCallback->m_rgchPhaseID; + m_pMenu->Rebuild(); +} + + diff --git a/external/steamworks/steamworksexample/OverlayExamples.h b/external/steamworks/steamworksexample/OverlayExamples.h new file mode 100644 index 0000000..635bb0c --- /dev/null +++ b/external/steamworks/steamworksexample/OverlayExamples.h @@ -0,0 +1,58 @@ +//========= Copyright © Valve LLC, All rights reserved. ============ +// +// Purpose: Class that shows some examples for bringing up the Steam Overlay +// +//============================================================================= + +#ifndef OVERLAYEXAMPLES_H +#define OVERLAYEXAMPLES_H + +#include "SpaceWar.h" +#include "GameEngine.h" +#include "SpaceWarClient.h" + + +class CSpaceWarClient; +class COverlayExamplesMenu; + +class COverlayExamples +{ +public: + // Constructor + COverlayExamples( IGameEngine *pGameEngine ); + + // Run a frame + void RunFrame(); + + // shows / refreshes item store + void Show(); + + // handles input from menu + void OnMenuSelection( OverlayExample_t selection ); + + bool BHasLastGamePhase() const { return !m_strLastGamePhaseIDToShow.empty(); } + bool BHasLastTimelineEvent() const { return m_ulLastCrashIntoSunEventIDToShow != 0; } + +private: + + // Engine + IGameEngine *m_pGameEngine; + + COverlayExamplesMenu *m_pMenu; + OverlayExample_t m_delayedCommand; + std::string m_strLastGamePhaseIDToShow; + uint64 m_ulLastCrashIntoSunEventIDToShow = 0; + + STEAM_CALLBACK( COverlayExamples, OnScreenshotRequested, ScreenshotRequested_t ); + STEAM_CALLBACK( COverlayExamples, OnSteamScreenshotReady, ScreenshotReady_t ); + + // callback for when we ask about an event having recordings + void OnDoesEventRecordingExist( SteamTimelineEventRecordingExists_t *pCallback, bool bIOFailure ); + CCallResult m_SteamCallResultDoesEventRecordingExist; + + // callback for when we ask about a phase having recordings + void OnDoesGamePhaseRecordingExist( SteamTimelineGamePhaseRecordingExists_t *pCallback, bool bIOFailure ); + CCallResult m_SteamCallResultDoesGamePhaseRecordingExist; +}; + +#endif // OVERLAYEXAMPLES_H diff --git a/external/steamworks/steamworksexample/PhotonBeam.cpp b/external/steamworks/steamworksexample/PhotonBeam.cpp new file mode 100644 index 0000000..de6b319 --- /dev/null +++ b/external/steamworks/steamworksexample/PhotonBeam.cpp @@ -0,0 +1,40 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for rendering photon beams +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" +#include "PhotonBeam.h" +#include "SpaceWar.h" + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CPhotonBeam::CPhotonBeam( IGameEngine *pGameEngine, float xPos, float yPos, DWORD dwBeamColor, float flInitialRotation, float flInitialXVelocity, float flInitialYVelocity ) + : CSpaceWarEntity( pGameEngine, 3, true ) +{ + // Beams only have a lifetime of 1 second + m_ulTickCountToDieAt = m_pGameEngine->GetGameTickCount()+PHOTON_BEAM_LIFETIME_IN_TICKS; + + // Set a really high max velocity for photon beams + SetMaximumVelocity( 500 ); + + AddLine( -2.0f, -3.0f, -2.0f, 3.0f, dwBeamColor ); + AddLine( 2.0f, -3.0f, 2.0f, 3.0f, dwBeamColor ); + SetPosition( xPos, yPos ); + SetRotationDeltaNextFrame( flInitialRotation ); + SetVelocity( flInitialXVelocity, flInitialYVelocity ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Update with data from server +//----------------------------------------------------------------------------- +void CPhotonBeam::OnReceiveServerUpdate( ServerPhotonBeamUpdateData_t *pUpdateData ) +{ + SetPosition( pUpdateData->GetXPosition()*m_pGameEngine->GetViewportWidth(), pUpdateData->GetYPosition()*m_pGameEngine->GetViewportHeight() ); + SetVelocity( pUpdateData->GetXVelocity(), pUpdateData->GetYVelocity() ); + SetAccumulatedRotation( pUpdateData->GetRotation() ); +} \ No newline at end of file diff --git a/external/steamworks/steamworksexample/PhotonBeam.h b/external/steamworks/steamworksexample/PhotonBeam.h new file mode 100644 index 0000000..6098c9b --- /dev/null +++ b/external/steamworks/steamworksexample/PhotonBeam.h @@ -0,0 +1,31 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for rendering photon beams +// +// $NoKeywords: $ +//============================================================================= + +#ifndef PHOTONBEAM_H +#define PHOTONBEAM_H + +#include "GameEngine.h" +#include "SpaceWarEntity.h" +#include "SpaceWar.h" + +class CPhotonBeam : public CSpaceWarEntity +{ +public: + // Constructor + CPhotonBeam( IGameEngine *pGameEngine, float xPos, float yPos, DWORD dwBeamColor, float flInitialRotation, float flInitialXVelocity, float flInitialYVelocity ); + + // Check if the photon beam needs to die + bool BIsBeamExpired() { return m_pGameEngine->GetGameTickCount() > m_ulTickCountToDieAt; } + + // Update with new data from server + void OnReceiveServerUpdate( ServerPhotonBeamUpdateData_t *pUpdateData ); + +private: + uint64 m_ulTickCountToDieAt; +}; + +#endif // PHOTONBEAM_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/QuitMenu.cpp b/external/steamworks/steamworksexample/QuitMenu.cpp new file mode 100644 index 0000000..ae8c0f0 --- /dev/null +++ b/external/steamworks/steamworksexample/QuitMenu.cpp @@ -0,0 +1,21 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class to define the pause menu +// +// $NoKeywords: $ +//============================================================================= + + +#include "stdafx.h" +#include "QuitMenu.h" +#include "SpaceWar.h" + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CQuitMenu::CQuitMenu( IGameEngine *pGameEngine ) : CBaseMenu( pGameEngine ) +{ + AddMenuItem( MenuItem_t( "Resume Game", k_EClientGameActive ) ); + AddMenuItem( MenuItem_t( "Exit To Menu", k_EClientGameMenu ) ); + AddMenuItem( MenuItem_t( "Exit To Desktop", k_EClientGameExiting ) ); +} diff --git a/external/steamworks/steamworksexample/QuitMenu.h b/external/steamworks/steamworksexample/QuitMenu.h new file mode 100644 index 0000000..8667346 --- /dev/null +++ b/external/steamworks/steamworksexample/QuitMenu.h @@ -0,0 +1,25 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class to define the pause game menu +// +// $NoKeywords: $ +//============================================================================= + +#ifndef QUITMENU_H +#define QUITMENU_H + +#include +#include +#include "GameEngine.h" +#include "SpaceWar.h" +#include "BaseMenu.h" +#include "SpaceWarClient.h" + +class CQuitMenu : public CBaseMenu +{ +public: + // Constructor + CQuitMenu( IGameEngine *pGameEngine ); +}; + +#endif // QUITMENU_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/RemotePlay.cpp b/external/steamworks/steamworksexample/RemotePlay.cpp new file mode 100644 index 0000000..43152f7 --- /dev/null +++ b/external/steamworks/steamworksexample/RemotePlay.cpp @@ -0,0 +1,180 @@ +//========= Copyright � 1996-2009, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for Remote Play session list +// +//============================================================================= + +#include "stdafx.h" +#include "RemotePlay.h" +#include "BaseMenu.h" + + +//----------------------------------------------------------------------------- +// Purpose: Menu that shows your Remote Play session +//----------------------------------------------------------------------------- +class CRemotePlayListMenu : public CBaseMenu +{ + static const RemotePlayListMenuItem_t k_menuItemEmpty; + +public: + + //----------------------------------------------------------------------------- + // Purpose: Constructor + //----------------------------------------------------------------------------- + CRemotePlayListMenu( IGameEngine *pGameEngine ) : CBaseMenu( pGameEngine ) + { + + } + + //----------------------------------------------------------------------------- + // Purpose: Creates Remote Play session list menu + //----------------------------------------------------------------------------- + void Rebuild() + { + PushSelectedItem(); + ClearMenuItems(); + + AddMenuItem( CRemotePlayListMenu::MenuItem_t( "Remote Play Session List", k_menuItemEmpty ) ); + + InputHandle_t arrInputHandles[ STEAM_INPUT_MAX_COUNT ]; + int nNumControllers = SteamInput()->GetConnectedControllers( arrInputHandles ); + + uint32 unSessionCount = SteamRemotePlay()->GetSessionCount(); + for ( uint32 iIndex = 0; iIndex < unSessionCount; iIndex++ ) + { + RemotePlaySessionID_t unSessionID = SteamRemotePlay()->GetSessionID( iIndex ); + if ( !unSessionID ) + { + continue; + } + + RemotePlayListMenuItem_t item; + item.m_unSessionID = unSessionID; + + const char *pszSessionPersonaName = SteamFriends()->GetFriendPersonaName( SteamRemotePlay()->GetSessionSteamID( unSessionID ) ); + const char *pszSessionClientName = SteamRemotePlay()->GetSessionClientName( unSessionID ); + const char *pszSessionClientFormFactor = GetFormFactor( SteamRemotePlay()->GetSessionClientFormFactor( unSessionID ) ); + + int nResolutionX, nResolutionY; + SteamRemotePlay()->BGetSessionClientResolution( unSessionID, &nResolutionX, &nResolutionY ); + + char szLabel[ 1024 ]; + snprintf( szLabel, sizeof( szLabel ), "%s streaming to %s: %s %dx%d", pszSessionPersonaName, pszSessionClientName, pszSessionClientFormFactor, nResolutionX, nResolutionY ); + + for ( int iController = 0; iController < nNumControllers; ++iController ) + { + if ( SteamInput()->GetRemotePlaySessionID( arrInputHandles[ iController ] ) == unSessionID ) + { + strncat( szLabel, ", has ", sizeof( szLabel ) - strlen( szLabel ) - 1 ); + strncat( szLabel, GetControllerType( SteamInput()->GetInputTypeForHandle( arrInputHandles[ iController ] ) ), sizeof( szLabel ) - strlen( szLabel ) - 1 ); + } + } + AddMenuItem( CRemotePlayListMenu::MenuItem_t( szLabel, item ) ); + } + + PopSelectedItem(); + } + +private: + const char *GetFormFactor( ESteamDeviceFormFactor eFormFactor ) + { + switch ( eFormFactor ) + { + case k_ESteamDeviceFormFactorPhone: + return "[PHONE]"; + case k_ESteamDeviceFormFactorTablet: + return "[TABLET]"; + case k_ESteamDeviceFormFactorComputer: + return "[COMPUTER]"; + case k_ESteamDeviceFormFactorTV: + return "[TV]"; + default: + return "[UNKNOWN]"; + } + } + + const char *GetControllerType( ESteamInputType eInputType ) + { + switch ( eInputType ) + { + case k_ESteamInputType_SteamController: + return "Steam Controller"; + case k_ESteamInputType_XBox360Controller: + return "XBox 360 Controller"; + case k_ESteamInputType_XBoxOneController: + return "XBox One Controller"; + case k_ESteamInputType_PS4Controller: + return "PS4 Controller"; + case k_ESteamInputType_MobileTouch: + return "Touch Controller"; + default: + return "Game Controller"; + } + } +}; + +const RemotePlayListMenuItem_t CRemotePlayListMenu::k_menuItemEmpty = { 0 }; + + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CRemotePlayList::CRemotePlayList( IGameEngine *pGameEngine ) : m_pGameEngine( pGameEngine ) +{ + m_pRemotePlayListMenu = new CRemotePlayListMenu( pGameEngine ); + m_nNumControllers = 0; +} + + +//----------------------------------------------------------------------------- +// Purpose: Run a frame for the CRemotePlayList +//----------------------------------------------------------------------------- +void CRemotePlayList::RunFrame() +{ + InputHandle_t arrInputHandles[ STEAM_INPUT_MAX_COUNT ]; + int nNumControllers = SteamInput()->GetConnectedControllers( arrInputHandles ); + if ( nNumControllers != m_nNumControllers ) + { + m_nNumControllers = nNumControllers; + + m_pRemotePlayListMenu->Rebuild(); + } + + m_pRemotePlayListMenu->RunFrame(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles menu actions when viewing a Remote Play session list +//----------------------------------------------------------------------------- +void CRemotePlayList::OnMenuSelection( RemotePlayListMenuItem_t selection ) +{ + // Do nothing (yet) +} + + +//----------------------------------------------------------------------------- +// Purpose: Shows / Refreshes the Remote Play session list +//----------------------------------------------------------------------------- +void CRemotePlayList::Show() +{ + m_pRemotePlayListMenu->Rebuild(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handle Remote Play session connected +//----------------------------------------------------------------------------- +void CRemotePlayList::OnRemotePlaySessionConnected( SteamRemotePlaySessionConnected_t *pParam ) +{ + m_pRemotePlayListMenu->Rebuild(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handle Remote Play session disconnected +//----------------------------------------------------------------------------- +void CRemotePlayList::OnRemotePlaySessionDisconnected( SteamRemotePlaySessionDisconnected_t *pParam ) +{ + m_pRemotePlayListMenu->Rebuild(); +} diff --git a/external/steamworks/steamworksexample/RemotePlay.h b/external/steamworks/steamworksexample/RemotePlay.h new file mode 100644 index 0000000..846414c --- /dev/null +++ b/external/steamworks/steamworksexample/RemotePlay.h @@ -0,0 +1,45 @@ +//========= Copyright © 1996-2009, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for Remote Play session list +// +//============================================================================= + +#ifndef REMOTEPLAY_H +#define REMOTEPLAY_H + +#include "SpaceWar.h" +#include "GameEngine.h" +#include "SpaceWarClient.h" + + +class CSpaceWarClient; +class CRemotePlayListMenu; + +class CRemotePlayList +{ +public: + // Constructor + CRemotePlayList( IGameEngine *pGameEngine ); + + // Run a frame + void RunFrame(); + + // shows / refreshes Remote Play session list + void Show(); + + // handles input from Remote Play session list menu + void OnMenuSelection( RemotePlayListMenuItem_t selection ); + +private: + STEAM_CALLBACK( CRemotePlayList, OnRemotePlaySessionConnected, SteamRemotePlaySessionConnected_t ); + STEAM_CALLBACK( CRemotePlayList, OnRemotePlaySessionDisconnected, SteamRemotePlaySessionDisconnected_t ); + +private: + // Engine + IGameEngine *m_pGameEngine; + + CRemotePlayListMenu *m_pRemotePlayListMenu; + int m_nNumControllers; +}; + +#endif // REMOTEPLAY_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/RemoteStorage.cpp b/external/steamworks/steamworksexample/RemoteStorage.cpp new file mode 100644 index 0000000..99a8b70 --- /dev/null +++ b/external/steamworks/steamworksexample/RemoteStorage.cpp @@ -0,0 +1,365 @@ +//========= Copyright 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for tracking stats and achievements +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" +#include "RemoteStorage.h" +#include "BaseMenu.h" +#include + + +#define CLOUDDISP_FONT_HEIGHT 20 +#define CLOUDDISP_COLUMN_WIDTH 600 +#define CLOUDDISP_TEXT_HEIGHT 20 +#define CLOUDDISP_VERT_SPACING 4 + +#define MESSAGE_FILE_NAME "message.dat" + +extern uint64 g_ulLastReturnKeyTick; + +//----------------------------------------------------------------------------- +// NOTE +// +// The Steam program is normally responsible for synchronizing an App's files +// to the Steam Cloud before launch and after the program exits. +// +// This means that, if you build this example app and run it directly, +// the Remote Storage page may appear to work (it will save the file changes +// to disk, locally), however nothing will actually get pulled down from +// or sent up to the Steam Cloud. +// +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CRemoteStorage::CRemoteStorage( IGameEngine *pGameEngine ) : m_pGameEngine( pGameEngine ) +{ + m_pRemoteStorageScreen = new CRemoteStorageScreen( pGameEngine ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Destructor +//----------------------------------------------------------------------------- +CRemoteStorage::~CRemoteStorage() +{ + delete m_pRemoteStorageScreen; +} + + +//----------------------------------------------------------------------------- +// Purpose: Called when the user selects view remote storage files +//----------------------------------------------------------------------------- +void CRemoteStorage::Show() +{ + m_pRemoteStorageScreen->Show(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Called once per frame +//----------------------------------------------------------------------------- +void CRemoteStorage::Render() +{ + m_pRemoteStorageScreen->Render(); + if ( m_pRemoteStorageScreen->BFinished() ) + SpaceWarClient()->SetGameState( k_EClientGameMenu ); +} + + +//----------------------------------------------------------------------------- +// Purpose: A sync menu item has been selected +//----------------------------------------------------------------------------- +void CRemoteStorage::OnMenuSelection( ERemoteStorageSyncMenuCommand selection ) +{ +} + + +//----------------------------------------------------------------------------- +// Purpose: CRemoteStorageScreen implementation +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CRemoteStorageScreen::CRemoteStorageScreen( IGameEngine *pGameEngine ) : m_pGameEngine( pGameEngine ) +{ + m_rgchGreeting[0] = 0; + strncpy( m_rgchGreeting, "", sizeof( m_rgchGreeting ) ); + m_rgchGreetingNext[0] = 0; + + m_pSteamRemoteStorage = SteamRemoteStorage(); + + m_hDisplayFont = pGameEngine->HCreateFont( CLOUDDISP_FONT_HEIGHT, FW_MEDIUM, false, "Arial" ); + if ( !m_hDisplayFont ) + OutputDebugString( "RemoteStorage font was not created properly, text won't draw\n" ); + + GetFileStats(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Load the user's saved message +//----------------------------------------------------------------------------- +void CRemoteStorageScreen::LoadMessage() +{ + if ( !m_pSteamRemoteStorage->FileExists( MESSAGE_FILE_NAME ) ) + return; + + int32 cubFile = m_pSteamRemoteStorage->GetFileSize( MESSAGE_FILE_NAME ); + if ( cubFile >= sizeof( m_rgchGreeting ) ) + { + // ?? too big, nuke it + char c = 0; + OutputDebugString( "RemoteStorage: File was larger than expected. . .\n" ); + m_pSteamRemoteStorage->FileWrite( MESSAGE_FILE_NAME, &c, 1 ); + } + else + { + int32 cubRead = m_pSteamRemoteStorage->FileRead( MESSAGE_FILE_NAME, m_rgchGreeting, sizeof( m_rgchGreeting ) - 1 ); + m_rgchGreeting[cubRead] = 0; // null-terminate + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Update stats on our files in the Cloud +//----------------------------------------------------------------------------- +void CRemoteStorageScreen::GetFileStats() +{ + m_ulBytesQuota = 0; + m_ulAvailableBytes = 0; + m_nNumFilesInCloud = m_pSteamRemoteStorage->GetFileCount(); + m_pSteamRemoteStorage->GetQuota( &m_ulBytesQuota, &m_ulAvailableBytes ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Called when the user selects view remote storage files +//----------------------------------------------------------------------------- +void CRemoteStorageScreen::Show() +{ + GetFileStats(); + LoadMessage(); + if ( m_pGameEngine->BIsSteamInputDeviceActive() ) + { + const int32 width = m_pGameEngine->GetViewportWidth(); + const int32 pxColumn1Left = width / 2 - CLOUDDISP_COLUMN_WIDTH / 2; + int32 pxVertOffset = 8 * CLOUDDISP_TEXT_HEIGHT + 4 * ( CLOUDDISP_TEXT_HEIGHT + CLOUDDISP_VERT_SPACING ); + SteamUtils()->ShowFloatingGamepadTextInput( k_EFloatingGamepadTextInputModeModeSingleLine, pxColumn1Left, pxVertOffset, CLOUDDISP_COLUMN_WIDTH, CLOUDDISP_TEXT_HEIGHT ); + } +} + +bool CRemoteStorageScreen::BHandleCancel() +{ + // always cancel + m_rgchGreetingNext[0] = 0; + + if( m_pGameEngine->BIsSteamInputDeviceActive() ) + { + SteamUtils()->DismissFloatingGamepadTextInput(); + } + + m_bFinished = true; + return true; +} + +bool CRemoteStorageScreen::BHandleSelect() +{ + int nGreetingNextLength = (int)strlen( m_rgchGreetingNext ); + bool bQuotaExceeded = nGreetingNextLength > m_ulBytesQuota; + if ( !bQuotaExceeded ) + { + uint64 ulCurrentTickCount = m_pGameEngine->GetGameTickCount(); + if ( ulCurrentTickCount - 150 > g_ulLastReturnKeyTick ) + { + // global from BaseMenu.h! + g_ulLastReturnKeyTick = ulCurrentTickCount; + + // Do it + { + m_bFinished = true; + + strncpy( m_rgchGreeting, m_rgchGreetingNext, sizeof( m_rgchGreeting ) ); + m_rgchGreetingNext[0] = 0; + + // Note: not writing the NULL termination, so won't read it back later either. + bool bRet = m_pSteamRemoteStorage->FileWrite( MESSAGE_FILE_NAME, m_rgchGreeting, (int)strlen( m_rgchGreeting ) ); + + // Update our stats on stuff + GetFileStats(); + + if ( !bRet ) + { + OutputDebugString( "RemoteStorage: Failed to write file!\n" ); + } + + return true; + } + } + } + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: Render the Remote Storage page +//----------------------------------------------------------------------------- +void CRemoteStorageScreen::Render() +{ + m_bFinished = false; + + // Update key press information + + int nGreetingNextLength = (int) strlen( m_rgchGreetingNext ); + + DWORD dwVKDown = 0; + + bool bQuotaExceeded = nGreetingNextLength > m_ulBytesQuota; + + if ( m_pGameEngine->BIsControllerActionActive( eControllerDigitalAction_MenuCancel ) ) + { + if ( BHandleCancel() ) + return; + } + else if ( m_pGameEngine->BIsControllerActionActive( eControllerDigitalAction_MenuSelect ) ) + { + if ( BHandleSelect() ) + return; + } + + while ( m_pGameEngine->BGetFirstKeyDown( &dwVKDown ) ) + { + if ( VK_ESCAPE == dwVKDown ) + { + if ( BHandleCancel() ) + return; + } + else if ( VK_RETURN == dwVKDown ) + { + if ( BHandleSelect() ) + return; + } + else if ( VK_BACK == dwVKDown ) + { + if ( nGreetingNextLength ) + { + m_rgchGreetingNext[--nGreetingNextLength] = 0; + } + } + else if ( ( dwVKDown >= 0x30 && dwVKDown <= 0x39 ) + || ( dwVKDown >= 0x41 && dwVKDown <= 0x5A ) + || dwVKDown == VK_SPACE ) + { + // Add the key pressed + if ( nGreetingNextLength + 1 < sizeof( m_rgchGreetingNext ) ) + { + m_rgchGreetingNext[nGreetingNextLength++] = (char) dwVKDown; + m_rgchGreetingNext[nGreetingNextLength] = 0; + } + } + } + + const int32 width = m_pGameEngine->GetViewportWidth(); + //const int32 height = m_pGameEngine->GetViewportHeight(); + + const int32 pxColumn1Left = width / 2 - CLOUDDISP_COLUMN_WIDTH / 2; + + RECT rect; + { + int32 pxVertOffset = 8 * ( CLOUDDISP_TEXT_HEIGHT ); + rect.top = pxVertOffset; + rect.bottom = rect.top + CLOUDDISP_TEXT_HEIGHT; + rect.left = pxColumn1Left; + rect.right = rect.left + CLOUDDISP_COLUMN_WIDTH; + pxVertOffset = rect.bottom + CLOUDDISP_VERT_SPACING; + + char rgchBuffer[256]; + sprintf_safe( rgchBuffer, "Num Files In Cloud: %d", m_nNumFilesInCloud ); + m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer ); + + rect.top = pxVertOffset; + rect.bottom = rect.top + CLOUDDISP_TEXT_HEIGHT; + rect.left = pxColumn1Left; + rect.right = rect.left + CLOUDDISP_COLUMN_WIDTH; + pxVertOffset = rect.bottom + CLOUDDISP_TEXT_HEIGHT + CLOUDDISP_VERT_SPACING; + + sprintf_safe( rgchBuffer, "Quota: %llu bytes, %llu bytes remaining", m_ulBytesQuota, m_ulAvailableBytes ); + m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer ); + + rect.top = pxVertOffset; + rect.bottom = rect.top + CLOUDDISP_TEXT_HEIGHT; + rect.left = pxColumn1Left; + rect.right = rect.left + CLOUDDISP_COLUMN_WIDTH; + pxVertOffset = rect.bottom + CLOUDDISP_VERT_SPACING; + + sprintf_safe( rgchBuffer, "Current Message:" ); + m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer ); + + rect.top = pxVertOffset; + rect.bottom = rect.top + CLOUDDISP_TEXT_HEIGHT; + rect.left = pxColumn1Left; + rect.right = rect.left + CLOUDDISP_COLUMN_WIDTH; + pxVertOffset = rect.bottom + CLOUDDISP_TEXT_HEIGHT + CLOUDDISP_VERT_SPACING; + + m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, m_rgchGreeting ); + + rect.top = pxVertOffset; + rect.bottom = rect.top + CLOUDDISP_TEXT_HEIGHT; + rect.left = pxColumn1Left; + rect.right = rect.left + CLOUDDISP_COLUMN_WIDTH; + pxVertOffset = rect.bottom + CLOUDDISP_VERT_SPACING; + + sprintf_safe( rgchBuffer, "Type in a new message below:" ); + m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer ); + + rect.top = pxVertOffset; + rect.bottom = rect.top + CLOUDDISP_TEXT_HEIGHT; + rect.left = pxColumn1Left; + rect.right = rect.left + CLOUDDISP_COLUMN_WIDTH; + pxVertOffset = rect.bottom + CLOUDDISP_TEXT_HEIGHT + CLOUDDISP_VERT_SPACING; + + m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, m_rgchGreetingNext ); + + rect.top = pxVertOffset; + rect.bottom = rect.top + CLOUDDISP_TEXT_HEIGHT; + rect.left = pxColumn1Left; + rect.right = rect.left + CLOUDDISP_COLUMN_WIDTH; + pxVertOffset = rect.bottom + CLOUDDISP_TEXT_HEIGHT + CLOUDDISP_VERT_SPACING; + + if ( m_pGameEngine->BIsSteamInputDeviceActive() ) + { + const char *rgchSaveActionOrigin = m_pGameEngine->GetTextStringForControllerOriginDigital( eControllerActionSet_MenuControls, eControllerDigitalAction_MenuSelect ); + const char *rgchCancelActionOrigin = m_pGameEngine->GetTextStringForControllerOriginDigital( eControllerActionSet_MenuControls, eControllerDigitalAction_MenuCancel ); + if ( strcmp( rgchSaveActionOrigin, "None" ) == 0 || strcmp( rgchCancelActionOrigin, "None" ) == 0 ) + { + sprintf_safe( rgchBuffer, "Hit to save, to cancel. Controller bindings are not setup properly" ); + } + else + { + sprintf_safe( rgchBuffer, "Hit or %s to save, or %s to cancel", rgchSaveActionOrigin, rgchCancelActionOrigin ); + } + } + else + { + sprintf_safe( rgchBuffer, "Hit to save, to cancel" ); + } + + m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer ); + + if ( bQuotaExceeded ) + { + rect.top = pxVertOffset; + rect.bottom = rect.top + CLOUDDISP_TEXT_HEIGHT; + rect.left = pxColumn1Left; + rect.right = rect.left + CLOUDDISP_COLUMN_WIDTH; + pxVertOffset = rect.bottom + CLOUDDISP_TEXT_HEIGHT + CLOUDDISP_VERT_SPACING; + + sprintf_safe( rgchBuffer, "!! QUOTA EXCEEDED !!" ); + m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer ); + } + } +} diff --git a/external/steamworks/steamworksexample/RemoteStorage.h b/external/steamworks/steamworksexample/RemoteStorage.h new file mode 100644 index 0000000..2368e20 --- /dev/null +++ b/external/steamworks/steamworksexample/RemoteStorage.h @@ -0,0 +1,100 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for manipulating Steam Cloud +// +// $NoKeywords: $ +//============================================================================= + +#ifndef REMOTE_STORAGE_H +#define REMOTE_STORAGE_H + +#include "SpaceWar.h" +#include "GameEngine.h" + +class ISteamUser; +class CSpaceWarClient; +class IRemoteStorageSync; +class CRemoteStorageScreen; + +enum ERemoteStorageSyncMenuCommand +{ + k_EMenuCommandNone = 0, + k_EMenuCommandProgress = 1, + k_EMenuCommandSyncComplete = 2, +}; + +//----------------------------------------------------------------------------- +// Purpose: Example of Steam Cloud +//----------------------------------------------------------------------------- +class CRemoteStorage +{ +public: + + // Constructor + CRemoteStorage( IGameEngine *pGameEngine ); + ~CRemoteStorage(); + + // call when user changes to this menu + void Show(); + + // Display the remote storage screen + void Render(); + + // A sync menu item has been selected + void OnMenuSelection( ERemoteStorageSyncMenuCommand selection ); + +private: + IGameEngine *m_pGameEngine; + CRemoteStorageScreen *m_pRemoteStorageScreen; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Screen where user can enter their custom message +//----------------------------------------------------------------------------- +class CRemoteStorageScreen +{ +public: + CRemoteStorageScreen( IGameEngine *pGameEngine ); + + // call when user changes to this menu + void Show(); + + // Display the remote storage screen + void Render(); + + // Done showing this page? + bool BFinished() { return m_bFinished; } + +private: + void GetFileStats(); + void LoadMessage(); + bool BHandleSelect(); + bool BHandleCancel(); + + // Game engine + IGameEngine *m_pGameEngine; + + // Display font + HGAMEFONT m_hDisplayFont; + + // Steam User interface + ISteamUser *m_pSteamUser; + + // Steam RemoteStorage interface + ISteamRemoteStorage *m_pSteamRemoteStorage; + + // Greeting message + char m_rgchGreeting[40]; + char m_rgchGreetingNext[40]; + + bool m_bFinished; + + int32 m_nNumFilesInCloud; + uint64 m_ulBytesQuota; + uint64 m_ulAvailableBytes; +}; + + + +#endif diff --git a/external/steamworks/steamworksexample/ServerBrowser.cpp b/external/steamworks/steamworksexample/ServerBrowser.cpp new file mode 100644 index 0000000..a355134 --- /dev/null +++ b/external/steamworks/steamworksexample/ServerBrowser.cpp @@ -0,0 +1,202 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for handling finding servers, getting their details, and displaying +// them inside the game +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" +#include "ServerBrowser.h" +#include "ServerBrowserMenu.h" + +//----------------------------------------------------------------------------- +// Purpose: Constructor -- initialize from steam gameserveritem_t +//----------------------------------------------------------------------------- +CGameServer::CGameServer( gameserveritem_t *pGameServerItem ) +{ + m_unIPAddress = pGameServerItem->m_NetAdr.GetIP(); + m_nConnectionPort = pGameServerItem->m_NetAdr.GetConnectionPort(); + m_nPing = pGameServerItem->m_nPing; + strncpy_safe( m_szMap, pGameServerItem->m_szMap, ARRAYSIZE( m_szMap ) ); + strncpy_safe( m_szGameDescription, pGameServerItem->m_szGameDescription, ARRAYSIZE( m_szGameDescription ) ); + m_nPlayers = pGameServerItem->m_nPlayers; + m_nMaxPlayers = pGameServerItem->m_nMaxPlayers; + m_nBotPlayers = pGameServerItem->m_nBotPlayers; + m_bPassword = pGameServerItem->m_bPassword; + m_bSecure = pGameServerItem->m_bSecure; + m_nServerVersion = pGameServerItem->m_nServerVersion; + strncpy_safe( m_szServerName, pGameServerItem->GetName(), ARRAYSIZE( m_szServerName ) ); + sprintf_safe( m_szServerString, "%s (%i/%i) at %s ping(%d)", pGameServerItem->GetName(), pGameServerItem->m_nPlayers, pGameServerItem->m_nMaxPlayers, pGameServerItem->m_NetAdr.GetConnectionAddressString(), pGameServerItem->m_nPing ); + m_steamID = pGameServerItem->m_steamID; +} + + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CServerBrowser::CServerBrowser( IGameEngine *pGameEngine ) +{ + m_pMenu = new CServerBrowserMenu( pGameEngine ); + m_pGameEngine = pGameEngine; + m_nServers = 0; + m_bRequestingServers = false; + m_hServerListRequest = NULL; + m_pMenu->Rebuild( m_ListGameServers, m_bRequestingServers ); + m_pMenu->SetHeading( "Internet Server browser" ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Destructor +//----------------------------------------------------------------------------- +CServerBrowser::~CServerBrowser() +{ + if ( m_hServerListRequest ) + { + SteamMatchmakingServers()->ReleaseRequest( m_hServerListRequest ); + m_hServerListRequest = NULL; + } + + if ( m_pMenu ) + delete m_pMenu; + // ... +} + + +//----------------------------------------------------------------------------- +// Purpose: Initiate a refresh of internet servers +//----------------------------------------------------------------------------- +void CServerBrowser::RefreshInternetServers() +{ + // If we are still finishing the previous refresh, then ignore this new request + if ( m_bRequestingServers ) + return; + + // If another request is outstanding, make sure we release it properly + if ( m_hServerListRequest ) + { + SteamMatchmakingServers()->ReleaseRequest( m_hServerListRequest ); + m_hServerListRequest = NULL; + } + + OutputDebugString( "Refreshing internet servers\n" ); + // Track that we are now in a refresh, what type of refresh, and reset our server count + m_bRequestingServers = true; + m_nServers = 0; + m_ListGameServers.clear(); + m_pMenu->SetHeading( "Internet Server browser" ); + + m_pMenu->Rebuild( m_ListGameServers, m_bRequestingServers ); + + Steamworks_TestSecret(); + + // Allocate some filters, there are some common pre-defined values that can be used: + // + // "gamedir" -- this is used to specify mods inside or a single product/appid + // "secure" -- this is used to specify whether anti-cheat is enabled for a server + // "gametype" -- this is used to specify game type and is set to whatever your game server code sets + + MatchMakingKeyValuePair_t pFilters[2]; + MatchMakingKeyValuePair_t *pFilter = pFilters; + + strncpy_safe( pFilters[ 0 ].m_szKey, "gamedir", sizeof(pFilters[ 0 ].m_szKey) ); + strncpy_safe( pFilters[ 0 ].m_szValue, "spacewar", sizeof(pFilters[ 0 ].m_szValue) ); + + strncpy_safe( pFilters[ 1 ].m_szKey, "secure", sizeof(pFilters[ 1 ].m_szKey) ); + strncpy_safe( pFilters[ 1 ].m_szValue, "1", sizeof(pFilters[ 1 ].m_szValue) ); + + //strncpy_safe( pFilters[ 2 ].m_szKey, "gametype", sizeof(pFilters[ 1 ].m_szValue) ); + //strncpy_safe( pFilters[ 2 ].m_szValue, "dm", sizeof(pFilters[ 1 ].m_szValue) ); + + // bugbug jmccaskey - passing just the appid without filters results in getting all servers rather than + // servers filtered by appid alone. So, we'll use the filters to filter the results better. + m_hServerListRequest = SteamMatchmakingServers()->RequestInternetServerList( SteamUtils()->GetAppID(), &pFilter, ARRAYSIZE(pFilters), this ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Initiate a refresh of LAN servers +//----------------------------------------------------------------------------- +void CServerBrowser::RefreshLANServers() +{ + // If we are still finishing the previous refresh, then ignore this new request + if ( m_bRequestingServers ) + return; + + // If another request is outstanding, make sure we release it properly + if ( m_hServerListRequest ) + { + SteamMatchmakingServers()->ReleaseRequest( m_hServerListRequest ); + m_hServerListRequest = NULL; + } + + OutputDebugString( "Refreshing LAN servers\n" ); + // Track that we are now in a refresh, what type of refresh, and reset our server count + m_bRequestingServers = true; + m_nServers = 0; + m_ListGameServers.clear(); + m_pMenu->SetHeading( "LAN Server browser" ); + + m_pMenu->Rebuild( m_ListGameServers, m_bRequestingServers ); + + // LAN refresh doesn't accept filters like internet above does + m_hServerListRequest = SteamMatchmakingServers()->RequestLANServerList( SteamUtils()->GetAppID(), this ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Callback from Steam telling us about a server that has responded +//----------------------------------------------------------------------------- +void CServerBrowser::ServerResponded( HServerListRequest hReq, int iServer ) +{ + // Assert( hReq == m_hServerListRequest ); + + gameserveritem_t *pServer = SteamMatchmakingServers()->GetServerDetails( hReq, iServer ); + if ( pServer ) + { + // Filter out servers that don't match our appid here (might get these in LAN calls since we can't put more filters on it) + if ( pServer->m_nAppID == SteamUtils()->GetAppID() ) + { + m_ListGameServers.push_back( CGameServer( pServer ) ); + m_nServers++; + } + } + + // Rebuild menu + m_pMenu->Rebuild( m_ListGameServers, m_bRequestingServers ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Callback from Steam telling us about a server that has failed to respond +//----------------------------------------------------------------------------- +void CServerBrowser::ServerFailedToRespond( HServerListRequest hReq, int iServer ) +{ + // Assert( hReq == m_hServerListRequest ); + + // bugbug jmccaskey - why would we ever need this? Remove servers from our list I guess? +} + + +//----------------------------------------------------------------------------- +// Purpose: Callback from Steam telling us a refresh is complete +//----------------------------------------------------------------------------- +void CServerBrowser::RefreshComplete( HServerListRequest hReq, EMatchMakingServerResponse response ) +{ + // Assert( hReq == m_hServerListRequest ); + + // Doesn't really matter to us whether the response tells us the refresh succeeded or failed, + // we just track whether we are done refreshing or not + m_bRequestingServers = false; +} + + +//----------------------------------------------------------------------------- +// Purpose: Run a server browser frame (does stuff like checking KB input to change state) +//----------------------------------------------------------------------------- +void CServerBrowser::RunFrame() +{ + m_pMenu->RunFrame(); +} + diff --git a/external/steamworks/steamworksexample/ServerBrowser.h b/external/steamworks/steamworksexample/ServerBrowser.h new file mode 100644 index 0000000..f183d1e --- /dev/null +++ b/external/steamworks/steamworksexample/ServerBrowser.h @@ -0,0 +1,94 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for handling finding servers, getting their details, and displaying +// them inside the game +// +// $NoKeywords: $ +//============================================================================= + +#ifndef SERVERBROWSER_H +#define SERVERBROWSER_H + +#include "SpaceWar.h" +#include "GameEngine.h" +#include "BaseMenu.h" +#include + +class CSpaceWarClient; +class CServerBrowserMenu; + + +// Class to encapsulate game server data +class CGameServer +{ +public: + CGameServer( gameserveritem_t *pGameServerItem ); + + const char* GetName() { return m_szServerName; } + + const char* GetDisplayString() { return m_szServerString; } + + uint32 GetIP() { return m_unIPAddress; } + + int32 GetPort() { return m_nConnectionPort; } + CSteamID GetSteamID() { return m_steamID; } + +private: + uint32 m_unIPAddress; // IP address for the server + int32 m_nConnectionPort; // Port for game clients to connect to for this server + int m_nPing; // current ping time in milliseconds + char m_szMap[32]; // current map + char m_szGameDescription[64]; // game description + int m_nPlayers; // current number of players on the server + int m_nMaxPlayers; // Maximum players that can join this server + int m_nBotPlayers; // Number of bots (i.e simulated players) on this server + bool m_bPassword; // true if this server needs a password to join + bool m_bSecure; // Is this server protected by VAC + int m_nServerVersion; // server version as reported to Steam + char m_szServerName[64]; // Game server name + char m_szServerString[128]; // String to show in server browser + CSteamID m_steamID; +}; + +class CServerBrowser : public ISteamMatchmakingServerListResponse +{ +public: + CServerBrowser( IGameEngine *pGameEngine ); + ~CServerBrowser(); + + // Initiate a refresh of internet servers + void RefreshInternetServers(); + + // Initiate a refresh of LAN servers + void RefreshLANServers(); + + // Run a frame (to handle kb input and such as well as render) + void RunFrame(); + + // ISteamMatchmakingServerListResponse + void ServerResponded( HServerListRequest hReq, int iServer ); + void ServerFailedToRespond( HServerListRequest hReq, int iServer ); + void RefreshComplete( HServerListRequest hReq, EMatchMakingServerResponse response ); + +private: + + // Pointer to engine instance (so we can draw stuff) + IGameEngine *m_pGameEngine; + + // Track the number of servers we know about + int m_nServers; + + // Track whether we are in the middle of a refresh or not + bool m_bRequestingServers; + + // Track what server list request is currently running + HServerListRequest m_hServerListRequest; + + // Menu object + CServerBrowserMenu *m_pMenu; + + // List of game servers + std::list< CGameServer > m_ListGameServers; +}; + +#endif //SERVERBROWSER_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/ServerBrowserMenu.h b/external/steamworks/steamworksexample/ServerBrowserMenu.h new file mode 100644 index 0000000..b8966e5 --- /dev/null +++ b/external/steamworks/steamworksexample/ServerBrowserMenu.h @@ -0,0 +1,38 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class to find servers menu +// +//============================================================================= + +#ifndef SERVERBROWSERMENU_H +#define SERVERBROWSERMENU_H + +#include "BaseMenu.h" +#include "ServerBrowser.h" + +class CServerBrowserMenu : public CBaseMenu +{ +public: + // Constructor + CServerBrowserMenu( IGameEngine *pGameEngine ) : CBaseMenu( pGameEngine ) {} + + void Rebuild( std::list &List, bool bIsRefreshing ) + { + ClearMenuItems(); + + ServerBrowserMenuData_t data; + std::list::iterator iter; + + for( iter = List.begin(); iter != List.end(); ++iter ) + { + data.m_eStateToTransitionTo = k_EClientGameConnecting; + data.m_steamIDGameServer = iter->GetSteamID(); + AddMenuItem( MenuItem_t( iter->GetDisplayString(), data ) ); + } + + data.m_eStateToTransitionTo = k_EClientGameMenu; + AddMenuItem( CServerBrowserMenu::MenuItem_t( "Return to main menu", data ) ); + } +}; + +#endif // SERVERBROWSERMENU_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/Ship.cpp b/external/steamworks/steamworksexample/Ship.cpp new file mode 100644 index 0000000..4913fbc --- /dev/null +++ b/external/steamworks/steamworksexample/Ship.cpp @@ -0,0 +1,963 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for rendering the player ships +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" +#include "GameEngine.h" +#include "Ship.h" +#include "stdlib.h" +#include "SpaceWarServer.h" +#include "StatsAndAchievements.h" +#include "Inventory.h" +#include +#include + +//----------------------------------------------------------------------------- +// Purpose: Constructor for thrusters +//----------------------------------------------------------------------------- +CForwardThrusters::CForwardThrusters( IGameEngine *pGameEngine, CShip *pShip ) : CVectorEntity( pGameEngine, 0 ) +{ + DWORD dwColor = D3DCOLOR_ARGB( 255, 255, 255, 102 ); + + // Initialize our geometry + AddLine( 0.0, 12.0f, 0.0f, 19.0f, dwColor ); + AddLine( 1.0, 12.0f, 6.0f, 19.0f, dwColor ); + AddLine( 4.0, 12.0f, 11.0f, 19.0f, dwColor ); + AddLine( -1.0, 12.0f, -6.0f, 19.0f, dwColor ); + AddLine( -4.0, 12.0f, -11.0f, 19.0f, dwColor ); + + m_pShip = pShip; +} + + +//----------------------------------------------------------------------------- +// Purpose: Run Frame, updates us to be in the same position/rotation as the ship we belong to +//----------------------------------------------------------------------------- +void CForwardThrusters::RunFrame() +{ + SetAccumulatedRotation( m_pShip->GetAccumulatedRotation() ); + SetPosition( m_pShip->GetXPos(), m_pShip->GetYPos() ); + + CVectorEntity::RunFrame(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Constructor for reverse thrusters +//----------------------------------------------------------------------------- +CReverseThrusters::CReverseThrusters( IGameEngine *pGameEngine, CShip *pShip ) : CVectorEntity( pGameEngine, 0 ) +{ + DWORD dwColor = D3DCOLOR_ARGB( 255, 255, 255, 102 ); + + // Initialize our geometry + AddLine( -8.875, 10.5f, -14.85f, 10.5f, dwColor ); + AddLine( -8.875, 10.5f, -13.765f, 5.61f, dwColor ); + AddLine( -8.875, 10.5f, -7.85f, 3.5f, dwColor ); + + AddLine( 8.875, 10.5f, 14.85f, 10.5f, dwColor ); + AddLine( 8.875, 10.5f, 13.765f, 5.61f, dwColor ); + AddLine( 8.875, 10.5f, 7.85f, 3.5f, dwColor ); + + m_pShip = pShip; +} + + +//----------------------------------------------------------------------------- +// Purpose: Run Frame, updates us to be in the same position/rotation as the ship we belong to +//----------------------------------------------------------------------------- +void CReverseThrusters::RunFrame() +{ + SetAccumulatedRotation( m_pShip->GetAccumulatedRotation() ); + SetPosition( m_pShip->GetXPos(), m_pShip->GetYPos() ); + + CVectorEntity::RunFrame(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Constructor for ship debris after explosion +//----------------------------------------------------------------------------- +CShipDebris::CShipDebris( IGameEngine *pGameEngine, float xPos, float yPos, DWORD dwDebrisColor ) : CSpaceWarEntity( pGameEngine, 0, true ) +{ + AddLine( 0.0f, 0.0f, 16.0f, 0.0f, dwDebrisColor ); + + // Random rotation between 0 and 360 degrees (6.28 radians) + float flRotation = (float)(rand()%628)/100.0f; + SetRotationDeltaNextFrame( flRotation ); + + // Rotation to apply per second + int nRandRotation = rand()%(157*2) - (157); + m_flRotationPerInterval = nRandRotation/100.0f; + + float sinvalue = (float)sin( flRotation ); + float cosvalue = (float)cos( flRotation ); + + float xVelocity = GetXVelocity() + ( sinvalue * 80 ); + float yVelocity = GetYVelocity() - ( cosvalue * 80 ); + + // Offset out a bit from the center of the ship compensating for rotation + float offset = (rand()%12)-6.0f; + float xOffset = xPos + (cosvalue*-offset - sinvalue*-offset); + float yOffset = yPos + (cosvalue*-offset + sinvalue*-offset); + + // Set velocity + SetVelocity( xVelocity, yVelocity ); + + // Set position + SetPosition( xOffset, yOffset ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Run frame for debris (keep it spinning) +//----------------------------------------------------------------------------- +void CShipDebris::RunFrame() +{ + SetRotationDeltaNextFrame( m_flRotationPerInterval * MIN( m_pGameEngine->GetGameTicksFrameDelta(), 400.0f )/400.0f ); + CSpaceWarEntity::RunFrame(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +#pragma warning( push ) +// warning C4355: 'this' : used in base member initializer list +// This is OK because the thruster classes won't use the ship object in their constructors (where it may still be only partly constructed) +#pragma warning( disable : 4355 ) +CShip::CShip( IGameEngine *pGameEngine, bool bIsServerInstance, float xPos, float yPos, DWORD dwShipColor ) : + CSpaceWarEntity( pGameEngine, 11, true ), m_ForwardThrusters( pGameEngine, this ), m_ReverseThrusters( pGameEngine, this ) +{ + m_bDisabled = false; + m_bExploding = false; + m_ulLastThrustStartedTickCount = 0; + m_dwVKLeft = 0; + m_dwVKRight = 0; + m_nFade = 255; + m_dwVKForwardThrusters = 0; + m_dwVKReverseThrusters = 0; + m_dwVKFire = 0; + m_ulLastPhotonTickCount = 0; + m_dwShipColor = dwShipColor; + m_bForwardThrustersActive = false; + m_bReverseThrustersActive = false; + m_bIsLocalPlayer = false; + m_ulLastClientUpdateTick = 0; + m_bIsServerInstance = bIsServerInstance; + m_nShipDecoration = 0; + m_nShipPower = 0; + m_nShipWeapon = 0; + m_hTextureWhite = 0; + m_nShipShieldStrength = 0; + m_ulExplosionTickCount = 0; + m_bTriggerEffectEnabled = false; + + memset( &m_SpaceWarClientUpdateData, 0, sizeof( m_SpaceWarClientUpdateData ) ); + + for( int i=0; i < MAX_PHOTON_BEAMS_PER_SHIP; ++i ) + { + m_rgPhotonBeams[i] = NULL; + } + + BuildGeometry(); + + SetPosition( xPos, yPos ); + + // Set Controller color to ship color + m_pGameEngine->SetControllerColor( m_dwShipColor >> 16 & 255, m_dwShipColor >> 8 & 255, m_dwShipColor & 255, k_ESteamControllerLEDFlag_SetColor ); +} +#pragma warning( pop ) + +void CShip::BuildGeometry() +{ + ClearVertexes(); + + // Initialize our geometry + AddLine( -9.0f, 12.0f, 0.0f, -12.0f, m_dwShipColor ); + AddLine( 0.0f, -12.0f, 9.0f, 12.0f, m_dwShipColor ); + AddLine( 9.0f, 12.0f, -9.0f, 12.0f, m_dwShipColor ); + + switch ( m_nShipDecoration ) + { + case 1: + AddLine( 0.0f, -12.0f, -0.0f, 12.0f, m_dwShipColor ); + AddLine( 4.5f, 0.0f, -4.5f, 0.0f, m_dwShipColor ); + break; + case 2: + AddLine( 0.0f, -12.0f, -0.0f, 12.0f, m_dwShipColor ); + AddLine( 4.5f, 0.0f, -4.5f, 0.0f, m_dwShipColor ); + AddLine( 2.5f, -6.0f, -9.0f, 12.0f, m_dwShipColor ); + AddLine( 9.0f, 12.0f, -2.5f, -6.0f, m_dwShipColor ); + break; + case 3: + AddLine( 0.0f, -12.0f, 0.0f, 12.0f, m_dwShipColor ); + AddLine( 2.0f, -8.0f, 2.0f, 12.0f, m_dwShipColor ); + AddLine( -2.0f, -8.0f, -2.0f, 12.0f, m_dwShipColor ); + break; + case 4: + AddLine( -12.0, 12.0f, -3.0f,-12.0f, m_dwShipColor ); + AddLine( -17.0f, 4.0f,-11.0f,-10.0f, m_dwShipColor ); + AddLine( -17.0f, 4.0f,-10.0f, 7.0f, m_dwShipColor ); + AddLine( -11.0f,-10.0f, -3.0f,-7.0f, m_dwShipColor ); + break; + } +} + +//----------------------------------------------------------------------------- +// Purpose: Destructor +//----------------------------------------------------------------------------- +CShip::~CShip() +{ + // Cleanup beams + { + for( int i=0; i < MAX_PHOTON_BEAMS_PER_SHIP; ++i ) + { + if ( m_rgPhotonBeams[i] ) + delete m_rgPhotonBeams[i]; + } + } + + // Cleanup debris + { + std::list::iterator iter; + for ( iter = m_ListDebris.begin(); iter != m_ListDebris.end(); ++iter ) + { + delete (*iter); + } + m_ListDebris.clear(); + } + + // Restore Controller Color + m_pGameEngine->SetControllerColor( 0, 0, 0, k_ESteamControllerLEDFlag_RestoreUserDefault ); + + // Turn off trigger effect + if ( m_bTriggerEffectEnabled ) + { + m_pGameEngine->SetTriggerEffect( false ); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Update entity with updated data from the server +//----------------------------------------------------------------------------- +void CShip::OnReceiveServerUpdate( ServerShipUpdateData_t *pUpdateData ) +{ + if ( m_bIsServerInstance ) + { + OutputDebugString( "Should not be receiving server updates on the server itself\n" ); + return; + } + + SetDisabled( pUpdateData->GetDisabled() ); + + SetExploding( pUpdateData->GetExploding() ); + + SetPosition( pUpdateData->GetXPosition()*m_pGameEngine->GetViewportWidth(), pUpdateData->GetYPosition()*m_pGameEngine->GetViewportHeight() ); + SetVelocity( pUpdateData->GetXVelocity(), pUpdateData->GetYVelocity() ); + SetAccumulatedRotation( pUpdateData->GetRotation() ); + + m_nShipPower = pUpdateData->GetPower(); + m_nShipWeapon = pUpdateData->GetWeapon(); + if ( m_nShipDecoration != pUpdateData->GetDecoration() ) + { + m_nShipDecoration = pUpdateData->GetDecoration(); + BuildGeometry(); + } + if ( !m_bIsLocalPlayer || pUpdateData->GetShieldStrength() == 0 ) + { + m_nShipShieldStrength = pUpdateData->GetShieldStrength(); + } + + m_bForwardThrustersActive = pUpdateData->GetForwardThrustersActive(); + m_bReverseThrustersActive = pUpdateData->GetReverseThrustersActive(); + + // Update the photon beams + for ( int i=0; i < MAX_PHOTON_BEAMS_PER_SHIP; ++i ) + { + ServerPhotonBeamUpdateData_t *pPhotonUpdate = pUpdateData->AccessPhotonBeamData( i ); + if ( pPhotonUpdate->GetActive() ) + { + if ( !m_rgPhotonBeams[i] ) + { + m_rgPhotonBeams[i] = new CPhotonBeam( m_pGameEngine, + pPhotonUpdate->GetXPosition(), pPhotonUpdate->GetYPosition(), + m_dwShipColor, pPhotonUpdate->GetRotation(), + pPhotonUpdate->GetXVelocity(), pPhotonUpdate->GetYVelocity() ); + } + else + { + m_rgPhotonBeams[i]->OnReceiveServerUpdate( pPhotonUpdate ); + } + } + else + { + if ( m_rgPhotonBeams[i] ) + { + delete m_rgPhotonBeams[i]; + m_rgPhotonBeams[i] = NULL; + } + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Update entity with updated data from the client +//----------------------------------------------------------------------------- +void CShip::OnReceiveClientUpdate( ClientSpaceWarUpdateData_t *pUpdateData ) +{ + if ( !m_bIsServerInstance ) + { + OutputDebugString( "Should not be receiving client updates on non-server instances\n" ); + return; + } + + m_nShipDecoration = pUpdateData->GetDecoration(); + m_nShipPower = pUpdateData->GetPower(); + m_nShipWeapon = pUpdateData->GetWeapon(); + m_nShipShieldStrength = pUpdateData->GetShieldStrength(); + + memcpy( &m_SpaceWarClientUpdateData, pUpdateData, sizeof( ClientSpaceWarUpdateData_t ) ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Tell the server about any updates we have had client-side +//----------------------------------------------------------------------------- +bool CShip::BGetClientUpdateData( ClientSpaceWarUpdateData_t *pUpdateData ) +{ + // Limit the rate at which we send updates, even if our internal frame rate is higher + if ( m_pGameEngine->GetGameTickCount() - m_ulLastClientUpdateTick < 1000.0f/CLIENT_UPDATE_SEND_RATE ) + return false; + + m_ulLastClientUpdateTick = m_pGameEngine->GetGameTickCount(); + + // Update playername before sending + if ( m_bIsLocalPlayer ) + { + m_SpaceWarClientUpdateData.SetPlayerName( SteamFriends()->GetFriendPersonaName( SteamUser()->GetSteamID() ) ); + m_SpaceWarClientUpdateData.SetDecoration( m_nShipDecoration ); + m_SpaceWarClientUpdateData.SetWeapon( m_nShipWeapon ); + m_SpaceWarClientUpdateData.SetPower( m_nShipPower ); + m_SpaceWarClientUpdateData.SetShieldStrength( m_nShipShieldStrength ); + } + + memcpy( pUpdateData, &m_SpaceWarClientUpdateData, sizeof( ClientSpaceWarUpdateData_t ) ); + memset( &m_SpaceWarClientUpdateData, 0, sizeof( m_SpaceWarClientUpdateData ) ); + + return true; +} + +//----------------------------------------------------------------------------- +// Purpose: Get the name for this ship (only really works server side) +//----------------------------------------------------------------------------- +const char* CShip::GetPlayerName() +{ + return m_SpaceWarClientUpdateData.GetPlayerName(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Run a frame for the ship +//----------------------------------------------------------------------------- +void CShip::RunFrame() +{ + if ( m_bDisabled ) + return; + + const uint64 ulCurrentTickCount = m_pGameEngine->GetGameTickCount(); + + // Look for expired photon beams + int nNextAvailablePhotonBeamSlot = -1; // Track next available slot for use spawning new beams below + for( int i=0; i < MAX_PHOTON_BEAMS_PER_SHIP; ++i ) + { + if ( m_rgPhotonBeams[i] ) + { + if ( m_rgPhotonBeams[i]->BIsBeamExpired() ) + { + delete m_rgPhotonBeams[i]; + m_rgPhotonBeams[i] = NULL; + } + } + + if ( !m_rgPhotonBeams[i] && nNextAvailablePhotonBeamSlot == -1 ) + nNextAvailablePhotonBeamSlot = i; + } + + // run all the photon beams we have outstanding + for( int i=0; i < MAX_PHOTON_BEAMS_PER_SHIP; ++i ) + { + if ( m_rgPhotonBeams[i] ) + m_rgPhotonBeams[i]->RunFrame(); + } + + // run all the space debris + { + std::list::iterator iter; + for( iter = m_ListDebris.begin(); iter != m_ListDebris.end(); ++iter ) + (*iter)->RunFrame(); + } + + if ( m_bIsLocalPlayer ) + { + m_SpaceWarClientUpdateData.SetTurnLeftPressed( false ); + m_SpaceWarClientUpdateData.SetTurnRightPressed( false ); + + if ( m_pGameEngine->BIsKeyDown( m_dwVKLeft ) + || m_pGameEngine->BIsControllerActionActive( eControllerDigitalAction_TurnLeft ) ) + { + m_SpaceWarClientUpdateData.SetTurnLeftPressed( true ); + } + + if ( m_pGameEngine->BIsKeyDown( m_dwVKRight ) + || m_pGameEngine->BIsControllerActionActive( eControllerDigitalAction_TurnRight ) ) + { + m_SpaceWarClientUpdateData.SetTurnRightPressed( true ); + } + + // The Steam Controller can also map an anlog axis to thrust and steer + float fTurnSpeed, fUnused; + m_pGameEngine->GetControllerAnalogAction( eControllerAnalogAction_AnalogControls, &fTurnSpeed, &fUnused ); + + if ( fTurnSpeed > 0.0f ) + { + m_SpaceWarClientUpdateData.SetTurnRightPressed( true ); + m_SpaceWarClientUpdateData.SetTurnSpeed( fTurnSpeed ); + } + else if ( fTurnSpeed < 0.0f ) + { + m_SpaceWarClientUpdateData.SetTurnLeftPressed( true ); + m_SpaceWarClientUpdateData.SetTurnSpeed( fTurnSpeed ); + } + } + else if ( m_bIsServerInstance ) + { + // Server side + const float fMaxTurnSpeed = (PI_VALUE / 2.0f) * (float)m_pGameEngine->GetGameTicksFrameDelta( ) / 400.0f; + + float flRotationDelta = 0.0f; + float fTurnSpeed = m_SpaceWarClientUpdateData.GetTurnSpeed(); + if ( fTurnSpeed != 0.0f ) + { + flRotationDelta += fMaxTurnSpeed * fTurnSpeed; + } + else + { + if ( m_SpaceWarClientUpdateData.GetTurnLeftPressed( ) ) + { + flRotationDelta += -1.0f * fMaxTurnSpeed; + } + + if ( m_SpaceWarClientUpdateData.GetTurnRightPressed( ) ) + { + flRotationDelta += fMaxTurnSpeed; + } + } + + SetRotationDeltaNextFrame( flRotationDelta ); + } + + // Compute acceleration + if ( m_bIsLocalPlayer ) + { + // client side + m_SpaceWarClientUpdateData.SetReverseThrustersPressed( false ); + m_SpaceWarClientUpdateData.SetForwardThrustersPressed( false ); + + bool bForwardThrustActive = false; + if ( m_pGameEngine->BIsKeyDown( m_dwVKForwardThrusters ) || + m_pGameEngine->BIsControllerActionActive( eControllerDigitalAction_ForwardThrust ) ) + { + m_SpaceWarClientUpdateData.SetForwardThrustersPressed( true ); + bForwardThrustActive = true; + //m_pGameEngine->SetControllerColor( 100, 255, 0, k_ESteamControllerLEDFlag_SetColor ); + } + + if ( m_pGameEngine->BIsKeyDown( m_dwVKReverseThrusters ) || + m_pGameEngine->BIsControllerActionActive( eControllerDigitalAction_ReverseThrust ) ) + { + m_SpaceWarClientUpdateData.SetReverseThrustersPressed( true ); + } + + + // The Steam Controller can also map an analog axis to thrust and steer + float fThrusterLevel, fUnused; + m_pGameEngine->GetControllerAnalogAction( eControllerAnalogAction_AnalogControls, &fUnused, &fThrusterLevel ); + + if ( fThrusterLevel > 0.0f ) + { + m_SpaceWarClientUpdateData.SetForwardThrustersPressed( true ); + m_SpaceWarClientUpdateData.SetThrustersLevel( fThrusterLevel ); + bForwardThrustActive = true; + } + else if ( fThrusterLevel < 0.0f ) + { + m_SpaceWarClientUpdateData.SetReverseThrustersPressed( true ); + m_SpaceWarClientUpdateData.SetThrustersLevel( fThrusterLevel ); + } + + // We can activate action set layers based upon our state. + // This allows action bindings or settings to be changed on an existing action set for contextual usage + if ( bForwardThrustActive ) + { + m_pGameEngine->ActivateSteamControllerActionSetLayer( eControllerActionSet_Layer_Thrust ); + } + else if ( m_pGameEngine->BIsActionSetLayerActive( eControllerActionSet_Layer_Thrust ) ) + { + m_pGameEngine->DeactivateSteamControllerActionSetLayer( eControllerActionSet_Layer_Thrust ); + } + + // Hardcoded keys to choose various outfits and weapon powerups which require inventory. Note that this is not + // a "secure" multiplayer model - clients can lie about what they own. A more robust solution, if your items + // matter enough to bother, would be to use SerializeResult / DeserializeResult to encode the fact that your + // steamid owns certain items, and then send that encoded result to the server which decodes and verifies it. + if ( m_pGameEngine->BIsKeyDown( 0x30 ) ) + { + m_nShipDecoration = 0; + BuildGeometry(); + } + else if ( m_pGameEngine->BIsKeyDown( 0x31 ) && SpaceWarLocalInventory()->HasInstanceOf( k_SpaceWarItem_ShipDecoration1 ) ) + { + m_nShipDecoration = 1; + BuildGeometry(); + } + else if ( m_pGameEngine->BIsKeyDown( 0x32 ) && SpaceWarLocalInventory()->HasInstanceOf( k_SpaceWarItem_ShipDecoration2 ) ) + { + m_nShipDecoration = 2; + BuildGeometry(); + } + else if ( m_pGameEngine->BIsKeyDown( 0x33 ) && SpaceWarLocalInventory()->HasInstanceOf( k_SpaceWarItem_ShipDecoration3 ) ) + { + m_nShipDecoration = 3; + BuildGeometry(); + } + else if ( m_pGameEngine->BIsKeyDown( 0x34 ) && SpaceWarLocalInventory()->HasInstanceOf( k_SpaceWarItem_ShipDecoration4 ) ) + { + m_nShipDecoration = 4; + BuildGeometry(); + } + else if ( m_pGameEngine->BIsKeyDown( 0x35 ) && SpaceWarLocalInventory()->HasInstanceOf( k_SpaceWarItem_ShipWeapon1 ) ) + { + m_nShipWeapon = 1; + } + else if ( m_pGameEngine->BIsKeyDown( 0x36 ) && SpaceWarLocalInventory()->HasInstanceOf( k_SpaceWarItem_ShipWeapon2 ) ) + { + m_nShipWeapon = 2; + } + else if ( m_pGameEngine->BIsKeyDown( 0x37 ) && SpaceWarLocalInventory()->HasInstanceOf( k_SpaceWarItem_ShipSpecial1 ) ) + { + m_nShipPower = 1; + } + else if ( m_pGameEngine->BIsKeyDown( 0x38 ) && SpaceWarLocalInventory()->HasInstanceOf( k_SpaceWarItem_ShipSpecial2 ) ) + { + m_nShipPower = 2; + } + } + else if ( m_bIsServerInstance ) + { + // Server side + float xThrust = 0; + float yThrust = 0; + m_bReverseThrustersActive = false; + m_bForwardThrustersActive = false; + if ( m_SpaceWarClientUpdateData.GetReverseThrustersPressed() || m_SpaceWarClientUpdateData.GetForwardThrustersPressed() ) + { + float flSign = 1.0f; + if ( m_SpaceWarClientUpdateData.GetReverseThrustersPressed() ) + { + m_bReverseThrustersActive = true; + flSign = -1.0f; + } + else + { + m_bForwardThrustersActive = true; + } + + float fThrusterLevel = m_SpaceWarClientUpdateData.GetThrustersLevel(); + if ( fThrusterLevel != 0.0f ) + { + flSign = fThrusterLevel; + } + + if ( m_ulLastThrustStartedTickCount == 0 ) + { + m_ulLastThrustStartedTickCount = ulCurrentTickCount; + m_pGameEngine->TriggerControllerHaptics( k_ESteamControllerPad_Left, 2900, 1200, 4 ); + } + + // You have to hold the key for a second to reach maximum thrust + float factor = MIN( ((float)(ulCurrentTickCount - m_ulLastThrustStartedTickCount) / 500.0f) + 0.2f, 1.0f ); + + xThrust = flSign * (float)(MAXIMUM_SHIP_THRUST * factor * sin( GetAccumulatedRotation() ) ); + yThrust = flSign * -1.0f * (float)(MAXIMUM_SHIP_THRUST * factor * cos( GetAccumulatedRotation() ) ); + } + else + { + m_ulLastThrustStartedTickCount = 0; + } + + SetAcceleration( xThrust, yThrust ); + } + + + // We'll use these values in a few places below to compute positions of child objects + // appropriately given our rotation + float sinvalue = (float)sin( GetAccumulatedRotation() ); + float cosvalue = (float)cos( GetAccumulatedRotation() ); + + if ( m_bIsLocalPlayer ) + { + // client side + if ( m_pGameEngine->BIsKeyDown( m_dwVKFire ) || + m_pGameEngine->BIsControllerActionActive( eControllerDigitalAction_FireLasers ) ) + { + m_SpaceWarClientUpdateData.SetFirePressed( true ); + } + } + else if ( m_bIsServerInstance ) + { + // server side + if ( nNextAvailablePhotonBeamSlot != -1 && !m_bExploding && m_SpaceWarClientUpdateData.GetFirePressed() && ulCurrentTickCount - PHOTON_BEAM_FIRE_INTERVAL_TICKS > m_ulLastPhotonTickCount ) + { + m_ulLastPhotonTickCount = ulCurrentTickCount; + + if ( m_nShipWeapon == 1 ) // Item#101 + { + float sinvalue1 = (float)sin( GetAccumulatedRotation() - .1f ); + float cosvalue1 = (float)cos( GetAccumulatedRotation() - .1f ); + float sinvalue2 = (float)sin( GetAccumulatedRotation() + .1f ); + float cosvalue2 = (float)cos( GetAccumulatedRotation() + .1f ); + + float xVelocity = GetXVelocity() + ( sinvalue1 * 275 ); + float yVelocity = GetYVelocity() - ( cosvalue1 * 275 ); + + // Offset 12 points up from the center of the ship, compensating for rotation + float xPos = GetXPos() - sinvalue1*-12.0f; + float yPos = GetYPos() + cosvalue1*-12.0f; + + m_rgPhotonBeams[nNextAvailablePhotonBeamSlot] = new CPhotonBeam( m_pGameEngine, xPos, yPos, m_dwShipColor, GetAccumulatedRotation(), xVelocity, yVelocity ); + + nNextAvailablePhotonBeamSlot = -1; // Track next available slot for use spawning new beams below + for( int i=0; i < MAX_PHOTON_BEAMS_PER_SHIP; ++i ) + { + if ( !m_rgPhotonBeams[i] && nNextAvailablePhotonBeamSlot == -1 ) + nNextAvailablePhotonBeamSlot = i; + } + + if ( nNextAvailablePhotonBeamSlot != -1 ) + { + xVelocity = GetXVelocity() + ( sinvalue2 * 275 ); + yVelocity = GetYVelocity() - ( cosvalue2 * 275 ); + + // Offset 12 points up from the center of the ship, compensating for rotation + xPos = GetXPos() - sinvalue2*-12.0f; + yPos = GetYPos() + cosvalue2*-12.0f; + + m_rgPhotonBeams[nNextAvailablePhotonBeamSlot] = new CPhotonBeam( m_pGameEngine, xPos, yPos, m_dwShipColor, GetAccumulatedRotation(), xVelocity, yVelocity ); + m_pGameEngine->TriggerControllerHaptics( k_ESteamControllerPad_Right, 1000, 1500, 2 ); + } + } + else + { + float speed = 275; + if ( m_nShipWeapon == 2 ) // Item#102 + { + speed = 500; + } + float xVelocity = GetXVelocity() + ( sinvalue * speed ); + float yVelocity = GetYVelocity() - ( cosvalue * speed ); + + // Offset 12 points up from the center of the ship, compensating for rotation + float xPos = GetXPos() - sinvalue*-12.0f; + float yPos = GetYPos() + cosvalue*-12.0f; + + m_rgPhotonBeams[nNextAvailablePhotonBeamSlot] = new CPhotonBeam( m_pGameEngine, xPos, yPos, m_dwShipColor, GetAccumulatedRotation(), xVelocity, yVelocity ); + m_pGameEngine->TriggerControllerHaptics( k_ESteamControllerPad_Right, 1200, 2500, 3 ); + } + } + } + + CSpaceWarEntity::RunFrame(); + + // Finally, update the thrusters ( we do this after the base class call as they rely on our data being fully up-to-date) + m_ForwardThrusters.RunFrame(); + m_ReverseThrusters.RunFrame(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Render the ship +//----------------------------------------------------------------------------- +void CShip::Render() +{ + int beamCount = 0; + + if ( m_bDisabled ) + return; + + // render all the photon beams we have outstanding + for ( int i = 0; i < MAX_PHOTON_BEAMS_PER_SHIP; ++i ) + { + if ( m_rgPhotonBeams[i] ) + { + m_rgPhotonBeams[i]->Render(); + beamCount++; + } + } + + + if ( m_bExploding ) + { + // Don't draw actual ship, instead draw the pieces created in the explosion + std::list::iterator iter; + for ( iter = m_ListDebris.begin(); iter != m_ListDebris.end(); ++iter ) + ( *iter )->Render(); + return; + } + + // Check if we should be drawing thrusters + if ( m_bForwardThrustersActive ) + { + if ( rand() % 3 == 0 ) + m_ForwardThrusters.Render(); + } + + if ( m_bReverseThrustersActive ) + { + if ( rand() % 3 == 0 ) + m_ReverseThrusters.Render(); + } + + DWORD actualColor = m_dwShipColor; + + if ( m_nShipPower == 1 ) // Item#103 but need to check if the other guy has it sometimes? + { + if ( beamCount > 0 ) + { + m_nFade = 255; + } + else if ( m_nFade > 0 ) + { + m_nFade -= 5; + if ( m_nFade < 0 ) + m_nFade = 0; + if ( m_bIsLocalPlayer && m_nFade < 50 ) + { + m_nFade = 128; + } + } + actualColor = (actualColor & 0xffffff) | (m_nFade<<24); + } + + DWORD shieldColor = 0x00af8f00; + + if ( m_nShipPower == 2 ) + { + shieldColor = shieldColor | ((m_nShipShieldStrength / 4)<<24); + if ( m_nShipShieldStrength < 256 ) + m_nShipShieldStrength++; + + if ( !m_hTextureWhite ) + { + byte *pRGBAData = new byte[1 * 1 * 4]; + memset( pRGBAData, 255, 1 * 1 * 4 ); + m_hTextureWhite = m_pGameEngine->HCreateTexture( pRGBAData, 1, 1 ); + delete[] pRGBAData; + } + + float rotationClockwise = (m_pGameEngine->GetGameTickCount() / 500.0f); + float rotationCounter = -(m_pGameEngine->GetGameTickCount() / 500.0f); + + float x1 = 28.0f * (float)cos( rotationClockwise ); + float y1 = 28.0f * (float)sin( rotationClockwise ); + float x2 = 28.0f * (float)cos( rotationCounter ); + float y2 = 28.0f * (float)sin( rotationCounter ); + + m_pGameEngine->BDrawTexturedQuad( + this->GetXPos() - x1, this->GetYPos() - y1, this->GetXPos() + y1, this->GetYPos() - x1, + this->GetXPos() - y1, this->GetYPos() + x1, this->GetXPos() + x1, this->GetYPos() + y1, + 0, 0, 1, 1, shieldColor, m_hTextureWhite ); + + m_pGameEngine->BDrawTexturedQuad( + this->GetXPos() - x2, this->GetYPos() - y2, this->GetXPos() + y2, this->GetYPos() - x2, + this->GetXPos() - y2, this->GetYPos() + x2, this->GetXPos() + x2, this->GetYPos() + y2, + 0, 0, 1, 1, shieldColor, m_hTextureWhite ); + } + else + { + m_nShipShieldStrength = 0; + } + + CSpaceWarEntity::Render(actualColor); +} + +void CShip::UpdateVibrationEffects() +{ + if ( m_ulExplosionTickCount > 0 ) + { + float flVibration = MIN( ((float)(m_pGameEngine->GetGameTickCount() - m_ulExplosionTickCount) / 1000.0f), 1.0f ); + if ( flVibration == 1.0f ) + { + m_pGameEngine->TriggerControllerVibration( 0, 0 ); + m_ulExplosionTickCount = 0; + } + else + { + m_pGameEngine->TriggerControllerVibration( (unsigned short)( ( 1.0f - flVibration ) * 48000.0f), (unsigned short)( ( 1.0f - flVibration ) * 24000.0f) ); + } + } + + bool bTriggerEffectEnabled = !BIsDisabled() && !BIsExploding(); + if ( bTriggerEffectEnabled != m_bTriggerEffectEnabled ) + { + m_pGameEngine->SetTriggerEffect( bTriggerEffectEnabled ); + m_bTriggerEffectEnabled = bTriggerEffectEnabled; + } +} + +//----------------------------------------------------------------------------- +// Purpose: Set whether the ship is exploding +//----------------------------------------------------------------------------- +void CShip::SetExploding( bool bExploding ) +{ + // If we are already in the specified state, no need to do the below work + if ( m_bExploding == bExploding ) + { + UpdateVibrationEffects(); + return; + } + + Steamworks_TestSecret(); + + // Track that we are exploding, and disable collision detection + m_bExploding = bExploding; + SetCollisionDetectionDisabled( m_bExploding ); + + if ( bExploding ) + { + m_ulExplosionTickCount = m_pGameEngine->GetGameTickCount(); + + for( int i = 0; i < SHIP_DEBRIS_PIECES; ++i ) + { + CShipDebris * pDebris = new CShipDebris( m_pGameEngine, GetXPos(), GetYPos(), m_dwShipColor ); + m_ListDebris.push_back( pDebris ); + } + } + else + { + m_ulExplosionTickCount = 0; + + std::list::iterator iter; + for( iter = m_ListDebris.begin(); iter != m_ListDebris.end(); ++iter ) + delete *iter; + m_ListDebris.clear(); + } + + UpdateVibrationEffects(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Check for photons which have hit the target and remove them +//----------------------------------------------------------------------------- +void CShip::DestroyPhotonsColldingWith( CVectorEntity *pTarget ) +{ + for( int i=0; i < MAX_PHOTON_BEAMS_PER_SHIP; ++i ) + { + if ( !m_rgPhotonBeams[i] ) + continue; + + if ( m_rgPhotonBeams[i]->BCollidesWith( pTarget ) ) + { + // Photon beam hit the entity, destroy beam + delete m_rgPhotonBeams[i]; + m_rgPhotonBeams[i] = NULL; + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Check whether any of the photons this ship has fired are colliding with the target +//----------------------------------------------------------------------------- +bool CShip::BCheckForPhotonsCollidingWith( CVectorEntity *pTarget ) +{ + for( int i=0; i < MAX_PHOTON_BEAMS_PER_SHIP; ++i ) + { + if ( !m_rgPhotonBeams[i] ) + continue; + + if ( m_rgPhotonBeams[i]->BCollidesWith( pTarget ) ) + { + return true; + } + } + + return false; +} + + + +//----------------------------------------------------------------------------- +// Purpose: Build the update data to send from server to clients +//----------------------------------------------------------------------------- +void CShip::BuildServerUpdate( ServerShipUpdateData_t *pUpdateData ) +{ + pUpdateData->SetDisabled( BIsDisabled() ); + pUpdateData->SetExploding( BIsExploding() ); + pUpdateData->SetXAcceleration( GetXAccelerationLastFrame() ); + pUpdateData->SetYAcceleration( GetYAccelerationLastFrame() ); + pUpdateData->SetXPosition( GetXPos()/(float)m_pGameEngine->GetViewportWidth() ); + pUpdateData->SetYPosition( GetYPos()/(float)m_pGameEngine->GetViewportHeight() ); + pUpdateData->SetXVelocity( GetXVelocity() ); + pUpdateData->SetYVelocity( GetYVelocity() ); + pUpdateData->SetRotation( GetAccumulatedRotation() ); + pUpdateData->SetRotationDeltaLastFrame( GetRotationDeltaLastFrame() ); + pUpdateData->SetForwardThrustersActive( m_bForwardThrustersActive ); + pUpdateData->SetReverseThrustersActive( m_bReverseThrustersActive ); + pUpdateData->SetDecoration( m_nShipDecoration ); + pUpdateData->SetWeapon( m_nShipWeapon ); + pUpdateData->SetPower( m_nShipPower ); + pUpdateData->SetShieldStrength( m_nShipShieldStrength ); + + BuildServerPhotonBeamUpdate( pUpdateData ); +} + +//----------------------------------------------------------------------------- +// Purpose: Build the photon beam update data to send from the server to clients +//----------------------------------------------------------------------------- +void CShip::BuildServerPhotonBeamUpdate( ServerShipUpdateData_t *pUpdateData ) +{ + for( int i = 0; i < MAX_PHOTON_BEAMS_PER_SHIP; ++i ) + { + ServerPhotonBeamUpdateData_t *pPhotonUpdate = pUpdateData->AccessPhotonBeamData( i ); + if ( m_rgPhotonBeams[i] ) + { + pPhotonUpdate->SetActive( true ); + pPhotonUpdate->SetXPosition( m_rgPhotonBeams[i]->GetXPos()/(float)m_pGameEngine->GetViewportWidth() ); + pPhotonUpdate->SetYPosition( m_rgPhotonBeams[i]->GetYPos()/(float)m_pGameEngine->GetViewportHeight() ); + pPhotonUpdate->SetXVelocity( m_rgPhotonBeams[i]->GetXVelocity() ); + pPhotonUpdate->SetYVelocity( m_rgPhotonBeams[i]->GetYVelocity() ); + pPhotonUpdate->SetRotation( m_rgPhotonBeams[i]->GetAccumulatedRotation() ); + } + else + { + pPhotonUpdate->SetActive( false ); + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Accumulate stats for this ship +//----------------------------------------------------------------------------- +void CShip::AccumulateStats( CStatsAndAchievements *pStats ) +{ + if ( m_bIsLocalPlayer ) + { + pStats->AddDistanceTraveled( GetDistanceTraveledLastFrame() ); + } +} diff --git a/external/steamworks/steamworksexample/Ship.h b/external/steamworks/steamworksexample/Ship.h new file mode 100644 index 0000000..1837a8c --- /dev/null +++ b/external/steamworks/steamworksexample/Ship.h @@ -0,0 +1,230 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for rendering the player ships +// +// $NoKeywords: $ +//============================================================================= + +#ifndef SHIP_H +#define SHIP_H + +#include +#include "GameEngine.h" +#include "SpaceWarEntity.h" +#include "PhotonBeam.h" +#include "SpaceWar.h" + +#define MAXIMUM_SHIP_THRUST 150 + +#define SHIP_DEBRIS_PIECES 6 + +// Forward declaration +class CShip; +class CSpaceWarServer; +class CStatsAndAchievements; + +// Simple class for the ship thrusters +class CForwardThrusters : public CVectorEntity +{ +public: + CForwardThrusters( IGameEngine *pGameEngine, CShip *pShip ); + + // Run Frame + void RunFrame(); + +private: + CShip *m_pShip; +}; + +// Again, but in reverse +class CReverseThrusters : public CVectorEntity +{ +public: + CReverseThrusters( IGameEngine *pGameEngine, CShip *pShip ); + + // Run Frame + void RunFrame(); + +private: + CShip *m_pShip; +}; + +// Class to represent debris after explosion +class CShipDebris : public CSpaceWarEntity +{ +public: + CShipDebris( IGameEngine *pGameEngine, float xPos, float yPos, DWORD dwDebrisColor ); + + // Run Frame + void RunFrame(); +private: + + // We keep the debris spinning + float m_flRotationPerInterval; +}; + +class CShip : public CSpaceWarEntity +{ +public: + // Constructor + CShip( IGameEngine *pGameEngine, bool bIsServerInstance, float xPos, float yPos, DWORD dwShipColor ); + + // Destructor + ~CShip(); + + // Run a frame + void RunFrame(); + + // Render a frame + void Render(); + + // Update ship with data from server + void OnReceiveServerUpdate( ServerShipUpdateData_t *pUpdateData ); + + // Update the ship with data from a client + void OnReceiveClientUpdate( ClientSpaceWarUpdateData_t *pUpdateData ); + + // Get the update data for this ship client side (copying into memory passed in) + bool BGetClientUpdateData( ClientSpaceWarUpdateData_t *pUpdatedata ); + + // Build update data for the ship to send to clients + void BuildServerUpdate( ServerShipUpdateData_t *pUpdateData ); + + // Build update data for photon beams to send to clients + void BuildServerPhotonBeamUpdate( ServerShipUpdateData_t *pUpdateData ); + + // Reset vertex data for our object + void ResetVertexData(); + + // Set whether the ship is exploding + void SetExploding( bool bExploding ); + + // Rebuild the geometry when we change decoration + void BuildGeometry(); + + // Set whether the ship is disabled + void SetDisabled( bool bDisabled ) { m_bDisabled = bDisabled; } + + // Set the initial rotation for the ship + void SetInitialRotation( float flRotation ) { SetAccumulatedRotation( flRotation ); } + + // Setters for key bindings + void SetVKBindingLeft( DWORD dwVKLeft ) { m_dwVKLeft = dwVKLeft; } + void SetVKBindingRight( DWORD dwVKRight ) { m_dwVKRight = dwVKRight; } + void SetVKBindingForwardThrusters( DWORD dwVKForward ) { m_dwVKForwardThrusters = dwVKForward; } + void SetVKBindingReverseThrusters( DWORD dwVKReverse ) { m_dwVKReverseThrusters = dwVKReverse; } + void SetVKBindingFire( DWORD dwVKFire ) { m_dwVKFire = dwVKFire; } + + // Check for photons which have hit the entity and destroy the photons + void DestroyPhotonsColldingWith( CVectorEntity *pTarget ); + + // Check whether any of the photons this ship has fired are colliding with the target + bool BCheckForPhotonsCollidingWith( CVectorEntity *pTarget ); + + // Check if the ship is currently exploding + bool BIsExploding() { return m_bExploding; } + + // Check if the ship is currently disabled + bool BIsDisabled() { return m_bDisabled; } + + // Set whether this ship instance is for the local player + // (meaning it should pay attention to key input and such) + void SetIsLocalPlayer( bool bValue ) { m_bIsLocalPlayer = bValue; } + bool BIsLocalPlayer() { return m_bIsLocalPlayer; } + + // Accumulate stats for this ship + void AccumulateStats( CStatsAndAchievements *pStats ); + + // Get the name for this ship (only really works server side) + const char* GetPlayerName(); + + int GetShieldStrength() { return m_nShipShieldStrength; } + void SetShieldStrength( int strength ) { m_nShipShieldStrength = strength; } + + // Update the vibration effects for the ship + void UpdateVibrationEffects(); + +private: + + // Last time we sent an update on our local data to the server + uint64 m_ulLastClientUpdateTick; + + // Last time we detected the thrust key go down + uint64 m_ulLastThrustStartedTickCount; + + // Last time we fired a photon + uint64 m_ulLastPhotonTickCount; + + // When we exploded + uint64 m_ulExplosionTickCount; + + // Current trigger effect state + bool m_bTriggerEffectEnabled; + + // is this ship our local ship, or a remote player? + bool m_bIsLocalPlayer; + + // Is this ship instance running inside the server (otherwise its a client...) + bool m_bIsServerInstance; + + // is the ship exploding? + bool m_bExploding; + + // is the ship disabled for now? + bool m_bDisabled; + + // cloak fade out + int m_nFade; + + // vector of beams we have fired (in order of firing time) + CPhotonBeam * m_rgPhotonBeams[MAX_PHOTON_BEAMS_PER_SHIP]; + + // vector of debris to draw after an explosion + std::list< CShipDebris *> m_ListDebris; + + // Color for this ship + DWORD m_dwShipColor; + + // Decoration for this ship + int m_nShipDecoration; + + // Weapon for this ship + int m_nShipWeapon; + + // Power for this ship + int m_nShipPower; + + // Power for this ship + int m_nShipShieldStrength; + + HGAMETEXTURE m_hTextureWhite; + + // Thrusters for this ship + CForwardThrusters m_ForwardThrusters; + + // Track whether to draw the thrusters next render call + bool m_bForwardThrustersActive; + + // Thrusters for this ship + CReverseThrusters m_ReverseThrusters; + + // Thrust and rotation speed can be anlog when using a Steam Controller + float m_fThrusterLevel; + float m_fTurnSpeed; + + // Track whether to draw the thrusters next render call + bool m_bReverseThrustersActive; + + // This will get populated only if we are the local instance, and then + // sent to the server in response to each server update + ClientSpaceWarUpdateData_t m_SpaceWarClientUpdateData; + + // key bindings + DWORD m_dwVKLeft; + DWORD m_dwVKRight; + DWORD m_dwVKForwardThrusters; + DWORD m_dwVKReverseThrusters; + DWORD m_dwVKFire; +}; + +#endif // SHIP_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/SimpleProtobuf.cpp b/external/steamworks/steamworksexample/SimpleProtobuf.cpp new file mode 100644 index 0000000..5ff77c1 --- /dev/null +++ b/external/steamworks/steamworksexample/SimpleProtobuf.cpp @@ -0,0 +1,465 @@ +//====== Copyright 1996-2014, Valve Corporation, All rights reserved. ======= +// +// Purpose: Simple C++ protobuf manipulation routines. For a more advanced, +// fully-featured library, see https://developers.google.com/protocol-buffers/ +// +//=========================================================================== + +#include "SimpleProtobuf.h" + + +// +// NOTE: +// You should probably be using the official protobuf library instead if you +// have any concerns about how this code works, or are planning to modify it. +// + +#define CHECK_OVERRUN( ptr, end, len ) ( end < ptr || (size_t)( end - ptr ) < len ) + +static void ProtobufEncodeVarInt( std::string& strProtobuf, uint64 ulVarInt ) +{ + for ( ; ulVarInt >= 128; ulVarInt >>= 7 ) + strProtobuf.append( 1, ((char)ulVarInt & (char)127) | (char)128 ); + strProtobuf.append( 1, (char)ulVarInt ); +} + +void ProtobufWriteField_Integer( std::string& strProtobuf, uint32 uFieldNumber, uint64 ulVarIntData ) +{ + ProtobufEncodeVarInt( strProtobuf, PROTOBUF_FIELDTAG_INTEGER( uFieldNumber ) ); + ProtobufEncodeVarInt( strProtobuf, ulVarIntData ); +} + +void ProtobufWriteField_SInteger( std::string& strProtobuf, uint32 uFieldNumber, int64 ulSwizzleVarIntData ) +{ + ProtobufEncodeVarInt( strProtobuf, PROTOBUF_FIELDTAG_SINTEGER( uFieldNumber ) ); + ProtobufEncodeVarInt( strProtobuf, (ulSwizzleVarIntData << 1) ^ (ulSwizzleVarIntData >> 63) ); +} + +void ProtobufWriteField_Fixed64( std::string& strProtobuf, uint32 uFieldNumber, uint64 ulFixed64Data ) +{ + ProtobufEncodeVarInt( strProtobuf, PROTOBUF_FIELDTAG_FIXED64( uFieldNumber ) ); +#ifdef VALVE_BIG_ENDIAN + ulFixed64Data = QWordSwap( ulFixed64Data ); +#endif + strProtobuf.append( reinterpret_cast(&ulFixed64Data), 8 ); +} + +void ProtobufWriteField_Fixed64( std::string& strProtobuf, uint32 uFieldNumber, double flFixed64Data ) +{ + ProtobufEncodeVarInt( strProtobuf, PROTOBUF_FIELDTAG_FIXED64( uFieldNumber ) ); + const char *pData = reinterpret_cast(&flFixed64Data); +#ifdef VALVE_BIG_ENDIAN + strProtobuf.append( std::const_reverse_iterator( pData + 8 ), std::const_reverse_iterator( pData ) ); +#else + strProtobuf.append( pData, 8 ); +#endif +} + +void ProtobufWriteField_String( std::string& strProtobuf, uint32 uFieldNumber, const char *pchData, size_t cchData ) +{ + ProtobufEncodeVarInt( strProtobuf, PROTOBUF_FIELDTAG_STRING( uFieldNumber ) ); + ProtobufEncodeVarInt( strProtobuf, cchData ); + strProtobuf.append( pchData, cchData ); +} + +void ProtobufWriteField_String( std::string& strProtobuf, uint32 uFieldNumber, const std::string &strData ) +{ + ProtobufWriteField_String( strProtobuf, uFieldNumber, strData.data(), strData.size() ); +} + +void ProtobufWriteField_String( std::string& strProtobuf, uint32 uFieldNumber, const char *pchData ) +{ + ProtobufWriteField_String( strProtobuf, uFieldNumber, pchData, strlen( pchData ) ); +} + +void ProtobufWriteField_Fixed32( std::string& strProtobuf, uint32 uFieldNumber, uint32 ulFixed32Data ) +{ + ProtobufEncodeVarInt( strProtobuf, PROTOBUF_FIELDTAG_FIXED32( uFieldNumber ) ); +#ifdef VALVE_BIG_ENDIAN + ulFixed32Data = DWordSwap( ulFixed32Data ); +#endif + strProtobuf.append( reinterpret_cast(&ulFixed32Data), 4 ); +} + +void ProtobufWriteField_Fixed32( std::string& strProtobuf, uint32 uFieldNumber, float flFixed32Data ) +{ + ProtobufEncodeVarInt( strProtobuf, PROTOBUF_FIELDTAG_FIXED32( uFieldNumber ) ); + const char *pData = reinterpret_cast(&flFixed32Data); +#ifdef VALVE_BIG_ENDIAN + strProtobuf.append( std::const_reverse_iterator( pData + 4 ), std::const_reverse_iterator( pData ) ); +#else + strProtobuf.append( pData, 4 ); +#endif +} + + +static bool ProtobufDecodeVarInt( const char * &pParsePosition, const char *pParseEnd, uint64 &ulVarInt ) +{ + const char * pStart = pParsePosition; + while ( pParsePosition < pParseEnd && (*pParsePosition & 128) ) + ++pParsePosition; + if ( pParsePosition >= pParseEnd ) + return false; + uint64 v = 0; + for ( const char *p = pParsePosition++; p >= pStart; --p ) + v = (v << 7) + (*p & 127); + ulVarInt = v; + return true; +} + +bool ProtobufReadFieldTag( const char * &pParsePosition, const char *pParseEnd, uint32 &uFieldTag ) +{ + uint64 v; + if ( !ProtobufDecodeVarInt( pParsePosition, pParseEnd, v ) || v == 0 || (v >> 32) != 0 ) + { + pParsePosition = pParseEnd; + return false; + } + uFieldTag = (uint32)v; + return true; +} + +bool ProtobufSkipFieldValue( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag ) +{ + switch ( uFieldTag & 7 ) + { + case 0: // VARINT + while ( pParsePosition < pParseEnd ) + { + char c = *pParsePosition++; + if ( !( c & 128 ) ) + return true; + } + return false; + + case 1: // FIXED64 + if ( CHECK_OVERRUN( pParsePosition, pParseEnd, 8 ) ) + { + pParsePosition = pParseEnd; + return false; + } + pParsePosition += 8; + return true; + + case 2: // LENGTH DELIM (string, etc) + { + uint64 ulLength = 0; + if ( !ProtobufDecodeVarInt( pParsePosition, pParseEnd, ulLength ) ) + return false; + if ( CHECK_OVERRUN( pParsePosition, pParseEnd, ulLength ) ) + { + pParsePosition = pParseEnd; + return false; + } + pParsePosition += ulLength; + return true; + } + + case 5: // FIXED32 + if ( CHECK_OVERRUN( pParsePosition, pParseEnd, 4 ) ) + { + pParsePosition = pParseEnd; + return false; + } + pParsePosition += 4; + return true; + + default: // UNKNOWN + pParsePosition = pParseEnd; + return false; + } +} + +bool ProtobufReadFixed32( const char * &pParsePosition, const char *pParseEnd, int32 &nValue ) +{ + if ( CHECK_OVERRUN( pParsePosition, pParseEnd, 4 ) ) + { + pParsePosition = pParseEnd; + return false; + } + memcpy( &nValue, pParsePosition, 4 ); +#ifdef VALVE_BIG_ENDIAN + nValue = DWordSwap( nValue ); +#endif + pParsePosition += 4; + return true; +} + +bool ProtobufReadFixed32( const char * &pParsePosition, const char *pParseEnd, uint32 &uValue ) +{ + if ( CHECK_OVERRUN( pParsePosition, pParseEnd, 4 ) ) + { + pParsePosition = pParseEnd; + return false; + } + memcpy( &uValue, pParsePosition, 4 ); +#ifdef VALVE_BIG_ENDIAN + uValue = DWordSwap( uValue ); +#endif + pParsePosition += 4; + return true; +} + +bool ProtobufReadFixed32( const char * &pParsePosition, const char *pParseEnd, float &flValue ) +{ + if ( CHECK_OVERRUN( pParsePosition, pParseEnd, 4 ) ) + { + pParsePosition = pParseEnd; + return false; + } +#ifdef VALVE_BIG_ENDIAN + std::copy( std::const_reverse_iterator( pParsePosition + 4 ), std::const_reverse_iterator( pParsePosition ), reinterpret_cast(&flValue) ); +#else + memcpy( &flValue, pParsePosition, 4 ); +#endif + pParsePosition += 4; + return true; +} + +bool ProtobufReadFixed64( const char * &pParsePosition, const char *pParseEnd, int64 &lValue ) +{ + if ( CHECK_OVERRUN( pParsePosition, pParseEnd, 8 ) ) + { + pParsePosition = pParseEnd; + return false; + } + memcpy( &lValue, pParsePosition, 8 ); +#ifdef VALVE_BIG_ENDIAN + lValue = QWordSwap( lValue ); +#endif + pParsePosition += 8; + return true; +} + +bool ProtobufReadFixed64( const char * &pParsePosition, const char *pParseEnd, uint64 &ulValue ) +{ + if ( CHECK_OVERRUN( pParsePosition, pParseEnd, 8 ) ) + { + pParsePosition = pParseEnd; + return false; + } + memcpy( &ulValue, pParsePosition, 8 ); +#ifdef VALVE_BIG_ENDIAN + ulValue = QWordSwap( ulValue ); +#endif + pParsePosition += 8; + return true; +} + +bool ProtobufReadFixed64( const char * &pParsePosition, const char *pParseEnd, double &flValue ) +{ + if ( CHECK_OVERRUN( pParsePosition, pParseEnd, 8 ) ) + { + pParsePosition = pParseEnd; + return false; + } +#ifdef VALVE_BIG_ENDIAN + std::copy( std::const_reverse_iterator( pParsePosition + 8 ), std::const_reverse_iterator( pParsePosition ), reinterpret_cast(&flValue) ); +#else + memcpy( &flValue, pParsePosition, 8 ); +#endif + pParsePosition += 8; + return true; +} + +bool ProtobufReadInteger( const char * &pParsePosition, const char *pParseEnd, uint64 &ulVarInt ) +{ + return ProtobufDecodeVarInt( pParsePosition, pParseEnd, ulVarInt ); +} + +bool ProtobufReadInteger( const char * &pParsePosition, const char *pParseEnd, int64 &lVarInt ) +{ + return ProtobufDecodeVarInt( pParsePosition, pParseEnd, reinterpret_cast(lVarInt) ); +} + +bool ProtobufReadInteger( const char * &pParsePosition, const char *pParseEnd, uint32 &uVarInt ) +{ + uint64 ulVarInt; + if ( !ProtobufDecodeVarInt( pParsePosition, pParseEnd, ulVarInt ) ) + return false; + uVarInt = (uint32)ulVarInt; + return (uint64)uVarInt == ulVarInt; +} + +bool ProtobufReadInteger( const char * &pParsePosition, const char *pParseEnd, int32 &nVarInt ) +{ + uint64 ulVarInt; + if ( !ProtobufDecodeVarInt( pParsePosition, pParseEnd, ulVarInt ) ) + return false; + nVarInt = (int32)ulVarInt; + return (uint64)(int64)nVarInt == ulVarInt; +} + +bool ProtobufReadInteger( const char * &pParsePosition, const char *pParseEnd, bool &bVarInt ) +{ + uint64 ulVarInt; + if ( !ProtobufDecodeVarInt( pParsePosition, pParseEnd, ulVarInt ) ) + return false; + bVarInt = ( ulVarInt != 0 ); + return true; +} + +bool ProtobufReadSInteger( const char * &pParsePosition, const char *pParseEnd, int64 &lVarInt ) +{ + uint64 v; + if ( !ProtobufDecodeVarInt( pParsePosition, pParseEnd, v ) ) + return false; + lVarInt = (int64)(v >> 1) ^ -(int64)(v & 1); + return true; +} + +bool ProtobufReadSInteger( const char * &pParsePosition, const char *pParseEnd, int32 &nVarInt ) +{ + uint64 v; + if ( !ProtobufDecodeVarInt( pParsePosition, pParseEnd, v ) ) + return false; + int64 lVarInt = (int64)(v >> 1) ^ -(int64)(v & 1); + nVarInt = (int32)lVarInt; + return (int64)nVarInt == lVarInt; +} + +bool ProtobufReadString( const char * &pParsePosition, const char *pParseEnd, std::string &strValue ) +{ + uint64 ulLength; + if ( !ProtobufDecodeVarInt( pParsePosition, pParseEnd, ulLength ) ) + return false; + if ( CHECK_OVERRUN( pParsePosition, pParseEnd, ulLength ) ) + { + pParsePosition = pParseEnd; + return false; + } + strValue.assign( pParsePosition, (size_t)ulLength ); + pParsePosition += ulLength; + return true; +} + +bool ProtobufReadStringAlias( const char * &pParsePosition, const char *pParseEnd, const char * &pStringDataStart, const char * &pStringDataEnd ) +{ + uint64 ulLength; + if ( !ProtobufDecodeVarInt( pParsePosition, pParseEnd, ulLength ) ) + return false; + if ( CHECK_OVERRUN( pParsePosition, pParseEnd, ulLength ) ) + { + pParsePosition = pParseEnd; + return false; + } + pStringDataStart = pParsePosition; + pParsePosition += ulLength; + pStringDataEnd = pParsePosition; + return true; +} + + +template < typename T > +static bool ProtobufReadRepeated_T( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector< T > &vecData, bool( *pfnRead )(const char * &, const char *, T &) ) +{ + if ( (uFieldTag & 7) == 2 ) + { + const char *pStart = NULL, *pEnd = NULL; + if ( !ProtobufReadStringAlias( pParsePosition, pParseEnd, pStart, pEnd ) ) + return false; + + while ( pStart != pEnd ) + { + T v; + if ( !pfnRead( pStart, pEnd, v ) ) + return false; + vecData.push_back( v ); + } + } + else + { + T v; + if ( !pfnRead( pParsePosition, pParseEnd, v ) ) + return false; + vecData.push_back( v ); + } + return true; +} + +bool ProtobufReadRepeatedInteger( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ) { return ProtobufReadRepeated_T( pParsePosition, pParseEnd, uFieldTag, vec, &ProtobufReadInteger ); } +bool ProtobufReadRepeatedInteger( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ) { return ProtobufReadRepeated_T( pParsePosition, pParseEnd, uFieldTag, vec, &ProtobufReadInteger ); } +bool ProtobufReadRepeatedInteger( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ) { return ProtobufReadRepeated_T( pParsePosition, pParseEnd, uFieldTag, vec, &ProtobufReadInteger ); } +bool ProtobufReadRepeatedInteger( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ) { return ProtobufReadRepeated_T( pParsePosition, pParseEnd, uFieldTag, vec, &ProtobufReadInteger ); } +bool ProtobufReadRepeatedInteger( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ) { return ProtobufReadRepeated_T( pParsePosition, pParseEnd, uFieldTag, vec, &ProtobufReadInteger ); } +bool ProtobufReadRepeatedSInteger( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ) { return ProtobufReadRepeated_T( pParsePosition, pParseEnd, uFieldTag, vec, &ProtobufReadSInteger ); } +bool ProtobufReadRepeatedSInteger( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ) { return ProtobufReadRepeated_T( pParsePosition, pParseEnd, uFieldTag, vec, &ProtobufReadSInteger ); } +bool ProtobufReadRepeatedFixed32( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ) { return ProtobufReadRepeated_T( pParsePosition, pParseEnd, uFieldTag, vec, &ProtobufReadFixed32 ); } +bool ProtobufReadRepeatedFixed32( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ) { return ProtobufReadRepeated_T( pParsePosition, pParseEnd, uFieldTag, vec, &ProtobufReadFixed32 ); } +bool ProtobufReadRepeatedFixed32( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ) { return ProtobufReadRepeated_T( pParsePosition, pParseEnd, uFieldTag, vec, &ProtobufReadFixed32 ); } +bool ProtobufReadRepeatedFixed64( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ) { return ProtobufReadRepeated_T( pParsePosition, pParseEnd, uFieldTag, vec, &ProtobufReadFixed64 ); } +bool ProtobufReadRepeatedFixed64( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ) { return ProtobufReadRepeated_T( pParsePosition, pParseEnd, uFieldTag, vec, &ProtobufReadFixed64 ); } +bool ProtobufReadRepeatedFixed64( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ) { return ProtobufReadRepeated_T( pParsePosition, pParseEnd, uFieldTag, vec, &ProtobufReadFixed64 ); } + +bool ProtobufReadRepeatedString( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ) +{ + vec.push_back( std::string() ); + if ( !ProtobufReadString( pParsePosition, pParseEnd, vec.back() ) ) + { + vec.pop_back(); + return false; + } + return true; +} + + +template < typename T > +static bool ProtobufExtractField_T( const char *pParsePosition, const char *pParseEnd, uint32 uFieldTag, T &value, bool( *pfnRead )(const char * &, const char *, T &) ) +{ + uint32 uCurrentTag = 0; + bool bOK = false; + while ( ProtobufReadFieldTag( pParsePosition, pParseEnd, uCurrentTag ) ) + { + if ( uCurrentTag == uFieldTag ) + bOK = pfnRead( pParsePosition, pParseEnd, value ); + else + ProtobufSkipFieldValue( pParsePosition, pParseEnd, uCurrentTag ); + } + return bOK; +} + +template < typename T > +static bool ProtobufExtractField_T( const char *pParsePosition, const char *pParseEnd, uint32 uFieldTag, T &value, bool( *pfnRead )(const char * &, const char *, uint32, T &) ) +{ + uint32 uCurrentTag = 0; + bool bOK = false; + while ( ProtobufReadFieldTag( pParsePosition, pParseEnd, uCurrentTag ) ) + { + if ( uCurrentTag == uFieldTag || uCurrentTag == PROTOBUF_FIELDTAG_STRING( uFieldTag >> 3 ) ) + bOK = pfnRead( pParsePosition, pParseEnd, uCurrentTag, value ); + else + ProtobufSkipFieldValue( pParsePosition, pParseEnd, uCurrentTag ); + } + return bOK; +} + +bool ProtobufExtractField_Integer( const std::string &strProtobuf, uint32 uFieldNumber, uint64 &value ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_INTEGER( uFieldNumber ), value, &ProtobufReadInteger ); } +bool ProtobufExtractField_Integer( const std::string &strProtobuf, uint32 uFieldNumber, int64 &value ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_INTEGER( uFieldNumber ), value, &ProtobufReadInteger ); } +bool ProtobufExtractField_Integer( const std::string &strProtobuf, uint32 uFieldNumber, uint32 &value ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_INTEGER( uFieldNumber ), value, &ProtobufReadInteger ); } +bool ProtobufExtractField_Integer( const std::string &strProtobuf, uint32 uFieldNumber, int32 &value ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_INTEGER( uFieldNumber ), value, &ProtobufReadInteger ); } +bool ProtobufExtractField_Integer( const std::string &strProtobuf, uint32 uFieldNumber, bool &value ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_INTEGER( uFieldNumber ), value, &ProtobufReadInteger ); } +bool ProtobufExtractField_SInteger( const std::string &strProtobuf, uint32 uFieldNumber, int64 &value ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_SINTEGER( uFieldNumber ), value, &ProtobufReadSInteger ); } +bool ProtobufExtractField_SInteger( const std::string &strProtobuf, uint32 uFieldNumber, int32 &value ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_SINTEGER( uFieldNumber ), value, &ProtobufReadSInteger ); } +bool ProtobufExtractField_Fixed64( const std::string &strProtobuf, uint32 uFieldNumber, int64 &value ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_FIXED64( uFieldNumber ), value, &ProtobufReadFixed64 ); } +bool ProtobufExtractField_Fixed64( const std::string &strProtobuf, uint32 uFieldNumber, uint64 &value ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_FIXED64( uFieldNumber ), value, &ProtobufReadFixed64 ); } +bool ProtobufExtractField_Fixed64( const std::string &strProtobuf, uint32 uFieldNumber, double &value ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_FIXED64( uFieldNumber ), value, &ProtobufReadFixed64 ); } +bool ProtobufExtractField_Fixed32( const std::string &strProtobuf, uint32 uFieldNumber, int32 &value ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_FIXED32( uFieldNumber ), value, &ProtobufReadFixed32 ); } +bool ProtobufExtractField_Fixed32( const std::string &strProtobuf, uint32 uFieldNumber, uint32 &value ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_FIXED32( uFieldNumber ), value, &ProtobufReadFixed32 ); } +bool ProtobufExtractField_Fixed32( const std::string &strProtobuf, uint32 uFieldNumber, float &value ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_FIXED32( uFieldNumber ), value, &ProtobufReadFixed32 ); } +bool ProtobufExtractField_String( const std::string &strProtobuf, uint32 uFieldNumber, std::string &value ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_STRING( uFieldNumber ), value, &ProtobufReadString ); } + +bool ProtobufExtractField_Integer( const std::string &strProtobuf, uint32 uFieldNumber, std::vector &vec ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_INTEGER( uFieldNumber ), vec, &ProtobufReadRepeatedInteger ); } +bool ProtobufExtractField_Integer( const std::string &strProtobuf, uint32 uFieldNumber, std::vector &vec ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_INTEGER( uFieldNumber ), vec, &ProtobufReadRepeatedInteger ); } +bool ProtobufExtractField_Integer( const std::string &strProtobuf, uint32 uFieldNumber, std::vector &vec ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_INTEGER( uFieldNumber ), vec, &ProtobufReadRepeatedInteger ); } +bool ProtobufExtractField_Integer( const std::string &strProtobuf, uint32 uFieldNumber, std::vector &vec ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_INTEGER( uFieldNumber ), vec, &ProtobufReadRepeatedInteger ); } +bool ProtobufExtractField_Integer( const std::string &strProtobuf, uint32 uFieldNumber, std::vector &vec ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_INTEGER( uFieldNumber ), vec, &ProtobufReadRepeatedInteger ); } +bool ProtobufExtractField_SInteger( const std::string &strProtobuf, uint32 uFieldNumber, std::vector &vec ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_SINTEGER( uFieldNumber ), vec, &ProtobufReadRepeatedSInteger ); } +bool ProtobufExtractField_SInteger( const std::string &strProtobuf, uint32 uFieldNumber, std::vector &vec ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_SINTEGER( uFieldNumber ), vec, &ProtobufReadRepeatedSInteger ); } +bool ProtobufExtractField_Fixed64( const std::string &strProtobuf, uint32 uFieldNumber, std::vector &vec ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_FIXED64( uFieldNumber ), vec, &ProtobufReadRepeatedFixed64 ); } +bool ProtobufExtractField_Fixed64( const std::string &strProtobuf, uint32 uFieldNumber, std::vector &vec ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_FIXED64( uFieldNumber ), vec, &ProtobufReadRepeatedFixed64 ); } +bool ProtobufExtractField_Fixed64( const std::string &strProtobuf, uint32 uFieldNumber, std::vector &vec ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_FIXED64( uFieldNumber ), vec, &ProtobufReadRepeatedFixed64 ); } +bool ProtobufExtractField_Fixed32( const std::string &strProtobuf, uint32 uFieldNumber, std::vector &vec ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_FIXED32( uFieldNumber ), vec, &ProtobufReadRepeatedFixed32 ); } +bool ProtobufExtractField_Fixed32( const std::string &strProtobuf, uint32 uFieldNumber, std::vector &vec ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_FIXED32( uFieldNumber ), vec, &ProtobufReadRepeatedFixed32 ); } +bool ProtobufExtractField_Fixed32( const std::string &strProtobuf, uint32 uFieldNumber, std::vector &vec ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_FIXED32( uFieldNumber ), vec, &ProtobufReadRepeatedFixed32 ); } +bool ProtobufExtractField_String( const std::string &strProtobuf, uint32 uFieldNumber, std::vector &vec ) { return ProtobufExtractField_T( strProtobuf.data(), strProtobuf.data() + strProtobuf.size(), PROTOBUF_FIELDTAG_STRING( uFieldNumber ), vec, &ProtobufReadRepeatedString ); } + diff --git a/external/steamworks/steamworksexample/SimpleProtobuf.h b/external/steamworks/steamworksexample/SimpleProtobuf.h new file mode 100644 index 0000000..65ffb3f --- /dev/null +++ b/external/steamworks/steamworksexample/SimpleProtobuf.h @@ -0,0 +1,190 @@ +//====== Copyright 1996-2014, Valve Corporation, All rights reserved. ======= +// +// Purpose: Simple C++ protobuf manipulation routines. For a more advanced, +// fully-featured library, see https://developers.google.com/protocol-buffers/ +// +//=========================================================================== + +#ifndef SIMPLEPROTOBUF_H +#define SIMPLEPROTOBUF_H + +#pragma once + +#include "steam/steamtypes.h" +#include +#include +#include + + +// +// This file contains some quick-and-dirty helpers that can encode and +// decode the protocol-buffer ("protobuf") serialization format. It's +// a reasonable way to communicate with simple protobuf-based services. +// +// However, if you are doing serious work with protobufs, you should +// take the time to understand and use the official C++ library. It +// provides a tool which copmiles protobuf descriptions directly into +// working C++ classes, which will save you time and effort, and help +// with parsing complicated message types. +// +// https://developers.google.com/protocol-buffers/ +// + +// +// The protobuf serialization format is a simple field-based encoding; +// a complete protobuf is the unordered concatenation of all its fields. +// Unknown or incorrectly-typed fields are ignored by protobuf parsers. +// +// Details: https://developers.google.com/protocol-buffers/docs/encoding +// +// All protobuf value types use one of these five encodings: +// Integer: bool, enum, int32, uint32, int64, uint64 +// SInteger: sint32, sint64 +// Fixed32: fixed32, float +// Fixed64: fixed64, double +// String: string, bytes, nested message types +// +// Nested protobufs are built up independently, then encoded as string +// fields in the parent protobuf. +// +// Arrays ("repeated" field types) have two possible encodings: simple +// and packed. This utility file can parse both encodings, but only +// emits simple repeated fields (via multiple ProtobufWriteField calls +// with the same field number, one for every array element). +// + +// +// Example usage +// +// If this is the protobuf definition of a message... +// +// message TestMessage { +// optional uint32 index = 1; +// optional string text = 2; +// repeated double number = 3; +// optional bool flag = 4; +// } +// +// ...then this is how to compose it: +// +// std::string msg; +// ProtobufWriteField_Integer( msg, 1, iIndex ); +// ProtobufWriteField_Integer( msg, 4, true ); +// ProtobufWriteField_Fixed64( msg, 3, 1.0 ); +// ProtobufWriteField_Fixed64( msg, 3, 2.0 ); +// ProtobufWriteField_Fixed64( msg, 3, 3.0 ); +// ProtobufWriteField_String( msg, 2, "text field" ); +// +// ...and this is how to extract individual fields: +// +// std::string strText; +// ProtobufExtractField_String( msg, 2, strText ); +// +// ...and this is how to parse it with optimized low-level operations: +// +// bool bFlag = false; +// uint32 uIndex = 0; +// std::string strText; +// std::vector< double > vecNumbers; +// +// const char *pParse = msg.data(), *pEnd = msg.data() + msg.size(); +// for ( uint32 uFieldTag = 0; ProtobufReadFieldTag( pParse, pEnd, uFieldTag ); ) { +// switch ( uFieldTag ) { +// case PROTOBUF_FIELDTAG_INTEGER( 1 ): ProtobufReadInteger( pParse, pEnd, iIndex ); break; +// case PROTOBUF_FIELDTAG_STRING( 2 ): ProtobufReadString( pParse, pEnd, strText ); break; +// case PROTOBUF_FIELDTAG_FIXED64( 3 ): case PROTOBUF_FIELDTAG_REPEATED_FIXED64( 3 ): +// ProtobufReadRepeatedFixed64( pParse, pEnd, uFieldTag, vecNumbers ); break; +// case PROTOBUF_FIELDTAG_STRING( 4 ): ProtobufReadInteger( pParse, pEnd, bFlag ); break; +// default: ProtobufSkipFieldValue( pParse, pEnd, uFieldTag ); break; +// } +// } +// +// +// NOTE: it is important to handle both REPEATED and non-REPEATED cases when +// parsing repeated fields, for all types other than strings! There are two +// different possible encodings for repeated non-string fields, and failing +// to handle both cases can lead to invalid parse results. +// + + +// Encoding functions +// +// Note: C++ type promotion rules will automatically handle smaller integer types + +void ProtobufWriteField_Integer( std::string& strProtobuf, uint32 uFieldNumber, uint64 ulVarIntData ); +void ProtobufWriteField_SInteger( std::string& strProtobuf, uint32 uFieldNumber, int64 lSwizzleVarIntData ); +void ProtobufWriteField_Fixed64( std::string& strProtobuf, uint32 uFieldNumber, uint64 ulFixed64Data ); +void ProtobufWriteField_Fixed64( std::string& strProtobuf, uint32 uFieldNumber, double flFixed64Data ); +void ProtobufWriteField_Fixed32( std::string& strProtobuf, uint32 uFieldNumber, uint32 ulFixed32Data ); +void ProtobufWriteField_Fixed32( std::string& strProtobuf, uint32 uFieldNumber, float flFixed32Data ); +void ProtobufWriteField_String( std::string& strProtobuf, uint32 uFieldNumber, const char *pchData, size_t cchData ); +void ProtobufWriteField_String( std::string& strProtobuf, uint32 uFieldNumber, const char *pchData ); +void ProtobufWriteField_String( std::string& strProtobuf, uint32 uFieldNumber, const std::string &strData ); + +// Decoding functions, high-level (not optimized for speed) +// + +bool ProtobufExtractField_Integer( const std::string & strProtobuf, uint32 uFieldNumber, uint64 &ulData ); +bool ProtobufExtractField_Integer( const std::string & strProtobuf, uint32 uFieldNumber, int64 &lData ); +bool ProtobufExtractField_Integer( const std::string & strProtobuf, uint32 uFieldNumber, uint32 &uData ); +bool ProtobufExtractField_Integer( const std::string & strProtobuf, uint32 uFieldNumber, int32 &iData ); +bool ProtobufExtractField_Integer( const std::string & strProtobuf, uint32 uFieldNumber, bool &bData ); +bool ProtobufExtractField_SInteger( const std::string & strProtobuf, uint32 uFieldNumber, int64 &lData ); +bool ProtobufExtractField_SInteger( const std::string & strProtobuf, uint32 uFieldNumber, int32 &lData ); +bool ProtobufExtractField_Fixed64( const std::string & strProtobuf, uint32 uFieldNumber, uint64 &ulData ); +bool ProtobufExtractField_Fixed64( const std::string & strProtobuf, uint32 uFieldNumber, int64 &lData ); +bool ProtobufExtractField_Fixed64( const std::string & strProtobuf, uint32 uFieldNumber, double &flData ); +bool ProtobufExtractField_Fixed32( const std::string & strProtobuf, uint32 uFieldNumber, uint32 &uData ); +bool ProtobufExtractField_Fixed32( const std::string & strProtobuf, uint32 uFieldNumber, int32 &iData ); +bool ProtobufExtractField_Fixed32( const std::string & strProtobuf, uint32 uFieldNumber, float &flData ); +bool ProtobufExtractField_String( const std::string & strProtobuf, uint32 uFieldNumber, std::string &strData ); + +// Decoding functions, low-level (see example usage and important NOTE in comments above) +// + +bool ProtobufReadFieldTag( const char * &pParsePosition, const char *pParseEnd, uint32 &uFieldTag ); +bool ProtobufSkipFieldValue( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag ); +bool ProtobufReadInteger( const char * &pParsePosition, const char *pParseEnd, uint64 &ulVarInt ); +bool ProtobufReadInteger( const char * &pParsePosition, const char *pParseEnd, int64 &lVarInt ); +bool ProtobufReadInteger( const char * &pParsePosition, const char *pParseEnd, uint32 &uVarInt ); +bool ProtobufReadInteger( const char * &pParsePosition, const char *pParseEnd, int32 &nVarInt ); +bool ProtobufReadInteger( const char * &pParsePosition, const char *pParseEnd, bool &bVarInt ); +bool ProtobufReadSInteger( const char * &pParsePosition, const char *pParseEnd, int64 &lVarInt ); +bool ProtobufReadSInteger( const char * &pParsePosition, const char *pParseEnd, int32 &nVarInt ); +bool ProtobufReadFixed64( const char * &pParsePosition, const char *pParseEnd, int64 &lValue ); +bool ProtobufReadFixed64( const char * &pParsePosition, const char *pParseEnd, uint64 &ulValue ); +bool ProtobufReadFixed64( const char * &pParsePosition, const char *pParseEnd, double &flValue ); +bool ProtobufReadFixed32( const char * &pParsePosition, const char *pParseEnd, int32 &nValue ); +bool ProtobufReadFixed32( const char * &pParsePosition, const char *pParseEnd, uint32 &uValue ); +bool ProtobufReadFixed32( const char * &pParsePosition, const char *pParseEnd, float &flValue ); +bool ProtobufReadString( const char * &pParsePosition, const char *pParseEnd, std::string &strValue ); +bool ProtobufReadStringAlias( const char * &pParsePosition, const char *pParseEnd, const char * &pStringDataStart, const char * &pStringDataEnd ); + +bool ProtobufReadRepeatedInteger( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ); +bool ProtobufReadRepeatedInteger( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ); +bool ProtobufReadRepeatedInteger( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ); +bool ProtobufReadRepeatedInteger( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ); +bool ProtobufReadRepeatedInteger( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ); +bool ProtobufReadRepeatedSInteger( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ); +bool ProtobufReadRepeatedSInteger( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ); +bool ProtobufReadRepeatedFixed64( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ); +bool ProtobufReadRepeatedFixed64( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ); +bool ProtobufReadRepeatedFixed64( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ); +bool ProtobufReadRepeatedFixed32( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ); +bool ProtobufReadRepeatedFixed32( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ); +bool ProtobufReadRepeatedFixed32( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ); +bool ProtobufReadRepeatedString( const char * &pParsePosition, const char *pParseEnd, uint32 uFieldTag, std::vector &vec ); + +#define PROTOBUF_FIELDTAG_INTEGER( Field ) ( (uint64)( Field ) << 3 ) +#define PROTOBUF_FIELDTAG_SINTEGER( Field ) ( (uint64)( Field ) << 3 ) +#define PROTOBUF_FIELDTAG_FIXED64( Field ) ( (uint64)( Field ) << 3 | (uint64)1 ) +#define PROTOBUF_FIELDTAG_STRING( Field ) ( (uint64)( Field ) << 3 | (uint64)2 ) +#define PROTOBUF_FIELDTAG_FIXED32( Field ) ( (uint64)( Field ) << 3 | (uint64)5 ) + +#define PROTOBUF_FIELDTAG_REPEATED_INTEGER PROTOBUF_FIELDTAG_STRING +#define PROTOBUF_FIELDTAG_REPEATED_SINTEGER PROTOBUF_FIELDTAG_STRING +#define PROTOBUF_FIELDTAG_REPEATED_FIXED32 PROTOBUF_FIELDTAG_STRING +#define PROTOBUF_FIELDTAG_REPEATED_FIXED64 PROTOBUF_FIELDTAG_STRING + + +#endif diff --git a/external/steamworks/steamworksexample/SpaceWar.h b/external/steamworks/steamworksexample/SpaceWar.h new file mode 100644 index 0000000..84ed8db --- /dev/null +++ b/external/steamworks/steamworksexample/SpaceWar.h @@ -0,0 +1,446 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Shared definitions for the communication between the server/client +// +// $NoKeywords: $ +//============================================================================= + +#ifndef SPACEWAR_H +#define SPACEWAR_H + + +// The Steamworks API's are modular, you can use some subsystems without using others +// When USE_GS_AUTH_API is defined you get the following Steam features: +// - Strong user authentication and authorization +// - Game server matchmaking +// - VAC cheat protection +// - Access to achievement/community API's +// - P2P networking capability + +// Remove this define to disable using the native Steam authentication and matchmaking system +// You can use this as a sample of how to integrate your game without replacing an existing matchmaking system +// When you un-define USE_GS_AUTH_API you get: +// - Access to achievement/community API's +// - P2P networking capability +// You CANNOT use: +// - VAC cheat protection +// - Game server matchmaking +// as these function depend on using Steam authentication +#define USE_GS_AUTH_API + + +// Current game server version +#define SPACEWAR_SERVER_VERSION "1.0.0.0" + +// UDP port for the spacewar server to listen on +#define SPACEWAR_SERVER_PORT 27015 + +// UDP port for the master server updater to listen on +#define SPACEWAR_MASTER_SERVER_UPDATER_PORT 27016 + +// How long to wait for a response from the server before resending our connection attempt +#define SERVER_CONNECTION_RETRY_MILLISECONDS 350 + +// How long to wait for a client to send an update before we drop its connection server side +#define SERVER_TIMEOUT_MILLISECONDS 5000 + +// Maximum packet size in bytes +#define MAX_SPACEWAR_PACKET_SIZE 1024*512 + +// Maximum number of players who can join a server and play simultaneously +#define MAX_PLAYERS_PER_SERVER 4 + +// Time to pause wait after a round ends before starting a new one +#define MILLISECONDS_BETWEEN_ROUNDS 4000 + +// How long photon beams live before expiring +#define PHOTON_BEAM_LIFETIME_IN_TICKS 1750 + +// How fast can photon beams be fired? +#define PHOTON_BEAM_FIRE_INTERVAL_TICKS 250 + +// Amount of space needed for beams per ship +#define MAX_PHOTON_BEAMS_PER_SHIP (PHOTON_BEAM_LIFETIME_IN_TICKS/PHOTON_BEAM_FIRE_INTERVAL_TICKS) + +// Time to timeout a connection attempt in +#define MILLISECONDS_CONNECTION_TIMEOUT 30000 + +// How many times a second does the server send world updates to clients +#define SERVER_UPDATE_SEND_RATE 60 + +// How many times a second do we send our updated client state to the server +#define CLIENT_UPDATE_SEND_RATE 30 + +// How fast does the server internally run at? +#define MAX_CLIENT_AND_SERVER_FPS 86 + + +template +inline T WordSwap( T w ) +{ + uint16 temp; + + temp = ((*((uint16 *)&w) & 0xff00) >> 8); + temp |= ((*((uint16 *)&w) & 0x00ff) << 8); + + return *((T*)&temp); +} + +template +inline T DWordSwap( T dw ) +{ + uint32 temp; + + temp = *((uint32 *)&dw) >> 24; + temp |= ((*((uint32 *)&dw) & 0x00FF0000) >> 8); + temp |= ((*((uint32 *)&dw) & 0x0000FF00) << 8); + temp |= ((*((uint32 *)&dw) & 0x000000FF) << 24); + + return *((T*)&temp); +} + +template +inline T QWordSwap( T dw ) +{ + uint64 temp; + + temp = *((uint64 *)&dw) >> 56; + temp |= ((*((uint64 *)&dw) & 0x00FF000000000000ull) >> 40); + temp |= ((*((uint64 *)&dw) & 0x0000FF0000000000ull) >> 24); + temp |= ((*((uint64 *)&dw) & 0x000000FF00000000ull) >> 8); + temp |= ((*((uint64 *)&dw) & 0x00000000FF000000ull) << 8); + temp |= ((*((uint64 *)&dw) & 0x0000000000FF0000ull) << 24); + temp |= ((*((uint64 *)&dw) & 0x000000000000FF00ull) << 40); + temp |= ((*((uint64 *)&dw) & 0x00000000000000FFull) << 56); + + return *((T*)&temp); +} + +#define LittleInt16( val ) ( val ) +#define LittleWord( val ) ( val ) +#define LittleInt32( val ) ( val ) +#define LittleDWord( val ) ( val ) +#define LittleQWord( val ) ( val ) +#define LittleFloat( val ) ( val ) + +// Leaderboard names +#define LEADERBOARD_QUICKEST_WIN "Quickest Win" +#define LEADERBOARD_FEET_TRAVELED "Feet Traveled" + + +// Player colors +DWORD const g_rgPlayerColors[ MAX_PLAYERS_PER_SERVER ] = +{ + D3DCOLOR_ARGB( 255, 255, 150, 150 ), // red + D3DCOLOR_ARGB( 255, 200, 200, 255 ), // blue + D3DCOLOR_ARGB( 255, 255, 204, 102 ), // orange + D3DCOLOR_ARGB( 255, 153, 255, 153 ), // green +}; + + +// Enum for possible game states on the client +enum EClientGameState +{ + k_EClientGameStartServer, + k_EClientGameActive, + k_EClientGameWaitingForPlayers, + k_EClientGameMenu, + k_EClientGameQuitMenu, + k_EClientGameExiting, + k_EClientGameInstructions, + k_EClientGameDraw, + k_EClientGameWinner, + k_EClientGameConnecting, + k_EClientGameConnectionFailure, + k_EClientFindInternetServers, + k_EClientStatsAchievements, + k_EClientCreatingLobby, + k_EClientInLobby, + k_EClientFindLobby, + k_EClientJoiningLobby, + k_EClientFindLANServers, + k_EClientRemoteStorage, + k_EClientLeaderboards, + k_EClientFriendsList, + k_EClientMinidump, + k_EClientClanChatRoom, + k_EClientWebCallback, + k_EClientMusic, + k_EClientWorkshop, + k_EClientHTMLSurface, + k_EClientInGameStore, + k_EClientRemotePlayInvite, + k_EClientRemotePlaySessions, + k_EClientOverlayAPI, +}; + + +// Enum for possible game states on the server +enum EServerGameState +{ + k_EServerWaitingForPlayers, + k_EServerActive, + k_EServerDraw, + k_EServerWinner, + k_EServerExiting, +}; + +#pragma pack( push, 1 ) + +// Data sent per photon beam from the server to update clients photon beam positions +struct ServerPhotonBeamUpdateData_t +{ + void SetActive( bool bIsActive ) { m_bIsActive = bIsActive; } + bool GetActive() { return m_bIsActive; } + + void SetRotation( float flRotation ) { m_flCurrentRotation = LittleFloat( flRotation ); } + float GetRotation() { return LittleFloat( m_flCurrentRotation ); } + + void SetXVelocity( float flVelocity ) { m_flXVelocity = LittleFloat( flVelocity ); } + float GetXVelocity() { return LittleFloat( m_flXVelocity ); } + + void SetYVelocity( float flVelocity ) { m_flYVelocity = LittleFloat( flVelocity ); } + float GetYVelocity() { return LittleFloat( m_flYVelocity ); } + + void SetXPosition( float flPosition ) { m_flXPosition = LittleFloat( flPosition ); } + float GetXPosition() { return LittleFloat( m_flXPosition ); } + + void SetYPosition( float flPosition ) { m_flYPosition = LittleFloat( flPosition ); } + float GetYPosition() { return LittleFloat( m_flYPosition ); } + + +private: + // Does the photon beam exist right now? + bool m_bIsActive; + + // The current rotation + float m_flCurrentRotation; + + // The current velocity + float m_flXVelocity; + float m_flYVelocity; + + // The current position + float m_flXPosition; + float m_flYPosition; +}; + + +// This is the data that gets sent per ship in each update, see below for the full update data +struct ServerShipUpdateData_t +{ + void SetRotation( float flRotation ) { m_flCurrentRotation = LittleFloat( flRotation ); } + float GetRotation() { return LittleFloat( m_flCurrentRotation ); } + + void SetRotationDeltaLastFrame( float flDelta ) { m_flRotationDeltaLastFrame = LittleFloat( flDelta ); } + float GetRotationDeltaLastFrame() { return LittleFloat( m_flRotationDeltaLastFrame ); } + + void SetXAcceleration( float flAcceleration ) { m_flXAcceleration = LittleFloat( flAcceleration ); } + float GetXAcceleration() { return LittleFloat( m_flXAcceleration ); } + + void SetYAcceleration( float flAcceleration ) { m_flYAcceleration = LittleFloat( flAcceleration ); } + float GetYAcceleration() { return LittleFloat( m_flYAcceleration ); } + + void SetXVelocity( float flVelocity ) { m_flXVelocity = LittleFloat( flVelocity ); } + float GetXVelocity() { return LittleFloat( m_flXVelocity ); } + + void SetYVelocity( float flVelocity ) { m_flYVelocity = LittleFloat( flVelocity ); } + float GetYVelocity() { return LittleFloat( m_flYVelocity ); } + + void SetXPosition( float flPosition ) { m_flXPosition = LittleFloat( flPosition ); } + float GetXPosition() { return LittleFloat( m_flXPosition ); } + + void SetYPosition( float flPosition ) { m_flYPosition = LittleFloat( flPosition ); } + float GetYPosition() { return LittleFloat( m_flYPosition ); } + + void SetExploding( bool bIsExploding ) { m_bExploding = bIsExploding; } + bool GetExploding() { return m_bExploding; } + + void SetDisabled( bool bIsDisabled ) { m_bDisabled = bIsDisabled; } + bool GetDisabled() { return m_bDisabled; } + + void SetForwardThrustersActive( bool bActive ) { m_bForwardThrustersActive = bActive; } + bool GetForwardThrustersActive() { return m_bForwardThrustersActive; } + + void SetReverseThrustersActive( bool bActive ) { m_bReverseThrustersActive = bActive; } + bool GetReverseThrustersActive() { return m_bReverseThrustersActive; } + + void SetDecoration( int nDecoration ) { m_nShipDecoration = nDecoration; } + int GetDecoration() { return m_nShipDecoration; } + + void SetWeapon( int nWeapon ) { m_nShipWeapon = nWeapon; } + int GetWeapon() { return m_nShipWeapon; } + + void SetPower( int nPower ) { m_nShipPower = nPower; } + int GetPower() { return m_nShipPower; } + + void SetShieldStrength( int nShieldStrength ) { m_nShieldStrength = nShieldStrength; } + int GetShieldStrength() { return m_nShieldStrength; } + + void SetThrustersLevel( float fLevel ) { m_fThrusterLevel = fLevel; } + float GetThrustersLevel( ) { return m_fThrusterLevel; } + + void SetTurnSpeed( float fSpeed ) { m_fTurnSpeed = fSpeed; } + float GetTurnSpeed( ) { return m_fTurnSpeed; } + + ServerPhotonBeamUpdateData_t *AccessPhotonBeamData( int iIndex ) { return &m_PhotonBeamData[iIndex]; } + +private: + // The current rotation of the ship + float m_flCurrentRotation; + + // The delta in rotation for the last frame (client side interpolation will use this) + float m_flRotationDeltaLastFrame; + + // The current thrust for the ship + float m_flXAcceleration; + float m_flYAcceleration; + + // The current velocity for the ship + float m_flXVelocity; + float m_flYVelocity; + + // The current position for the ship + float m_flXPosition; + float m_flYPosition; + + // Is the ship exploding? + bool m_bExploding; + + // Is the ship disabled? + bool m_bDisabled; + + // Are the thrusters to be drawn? + bool m_bForwardThrustersActive; + bool m_bReverseThrustersActive; + + // Decoration for this ship + int m_nShipDecoration; + + // Weapon for this ship + int m_nShipWeapon; + + // Power for this ship + int m_nShipPower; + int m_nShieldStrength; + + // Photon beam positions and data + ServerPhotonBeamUpdateData_t m_PhotonBeamData[MAX_PHOTON_BEAMS_PER_SHIP]; + + // Thrust and rotation speed can be anlog when using a Steam Controller + float m_fThrusterLevel; + float m_fTurnSpeed; +}; + + +// This is the data that gets sent from the server to each client for each update +struct ServerSpaceWarUpdateData_t +{ + void SetServerGameState( EServerGameState eState ) { m_eCurrentGameState = LittleDWord( (uint32)eState ); } + EServerGameState GetServerGameState() { return (EServerGameState)LittleDWord( m_eCurrentGameState ); } + + void SetPlayerWhoWon( uint32 iIndex ) { m_uPlayerWhoWonGame = LittleDWord( iIndex ); } + uint32 GetPlayerWhoWon() { return LittleDWord( m_uPlayerWhoWonGame ); } + + void SetPlayerActive( uint32 iIndex, bool bIsActive ) { m_rgPlayersActive[iIndex] = bIsActive; } + bool GetPlayerActive( uint32 iIndex ) { return m_rgPlayersActive[iIndex]; } + + void SetPlayerScore( uint32 iIndex, uint32 unScore ) { m_rgPlayerScores[iIndex] = LittleDWord(unScore); } + uint32 GetPlayerScore( uint32 iIndex ) { return LittleDWord(m_rgPlayerScores[iIndex]); } + + void SetPlayerSteamID( uint32 iIndex, uint64 ulSteamID ) { m_rgPlayerSteamIDs[iIndex] = LittleQWord(ulSteamID); } + uint64 GetPlayerSteamID( uint32 iIndex ) { return LittleQWord(m_rgPlayerSteamIDs[iIndex]); } + + ServerShipUpdateData_t *AccessShipUpdateData( uint32 iIndex ) { return &m_rgShipData[iIndex];} + +private: + // What state the game is in + uint32 m_eCurrentGameState; + + // Who just won the game? -- only valid when m_eCurrentGameState == k_EGameWinner + uint32 m_uPlayerWhoWonGame; + + // which player slots are in use + bool m_rgPlayersActive[MAX_PLAYERS_PER_SERVER]; + + // what are the scores for each player? + uint32 m_rgPlayerScores[MAX_PLAYERS_PER_SERVER]; + + // array of ship data + ServerShipUpdateData_t m_rgShipData[MAX_PLAYERS_PER_SERVER]; + + // array of players steamids for each slot, serialized to uint64 + uint64 m_rgPlayerSteamIDs[MAX_PLAYERS_PER_SERVER]; +}; + + +// This is the data that gets sent from each client to the server for each update +struct ClientSpaceWarUpdateData_t +{ + void SetPlayerName( const char *pchName ) { strncpy_safe( m_rgchPlayerName, pchName, sizeof( m_rgchPlayerName ) ); } + const char *GetPlayerName() { return m_rgchPlayerName; } + + void SetFirePressed( bool bIsPressed ) { m_bFirePressed = bIsPressed; } + bool GetFirePressed() { return m_bFirePressed; } + + void SetTurnLeftPressed( bool bIsPressed ) { m_bTurnLeftPressed = bIsPressed; } + bool GetTurnLeftPressed() { return m_bTurnLeftPressed; } + + void SetTurnRightPressed( bool bIsPressed ) { m_bTurnRightPressed = bIsPressed; } + bool GetTurnRightPressed() { return m_bTurnRightPressed; } + + void SetForwardThrustersPressed( bool bIsPressed ) { m_bForwardThrustersPressed = bIsPressed; } + bool GetForwardThrustersPressed() { return m_bForwardThrustersPressed; } + + void SetReverseThrustersPressed( bool bIsPressed ) { m_bReverseThrustersPressed = bIsPressed; } + bool GetReverseThrustersPressed() { return m_bReverseThrustersPressed; } + + void SetDecoration( int nDecoration ) { m_nShipDecoration = nDecoration; } + int GetDecoration() { return m_nShipDecoration; } + + void SetWeapon( int nWeapon ) { m_nShipWeapon = nWeapon; } + int GetWeapon() { return m_nShipWeapon; } + + void SetPower( int nPower ) { m_nShipPower = nPower; } + int GetPower() { return m_nShipPower; } + + void SetShieldStrength( int nShieldPower ) { m_nShieldStrength = nShieldPower; } + int GetShieldStrength() { return m_nShieldStrength; } + + void SetThrustersLevel( float fLevel ) { m_fThrusterLevel = fLevel; } + float GetThrustersLevel( ) { return m_fThrusterLevel; } + + void SetTurnSpeed( float fSpeed ) { m_fTurnSpeed = fSpeed; } + float GetTurnSpeed( ) { return m_fTurnSpeed; } + +private: + // Key's which are done + bool m_bFirePressed; + bool m_bTurnLeftPressed; + bool m_bTurnRightPressed; + bool m_bForwardThrustersPressed; + bool m_bReverseThrustersPressed; + + // Decoration for this ship + int m_nShipDecoration; + + // Weapon for this ship + int m_nShipWeapon; + + // Power for this ship + int m_nShipPower; + + int m_nShieldStrength; + + // Name of the player (needed server side to tell master server about) + // bugbug jmccaskey - Really lame to send this every update instead of event driven... + char m_rgchPlayerName[64]; + + // Thrust and rotation speed can be anlog when using a Steam Controller + float m_fThrusterLevel; + float m_fTurnSpeed; +}; + +#pragma pack( pop ) + +#endif // SPACEWAR_H diff --git a/external/steamworks/steamworksexample/SpaceWarClient.cpp b/external/steamworks/steamworksexample/SpaceWarClient.cpp new file mode 100644 index 0000000..51e171e --- /dev/null +++ b/external/steamworks/steamworksexample/SpaceWarClient.cpp @@ -0,0 +1,2746 @@ +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Main class for the space war game client +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" +#include "SpaceWarClient.h" +#include "SpaceWarServer.h" +#include "MainMenu.h" +#include "QuitMenu.h" +#include "stdlib.h" +#include "time.h" +#include "ServerBrowser.h" +#include "Leaderboards.h" +#include "Friends.h" +#include "musicplayer.h" +#include "clanchatroom.h" +#include "Lobby.h" +#include "p2pauth.h" +#include "voicechat.h" +#include "htmlsurface.h" +#include "Inventory.h" +#include "steam/steamencryptedappticket.h" +#include "RemotePlay.h" +#include "ItemStore.h" +#include "OverlayExamples.h" +#include "timeline.h" +#ifdef WIN32 +#include +#else +#define MAX_PATH PATH_MAX +#include +#define _getcwd getcwd +#define _snprintf snprintf +#endif +#if defined(USE_SDL2) +#include +#elif defined(SDL) +#include +#endif + + +CSpaceWarClient *g_pSpaceWarClient = NULL; +CSpaceWarClient* SpaceWarClient() { return g_pSpaceWarClient; } + +extern bool ParseCommandLine( const char *pchCmdLine, const char **ppchServerAddress, const char **ppchLobbyID ); + +#if defined(WIN32) +#define atoll _atoi64 +#endif + + +//----------------------------------------------------------------------------- +// Purpose: OS-flexible function to get milliseconds of clock time +//----------------------------------------------------------------------------- +uint32 Plat_GetTicks() +{ +#if defined(USE_SDL2) + return SDL_GetTicks64(); +#elif defined(SDL) + return SDL_GetTicks(); +#else + return GetTickCount(); +#endif +} + + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CSpaceWarClient::CSpaceWarClient( IGameEngine *pGameEngine ) +{ + Init( pGameEngine ); +} + + +//----------------------------------------------------------------------------- +// Purpose: initialize our client for use +//----------------------------------------------------------------------------- +void CSpaceWarClient::Init( IGameEngine *pGameEngine ) +{ + m_SteamIDLocalUser = SteamUser()->GetSteamID(); + m_eGameState = k_EClientGameMenu; + + g_pSpaceWarClient = this; + m_pGameEngine = pGameEngine; + m_uPlayerWhoWonGame = 0; + m_ulStateTransitionTime = m_pGameEngine->GetGameTickCount(); + m_ulLastNetworkDataReceivedTime = 0; + m_pServer = NULL; + m_uPlayerShipIndex = 0; + m_eConnectedStatus = k_EClientNotConnected; + m_bTransitionedGameState = true; + m_rgchErrorText[0] = 0; + m_unServerIP = 0; + m_usServerPort = 0; + m_ulPingSentTime = 0; + m_bSentWebOpen = false; + m_bShowTimer = false; + m_unTicksAtLaunch = 0; + m_hTimerFont = 0; + m_hConnServer = k_HSteamNetConnection_Invalid; + m_unTicksAtLaunch = Plat_GetTicks(); + + // Initialize the peer to peer connection process + SteamNetworkingUtils()->InitRelayNetworkAccess(); + + for( uint32 i = 0; i < MAX_PLAYERS_PER_SERVER; ++i ) + { + m_rguPlayerScores[i] = 0; + m_rgpShips[i] = NULL; + } + + // Seed random num generator + srand( (uint32)time( NULL ) ); + + m_hHUDFont = pGameEngine->HCreateFont( HUD_FONT_HEIGHT, FW_BOLD, false, "Arial" ); + if ( !m_hHUDFont ) + OutputDebugString( "HUD font was not created properly, text won't draw\n" ); + + m_hInstructionsFont = pGameEngine->HCreateFont( INSTRUCTIONS_FONT_HEIGHT, FW_BOLD, false, "Arial" ); + if ( !m_hInstructionsFont ) + OutputDebugString( "instruction font was not created properly, text won't draw\n" ); + + m_hInGameStoreFont = pGameEngine->HCreateFont( INSTRUCTIONS_FONT_HEIGHT, FW_BOLD, false, "Courier New" ); + if ( !m_hInGameStoreFont ) + OutputDebugString( "in-game store font was not created properly, text won't draw\n" ); + + // Initialize starfield + m_pStarField = new CStarField( pGameEngine ); + + // Initialize main menu + m_pMainMenu = new CMainMenu( pGameEngine ); + + // Initialize pause menu + m_pQuitMenu = new CQuitMenu( pGameEngine ); + + // Initialize sun + m_pSun = new CSun( pGameEngine ); + + m_nNumWorkshopItems = 0; + for (uint32 i = 0; i < MAX_WORKSHOP_ITEMS; ++i) + { + m_rgpWorkshopItems[i] = NULL; + } + + // initialize P2P auth engine + m_pP2PAuthedGame = new CP2PAuthedGame( m_pGameEngine ); + + // Create matchmaking menus + m_pServerBrowser = new CServerBrowser( m_pGameEngine ); + m_pLobbyBrowser = new CLobbyBrowser( m_pGameEngine ); + m_pLobby = new CLobby( m_pGameEngine ); + + + // Init stats + m_pStatsAndAchievements = new CStatsAndAchievements( pGameEngine ); + m_pTimeline = new CTimeline( pGameEngine ); + m_pLeaderboards = new CLeaderboards( pGameEngine ); + m_pFriendsList = new CFriendsList( pGameEngine ); + m_pMusicPlayer = new CMusicPlayer( pGameEngine ); + m_pClanChatRoom = new CClanChatRoom( pGameEngine ); + + // Remote Play session list + m_pRemotePlayList = new CRemotePlayList( pGameEngine ); + + // Remote Storage page + m_pRemoteStorage = new CRemoteStorage( pGameEngine ); + + // P2P voice chat + m_pVoiceChat = new CVoiceChat( pGameEngine ); + + // HTML Surface page + m_pHTMLSurface = new CHTMLSurface(pGameEngine); + + // in-game store + m_pItemStore = new CItemStore( pGameEngine ); + m_pItemStore->LoadItemsWithPrices(); + + m_pOverlayExamples = new COverlayExamples( pGameEngine ); + + LoadWorkshopItems(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Destructor +//----------------------------------------------------------------------------- +CSpaceWarClient::~CSpaceWarClient() +{ + DisconnectFromServer(); + + if ( m_pP2PAuthedGame ) + { + m_pP2PAuthedGame->EndGame(); + delete m_pP2PAuthedGame; + m_pP2PAuthedGame = NULL; + } + + if ( m_pServer ) + { + delete m_pServer; + m_pServer = NULL; + } + + if ( m_pStarField ) + delete m_pStarField; + + if ( m_pMainMenu ) + delete m_pMainMenu; + + if ( m_pQuitMenu ) + delete m_pQuitMenu; + + if ( m_pSun ) + delete m_pSun; + + if ( m_pStatsAndAchievements ) + delete m_pStatsAndAchievements; + + if ( m_pTimeline ) + delete m_pTimeline; + + if ( m_pServerBrowser ) + delete m_pServerBrowser; + + if ( m_pVoiceChat ) + delete m_pVoiceChat; + + if ( m_pHTMLSurface ) + delete m_pHTMLSurface; + + for( uint32 i = 0; i < MAX_PLAYERS_PER_SERVER; ++i ) + { + if ( m_rgpShips[i] ) + { + delete m_rgpShips[i]; + m_rgpShips[i] = NULL; + } + } + + for (uint32 i = 0; i < MAX_WORKSHOP_ITEMS; ++i) + { + if ( m_rgpWorkshopItems[i] ) + { + delete m_rgpWorkshopItems[i]; + m_rgpWorkshopItems[i] = NULL; + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Tell the connected server we are disconnecting (if we are connected) +//----------------------------------------------------------------------------- +void CSpaceWarClient::DisconnectFromServer() +{ + if ( m_eConnectedStatus != k_EClientNotConnected ) + { +#ifdef USE_GS_AUTH_API + if ( m_hAuthTicket != k_HAuthTicketInvalid ) + SteamUser()->CancelAuthTicket( m_hAuthTicket ); + m_hAuthTicket = k_HAuthTicketInvalid; +#else + SteamUser()->AdvertiseGame( k_steamIDNil, 0, 0 ); +#endif + + // tell steam china duration control system that we are no longer in a match + SteamUser()->BSetDurationControlOnlineState( k_EDurationControlOnlineState_Offline ); + + m_eConnectedStatus = k_EClientNotConnected; + + UpdateScoreInGamePhase( true ); + SteamTimeline()->EndGamePhase(); + + m_unLastGamePhaseID = m_unGamePhaseID; + m_unGamePhaseID = 0; + } + if ( m_pP2PAuthedGame ) + { + m_pP2PAuthedGame->EndGame(); + } + + if ( m_pVoiceChat ) + { + m_pVoiceChat->StopVoiceChat(); + } + + if ( m_hConnServer != k_HSteamNetConnection_Invalid ) + SteamNetworkingSockets()->CloseConnection( m_hConnServer, k_EDRClientDisconnect, nullptr, false ); + m_steamIDGameServer = CSteamID(); + m_steamIDGameServerFromBrowser = CSteamID(); + m_hConnServer = k_HSteamNetConnection_Invalid; +} + + +//----------------------------------------------------------------------------- +// Purpose: Receive basic server info from the server after we initiate a connection +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnReceiveServerInfo( CSteamID steamIDGameServer, bool bVACSecure, const char *pchServerName ) +{ + m_eConnectedStatus = k_EClientConnectedPendingAuthentication; + m_pQuitMenu->SetHeading( pchServerName ); + m_steamIDGameServer = steamIDGameServer; + + SteamNetConnectionInfo_t info; + SteamNetworkingSockets()->GetConnectionInfo( m_hConnServer, &info ); + m_unServerIP = info.m_addrRemote.GetIPv4(); + m_usServerPort = info.m_addrRemote.m_port; + + // set how to connect to the game server, using the Rich Presence API + // this lets our friends connect to this game via their friends list + UpdateRichPresenceConnectionInfo(); + + MsgClientBeginAuthentication_t msg; +#ifdef USE_GS_AUTH_API + SteamNetworkingIdentity snid; + // if the server Steam ID was aquired from another source ( m_steamIDGameServerFromBrowser ) + // then use it as the identity + // if it only came from the server itself, then use the IP address + if ( m_steamIDGameServer == m_steamIDGameServerFromBrowser ) + snid.SetSteamID( m_steamIDGameServer ); + else + snid.SetIPv4Addr( m_unServerIP, m_usServerPort ); + char rgchToken[1024]; + uint32 unTokenLen = 0; + m_hAuthTicket = SteamUser()->GetAuthSessionTicket( rgchToken, sizeof( rgchToken ), &unTokenLen, &snid ); + msg.SetToken( rgchToken, unTokenLen ); + +#else + // When you aren't using Steam auth you can still call AdvertiseGame() so you can communicate presence data to the friends + // system. Make sure to pass k_steamIDNonSteamGS + uint32 unTokenLen = SteamUser()->AdvertiseGame( k_steamIDNonSteamGS, m_unServerIP, m_usServerPort ); + msg.SetSteamID( SteamUser()->GetSteamID().ConvertToUint64() ); +#endif + + Steamworks_TestSecret(); + + if ( msg.GetTokenLen() < 1 ) + OutputDebugString( "Warning: Looks like GetAuthSessionTicket didn't give us a good ticket\n" ); + + BSendServerData( &msg, sizeof(msg), k_nSteamNetworkingSend_Reliable ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Receive an authentication response from the server +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnReceiveServerAuthenticationResponse( bool bSuccess, uint32 uPlayerPosition ) +{ + if ( !bSuccess ) + { + SetConnectionFailureText( "Connection failure.\nMultiplayer authentication failed\n" ); + SetGameState( k_EClientGameConnectionFailure ); + DisconnectFromServer(); + } + else + { + // Is this a duplicate message? If so ignore it... + if ( m_eConnectedStatus == k_EClientConnectedAndAuthenticated && m_uPlayerShipIndex == uPlayerPosition ) + return; + + m_uPlayerShipIndex = uPlayerPosition; + m_eConnectedStatus = k_EClientConnectedAndAuthenticated; + + // set information so our friends can join the lobby + UpdateRichPresenceConnectionInfo(); + + // tell steam china duration control system that we are in a match and not to be interrupted + SteamUser()->BSetDurationControlOnlineState( k_EDurationControlOnlineState_OnlineHighPri ); + } +} + +void CSpaceWarClient::OnReceiveServerFullResponse() +{ + SetConnectionFailureText("Connection failure.\nServer is full\n"); + SetGameState(k_EClientGameConnectionFailure); + DisconnectFromServer(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles receiving a state update from the game server +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnReceiveServerUpdate( ServerSpaceWarUpdateData_t *pUpdateData ) +{ + // Update our client state based on what the server tells us + + switch( pUpdateData->GetServerGameState() ) + { + case k_EServerWaitingForPlayers: + if ( m_eGameState == k_EClientGameQuitMenu ) + break; + else if (m_eGameState == k_EClientGameMenu ) + break; + else if ( m_eGameState == k_EClientGameExiting ) + break; + + SetGameState( k_EClientGameWaitingForPlayers ); + break; + case k_EServerActive: + if ( m_eGameState == k_EClientGameQuitMenu ) + break; + else if (m_eGameState == k_EClientGameMenu ) + break; + else if ( m_eGameState == k_EClientGameExiting ) + break; + + SetGameState( k_EClientGameActive ); + break; + case k_EServerDraw: + if ( m_eGameState == k_EClientGameQuitMenu ) + break; + else if ( m_eGameState == k_EClientGameMenu ) + break; + else if ( m_eGameState == k_EClientGameExiting ) + break; + + SetGameState( k_EClientGameDraw ); + break; + case k_EServerWinner: + if ( m_eGameState == k_EClientGameQuitMenu ) + break; + else if ( m_eGameState == k_EClientGameMenu ) + break; + else if ( m_eGameState == k_EClientGameExiting ) + break; + + SetGameState( k_EClientGameWinner ); + break; + case k_EServerExiting: + if ( m_eGameState == k_EClientGameExiting ) + break; + + SetGameState( k_EClientGameMenu ); + break; + } + + // Update scores + bool bScoresChanged = false; + for( int i=0; i < MAX_PLAYERS_PER_SERVER; ++i ) + { + m_rguPlayerScores[i] = pUpdateData->GetPlayerScore(i); + bScoresChanged = bScoresChanged || m_rguPlayerScores[ i ] != pUpdateData->GetPlayerScore( i ); + } + if ( bScoresChanged ) + { + UpdateScoreInGamePhase( false ); + } + + // Update who won last + m_uPlayerWhoWonGame = pUpdateData->GetPlayerWhoWon(); + + if ( m_pP2PAuthedGame ) + { + // has the player list changed? + if ( m_pServer ) + { + // if i am the server owner i need to auth everyone who wants to play + // assume i am in slot 0, so start at slot 1 + for( uint32 i=1; i < MAX_PLAYERS_PER_SERVER; ++i ) + { + CSteamID steamIDNew( pUpdateData->GetPlayerSteamID(i) ); + if ( steamIDNew == SteamUser()->GetSteamID() ) + { + OutputDebugString( "Server player slot 0 is not server owner.\n" ); + } + else if ( steamIDNew != m_rgSteamIDPlayers[i] ) + { + if ( m_rgSteamIDPlayers[i].IsValid() ) + { + m_pP2PAuthedGame->PlayerDisconnect( i ); + } + if ( steamIDNew.IsValid() ) + { + m_pP2PAuthedGame->RegisterPlayer( i, steamIDNew ); + } + } + } + } + else + { + // i am just a client, i need to auth the game owner ( slot 0 ) + CSteamID steamIDNew( pUpdateData->GetPlayerSteamID( 0 ) ); + if ( steamIDNew == SteamUser()->GetSteamID() ) + { + OutputDebugString( "Server player slot 0 is not server owner.\n" ); + } + else if ( steamIDNew != m_rgSteamIDPlayers[0] ) + { + if ( m_rgSteamIDPlayers[0].IsValid() ) + { + OutputDebugString( "Server player slot 0 has disconnected - but thats the server owner.\n" ); + m_pP2PAuthedGame->PlayerDisconnect( 0 ); + } + if ( steamIDNew.IsValid() ) + { + m_pP2PAuthedGame->StartAuthPlayer( 0, steamIDNew ); + } + } + } + } + + // update all players that are active + if ( m_pVoiceChat ) + m_pVoiceChat->MarkAllPlayersInactive(); + + // Update the players + for( uint32 i=0; i < MAX_PLAYERS_PER_SERVER; ++i ) + { + // Update steamid array with data from server + m_rgSteamIDPlayers[i].SetFromUint64( pUpdateData->GetPlayerSteamID( i ) ); + + if ( pUpdateData->GetPlayerActive( i ) ) + { + // Check if we have a ship created locally for this player slot, if not create it + if ( !m_rgpShips[i] ) + { + ServerShipUpdateData_t *pShipData = pUpdateData->AccessShipUpdateData( i ); + m_rgpShips[i] = new CShip( m_pGameEngine, false, pShipData->GetXPosition(), pShipData->GetYPosition(), g_rgPlayerColors[i] ); + if ( i == m_uPlayerShipIndex ) + { + // If this is our local ship, then setup key bindings appropriately + m_rgpShips[i]->SetVKBindingLeft( 0x41 ); // A key + m_rgpShips[i]->SetVKBindingRight( 0x44 ); // D key + m_rgpShips[i]->SetVKBindingForwardThrusters( 0x57 ); // W key + m_rgpShips[i]->SetVKBindingReverseThrusters( 0x53 ); // S key + m_rgpShips[i]->SetVKBindingFire( VK_SPACE ); + } + } + + if ( i == m_uPlayerShipIndex ) + m_rgpShips[i]->SetIsLocalPlayer( true ); + else + m_rgpShips[i]->SetIsLocalPlayer( false ); + + m_rgpShips[i]->OnReceiveServerUpdate( pUpdateData->AccessShipUpdateData( i ) ); + + if ( m_pVoiceChat ) + m_pVoiceChat->MarkPlayerAsActive( m_rgSteamIDPlayers[i] ); + } + else + { + // Make sure we don't have a ship locally for this slot + if ( m_rgpShips[i] ) + { + delete m_rgpShips[i]; + m_rgpShips[i] = NULL; + } + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Used to transition game state +//----------------------------------------------------------------------------- +void CSpaceWarClient::SetGameState( EClientGameState eState ) +{ + if ( m_eGameState == eState ) + return; + + m_bTransitionedGameState = true; + m_ulStateTransitionTime = m_pGameEngine->GetGameTickCount(); + m_eGameState = eState; + + // Let the stats handler check the state (so it can detect wins, losses, etc...) + m_pStatsAndAchievements->OnGameStateChange( eState ); + m_pTimeline->OnGameStateChange( eState ); + + // update any rich presence state + UpdateRichPresenceConnectionInfo(); +} + + +//----------------------------------------------------------------------------- +// Purpose: set the error string to display in the UI +//----------------------------------------------------------------------------- +void CSpaceWarClient::SetConnectionFailureText( const char *pchErrorText ) +{ + sprintf_safe( m_rgchErrorText, "%s", pchErrorText ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Send data to the current server +//----------------------------------------------------------------------------- +bool CSpaceWarClient::BSendServerData( const void *pData, uint32 nSizeOfData, int nSendFlags ) +{ + EResult res = SteamNetworkingSockets()->SendMessageToConnection( m_hConnServer, pData, nSizeOfData, nSendFlags, nullptr ); + switch (res) + { + case k_EResultOK: + case k_EResultIgnored: + break; + + case k_EResultInvalidParam: + OutputDebugString("Failed sending data to server: Invalid connection handle, or the individual message is too big\n"); + return false; + case k_EResultInvalidState: + OutputDebugString("Failed sending data to server: Connection is in an invalid state\n"); + return false; + case k_EResultNoConnection: + OutputDebugString("Failed sending data to server: Connection has ended\n"); + return false; + case k_EResultLimitExceeded: + OutputDebugString("Failed sending data to server: There was already too much data queued to be sent\n"); + return false; + default: + { + char msg[256]; + sprintf( msg, "SendMessageToConnection returned %d\n", res ); + OutputDebugString( msg ); + return false; + } + } + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Initiates a connection to a server +//----------------------------------------------------------------------------- +void CSpaceWarClient::InitiateServerConnection( uint32 unServerAddress, const int32 nPort ) +{ + if ( m_eGameState == k_EClientInLobby && m_steamIDLobby.IsValid() ) + { + SteamMatchmaking()->LeaveLobby( m_steamIDLobby ); + } + + SetGameState( k_EClientGameConnecting ); + + // Update when we last retried the connection, as well as the last packet received time so we won't timeout too soon, + // and so we will retry at appropriate intervals if packets drop + m_ulLastNetworkDataReceivedTime = m_ulLastConnectionAttemptRetryTime = m_pGameEngine->GetGameTickCount(); + + // ping the server to find out what it's steamID is + m_unServerIP = unServerAddress; + m_usServerPort = (uint16)nPort; + m_GameServerPing.RetrieveSteamIDFromGameServer( this, m_unServerIP, m_usServerPort ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Initiates a connection to a server via P2P (NAT-traversing) connection +//----------------------------------------------------------------------------- +void CSpaceWarClient::InitiateServerConnection( CSteamID steamIDGameServer ) +{ + if ( m_eGameState == k_EClientInLobby && m_steamIDLobby.IsValid() ) + { + SteamMatchmaking()->LeaveLobby( m_steamIDLobby ); + } + + SetGameState( k_EClientGameConnecting ); + + m_steamIDGameServerFromBrowser = m_steamIDGameServer = steamIDGameServer; + + SteamNetworkingIdentity identity; + identity.SetSteamID(steamIDGameServer); + + m_hConnServer = SteamNetworkingSockets()->ConnectP2P( identity, 0, 0, nullptr ); + if ( m_pVoiceChat ) + m_pVoiceChat->m_hConnServer = m_hConnServer; + if ( m_pP2PAuthedGame ) + m_pP2PAuthedGame->m_hConnServer = m_hConnServer; + + // Update when we last retried the connection, as well as the last packet received time so we won't timeout too soon, + // and so we will retry at appropriate intervals if packets drop + m_ulLastNetworkDataReceivedTime = m_ulLastConnectionAttemptRetryTime = m_pGameEngine->GetGameTickCount(); + + SteamTimeline()->StartGamePhase(); + + // When you call this function for real, you should use an ID that you'll refer back to + m_unGamePhaseID = Plat_GetTicks(); + //SteamTimeline()->SetGamePhaseID( std::to_string( m_unGamePhaseID ).c_str() ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handle any connection status change +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnNetConnectionStatusChanged(SteamNetConnectionStatusChangedCallback_t* pCallback) +{ + /// Connection handle + HSteamNetConnection m_hConn = pCallback->m_hConn; + + /// Full connection info + SteamNetConnectionInfo_t m_info = pCallback->m_info; + + /// Previous state. (Current state is in m_info.m_eState) + ESteamNetworkingConnectionState m_eOldState = pCallback->m_eOldState; + + //----------------------------------------------------------------------------- + // Triggered when a server rejects our connection + //----------------------------------------------------------------------------- + if ((m_eOldState == k_ESteamNetworkingConnectionState_Connecting || m_eOldState == k_ESteamNetworkingConnectionState_Connected) && + m_info.m_eState == k_ESteamNetworkingConnectionState_ClosedByPeer) + { + // close the connection with the server + SteamNetworkingSockets()->CloseConnection(m_hConn, m_info.m_eEndReason, nullptr, false); + switch (m_info.m_eEndReason) + { + case k_EDRServerReject: + OnReceiveServerAuthenticationResponse(false, 0); + break; + case k_EDRServerFull: + OnReceiveServerFullResponse(); + break; + } + } + //----------------------------------------------------------------------------- + // Triggered if our connection to the server fails + //----------------------------------------------------------------------------- + else if ((m_eOldState == k_ESteamNetworkingConnectionState_Connecting || m_eOldState == k_ESteamNetworkingConnectionState_Connected) && + m_info.m_eState == k_ESteamNetworkingConnectionState_ProblemDetectedLocally) + { + // failed, error out + OutputDebugString("Failed to make P2P connection, quiting server\n"); + SteamNetworkingSockets()->CloseConnection(m_hConn, m_info.m_eEndReason, nullptr, false); + OnReceiveServerExiting(); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Receives incoming network data +//----------------------------------------------------------------------------- +void CSpaceWarClient::ReceiveNetworkData() +{ + if ( !SteamNetworkingSockets() ) + return; + if ( m_hConnServer == k_HSteamNetConnection_Invalid ) + return; + + SteamNetworkingMessage_t* msgs[32]; + int res = SteamNetworkingSockets()->ReceiveMessagesOnConnection(m_hConnServer, msgs, 32); + for (int i = 0; i < res; i++) + { + SteamNetworkingMessage_t* message = msgs[i]; + uint32 cubMsgSize = message->GetSize(); + + m_ulLastNetworkDataReceivedTime = m_pGameEngine->GetGameTickCount(); + + // make sure we're connected + if (m_eConnectedStatus == k_EClientNotConnected && m_eGameState != k_EClientGameConnecting) + { + message->Release(); + continue; + } + + if (cubMsgSize < sizeof(DWORD)) + { + OutputDebugString("Got garbage on client socket, too short\n"); + message->Release(); + continue; + } + + EMessage eMsg = (EMessage)LittleDWord(*(DWORD*)message->GetData()); + switch (eMsg) + { + case k_EMsgServerSendInfo: + { + if (cubMsgSize != sizeof(MsgServerSendInfo_t)) + { + OutputDebugString("Bad server info msg\n"); + break; + } + MsgServerSendInfo_t* pMsg = (MsgServerSendInfo_t*)message->GetData(); + + // pull the IP address of the user from the socket + OnReceiveServerInfo(CSteamID(pMsg->GetSteamIDServer()), pMsg->GetSecure(), pMsg->GetServerName()); + } + break; + case k_EMsgServerPassAuthentication: + { + if (cubMsgSize != sizeof(MsgServerPassAuthentication_t)) + { + OutputDebugString("Bad accept connection msg\n"); + break; + } + MsgServerPassAuthentication_t* pMsg = (MsgServerPassAuthentication_t*)message->GetData(); + + // Our game client doesn't really care about whether the server is secure, or what its + // steamID is, but if it did we would pass them in here as they are part of the accept message + OnReceiveServerAuthenticationResponse(true, pMsg->GetPlayerPosition()); + } + break; + case k_EMsgServerFailAuthentication: + { + OnReceiveServerAuthenticationResponse(false, 0); + } + break; + case k_EMsgServerUpdateWorld: + { + if (cubMsgSize != sizeof(MsgServerUpdateWorld_t)) + { + OutputDebugString("Bad server world update msg\n"); + break; + } + + MsgServerUpdateWorld_t* pMsg = (MsgServerUpdateWorld_t*)message->GetData(); + OnReceiveServerUpdate(pMsg->AccessUpdateData()); + } + break; + case k_EMsgServerExiting: + { + if (cubMsgSize != sizeof(MsgServerExiting_t)) + { + OutputDebugString("Bad server exiting msg\n"); + } + OnReceiveServerExiting(); + } + break; + case k_EMsgServerPingResponse: + { + uint64 ulTimePassedMS = m_pGameEngine->GetGameTickCount() - m_ulPingSentTime; + char rgchT[256]; + sprintf_safe(rgchT, "Round-trip ping time to server %d ms\n", (int)ulTimePassedMS); + rgchT[sizeof(rgchT) - 1] = 0; + OutputDebugString(rgchT); + m_ulPingSentTime = 0; + } + break; + + case k_EMsgVoiceChatData: + // This is really bad exmaple code that just assumes the message is the right size + // Don't ship code like this. + m_pVoiceChat->HandleVoiceChatData( message->GetData() ); + break; + + case k_EMsgP2PSendingTicket: + // This is really bad exmaple code that just assumes the message is the right size + // Don't ship code like this. + m_pP2PAuthedGame->HandleP2PSendingTicket( message->GetData() ); + break; + + case k_EMsgServerPlayerHitSun: + { + TimelineEventHandle_t ulEvent = SteamTimeline()->StartRangeTimelineEvent( "Hit Sun", "This description will be replaced", "steam_8", 8, 0, k_ETimelineEventClipPriority_None ); + SteamTimeline()->UpdateRangeTimelineEvent( ulEvent, nullptr, "It was too hot to handle", "steam_starburst", 10, k_ETimelineEventClipPriority_Standard ); + SteamTimeline()->EndRangeTimelineEvent( ulEvent, 3.f ); + m_ulLastCrashIntoSunEvent = 0; + } + break; + + default: + OutputDebugString("Unhandled message from server\n"); + break; + } + + message->Release(); + } + + // if we're running a server, do that as well + if ( m_pServer ) + { + m_pServer->ReceiveNetworkData(); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Handle the server telling us it is exiting +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnReceiveServerExiting() +{ + if ( m_pP2PAuthedGame ) + m_pP2PAuthedGame->EndGame(); + +#ifdef USE_GS_AUTH_API + if ( m_hAuthTicket != k_HAuthTicketInvalid ) + { + SteamUser()->CancelAuthTicket( m_hAuthTicket ); + } + m_hAuthTicket = k_HAuthTicketInvalid; +#else + SteamUser()->AdvertiseGame( k_steamIDNil, 0, 0 ); +#endif + + if ( m_eGameState != k_EClientGameActive ) + return; + m_eConnectedStatus = k_EClientNotConnected; + + SetConnectionFailureText( "Game server has exited." ); + SetGameState( k_EClientGameConnectionFailure ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Steam is asking us to join a game, based on the user selecting +// 'join game' on a friend in their friends list +// the string comes from the "connect" field set in the friends' rich presence +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnGameJoinRequested( GameRichPresenceJoinRequested_t *pCallback ) +{ + // parse out the connect + const char *pchServerAddress, *pchLobbyID; + + if ( ParseCommandLine( pCallback->m_rgchConnect, &pchServerAddress, &pchLobbyID ) ) + { + // exec + ExecCommandLineConnect( pchServerAddress, pchLobbyID ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: a Steam URL to launch this app was executed while the game is already running, eg steam://run/480//+connect%20127.0.0.1 +// Anybody can build random Steam URLs and these extra parameters must be carefully parsed to avoid unintended side-effects +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnNewUrlLaunchParameters( NewUrlLaunchParameters_t *pCallback ) +{ + const char *pchServerAddress, *pchLobbyID; + char szCommandLine[1024] = {}; + + if ( SteamApps()->GetLaunchCommandLine( szCommandLine, sizeof(szCommandLine) ) > 0 ) + { + if ( ParseCommandLine( szCommandLine, &pchServerAddress, &pchLobbyID ) ) + { + // exec + ExecCommandLineConnect( pchServerAddress, pchLobbyID ); + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Finishes up entering a lobby of our own creation +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnLobbyCreated( LobbyCreated_t *pCallback, bool bIOFailure ) +{ + if ( m_eGameState != k_EClientCreatingLobby ) + return; + + // record which lobby we're in + if ( pCallback->m_eResult == k_EResultOK ) + { + // success + m_steamIDLobby = pCallback->m_ulSteamIDLobby; + m_pLobby->SetLobbySteamID( m_steamIDLobby ); + + // set the name of the lobby if it's ours + char rgchLobbyName[256]; + sprintf_safe( rgchLobbyName, "%s's lobby", SteamFriends()->GetPersonaName() ); + SteamMatchmaking()->SetLobbyData( m_steamIDLobby, "name", rgchLobbyName ); + + // mark that we're in the lobby + SetGameState( k_EClientInLobby ); + } + else + { + // failed, show error + SetConnectionFailureText( "Failed to create lobby (lost connection to Steam back-end servers." ); + SetGameState( k_EClientGameConnectionFailure ); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Finishes up entering a lobby +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnLobbyEntered( LobbyEnter_t *pCallback, bool bIOFailure ) +{ + if ( m_eGameState != k_EClientJoiningLobby ) + return; + + if ( pCallback->m_EChatRoomEnterResponse != k_EChatRoomEnterResponseSuccess ) + { + // failed, show error + SetConnectionFailureText( "Failed to enter lobby" ); + SetGameState( k_EClientGameConnectionFailure ); + return; + } + + // success + + // move forward the state + m_steamIDLobby = pCallback->m_ulSteamIDLobby; + m_pLobby->SetLobbySteamID( m_steamIDLobby ); + SetGameState( k_EClientInLobby ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Joins a game from a lobby +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnLobbyGameCreated( LobbyGameCreated_t *pCallback ) +{ + if ( m_eGameState != k_EClientInLobby ) + return; + + // join the game server specified, via whichever method we can + if ( CSteamID( pCallback->m_ulSteamIDGameServer ).IsValid() ) + { + InitiateServerConnection( CSteamID( pCallback->m_ulSteamIDGameServer ) ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: a large avatar image has been loaded for us +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnAvatarImageLoaded( AvatarImageLoaded_t *pCallback ) +{ +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles menu actions in a lobby +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnMenuSelection( LobbyMenuItem_t selection ) +{ + if ( selection.m_eCommand == LobbyMenuItem_t::k_ELobbyMenuItemLeaveLobby ) + { + // leave the lobby + SteamMatchmaking()->LeaveLobby( m_steamIDLobby ); + m_steamIDLobby = CSteamID(); + + // return to main menu + SetGameState( k_EClientGameMenu ); + } + else if ( selection.m_eCommand == LobbyMenuItem_t::k_ELobbyMenuItemToggleReadState ) + { + // update our state + bool bOldState = ( 1 == atoi( SteamMatchmaking()->GetLobbyMemberData( m_steamIDLobby, SteamUser()->GetSteamID(), "ready" ) ) ); + bool bNewState = !bOldState; + // publish to everyone + SteamMatchmaking()->SetLobbyMemberData( m_steamIDLobby, "ready", bNewState ? "1" : "0" ); + } + else if ( selection.m_eCommand == LobbyMenuItem_t::k_ELobbyMenuItemStartGame ) + { + // make sure we're not already starting a server + if ( m_pServer ) + return; + + // broadcast to everyone in the lobby that the game is starting + SteamMatchmaking()->SetLobbyData( m_steamIDLobby, "game_starting", "1" ); + + // start a local game server + m_pServer = new CSpaceWarServer( m_pGameEngine ); + // we'll have to wait until the game server connects to the Steam server back-end + // before telling all the lobby members to join (so that the NAT traversal code has a path to contact the game server) + OutputDebugString( "Game server being created; game will start soon.\n" ); + } + else if ( selection.m_eCommand == LobbyMenuItem_t::k_ELobbyMenuItemInviteToLobby ) + { + SteamFriends()->ActivateGameOverlayInviteDialog( selection.m_steamIDLobby ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles menu actions when viewing a leaderboard +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnMenuSelection( LeaderboardMenuItem_t selection ) +{ + m_pLeaderboards->OnMenuSelection( selection ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles menu actions when viewing a leaderboard +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnMenuSelection( FriendsListMenuItem_t selection ) +{ + m_pFriendsList->OnMenuSelection( selection ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles menu actions when viewing the Remote Play session list +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnMenuSelection( RemotePlayListMenuItem_t selection ) +{ + m_pRemotePlayList->OnMenuSelection( selection ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles menu actions when viewing the remote storage sync screen +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnMenuSelection( ERemoteStorageSyncMenuCommand selection ) +{ + m_pRemoteStorage->OnMenuSelection( selection ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles menu actions when viewing the Item Store +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnMenuSelection( PurchaseableItem_t selection ) +{ + m_pItemStore->OnMenuSelection( selection ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles menu actions when viewing Overlay Examples +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnMenuSelection( OverlayExample_t selection ) +{ + m_pOverlayExamples->OnMenuSelection( selection ); +} + + +//----------------------------------------------------------------------------- +// Purpose: For a player in game, set the appropriate rich presence keys for display +// in the Steam friends list and return the value for steam_display +//----------------------------------------------------------------------------- +const char *CSpaceWarClient::SetInGameRichPresence() const +{ + const char *pchStatus; + + bool bWinning = false; + uint32 cWinners = 0; + uint32 uHighScore = m_rguPlayerScores[0]; + uint32 uMyScore = 0; + for ( uint32 i = 0; i < MAX_PLAYERS_PER_SERVER; ++i ) + { + if ( m_rguPlayerScores[i] > uHighScore ) + { + uHighScore = m_rguPlayerScores[i]; + cWinners = 0; + bWinning = false; + } + + if ( m_rguPlayerScores[i] == uHighScore ) + { + cWinners++; + bWinning = bWinning || (m_rgSteamIDPlayers[i] == m_SteamIDLocalUser); + } + + if ( m_rgSteamIDPlayers[i] == m_SteamIDLocalUser ) + { + uMyScore = m_rguPlayerScores[i]; + } + } + + if ( bWinning && cWinners > 1 ) + { + pchStatus = "Tied"; + } + else if ( bWinning ) + { + pchStatus = "Winning"; + } + else + { + pchStatus = "Losing"; + } + + char rgchBuffer[32]; + sprintf_safe( rgchBuffer, "%2u", uMyScore ); + SteamFriends()->SetRichPresence( "score", rgchBuffer ); + + return pchStatus; +} + + +//----------------------------------------------------------------------------- +// Purpose: does work on transitioning from one game state to another +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnGameStateChanged( EClientGameState eGameStateNew ) +{ + const char *pchSteamRichPresenceDisplay = "AtMainMenu"; + bool bDisplayScoreInRichPresence = false; + if ( m_eGameState == k_EClientFindInternetServers ) + { + // If we are just opening the find servers screen, then start a refresh + m_pServerBrowser->RefreshInternetServers(); + SteamFriends()->SetRichPresence( "status", "Finding an internet game" ); + pchSteamRichPresenceDisplay = "WaitingForMatch"; + } + else if ( m_eGameState == k_EClientFindLANServers ) + { + m_pServerBrowser->RefreshLANServers(); + SteamFriends()->SetRichPresence( "status", "Finding a LAN game" ); + pchSteamRichPresenceDisplay = "WaitingForMatch"; + } + else if ( m_eGameState == k_EClientCreatingLobby ) + { + // start creating the lobby + if ( !m_SteamCallResultLobbyCreated.IsActive() ) + { + // ask steam to create a lobby + SteamAPICall_t hSteamAPICall = SteamMatchmaking()->CreateLobby( k_ELobbyTypePublic /* public lobby, anyone can find it */, 4 ); + // set the function to call when this completes + m_SteamCallResultLobbyCreated.Set( hSteamAPICall, this, &CSpaceWarClient::OnLobbyCreated ); + } + SteamFriends()->SetRichPresence( "status", "Creating a lobby" ); + pchSteamRichPresenceDisplay = "WaitingForMatch"; + } + else if ( m_eGameState == k_EClientInLobby ) + { + pchSteamRichPresenceDisplay = "WaitingForMatch"; + } + else if ( m_eGameState == k_EClientFindLobby ) + { + m_pLobbyBrowser->Refresh(); + SteamFriends()->SetRichPresence( "status", "Main menu: finding lobbies" ); + pchSteamRichPresenceDisplay = "WaitingForMatch"; + } + else if ( m_eGameState == k_EClientGameMenu ) + { + // we've switched out to the main menu + + // Tell the server we have left if we are connected + DisconnectFromServer(); + + // shut down any server we were running + if ( m_pServer ) + { + delete m_pServer; + m_pServer = NULL; + } + + SteamFriends()->SetRichPresence( "status", "Main menu" ); + + // Refresh inventory + SpaceWarLocalInventory()->RefreshFromServer(); + } + else if ( m_eGameState == k_EClientGameWinner || m_eGameState == k_EClientGameDraw ) + { + // game over.. update the leaderboard + m_pLeaderboards->UpdateLeaderboards( m_pStatsAndAchievements ); + + // Check if the user is due for an item drop + SpaceWarLocalInventory()->CheckForItemDrops(); + + pchSteamRichPresenceDisplay = SetInGameRichPresence(); + bDisplayScoreInRichPresence = true; + UpdateScoreInGamePhase( true ); + } + else if ( m_eGameState == k_EClientLeaderboards ) + { + // we've switched to the leaderboard menu + m_pLeaderboards->Show(); + SteamFriends()->SetRichPresence( "status", "Viewing leaderboards" ); + } + else if ( m_eGameState == k_EClientFriendsList ) + { + // we've switched to the friends list menu + m_pFriendsList->Show(); + SteamFriends()->SetRichPresence( "status", "Viewing friends list" ); + } + else if ( m_eGameState == k_EClientClanChatRoom ) + { + // we've switched to the leaderboard menu + m_pClanChatRoom->Show(); + SteamFriends()->SetRichPresence( "status", "Chatting" ); + } + else if ( m_eGameState == k_EClientGameActive ) + { + // Load Inventory + SpaceWarLocalInventory()->RefreshFromServer(); + + // start voice chat + m_pVoiceChat->StartVoiceChat(); + SteamFriends()->SetRichPresence( "status", "In match" ); + + pchSteamRichPresenceDisplay = SetInGameRichPresence(); + bDisplayScoreInRichPresence = true; + } + else if ( m_eGameState == k_EClientRemotePlayInvite ) + { + SteamRemotePlay()->BSendRemotePlayTogetherInvite( CSteamID() ); + SetGameState( k_EClientGameMenu ); + } + else if ( m_eGameState == k_EClientRemotePlaySessions ) + { + // we've switched to the remote play menu + m_pRemotePlayList->Show(); + SteamFriends()->SetRichPresence( "status", "Viewing remote play sessions" ); + } + else if ( m_eGameState == k_EClientRemoteStorage ) + { + // we've switched to the remote storage menu + m_pRemoteStorage->Show(); + SteamFriends()->SetRichPresence( "status", "Viewing remote storage" ); + } + else if ( m_eGameState == k_EClientMusic ) + { + // we've switched to the music player menu + m_pMusicPlayer->Show(); + SteamFriends()->SetRichPresence( "status", "Using music player" ); + } + else if ( m_eGameState == k_EClientHTMLSurface ) + { + // we've switched to the html page + m_pHTMLSurface->Show(); + SteamFriends()->SetRichPresence("status", "Using the web"); + } + else if ( m_eGameState == k_EClientInGameStore ) + { + // we've switched to the item store + m_pItemStore->Show(); + SteamFriends()->SetRichPresence( "status", "Viewing Item Store" ); + } + else if ( m_eGameState == k_EClientOverlayAPI ) + { + // we've switched to the item store + m_pOverlayExamples->Show(); + SteamFriends()->SetRichPresence( "status", "Viewing Overlay API Examples" ); + } + + if ( pchSteamRichPresenceDisplay != NULL ) + { + SteamFriends()->SetRichPresence( "gamestatus", pchSteamRichPresenceDisplay ); + SteamFriends()->SetRichPresence( "steam_display", bDisplayScoreInRichPresence ? "#StatusWithScore" : "#StatusWithoutScore" ); + } + + // steam_player_group defines who the user is playing with. Set it to the steam ID + // of the server if we are connected, otherwise blank. + if ( m_steamIDGameServer.IsValid() ) + { + char rgchBuffer[32]; + sprintf_safe( rgchBuffer, "%llu", m_steamIDGameServer.ConvertToUint64() ); + SteamFriends()->SetRichPresence( "steam_player_group", rgchBuffer ); + } + else + { + SteamFriends()->SetRichPresence( "steam_player_group", "" ); + } + +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles notification of a steam ipc failure +// we may get multiple callbacks, one for each IPC operation we attempted +// since the actual failure, so protect ourselves from alerting more than once. +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnIPCFailure( IPCFailure_t *failure ) +{ + static bool bExiting = false; + if ( !bExiting ) + { + OutputDebugString( "Steam IPC Failure, shutting down\n" ); +#if defined( _WIN32 ) + ::MessageBoxA( NULL, "Connection to Steam Lost, Exiting", "Steam Connection Error", MB_OK ); +#endif + m_pGameEngine->Shutdown(); + bExiting = true; + } +} + +//----------------------------------------------------------------------------- +// Purpose: Handles notification of a Steam shutdown request since a Windows +// user in a second concurrent session requests to play this game. Shutdown +// this process immediately if possible. +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnSteamShutdown( SteamShutdown_t *callback ) +{ + static bool bExiting = false; + if ( !bExiting ) + { + OutputDebugString( "Steam shutdown request, shutting down\n" ); + m_pGameEngine->Shutdown(); + bExiting = true; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles notification that the Steam overlay is shown/hidden, note, this +// doesn't mean the overlay will or will not draw, it may still draw when not active. +// This does mean the time when the overlay takes over input focus from the game. +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnGameOverlayActivated( GameOverlayActivated_t *callback ) +{ + if ( callback->m_bActive ) + OutputDebugString( "Steam overlay now active\n" ); + else + OutputDebugString( "Steam overlay now inactive\n" ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handle the callback from the user clicking a steam://gamewebcallback/ link in the overlay browser +// You can use this to add support for external site signups where you want to pop back into the browser +// after some web page signup sequence, and optionally get back some detail about that. +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnGameWebCallback( GameWebCallback_t *callback ) +{ + m_bSentWebOpen = false; + char rgchString[256]; + sprintf_safe( rgchString, "User submitted following url: %s\n", callback->m_szURL ); + OutputDebugString( rgchString ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Do work that doesn't need to happen every frame +//----------------------------------------------------------------------------- +void CSpaceWarClient::RunOccasionally() +{ + if ( SteamUtils()->IsSteamChinaLauncher() ) + { + SteamAPICall_t hCallHandle = SteamUser()->GetDurationControl(); + if ( hCallHandle != k_uAPICallInvalid ) + { + m_SteamCallResultDurationControl.Set( hCallHandle, this, &CSpaceWarClient::OnDurationControlCallResult ); + } + + } + + // Service stats and achievements + m_pStatsAndAchievements->RunFrame(); + m_pTimeline->RunFrame(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Main frame function, updates the state of the world and performs rendering +//----------------------------------------------------------------------------- +void CSpaceWarClient::RunFrame() +{ + // Get any new data off the network to begin with + ReceiveNetworkData(); + + RenderTimer(); + + if ( m_eConnectedStatus != k_EClientNotConnected && m_pGameEngine->GetGameTickCount() - m_ulLastNetworkDataReceivedTime > MILLISECONDS_CONNECTION_TIMEOUT ) + { + SetConnectionFailureText( "Game server connection failure." ); + DisconnectFromServer(); // cleanup on our side, even though server won't get our disconnect msg + SetGameState( k_EClientGameConnectionFailure ); + } + + // Check if escape has been pressed, we'll use that info in a couple places below + bool bEscapePressed = false; + if ( m_pGameEngine->BIsKeyDown( VK_ESCAPE ) || + m_pGameEngine->BIsControllerActionActive( eControllerDigitalAction_PauseMenu ) || + m_pGameEngine->BIsControllerActionActive( eControllerDigitalAction_MenuCancel ) ) + { + static uint64 m_ulLastESCKeyTick = 0; + uint64 ulCurrentTickCount = m_pGameEngine->GetGameTickCount(); + if ( ulCurrentTickCount - 250 > m_ulLastESCKeyTick ) + { + m_ulLastESCKeyTick = ulCurrentTickCount; + bEscapePressed = true; + } + } + + // Run Steam client callbacks + SteamAPI_RunCallbacks(); + + // Do work that runs infrequently. we do this every second. + static time_t tLastCheck = 0; + time_t tNow = time( nullptr ); + if ( tNow != tLastCheck ) + { + tLastCheck = tNow; + RunOccasionally(); + } + + // if we just transitioned state, perform on change handlers + if ( m_bTransitionedGameState ) + { + m_bTransitionedGameState = false; + OnGameStateChanged( m_eGameState ); + } + + // Update state for everything + switch ( m_eGameState ) + { + case k_EClientGameMenu: + m_pStarField->Render(); + m_pMainMenu->RunFrame(); + // Make sure the Steam Controller is in the correct mode. + m_pGameEngine->SetSteamControllerActionSet( eControllerActionSet_MenuControls ); + break; + case k_EClientFindInternetServers: + case k_EClientFindLANServers: + m_pStarField->Render(); + m_pServerBrowser->RunFrame(); + break; + + case k_EClientCreatingLobby: + m_pStarField->Render(); + // draw some text about creating lobby (may take a second or two) + break; + + case k_EClientInLobby: + m_pStarField->Render(); + // display the lobby + m_pLobby->RunFrame(); + + // see if we have a game server ready to play on + if ( m_pServer && m_pServer->IsConnectedToSteam() ) + { + // server is up; tell everyone else to connect + SteamMatchmaking()->SetLobbyGameServer( m_steamIDLobby, 0, 0, m_pServer->GetSteamID() ); + // start connecting ourself via localhost (this will automatically leave the lobby) + InitiateServerConnection( m_pServer->GetSteamID() ); + } + break; + + case k_EClientFindLobby: + m_pStarField->Render(); + + // display the list of lobbies + m_pLobbyBrowser->RunFrame(); + break; + + case k_EClientJoiningLobby: + m_pStarField->Render(); + + // Draw text telling the user a connection attempt is in progress + DrawConnectionAttemptText(); + + // Check if we've waited too long and should time out the connection + if ( m_pGameEngine->GetGameTickCount() - m_ulStateTransitionTime > MILLISECONDS_CONNECTION_TIMEOUT ) + { + SetConnectionFailureText( "Timed out connecting to lobby." ); + SetGameState( k_EClientGameConnectionFailure ); + } + break; + + case k_EClientGameConnectionFailure: + m_pStarField->Render(); + DrawConnectionFailureText(); + + if ( bEscapePressed ) + SetGameState( k_EClientGameMenu ); + + break; + case k_EClientGameConnecting: + m_pStarField->Render(); + + // Draw text telling the user a connection attempt is in progress + DrawConnectionAttemptText(); + + // Check if we've waited too long and should time out the connection + if ( m_pGameEngine->GetGameTickCount() - m_ulStateTransitionTime > MILLISECONDS_CONNECTION_TIMEOUT ) + { + DisconnectFromServer(); + m_GameServerPing.CancelPing(); + SetConnectionFailureText( "Timed out connecting to game server" ); + SetGameState( k_EClientGameConnectionFailure ); + } + + break; + case k_EClientGameQuitMenu: + m_pStarField->Render(); + + // Update all the entities (this is client side interpolation)... + m_pSun->RunFrame(); + for( uint32 i=0; iRunFrame(); + } + + // Now draw the menu + m_pQuitMenu->RunFrame(); + + // Make sure the Steam Controller is in the correct mode. + m_pGameEngine->SetSteamControllerActionSet( eControllerActionSet_MenuControls ); + break; + case k_EClientGameInstructions: + m_pStarField->Render(); + DrawInstructions(); + + if ( bEscapePressed ) + SetGameState( k_EClientGameMenu ); + break; + case k_EClientWorkshop: + m_pStarField->Render(); + DrawWorkshopItems(); + + if (bEscapePressed) + SetGameState(k_EClientGameMenu); + break; + + case k_EClientStatsAchievements: + m_pStarField->Render(); + m_pStatsAndAchievements->Render(); + + if ( bEscapePressed ) + SetGameState( k_EClientGameMenu ); + if (m_pGameEngine->BIsKeyDown( 0x31 ) ) + { + SpaceWarLocalInventory()->DoExchange(); + } + else if ( m_pGameEngine->BIsKeyDown( 0x32 ) ) + { + SpaceWarLocalInventory()->ModifyItemProperties(); + } + break; + case k_EClientLeaderboards: + m_pStarField->Render(); + m_pLeaderboards->RunFrame(); + + if ( bEscapePressed ) + SetGameState( k_EClientGameMenu ); + break; + + case k_EClientFriendsList: + m_pStarField->Render(); + m_pFriendsList->RunFrame(); + + if ( bEscapePressed ) + SetGameState( k_EClientGameMenu ); + break; + + case k_EClientClanChatRoom: + m_pStarField->Render(); + m_pClanChatRoom->RunFrame(); + + if ( bEscapePressed ) + SetGameState( k_EClientGameMenu ); + break; + + case k_EClientRemotePlaySessions: + m_pStarField->Render(); + m_pRemotePlayList->RunFrame(); + + if ( bEscapePressed ) + SetGameState( k_EClientGameMenu ); + break; + + case k_EClientRemoteStorage: + m_pStarField->Render(); + m_pRemoteStorage->Render(); + break; + + case k_EClientHTMLSurface: + m_pHTMLSurface->RunFrame(); + m_pHTMLSurface->Render(); + break; + + + case k_EClientMinidump: +#ifdef _WIN32 + RaiseException( EXCEPTION_NONCONTINUABLE_EXCEPTION, + EXCEPTION_NONCONTINUABLE, + 0, NULL ); +#endif + SetGameState( k_EClientGameMenu ); + break; + + case k_EClientGameStartServer: + m_pStarField->Render(); + if ( !m_pServer ) + { + m_pServer = new CSpaceWarServer( m_pGameEngine ); + } + + if ( m_pServer && m_pServer->IsConnectedToSteam() ) + { + // server is ready, connect to it + InitiateServerConnection( m_pServer->GetSteamID() ); + } + break; + case k_EClientGameDraw: + case k_EClientGameWinner: + case k_EClientGameWaitingForPlayers: + m_pStarField->Render(); + + // Update all the entities (this is client side interpolation)... + m_pSun->RunFrame(); + for( uint32 i=0; iRunFrame(); + } + + DrawHUDText(); + DrawWinnerDrawOrWaitingText(); + + m_pVoiceChat->RunFrame(); + + if ( bEscapePressed ) + SetGameState( k_EClientGameQuitMenu ); + + break; + + case k_EClientGameActive: + // Make sure the Steam Controller is in the correct mode. + m_pGameEngine->SetSteamControllerActionSet( eControllerActionSet_ShipControls ); + + m_pStarField->Render(); + + // SendHeartbeat is safe to call on every frame since the API is internally rate-limited. + // Ideally you would only call this once per second though, to minimize unnecessary calls. + SteamInventory()->SendItemDropHeartbeat(); + + // Update all the entities... + m_pSun->RunFrame(); + for( uint32 i=0; iRunFrame(); + } + + for (uint32 i = 0; i < MAX_WORKSHOP_ITEMS; ++i) + { + if (m_rgpWorkshopItems[i]) + m_rgpWorkshopItems[i]->RunFrame(); + } + + + DrawHUDText(); + + m_pStatsAndAchievements->RunFrame(); + + m_pVoiceChat->RunFrame(); + + if ( bEscapePressed ) + SetGameState( k_EClientGameQuitMenu ); + + break; + case k_EClientGameExiting: + DisconnectFromServer(); + m_pGameEngine->Shutdown(); + return; + case k_EClientWebCallback: + m_pStarField->Render(); + + if ( !m_bSentWebOpen ) + { + m_bSentWebOpen = true; + + char szCurDir[MAX_PATH]; + if ( !_getcwd( szCurDir, sizeof(szCurDir) ) ) + { + strcpy( szCurDir, "." ); + } + char szURL[MAX_PATH]; + sprintf_safe( szURL, "file:///%s/test.html", szCurDir ); + // load the test html page, it just has a steam://gamewebcallback link in it + SteamFriends()->ActivateGameOverlayToWebPage( szURL ); + SetGameState( k_EClientGameMenu ); + } + + break; + case k_EClientMusic: + m_pStarField->Render(); + + m_pMusicPlayer->RunFrame(); + + if ( bEscapePressed ) + { + SetGameState( k_EClientGameMenu ); + } + break; + + case k_EClientInGameStore: + m_pStarField->Render(); + m_pItemStore->RunFrame(); + + if (bEscapePressed) + SetGameState(k_EClientGameMenu); + break; + + case k_EClientOverlayAPI: + m_pStarField->Render(); + m_pOverlayExamples->RunFrame(); + + if ( bEscapePressed ) + SetGameState( k_EClientGameMenu ); + break; + + default: + OutputDebugString( "Unhandled game state in CSpaceWar::RunFrame\n" ); + } + + + // Send an update on our local ship to the server + if ( m_eConnectedStatus == k_EClientConnectedAndAuthenticated && m_rgpShips[ m_uPlayerShipIndex ] ) + { + MsgClientSendLocalUpdate_t msg; + msg.SetShipPosition( m_uPlayerShipIndex ); + + // Send update as unreliable message. This means that if network packets drop, + // the networking system will not attempt retransmission, and our message may not arrive. + // That's OK, because we would rather just send a new, update message, instead of + // retransmitting the old one. + if ( m_rgpShips[ m_uPlayerShipIndex ]->BGetClientUpdateData( msg.AccessUpdateData() ) ) + BSendServerData( &msg, sizeof( msg ), k_nSteamNetworkingSend_Unreliable ); + } + + if ( m_pP2PAuthedGame ) + { + if ( m_pServer ) + { + // Now if we are the owner of the game, lets make sure all of our players are legit. + // if they are not, we tell the server to kick them off + // Start at 1 to skip myself + for ( int i = 1; i < MAX_PLAYERS_PER_SERVER; i++ ) + { + if ( m_pP2PAuthedGame->m_rgpP2PAuthPlayer[i] && !m_pP2PAuthedGame->m_rgpP2PAuthPlayer[i]->BIsAuthOk() ) + { + m_pServer->KickPlayerOffServer( m_pP2PAuthedGame->m_rgpP2PAuthPlayer[i]->m_steamID ); + } + } + } + else + { + // If we are not the owner of the game, lets make sure the game owner is legit + // if he is not, we leave the game + if ( m_pP2PAuthedGame->m_rgpP2PAuthPlayer[0] ) + { + if ( !m_pP2PAuthedGame->m_rgpP2PAuthPlayer[0]->BIsAuthOk() ) + { + // leave the game + SetGameState( k_EClientGameMenu ); + } + } + } + } + + // If we've started a local server run it + if ( m_pServer ) + { + m_pServer->RunFrame(); + } + + // Accumulate stats + for( uint32 i=0; iAccumulateStats( m_pStatsAndAchievements ); + } + + // Render everything that might have been updated by the server + switch ( m_eGameState ) + { + case k_EClientGameDraw: + case k_EClientGameWinner: + case k_EClientGameActive: + // Now render all the objects + m_pSun->Render(); + for( uint32 i=0; iRender(); + } + + for (uint32 i = 0; i < MAX_WORKSHOP_ITEMS; ++i) + { + if ( m_rgpWorkshopItems[i] ) + m_rgpWorkshopItems[i]->Render(); + } + + break; + default: + // Any needed drawing was already done above before server updates + break; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Draws the timer, if -timer was present on the command line +//----------------------------------------------------------------------------- +void CSpaceWarClient::RenderTimer() +{ + if ( !m_bShowTimer ) + return; + + static const uint32 k_unTimerFontHeight = 48; + if ( !m_hTimerFont ) + { + m_hTimerFont = m_pGameEngine->HCreateFont( k_unTimerFontHeight, FW_BOLD, false, "Arial" ); + if ( !m_hTimerFont ) + OutputDebugString( "Timer font was not created properly, text won't draw\n" ); + } + uint32 unSecondsSinceLaunch = ( Plat_GetTicks() - m_unTicksAtLaunch ) / 1000; + char buf[ 128 ]; + sprintf_safe( buf, "%u:%02u", unSecondsSinceLaunch / 60, unSecondsSinceLaunch % 60 ); + + DWORD dwColor = D3DCOLOR_ARGB( 255, 255, 200, 200 ); + RECT rectHeader; + rectHeader.top = 5; + rectHeader.bottom = rectHeader.top + k_unTimerFontHeight; + rectHeader.left = 0; + rectHeader.right = m_pGameEngine->GetViewportWidth() - 5; + m_pGameEngine->BDrawString( m_hTimerFont, rectHeader, dwColor, TEXTPOS_RIGHT | TEXTPOS_TOP, buf ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Draws some HUD text indicating game status +//----------------------------------------------------------------------------- +void CSpaceWarClient::DrawHUDText() +{ + // Padding from the edge of the screen for hud elements + const int32 nHudPaddingVertical = 15; + const int32 nHudPaddingHorizontal = 15; + + const int32 width = m_pGameEngine->GetViewportWidth(); + const int32 height = m_pGameEngine->GetViewportHeight(); + + const int32 nAvatarWidth = 64; + const int32 nAvatarHeight = 64; + + const int32 nSpaceBetweenAvatarAndScore = 6; + + LONG scorewidth = LONG((m_pGameEngine->GetViewportWidth() - nHudPaddingHorizontal*2.0f)/4.0f); + + char rgchBuffer[256]; + for( uint32 i=0; iGetFriendPersonaName() this call will work on friends, + // players on the same game server as us (if using the Steam game server auth API) + // and on ourself. + char rgchPlayerName[128]; + CSteamID playerSteamID( m_rgSteamIDPlayers[i] ); + + const char *pszVoiceState = m_pVoiceChat->IsPlayerTalking( playerSteamID ) ? "(VoiceChat)" : ""; + + if ( m_rgSteamIDPlayers[i].IsValid() ) + { + sprintf_safe( rgchPlayerName, "%s", SteamFriends()->GetFriendPersonaName( playerSteamID ) ); + } + else + { + sprintf_safe( rgchPlayerName, "Unknown Player" ); + } + + // We also want to use the Steam Avatar image inside the HUD if it is available. + // We look it up via GetMediumFriendAvatar, which returns an image index we use + // to look up the actual RGBA data below. + int iImage = SteamFriends()->GetMediumFriendAvatar( playerSteamID ); + HGAMETEXTURE hTexture = 0; + if ( iImage != -1 ) + hTexture = GetSteamImageAsTexture( iImage ); + + RECT rect; + switch( i ) + { + case 0: + rect.top = nHudPaddingVertical; + rect.bottom = rect.top+nAvatarHeight; + rect.left = nHudPaddingHorizontal; + rect.right = rect.left + scorewidth; + + if ( hTexture ) + { + m_pGameEngine->BDrawTexturedRect( (float)rect.left, (float)rect.top, (float)rect.left+nAvatarWidth, (float)rect.bottom, + 0.0f, 0.0f, 1.0, 1.0, D3DCOLOR_ARGB( 255, 255, 255, 255 ), hTexture ); + rect.left += nAvatarWidth + nSpaceBetweenAvatarAndScore; + rect.right += nAvatarWidth + nSpaceBetweenAvatarAndScore; + } + + sprintf_safe( rgchBuffer, "%s\nScore: %2u %s", rgchPlayerName, m_rguPlayerScores[i], pszVoiceState ); + m_pGameEngine->BDrawString( m_hHUDFont, rect, g_rgPlayerColors[i], TEXTPOS_LEFT|TEXTPOS_VCENTER, rgchBuffer ); + break; + case 1: + + rect.top = nHudPaddingVertical; + rect.bottom = rect.top+nAvatarHeight; + rect.left = width-nHudPaddingHorizontal-scorewidth; + rect.right = width-nHudPaddingHorizontal; + + if ( hTexture ) + { + m_pGameEngine->BDrawTexturedRect( (float)rect.right - nAvatarWidth, (float)rect.top, (float)rect.right, (float)rect.bottom, + 0.0f, 0.0f, 1.0, 1.0, D3DCOLOR_ARGB( 255, 255, 255, 255 ), hTexture ); + rect.right -= nAvatarWidth + nSpaceBetweenAvatarAndScore; + rect.left -= nAvatarWidth + nSpaceBetweenAvatarAndScore; + } + + sprintf_safe( rgchBuffer, "%s\nScore: %2u ", rgchPlayerName, m_rguPlayerScores[i] ); + m_pGameEngine->BDrawString( m_hHUDFont, rect, g_rgPlayerColors[i], TEXTPOS_RIGHT|TEXTPOS_VCENTER, rgchBuffer ); + break; + case 2: + rect.top = height-nHudPaddingVertical-nAvatarHeight; + rect.bottom = rect.top+nAvatarHeight; + rect.left = nHudPaddingHorizontal; + rect.right = rect.left + scorewidth; + + if ( hTexture ) + { + m_pGameEngine->BDrawTexturedRect( (float)rect.left, (float)rect.top, (float)rect.left+nAvatarWidth, (float)rect.bottom, + 0.0f, 0.0f, 1.0, 1.0, D3DCOLOR_ARGB( 255, 255, 255, 255 ), hTexture ); + rect.right += nAvatarWidth + nSpaceBetweenAvatarAndScore; + rect.left += nAvatarWidth + nSpaceBetweenAvatarAndScore; + } + + sprintf_safe( rgchBuffer, "%s\nScore: %2u %s", rgchPlayerName, m_rguPlayerScores[i], pszVoiceState ); + m_pGameEngine->BDrawString( m_hHUDFont, rect, g_rgPlayerColors[i], TEXTPOS_LEFT|TEXTPOS_BOTTOM, rgchBuffer ); + break; + case 3: + rect.top = height-nHudPaddingVertical-nAvatarHeight; + rect.bottom = rect.top+nAvatarHeight; + rect.left = width-nHudPaddingHorizontal-scorewidth; + rect.right = width-nHudPaddingHorizontal; + + if ( hTexture ) + { + m_pGameEngine->BDrawTexturedRect( (float)rect.right - nAvatarWidth, (float)rect.top, (float)rect.right, (float)rect.bottom, + 0.0f, 0.0f, 1.0, 1.0, D3DCOLOR_ARGB( 255, 255, 255, 255 ), hTexture ); + rect.right -= nAvatarWidth + nSpaceBetweenAvatarAndScore; + rect.left -= nAvatarWidth + nSpaceBetweenAvatarAndScore; + } + + sprintf_safe( rgchBuffer, "%s\nScore: %2u %s", rgchPlayerName, m_rguPlayerScores[i], pszVoiceState ); + m_pGameEngine->BDrawString( m_hHUDFont, rect, g_rgPlayerColors[i], TEXTPOS_RIGHT|TEXTPOS_BOTTOM, rgchBuffer ); + break; + default: + OutputDebugString( "DrawHUDText() needs updating for more players\n" ); + break; + } + } + + // Draw a Steam Input tooltip + if ( m_pGameEngine->BIsSteamInputDeviceActive( ) ) + { + char rgchHint[128]; + const char *rgchFireOrigin = m_pGameEngine->GetTextStringForControllerOriginDigital( eControllerActionSet_ShipControls, eControllerDigitalAction_FireLasers ); + + if ( strcmp( rgchFireOrigin, "None" ) == 0 ) + { + sprintf_safe( rgchHint, "No Fire action bound." ); + } + else + { + sprintf_safe( rgchHint, "Press '%s' to Fire", rgchFireOrigin ); + } + + RECT rect; + int nBorder = 30; + rect.top = m_pGameEngine->GetViewportHeight( ) - nBorder; + rect.bottom = m_pGameEngine->GetViewportHeight( )*2; + rect.left = nBorder; + rect.right = m_pGameEngine->GetViewportWidth( ); + m_pGameEngine->BDrawString( m_hHUDFont, rect, D3DCOLOR_ARGB( 255, 255, 255, 255 ), TEXTPOS_LEFT | TEXTPOS_TOP, rgchHint ); + } + +} + + +//----------------------------------------------------------------------------- +// Purpose: Draws some instructions on how to play the game +//----------------------------------------------------------------------------- +void CSpaceWarClient::DrawInstructions() +{ + const int32 width = m_pGameEngine->GetViewportWidth(); + + RECT rect; + rect.top = 0; + rect.bottom = m_pGameEngine->GetViewportHeight(); + rect.left = 0; + rect.right = width; + + char rgchBuffer[256]; + sprintf_safe( rgchBuffer, "Turn Ship Left: 'A'\nTurn Ship Right: 'D'\nForward Thrusters: 'W'\nReverse Thrusters: 'S'\nFire Photon Beams: 'Space'" ); + m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer ); + + rect.left = 0; + rect.right = width; + rect.top = LONG(m_pGameEngine->GetViewportHeight() * 0.7); + rect.bottom = m_pGameEngine->GetViewportHeight(); + + if ( m_pGameEngine->BIsSteamInputDeviceActive() ) + { + const char *rgchActionOrigin = m_pGameEngine->GetTextStringForControllerOriginDigital( eControllerActionSet_MenuControls, eControllerDigitalAction_MenuCancel ); + + if ( strcmp( rgchActionOrigin, "None" ) == 0 ) + { + sprintf_safe( rgchBuffer, "Press ESC to return to the Main Menu. No controller button bound\n Build ID:%d", SteamApps()->GetAppBuildId() ); + } + else + { + sprintf_safe( rgchBuffer, "Press ESC or '%s' to return the Main Menu\n Build ID:%d", rgchActionOrigin, SteamApps()->GetAppBuildId() ); + } + } + else + { + sprintf_safe( rgchBuffer, "Press ESC to return to the Main Menu\n Build ID:%d", SteamApps()->GetAppBuildId() ); + } + + m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_TOP, rgchBuffer ); + +} + +//----------------------------------------------------------------------------- +// Purpose: Draws some text indicating a connection attempt is in progress +//----------------------------------------------------------------------------- +void CSpaceWarClient::DrawConnectionAttemptText() +{ + const int32 width = m_pGameEngine->GetViewportWidth(); + + RECT rect; + rect.top = 0; + rect.bottom = m_pGameEngine->GetViewportHeight(); + rect.left = 0; + rect.right = width; + + // Figure out how long we are still willing to wait for success + uint32 uSecondsLeft = (MILLISECONDS_CONNECTION_TIMEOUT - uint32(m_pGameEngine->GetGameTickCount() - m_ulStateTransitionTime ))/1000; + + char rgchTimeoutString[256]; + if ( uSecondsLeft < 25 ) + sprintf_safe( rgchTimeoutString, ", timeout in %u...\n", uSecondsLeft ); + else + sprintf_safe( rgchTimeoutString, "...\n" ); + + + char rgchBuffer[256]; + if ( m_eGameState == k_EClientJoiningLobby ) + sprintf_safe( rgchBuffer, "Connecting to lobby%s", rgchTimeoutString ); + else + sprintf_safe( rgchBuffer, "Connecting to server%s", rgchTimeoutString ); + + m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Draws some text indicating a connection failure +//----------------------------------------------------------------------------- +void CSpaceWarClient::DrawConnectionFailureText() +{ + const int32 width = m_pGameEngine->GetViewportWidth(); + + RECT rect; + rect.top = 0; + rect.bottom = m_pGameEngine->GetViewportHeight(); + rect.left = 0; + rect.right = width; + + char rgchBuffer[256]; + sprintf_safe( rgchBuffer, "%s\n", m_rgchErrorText ); + m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer ); + + rect.left = 0; + rect.right = width; + rect.top = LONG(m_pGameEngine->GetViewportHeight() * 0.7); + rect.bottom = m_pGameEngine->GetViewportHeight(); + + if ( m_pGameEngine->BIsSteamInputDeviceActive() ) + { + const char *rgchActionOrigin = m_pGameEngine->GetTextStringForControllerOriginDigital( eControllerActionSet_MenuControls, eControllerDigitalAction_MenuCancel ); + + if ( strcmp( rgchActionOrigin, "None" ) == 0 ) + { + sprintf_safe( rgchBuffer, "Press ESC to return to the Main Menu. No controller button bound" ); + } + else + { + sprintf_safe( rgchBuffer, "Press ESC or '%s' to return the Main Menu", rgchActionOrigin ); + } + } + else + { + sprintf_safe( rgchBuffer, "Press ESC to return to the Main Menu" ); + } + m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_TOP, rgchBuffer ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Draws some text about who just won (or that there was a draw) +//----------------------------------------------------------------------------- +void CSpaceWarClient::DrawWinnerDrawOrWaitingText() +{ + int nSecondsToRestart = ((MILLISECONDS_BETWEEN_ROUNDS - (int)(m_pGameEngine->GetGameTickCount() - m_ulStateTransitionTime) )/1000) + 1; + if ( nSecondsToRestart < 0 ) + nSecondsToRestart = 0; + + RECT rect; + rect.top = 0; + rect.bottom = int(m_pGameEngine->GetViewportHeight()*0.6f); + rect.left = 0; + rect.right = m_pGameEngine->GetViewportWidth(); + + char rgchBuffer[256]; + if ( m_eGameState == k_EClientGameWaitingForPlayers ) + { + sprintf_safe( rgchBuffer, "Server is waiting for players.\n\nStarting in %d seconds...", nSecondsToRestart ); + m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer ); + } + else if ( m_eGameState == k_EClientGameDraw ) + { + sprintf_safe( rgchBuffer, "The round is a draw!\n\nStarting again in %d seconds...", nSecondsToRestart ); + m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer ); + } + else if ( m_eGameState == k_EClientGameWinner ) + { + if ( m_uPlayerWhoWonGame >= MAX_PLAYERS_PER_SERVER ) + { + OutputDebugString( "Invalid winner value\n" ); + return; + } + + char rgchPlayerName[128]; + if ( m_rgSteamIDPlayers[m_uPlayerWhoWonGame].IsValid() ) + { + sprintf_safe( rgchPlayerName, "%s", SteamFriends()->GetFriendPersonaName( m_rgSteamIDPlayers[m_uPlayerWhoWonGame] ) ); + } + else + { + sprintf_safe( rgchPlayerName, "Unknown Player" ); + } + + sprintf_safe( rgchBuffer, "%s wins!\n\nStarting again in %d seconds...", rgchPlayerName, nSecondsToRestart ); + + m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer ); + } + + // Note: GetLastDroppedItem is the result of an async function, this will not render the reward right away. Could wait for it. + const CSpaceWarItem *pItem = SpaceWarLocalInventory()->GetLastDroppedItem(); + if ( pItem ) + { + // (We're not really bothering to localize everything else, this is just an example.) + sprintf_safe( rgchBuffer, "You won a brand new %s!", pItem->GetLocalizedName().c_str() ); + + rect.top = 0; + rect.bottom = int(m_pGameEngine->GetViewportHeight()*0.4f); + rect.left = 0; + rect.right = m_pGameEngine->GetViewportWidth(); + m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Did we win the last game? +//----------------------------------------------------------------------------- +bool CSpaceWarClient::BLocalPlayerWonLastGame() +{ + if ( m_eGameState == k_EClientGameWinner ) + { + if ( m_uPlayerWhoWonGame >= MAX_PLAYERS_PER_SERVER ) + { + // ur + return false; + } + + if ( m_rgpShips[m_uPlayerWhoWonGame] && m_rgpShips[m_uPlayerWhoWonGame]->BIsLocalPlayer() ) + { + return true; + } + else + { + return false; + } + } + else + { + return false; + } +} + +//----------------------------------------------------------------------------- +// Purpose: Scale pixel sizes to "real" sizes +//----------------------------------------------------------------------------- +float CSpaceWarClient::PixelsToFeet( float flPixels ) +{ + // This game is actual size! (at 72dpi) LOL + // Those are very tiny ships, and an itty bitty neutron star + + float flReturn = ( flPixels / 72 ) / 12; + + return flReturn; +} + + +//----------------------------------------------------------------------------- +// Purpose: Get a specific Steam image RGBA as a game texture +//----------------------------------------------------------------------------- +HGAMETEXTURE CSpaceWarClient::GetSteamImageAsTexture( int iImage ) +{ + HGAMETEXTURE hTexture = 0; + + // iImage of 0 from steam means no avatar is set + if ( iImage ) + { + std::map::iterator iter; + iter = m_MapSteamImagesToTextures.find( iImage ); + if ( iter == m_MapSteamImagesToTextures.end() ) + { + // We haven't created a texture for this image index yet, do so now + + // Get the image size from Steam, making sure it looks valid afterwards + uint32 uAvatarWidth, uAvatarHeight; + SteamUtils()->GetImageSize( iImage, &uAvatarWidth, &uAvatarHeight ); + if ( uAvatarWidth > 0 && uAvatarHeight > 0 ) + { + // Get the actual raw RGBA data from Steam and turn it into a texture in our game engine + byte *pAvatarRGBA = new byte[ uAvatarWidth * uAvatarHeight * 4]; + SteamUtils()->GetImageRGBA( iImage, (uint8*)pAvatarRGBA, uAvatarWidth * uAvatarHeight * 4 ); + hTexture = m_pGameEngine->HCreateTexture( pAvatarRGBA, uAvatarWidth, uAvatarHeight ); + delete[] pAvatarRGBA; + if ( hTexture ) + { + m_MapSteamImagesToTextures[ iImage ] = hTexture; + } + } + } + else + { + hTexture = iter->second; + } + } + + return hTexture; +} + + +//----------------------------------------------------------------------------- +// Purpose: Request an encrypted app ticket +//----------------------------------------------------------------------------- +uint32 k_unSecretData = 0x5444; +void CSpaceWarClient::RetrieveEncryptedAppTicket() +{ + SteamAPICall_t hSteamAPICall = SteamUser()->RequestEncryptedAppTicket( &k_unSecretData, sizeof( k_unSecretData ) ); + m_SteamCallResultEncryptedAppTicket.Set( hSteamAPICall, this, &CSpaceWarClient::OnRequestEncryptedAppTicket ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Called when requested app ticket asynchronously completes +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnRequestEncryptedAppTicket( EncryptedAppTicketResponse_t *pEncryptedAppTicketResponse, bool bIOFailure ) +{ + if ( bIOFailure ) + return; + + if ( pEncryptedAppTicketResponse->m_eResult == k_EResultOK ) + { + uint8 rgubTicket[4096]; + uint32 cubTicket; + SteamUser()->GetEncryptedAppTicket( rgubTicket, sizeof( rgubTicket), &cubTicket ); + + +#ifdef _WIN32 + // normally at this point you transmit the encrypted ticket to the service that knows the decryption key + // this code is just to demonstrate the ticket cracking library + + // included is the "secret" key for spacewar. normally this is secret + const uint8 rgubKey[k_nSteamEncryptedAppTicketSymmetricKeyLen] = { 0xed, 0x93, 0x86, 0x07, 0x36, 0x47, 0xce, 0xa5, 0x8b, 0x77, 0x21, 0x49, 0x0d, 0x59, 0xed, 0x44, 0x57, 0x23, 0xf0, 0xf6, 0x6e, 0x74, 0x14, 0xe1, 0x53, 0x3b, 0xa3, 0x3c, 0xd8, 0x03, 0xbd, 0xbd }; + + uint8 rgubDecrypted[4096]; + uint32 cubDecrypted = sizeof( rgubDecrypted ); + if ( !SteamEncryptedAppTicket_BDecryptTicket( rgubTicket, cubTicket, rgubDecrypted, &cubDecrypted, rgubKey, sizeof( rgubKey ) ) ) + { + OutputDebugString( "Ticket failed to decrypt\n" ); + return; + } + + if ( !SteamEncryptedAppTicket_BIsTicketForApp( rgubDecrypted, cubDecrypted, SteamUtils()->GetAppID() ) ) + OutputDebugString( "Ticket for wrong app id\n" ); + + CSteamID steamIDFromTicket; + SteamEncryptedAppTicket_GetTicketSteamID( rgubDecrypted, cubDecrypted, &steamIDFromTicket ); + if ( steamIDFromTicket != SteamUser()->GetSteamID() ) + OutputDebugString( "Ticket for wrong user\n" ); + + uint32 cubData; + uint32 *punSecretData = (uint32 *)SteamEncryptedAppTicket_GetUserVariableData( rgubDecrypted, cubDecrypted, &cubData ); + if ( cubData != sizeof( uint32 ) || *punSecretData != k_unSecretData ) + OutputDebugString( "Failed to retrieve secret data\n" ); +#endif + } + else if ( pEncryptedAppTicketResponse->m_eResult == k_EResultLimitExceeded ) + { + OutputDebugString( "Calling RequestEncryptedAppTicket more than once per minute returns this error\n" ); + } + else if ( pEncryptedAppTicketResponse->m_eResult == k_EResultDuplicateRequest ) + { + OutputDebugString( "Calling RequestEncryptedAppTicket while there is already a pending request results in this error\n" ); + } + else if ( pEncryptedAppTicketResponse->m_eResult == k_EResultNoConnection ) + { + OutputDebugString( "Calling RequestEncryptedAppTicket while not connected to steam results in this error\n" ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Updates what we show to friends about what we're doing and how to connect +//----------------------------------------------------------------------------- +void CSpaceWarClient::UpdateRichPresenceConnectionInfo() +{ + // connect string that will come back to us on the command line when a friend tries to join our game + char rgchConnectString[128]; + rgchConnectString[0] = 0; + + if ( m_eConnectedStatus == k_EClientConnectedAndAuthenticated && m_unServerIP && m_usServerPort ) + { + // game server connection method + sprintf_safe( rgchConnectString, "+connect %d:%d", m_unServerIP, m_usServerPort ); + } + else if ( m_steamIDLobby.IsValid() ) + { + // lobby connection method + sprintf_safe( rgchConnectString, "+connect_lobby %llu", m_steamIDLobby.ConvertToUint64() ); + } + + SteamFriends()->SetRichPresence( "connect", rgchConnectString ); +} + + +//----------------------------------------------------------------------------- +// Purpose: applies a command-line connect +//----------------------------------------------------------------------------- +void CSpaceWarClient::ExecCommandLineConnect( const char *pchServerAddress, const char *pchLobbyID ) +{ + if ( pchServerAddress ) + { + int32 octet0 = 0, octet1 = 0, octet2 = 0, octet3 = 0; + int32 uPort = 0; + int nConverted = sscanf( pchServerAddress, "%d.%d.%d.%d:%d", &octet0, &octet1, &octet2, &octet3, &uPort ); + if ( nConverted == 5 ) + { + char rgchIPAddress[128]; + sprintf_safe( rgchIPAddress, "%d.%d.%d.%d", octet0, octet1, octet2, octet3 ); + uint32 unIPAddress = ( octet3 ) + ( octet2 << 8 ) + ( octet1 << 16 ) + ( octet0 << 24 ); + InitiateServerConnection( unIPAddress, uPort ); + } + } + + // if +connect_lobby was used to specify a lobby to join, connect now + if ( pchLobbyID ) + { + CSteamID steamIDLobby( (uint64)atoll( pchLobbyID ) ); + if ( steamIDLobby.IsValid() ) + { + // act just like we had selected it from the menu + LobbyBrowserMenuItem_t menuItem = { steamIDLobby, k_EClientJoiningLobby }; + OnMenuSelection( menuItem ); + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: parse CWorkshopItem from text file +//----------------------------------------------------------------------------- +CWorkshopItem *CSpaceWarClient::LoadWorkshopItemFromFile( const char *pszFileName ) +{ + FILE *file = fopen( pszFileName, "rt"); + if (!file) + return NULL; + + CWorkshopItem *pItem = NULL; + + char szLine[1024]; + + if ( fgets(szLine, sizeof(szLine), file) ) + { + float flXPos, flYPos, flXVelocity, flYVelocity; + // initialize object + if ( sscanf(szLine, "%f %f %f %f", &flXPos, &flYPos, &flXVelocity, &flYVelocity) ) + { + pItem = new CWorkshopItem( m_pGameEngine, 0 ); + + pItem->SetPosition( flXPos, flYPos ); + pItem->SetVelocity( flXVelocity, flYVelocity ); + + while (!feof(file)) + { + float xPos0, yPos0, xPos1, yPos1; + DWORD dwColor; + if ( fgets(szLine, sizeof(szLine), file) && + sscanf(szLine, "%f %f %f %f %x", &xPos0, &yPos0, &xPos1, &yPos1, &dwColor) >= 5 ) + { + // Add a line to the entity + pItem->AddLine(xPos0, yPos0, xPos1, yPos1, dwColor); + } + } + } + } + + fclose(file); + + return pItem; +} + + +//----------------------------------------------------------------------------- +// Purpose: load a Workshop item by PublishFileID +//----------------------------------------------------------------------------- +bool CSpaceWarClient::LoadWorkshopItem( PublishedFileId_t workshopItemID ) +{ + if ( m_nNumWorkshopItems == MAX_WORKSHOP_ITEMS ) + return false; // too much + + uint32 unItemState = SteamUGC()->GetItemState( workshopItemID ); + + if ( !(unItemState & k_EItemStateInstalled) ) + return false; + + uint32 unTimeStamp = 0; + uint64 unSizeOnDisk = 0; + char szItemFolder[1024] = { 0 }; + + if ( !SteamUGC()->GetItemInstallInfo( workshopItemID, &unSizeOnDisk, szItemFolder, sizeof(szItemFolder), &unTimeStamp ) ) + return false; + + char szFile[1024]; + if( unItemState & k_EItemStateLegacyItem ) + { + // szItemFolder just points directly to the item for legacy items that were published with the RemoteStorage API. + _snprintf( szFile, sizeof( szFile ), "%s", szItemFolder ); + } + else + { + _snprintf( szFile, sizeof( szFile ), "%s/workshopitem.txt", szItemFolder ); + } + + CWorkshopItem *pItem = LoadWorkshopItemFromFile( szFile ); + + if ( !pItem ) + return false; + + pItem->m_ItemDetails.m_nPublishedFileId = workshopItemID; + m_rgpWorkshopItems[m_nNumWorkshopItems++] = pItem; + + // get Workshop item details + SteamAPICall_t hSteamAPICall = SteamUGC()->RequestUGCDetails( workshopItemID, 60 ); + pItem->m_SteamCallResultUGCDetails.Set(hSteamAPICall, pItem, &CWorkshopItem::OnUGCDetailsResult); + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: load all subscribed workshop items +//----------------------------------------------------------------------------- +void CSpaceWarClient::LoadWorkshopItems() +{ + // reset workshop Items + for (uint32 i = 0; i < MAX_WORKSHOP_ITEMS; ++i) + { + if ( m_rgpWorkshopItems[i] ) + { + delete m_rgpWorkshopItems[i]; + m_rgpWorkshopItems[i] = NULL; + } + } + + m_nNumWorkshopItems = 0; // load default test item + + PublishedFileId_t vecSubscribedItems[MAX_WORKSHOP_ITEMS]; + + int numSubscribedItems = SteamUGC()->GetSubscribedItems( vecSubscribedItems, MAX_WORKSHOP_ITEMS ); + + if ( numSubscribedItems > MAX_WORKSHOP_ITEMS ) + numSubscribedItems = MAX_WORKSHOP_ITEMS; // crop + + // load all subscribed workshop items + for ( int iSubscribedItem=0; iSubscribedItemm_ItemDetails.m_rgchTitle, "Test Item", k_cchPublishedDocumentTitleMax ); + strncpy( pItem->m_ItemDetails.m_rgchDescription, "This is a local test item for debugging", k_cchPublishedDocumentDescriptionMax ); + m_rgpWorkshopItems[m_nNumWorkshopItems++] = pItem; + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: new Workshop was installed, load it instantly +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnWorkshopItemInstalled( ItemInstalled_t *pParam ) +{ + if ( pParam->m_unAppID == SteamUtils()->GetAppID() ) + LoadWorkshopItem( pParam->m_nPublishedFileId ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Remote Play Together guest invite was created +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnSteamRemotePlayTogetherGuestInvite( SteamRemotePlayTogetherGuestInvite_t *pParam ) +{ + char rgch[ 1024 ]; + sprintf_safe( rgch, "Remote Play Together guest invite URL: %s\n", + pParam->m_szConnectURL ); + OutputDebugString( rgch ); +} + + +//----------------------------------------------------------------------------- +// Purpose: duration control / anti indulgence callback notification for Steam China +// (this can run from an API call, or from an asynchronous callback. see OnDurationControlCallResult) +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnDurationControl( DurationControl_t *pParam ) +{ + const char *szExitPrompt = nullptr; + + switch ( pParam->m_progress ) + { + default: + break; + + case k_EDurationControl_ExitSoon_3h: + szExitPrompt = "3h playtime since last 5h break"; + break; + case k_EDurationControl_ExitSoon_5h: + szExitPrompt = "5h playtime today"; + break; + case k_EDurationControl_ExitSoon_Night: + szExitPrompt = "10PM-8AM"; + break; + } + + if ( szExitPrompt != nullptr ) + { + char rgch[ 256 ]; + sprintf_safe( rgch, "Duration control: %s (remaining time: %d)\n", + szExitPrompt, pParam->m_csecsRemaining ); + OutputDebugString( rgch ); + + // perform a clean exit + OnMenuSelection( k_EClientGameExiting ); + } + else if ( pParam->m_csecsRemaining < 30 ) + { + // Player doesn't have much playtime left, warn them + OutputDebugString( "Duration control: Playtime remaining is short - exit soon!\n" ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Draws PublishFileID, title & description for each subscribed Workshop item +//----------------------------------------------------------------------------- +void CSpaceWarClient::DrawWorkshopItems() +{ + const int32 width = m_pGameEngine->GetViewportWidth(); + + RECT rect; + rect.top = 0; + rect.bottom = 64; + rect.left = 0; + rect.right = width; + + char rgchBuffer[1024]; + sprintf_safe(rgchBuffer, "Subscribed Workshop Items"); + m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB(255, 25, 200, 25), TEXTPOS_CENTER |TEXTPOS_VCENTER, rgchBuffer); + + rect.left = 32; + rect.top = 64; + rect.bottom = 96; + + for (int iSubscribedItem = 0; iSubscribedItem < MAX_WORKSHOP_ITEMS; iSubscribedItem++) + { + CWorkshopItem *pItem = m_rgpWorkshopItems[ iSubscribedItem ]; + + if ( !pItem ) + continue; + + rect.top += 32; + rect.bottom += 32; + + sprintf_safe( rgchBuffer, "%u. \"%s\" (%llu) : %s", iSubscribedItem+1, + pItem->m_ItemDetails.m_rgchTitle, pItem->m_ItemDetails.m_nPublishedFileId, pItem->m_ItemDetails.m_rgchDescription ); + + m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB(255, 25, 200, 25), TEXTPOS_LEFT |TEXTPOS_VCENTER, rgchBuffer); + } + + rect.left = 0; + rect.right = width; + rect.top = LONG(m_pGameEngine->GetViewportHeight() * 0.8); + rect.bottom = m_pGameEngine->GetViewportHeight(); + + if ( m_pGameEngine->BIsSteamInputDeviceActive() ) + { + const char *rgchActionOrigin = m_pGameEngine->GetTextStringForControllerOriginDigital( eControllerActionSet_MenuControls, eControllerDigitalAction_MenuCancel ); + + if ( strcmp( rgchActionOrigin, "None" ) == 0 ) + { + sprintf_safe( rgchBuffer, "Press ESC to return to the Main Menu. No controller button bound" ); + } + else + { + sprintf_safe( rgchBuffer, "Press ESC or '%s' to return the Main Menu", rgchActionOrigin ); + } + } + else + { + sprintf_safe( rgchBuffer, "Press ESC to return to the Main Menu" ); + } + m_pGameEngine->BDrawString(m_hInstructionsFont, rect, D3DCOLOR_ARGB(255, 25, 200, 25), TEXTPOS_CENTER | TEXTPOS_TOP, rgchBuffer); +} + + +//----------------------------------------------------------------------------- +// Purpose: Draws PublishFileID, title & description for each subscribed Workshop item +//----------------------------------------------------------------------------- +void CSpaceWarClient::UpdateScoreInGamePhase( bool bFinal ) +{ + std::string strScores; + uint32 unHighScore = 0; + for ( int i = 0; i < MAX_PLAYERS_PER_SERVER; i++ ) + { + if ( !strScores.empty() ) + strScores += " / "; + strScores += std::to_string( m_rguPlayerScores[ i ] ); + unHighScore = unHighScore < m_rguPlayerScores[ i ] ? m_rguPlayerScores[ i ] : unHighScore; + } + + uint32 unCountAtHighScore = 0; + for ( int i = 0; i < MAX_PLAYERS_PER_SERVER; i++ ) + { + if ( m_rguPlayerScores[ i ] == unHighScore ) + unCountAtHighScore++; + } + + std::string strPlayerScore = "0"; + + SteamTimeline()->SetGamePhaseAttribute( "Scores", strScores.c_str(), 1 ); + SteamTimeline()->SetGamePhaseAttribute( "Player Score", strPlayerScore.c_str(), 2 ); + + if ( BLocalPlayerWonLastGame() ) + { + SteamTimeline()->AddGamePhaseTag( "Won", "steam_ribbon", "Game Outcome", 3 ); + } + else if ( unCountAtHighScore == 1 && unHighScore > 0 ) + { + SteamTimeline()->AddGamePhaseTag( "Lost", "steam_death", "Game Outcome", 3 ); + } + else if ( unCountAtHighScore > 1 && unHighScore > 0 ) + { + SteamTimeline()->AddGamePhaseTag( "Tied", "steam_triangle", "Game Outcome", 3 ); + } + else + { + SteamTimeline()->AddGamePhaseTag( "Stalemate", "steam_minus", "Game Outcome", 3 ); + } +} diff --git a/external/steamworks/steamworksexample/SpaceWarClient.h b/external/steamworks/steamworksexample/SpaceWarClient.h new file mode 100644 index 0000000..bb2a4ab --- /dev/null +++ b/external/steamworks/steamworksexample/SpaceWarClient.h @@ -0,0 +1,560 @@ +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Main class for the space war game client +// +// $NoKeywords: $ +//============================================================================= + +#ifndef SPACEWARCLIENT_H +#define SPACEWARCLIENT_H + + +#include "GameEngine.h" +#include "SpaceWar.h" +#include "Messages.h" +#include "StarField.h" +#include "Sun.h" +#include "Ship.h" +#include "StatsAndAchievements.h" +#include "RemoteStorage.h" +#include "musicplayer.h" +#include "steam/isteamnetworkingsockets.h" +#include "steam/isteamnetworkingutils.h" + +// Forward class declaration +class CConnectingMenu; +class CMainMenu; +class CQuitMenu; +class CSpaceWarServer; +class CServerBrowser; +class CLobbyBrowser; +class CLobby; +class CLeaderboards; +class CFriendsList; +class CClanChatRoom; +class CP2PAuthPlayer; +class CP2PAuthedGame; +class CVoiceChat; +class CHTMLSurface; +class CRemotePlayList; +class CItemStore; +class COverlayExamples; +class CTimeline; + +// Height of the HUD font +#define HUD_FONT_HEIGHT 18 + +// Height for the instructions font +#define INSTRUCTIONS_FONT_HEIGHT 24 + +// Enum for various client connection states +enum EClientConnectionState +{ + k_EClientNotConnected, // Initial state, not connected to a server + k_EClientConnectedPendingAuthentication, // We've established communication with the server, but it hasn't authed us yet + k_EClientConnectedAndAuthenticated, // Final phase, server has authed us, we are actually able to play on it +}; + +// a game server as shown in the find servers menu +struct ServerBrowserMenuData_t +{ + EClientGameState m_eStateToTransitionTo; + CSteamID m_steamIDGameServer; +}; + +// a lobby as shown in the find lobbies menu +struct LobbyBrowserMenuItem_t +{ + CSteamID m_steamIDLobby; + EClientGameState m_eStateToTransitionTo; +}; + +// a user as shown in the lobby screen +struct LobbyMenuItem_t +{ + enum ELobbyMenuItemCommand + { + k_ELobbyMenuItemUser, + k_ELobbyMenuItemStartGame, + k_ELobbyMenuItemToggleReadState, + k_ELobbyMenuItemLeaveLobby, + k_ELobbyMenuItemInviteToLobby + }; + + CSteamID m_steamIDUser; // the user who this is in the lobby + ELobbyMenuItemCommand m_eCommand; + CSteamID m_steamIDLobby; // set if k_ELobbyMenuItemInviteToLobby +}; + +// a leaderboard item +struct LeaderboardMenuItem_t +{ + bool m_bBack; + bool m_bNextLeaderboard; +}; + +// a friends list item +struct FriendsListMenuItem_t +{ + CSteamID m_steamIDFriend; +}; + +// a Remote Play session list item +struct RemotePlayListMenuItem_t +{ + uint32 m_unSessionID; +}; + +#define MAX_WORKSHOP_ITEMS 16 + +// a Steam Workshop item +class CWorkshopItem : public CVectorEntity +{ +public: + + CWorkshopItem( IGameEngine *pGameEngine, uint32 uCollisionRadius ) : CVectorEntity( pGameEngine, uCollisionRadius ) + { + memset( &m_ItemDetails, 0, sizeof(m_ItemDetails) ); + } + + void OnUGCDetailsResult(SteamUGCRequestUGCDetailsResult_t *pCallback, bool bIOFailure) + { + m_ItemDetails = pCallback->m_details; + } + + SteamUGCDetails_t m_ItemDetails; // meta data + CCallResult m_SteamCallResultUGCDetails; +}; + +struct PurchaseableItem_t +{ + SteamItemDef_t m_nItemDefID; + uint64 m_ulPrice; +}; + +struct OverlayExample_t +{ + enum EOverlayExampleItem + { + k_EOverlayExampleItem_BackToMenu, + k_EOverlayExampleItem_Invalid, + k_EOverlayExampleItem_ActivateGameOverlay, + k_EOverlayExampleItem_ActivateGameOverlayToUser, + k_EOverlayExampleItem_ActivateGameOverlayToWebPage, + k_EOverlayExampleItem_ActivateGameOverlayToWebPageModal, + k_EOverlayExampleItem_ActivateGameOverlayToStore, + // k_EOverlayExampleItem_ActivateGameOverlayRemotePlayTogetherInviteDialog, + k_EOverlayExampleItem_ActivateGameOverlayInviteDialogConnectString, + k_EOverlayExampleItem_HookScreenshots, + k_EOverlayExampleItem_RequestKeyboard, + k_EOverlayExampleItem_Notification_SetInset, + k_EOverlayExampleItem_Notification_SetPosition, + k_EOverlayExampleItem_Timeline_OpenOverlayToTimelineEvent, + k_EOverlayExampleItem_Timeline_OpenOverlayToGamePhase, + }; + + EOverlayExampleItem m_eItem; + const char *m_pchExtraCommandData; +}; + + +class CSpaceWarClient +{ +public: + //Constructor + CSpaceWarClient( IGameEngine *pEngine ); + + // Shared init for all constructors + void Init( IGameEngine *pGameEngine ); + + // Destructor + ~CSpaceWarClient(); + + // Run a game frame + void RunFrame(); + + void RenderTimer(); + + // Service calls that need to happen less frequently than every frame (e.g. every second) + void RunOccasionally(); + + // Checks for any incoming network data, then dispatches it + void ReceiveNetworkData(); + + // Connect to a server at a given IP address or game server steamID + void InitiateServerConnection( CSteamID steamIDGameServer ); + void InitiateServerConnection( uint32 unServerAddress, const int32 nPort ); + + // Send data to a client at the given ship index + bool BSendServerData( const void *pData, uint32 nSizeOfData, int nSendFlags ); + + // Menu callback handler (handles a bunch of menus that just change state with no extra data) + void OnMenuSelection( EClientGameState eState ) { SetGameState( eState ); } + + // Menu callback handler (handles server browser selections with extra data) + void OnMenuSelection( ServerBrowserMenuData_t selection ) + { + if ( selection.m_eStateToTransitionTo == k_EClientGameConnecting ) + { + InitiateServerConnection( selection.m_steamIDGameServer ); + } + else + { + SetGameState( selection.m_eStateToTransitionTo ); + } + } + + void OnMenuSelection( LobbyBrowserMenuItem_t selection ) + { + // start joining the lobby + if ( selection.m_eStateToTransitionTo == k_EClientJoiningLobby ) + { + SteamAPICall_t hSteamAPICall = SteamMatchmaking()->JoinLobby( selection.m_steamIDLobby ); + // set the function to call when this API completes + m_SteamCallResultLobbyEntered.Set( hSteamAPICall, this, &CSpaceWarClient::OnLobbyEntered ); + } + + SetGameState( selection.m_eStateToTransitionTo ); + } + + void OnMenuSelection( LobbyMenuItem_t selection ); + void OnMenuSelection( LeaderboardMenuItem_t selection ); + void OnMenuSelection( FriendsListMenuItem_t selection ); + void OnMenuSelection( RemotePlayListMenuItem_t selection ); + void OnMenuSelection( ERemoteStorageSyncMenuCommand selection ); + void OnMenuSelection( PurchaseableItem_t selection ); + void OnMenuSelection( OverlayExample_t selection ); + + void OnMenuSelection( MusicPlayerMenuItem_t selection ) { m_pMusicPlayer->OnMenuSelection( selection ); } + + // Set game state + void SetGameState( EClientGameState eState ); + EClientGameState GetGameState() { return m_eGameState; } + + // set failure text + void SetConnectionFailureText( const char *pchErrorText ); + + // Were we the winner? + bool BLocalPlayerWonLastGame(); + + // Get the steam id for the local user at this client + CSteamID GetLocalSteamID() { return m_SteamIDLocalUser; } + + // Get the local players name + const char* GetLocalPlayerName() + { + return SteamFriends()->GetFriendPersonaName( m_SteamIDLocalUser ); + } + + // Scale screen size to "real" size + float PixelsToFeet( float flPixels ); + + // Get a Steam-supplied image + HGAMETEXTURE GetSteamImageAsTexture( int iImage ); + + void RetrieveEncryptedAppTicket(); + + void ExecCommandLineConnect( const char *pchServerAddress, const char *pchLobbyID ); + + void SetShowTimer( bool bShowTimer ) { m_bShowTimer = bShowTimer; } + + uint32 GetLastGamePhaseID() const { return m_unLastGamePhaseID; } + uint64 GetLastCrashIntoSunEvent() const { return m_ulLastCrashIntoSunEvent; } +private: + + // Receive a response from the server for a connection attempt + void OnReceiveServerInfo( CSteamID steamIDGameServer, bool bVACSecure, const char *pchServerName ); + + // Receive a response from the server for a connection attempt + void OnReceiveServerAuthenticationResponse( bool bSuccess, uint32 uPlayerPosition ); + + // Recieved a response that the server is full + void OnReceiveServerFullResponse(); + + // Receive a state update from the server + void OnReceiveServerUpdate( ServerSpaceWarUpdateData_t *pUpdateData ); + + // Handle the server exiting + void OnReceiveServerExiting(); + + // Disconnects from a server (telling it so) if we are connected + void DisconnectFromServer(); + + // game state changes + void OnGameStateChanged( EClientGameState eGameStateNew ); + + // Draw the HUD text (should do this after drawing all the objects) + void DrawHUDText(); + + // Draw instructions for how to play the game + void DrawInstructions(); + + // Draw text telling the players who won (or that their was a draw) + void DrawWinnerDrawOrWaitingText(); + + // Draw text telling the user that the connection attempt has failed + void DrawConnectionFailureText(); + + // Draw connect to server text + void DrawConnectToServerText(); + + // Draw text telling the user a connection attempt is in progress + void DrawConnectionAttemptText(); + + // Updates what we show to friends about what we're doing and how to connect + void UpdateRichPresenceConnectionInfo(); + + // Draw description for all subscribed workshop items + void DrawWorkshopItems(); + + // load subscribed workshop items + void LoadWorkshopItems(); + void QueryWorkshopItems(); + + // Set appropriate rich presence keys for a player who is currently in-game and + // return the value that should go in steam_display + const char *SetInGameRichPresence() const; + + // Sets the player scores in the game phase + void UpdateScoreInGamePhase( bool bFinal ); + + // load a workshop item from file + bool LoadWorkshopItem( PublishedFileId_t workshopItemID ); + CWorkshopItem *LoadWorkshopItemFromFile( const char *pszFileName ); + + // draw the in-game store + void DrawInGameStore(); + + // Server we are connected to + CSpaceWarServer *m_pServer; + + // SteamID for the local user on this client + CSteamID m_SteamIDLocalUser; + + // Our ship position in the array below + uint32 m_uPlayerShipIndex; + + // List of steamIDs for each player + CSteamID m_rgSteamIDPlayers[MAX_PLAYERS_PER_SERVER]; + + // Ships for players, doubles as a way to check for open slots (pointer is NULL meaning open) + CShip *m_rgpShips[MAX_PLAYERS_PER_SERVER]; + + // Player scores + uint32 m_rguPlayerScores[MAX_PLAYERS_PER_SERVER]; + + // Who just won the game? Should be set if we go into the k_EGameWinner state + uint32 m_uPlayerWhoWonGame; + + // Current game state + EClientGameState m_eGameState; + + // true if we only just transitioned state + bool m_bTransitionedGameState; + + // Font handle for drawing the HUD text + HGAMEFONT m_hHUDFont; + + // Font handle for drawing the instructions text + HGAMEFONT m_hInstructionsFont; + + // Font handle for drawing the in-game store + HGAMEFONT m_hInGameStoreFont; + + // Time the last state transition occurred (so we can count-down round restarts) + uint64 m_ulStateTransitionTime; + + // Time we started our last connection attempt + uint64 m_ulLastConnectionAttemptRetryTime; + + // Time we last got data from the server + uint64 m_ulLastNetworkDataReceivedTime; + + // Time when we sent our ping + uint64 m_ulPingSentTime; + + // Text to display if we are in an error state + char m_rgchErrorText[256]; + + // Server address data + CSteamID m_steamIDGameServer; + CSteamID m_steamIDGameServerFromBrowser; + uint32 m_unServerIP; + uint16 m_usServerPort; + HAuthTicket m_hAuthTicket; + HSteamNetConnection m_hConnServer; + + // keep track of if we opened the overlay for a gamewebcallback + bool m_bSentWebOpen; + + // true if we want to show an on-screen timer in our main menu + bool m_bShowTimer; + uint32 m_unTicksAtLaunch; + HGAMEFONT m_hTimerFont; + + // simple class to marshal callbacks from pinging a game server + class CGameServerPing : public ISteamMatchmakingPingResponse + { + public: + CGameServerPing() + { + m_hGameServerQuery = HSERVERQUERY_INVALID; + m_pSpaceWarsClient = NULL; + } + + void RetrieveSteamIDFromGameServer( CSpaceWarClient *pSpaceWarClient, uint32 unIP, uint16 unPort ) + { + m_pSpaceWarsClient = pSpaceWarClient; + m_hGameServerQuery = SteamMatchmakingServers()->PingServer( unIP, unPort, this ); + } + + void CancelPing() + { + m_hGameServerQuery = HSERVERQUERY_INVALID; + } + + // Server has responded successfully and has updated data + virtual void ServerResponded( gameserveritem_t &server ) + { + if ( m_hGameServerQuery != HSERVERQUERY_INVALID && server.m_steamID.IsValid() ) + { + m_pSpaceWarsClient->InitiateServerConnection( server.m_steamID ); + } + + m_hGameServerQuery = HSERVERQUERY_INVALID; + } + + // Server failed to respond to the ping request + virtual void ServerFailedToRespond() + { + m_hGameServerQuery = HSERVERQUERY_INVALID; + } + + private: + HServerQuery m_hGameServerQuery; // we're ping a game server, so we can convert IP:Port to a steamID + CSpaceWarClient *m_pSpaceWarsClient; + }; + CGameServerPing m_GameServerPing; + + + // Track whether we are connected to a server (and what specific state that connection is in) + EClientConnectionState m_eConnectedStatus; + + // Star field instance + CStarField *m_pStarField; + + // Sun instance + CSun *m_pSun; + + // Steam Workshop items + CWorkshopItem *m_rgpWorkshopItems[ MAX_WORKSHOP_ITEMS ]; + int m_nNumWorkshopItems; // items in m_rgpWorkshopItem + + // Main menu instance + CMainMenu *m_pMainMenu; + + // Connecting menu instance + CConnectingMenu *m_pConnectingMenu; + + // Pause menu instance + CQuitMenu *m_pQuitMenu; + + // pointer to game engine instance we are running under + IGameEngine *m_pGameEngine; + + // track which steam image indexes we have textures for, and what handle that texture has + std::map m_MapSteamImagesToTextures; + + CStatsAndAchievements *m_pStatsAndAchievements; + CTimeline *m_pTimeline; + uint32 m_unGamePhaseID = 0; + uint32 m_unLastGamePhaseID = 0; + uint64 m_ulLastCrashIntoSunEvent = 0; + + CLeaderboards *m_pLeaderboards; + CFriendsList *m_pFriendsList; + CMusicPlayer *m_pMusicPlayer; + CClanChatRoom *m_pClanChatRoom; + CServerBrowser *m_pServerBrowser; + CRemotePlayList *m_pRemotePlayList; + CRemoteStorage *m_pRemoteStorage; + CItemStore *m_pItemStore; + COverlayExamples *m_pOverlayExamples; + + // lobby handling + // the name of the lobby we're connected to + CSteamID m_steamIDLobby; + // callback for when we're creating a new lobby + void OnLobbyCreated( LobbyCreated_t *pCallback, bool bIOFailure ); + CCallResult m_SteamCallResultLobbyCreated; + + // callback for when we've joined a lobby + void OnLobbyEntered( LobbyEnter_t *pCallback, bool bIOFailure ); + CCallResult m_SteamCallResultLobbyEntered; + + // callback for when the lobby game server has started + STEAM_CALLBACK( CSpaceWarClient, OnLobbyGameCreated, LobbyGameCreated_t ); + STEAM_CALLBACK( CSpaceWarClient, OnGameJoinRequested, GameRichPresenceJoinRequested_t ); + STEAM_CALLBACK( CSpaceWarClient, OnAvatarImageLoaded, AvatarImageLoaded_t ); + STEAM_CALLBACK( CSpaceWarClient, OnNewUrlLaunchParameters, NewUrlLaunchParameters_t ); + STEAM_CALLBACK( CSpaceWarClient, OnGameOverlayActivated, GameOverlayActivated_t ); + + // callback when getting the results of a web call + STEAM_CALLBACK( CSpaceWarClient, OnGameWebCallback, GameWebCallback_t ); + + // callback when new Workshop item was installed + STEAM_CALLBACK(CSpaceWarClient, OnWorkshopItemInstalled, ItemInstalled_t); + void OnUGCQueryCompleted( SteamUGCQueryCompleted_t *pParam, bool bIOFailure ); + CCallResult m_SteamCallResultUGCQueryCompleted; + + // callback when a Remote Play Together guest invite has been created + STEAM_CALLBACK( CSpaceWarClient, OnSteamRemotePlayTogetherGuestInvite, SteamRemotePlayTogetherGuestInvite_t ); + + // Steam China support. duration control callback can be posted asynchronously, but we also + // call it directly. + STEAM_CALLBACK( CSpaceWarClient, OnDurationControl, DurationControl_t ); + + // callresult callback, handles io failure + void OnDurationControlCallResult( DurationControl_t *pParam, bool bIOFailure ) + { + if ( !bIOFailure ) + { + OnDurationControl( pParam ); + } + } + CCallResult< CSpaceWarClient, DurationControl_t > m_SteamCallResultDurationControl; + + // lobby browser menu + CLobbyBrowser *m_pLobbyBrowser; + + // local lobby display + CLobby *m_pLobby; + + // p2p game auth manager + CP2PAuthedGame *m_pP2PAuthedGame; + + // p2p voice chat + CVoiceChat *m_pVoiceChat; + + // html page viewer + CHTMLSurface *m_pHTMLSurface; + + // Called when we get new connections, or the state of a connection changes + STEAM_CALLBACK(CSpaceWarClient, OnNetConnectionStatusChanged, SteamNetConnectionStatusChangedCallback_t); + + // ipc failure handler + STEAM_CALLBACK( CSpaceWarClient, OnIPCFailure, IPCFailure_t ); + + // Steam wants to shut down, Game for Windows applications should shutdown too + STEAM_CALLBACK( CSpaceWarClient, OnSteamShutdown, SteamShutdown_t ); + + // Called when SteamUser()->RequestEncryptedAppTicket() returns asynchronously + void OnRequestEncryptedAppTicket( EncryptedAppTicketResponse_t *pEncryptedAppTicketResponse, bool bIOFailure ); + CCallResult< CSpaceWarClient, EncryptedAppTicketResponse_t > m_SteamCallResultEncryptedAppTicket; +}; + +// Must define this stuff before BaseMenu.h as it depends on calling back into us through these accessors +extern CSpaceWarClient *g_pSpaceWarClient; +CSpaceWarClient *SpaceWarClient(); + +#endif // SPACEWARCLIENT_H diff --git a/external/steamworks/steamworksexample/SpaceWarEntity.cpp b/external/steamworks/steamworksexample/SpaceWarEntity.cpp new file mode 100644 index 0000000..a898d39 --- /dev/null +++ b/external/steamworks/steamworksexample/SpaceWarEntity.cpp @@ -0,0 +1,53 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: A SpaceWarEntity is just like a VectorEntity, except it knows how +// to apply gravity from the SpaceWar Sun +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" +#include "SpaceWarEntity.h" +#include "stdlib.h" +#include + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CSpaceWarEntity::CSpaceWarEntity( IGameEngine *pGameEngine, uint32 uCollisionRadius, bool bAffectedByGravity ) + : CVectorEntity( pGameEngine, uCollisionRadius ) +{ + m_bAffectedByGravity = bAffectedByGravity; +} + +//----------------------------------------------------------------------------- +// Purpose: RunFrame +//----------------------------------------------------------------------------- +void CSpaceWarEntity::RunFrame() +{ + + if ( m_bAffectedByGravity ) + { + float xAccel = GetXAcceleration(); + float yAccel = GetYAcceleration(); + + // Ships are also affected by the suns gravity, compute that here, sun is always at the center of the screen + float xPosSun = (float)m_pGameEngine->GetViewportWidth()/2; + float yPosSun = (float)m_pGameEngine->GetViewportHeight()/2; + + float distanceToSun = (float)sqrt( pow( xPosSun - GetXPos(), 2 ) + pow( yPosSun - GetYPos(), 2 ) ); + float distancePower = (float)pow( distanceToSun, 2.0f ); // gravity power falls off exponentially + float factor = MIN( 5200000.0f / distancePower, 150.0f ); // arbitrary value for power of gravity + + float xDirection = (GetXPos() - xPosSun)/distanceToSun; + float yDirection = (GetYPos() - yPosSun)/distanceToSun; + + xAccel -= factor * xDirection; + yAccel -= factor * yDirection; + + // Set updated acceleration + SetAcceleration( xAccel, yAccel ); + } + + CVectorEntity::RunFrame(); +} \ No newline at end of file diff --git a/external/steamworks/steamworksexample/SpaceWarEntity.h b/external/steamworks/steamworksexample/SpaceWarEntity.h new file mode 100644 index 0000000..f04ef4d --- /dev/null +++ b/external/steamworks/steamworksexample/SpaceWarEntity.h @@ -0,0 +1,31 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: A SpaceWarEntity is just like a VectorEntity, except it knows how +// to apply gravity from the SpaceWar Sun +// +// $NoKeywords: $ +//============================================================================= + +#ifndef SPACEWARENTITY_H +#define SPACEWARENTITY_H + +#include "GameEngine.h" +#include "VectorEntity.h" + +class CSpaceWarEntity : public CVectorEntity +{ +public: + // Constructor + CSpaceWarEntity( IGameEngine *pGameEngine, uint32 uCollisionRadius, bool bAffectedByGravity ); + + // Destructor + virtual ~CSpaceWarEntity() { return; } + + // Run Frame + void RunFrame(); + +private: + bool m_bAffectedByGravity; +}; + +#endif // SPACEWARENTITY_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/SpaceWarRes.h b/external/steamworks/steamworksexample/SpaceWarRes.h new file mode 100644 index 0000000..d38b3f4 --- /dev/null +++ b/external/steamworks/steamworksexample/SpaceWarRes.h @@ -0,0 +1,5 @@ +///////////////////////////////////////////////////////////////////////////// +// Header File for : SpaceWar +#define ID_ICON 101 + +///////////////////////////////////////////////////////////////////////////// diff --git a/external/steamworks/steamworksexample/SpaceWarRes.rc b/external/steamworks/steamworksexample/SpaceWarRes.rc new file mode 100644 index 0000000..d4bb96e --- /dev/null +++ b/external/steamworks/steamworksexample/SpaceWarRes.rc @@ -0,0 +1,39 @@ +///////////////////////////////////////////////////////////////////////////// +// Resource File for : SpaceWar +#include "SpaceWarRes.h" + +// The following line is a workaround for a redefinition warning in sal.h +// when using Visual Studio 2005 compilers and includes. Comment out the +// line if you would like to see the warning. +#define _INC_CRTDEFS + + +///////////////////////////////////////////////////////////////////////////// +// This resource files requires the Platform SDK to be compiled. +// #include + +// These are the only two definitions needed from gameux.h +#define ID_GDF_XML __GDF_XML +#define ID_GDF_THUMBNAIL __GDF_THUMBNAIL + +#define APSTUDIO_READONLY_SYMBOLS + +#include + +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Neutral Resources +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) +#ifdef _WIN32 + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +#pragma code_page(DEFAULT) +#endif //_WIN32 + +ID_GDF_XML DATA "NEU\\SpaceWar.gdf.xml" +ID_GDF_THUMBNAIL DATA "NEU\\boxart_NEU.png" +ID_ICON ICON "NEU\\gameicon_NEU.ico" + +#endif // Neutral resources +///////////////////////////////////////////////////////////////////////////// diff --git a/external/steamworks/steamworksexample/SpaceWarServer.cpp b/external/steamworks/steamworksexample/SpaceWarServer.cpp new file mode 100644 index 0000000..998283f --- /dev/null +++ b/external/steamworks/steamworksexample/SpaceWarServer.cpp @@ -0,0 +1,1118 @@ +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Main class for the space war game server +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" +#include "SpaceWarServer.h" +#include "SpaceWarClient.h" +#include "stdlib.h" +#include "time.h" +#include + + +//----------------------------------------------------------------------------- +// Purpose: Constructor -- note the syntax for setting up Steam API callback handlers +//----------------------------------------------------------------------------- +CSpaceWarServer::CSpaceWarServer( IGameEngine *pGameEngine ) +{ + m_bConnectedToSteam = false; + + + const char *pchGameDir = "spacewar"; + uint32 unIP = INADDR_ANY; + uint16 usMasterServerUpdaterPort = SPACEWAR_MASTER_SERVER_UPDATER_PORT; + +#ifdef USE_GS_AUTH_API + EServerMode eMode = eServerModeAuthenticationAndSecure; +#else + // Don't let Steam do authentication + EServerMode eMode = eServerModeNoAuthentication; +#endif + // Initialize the SteamGameServer interface, we tell it some info about us, and we request support + // for both Authentication (making sure users own games) and secure mode, VAC running in our game + // and kicking users who are VAC banned + + // !FIXME! We need a way to pass the dedicated server flag here! + + SteamErrMsg errMsg = { 0 }; + if ( SteamGameServer_InitEx( unIP, SPACEWAR_SERVER_PORT, usMasterServerUpdaterPort, eMode, SPACEWAR_SERVER_VERSION, &errMsg ) != k_ESteamAPIInitResult_OK ) + { + OutputDebugString( "SteamGameServer_Init call failed: " ); + OutputDebugString( errMsg ); + OutputDebugString( "\n" ); + } + + if ( SteamGameServer() ) + { + + // Set the "game dir". + // This is currently required for all games. However, soon we will be + // using the AppID for most purposes, and this string will only be needed + // for mods. it may not be changed after the server has logged on + SteamGameServer()->SetModDir( pchGameDir ); + + // These fields are currently required, but will go away soon. + // See their documentation for more info + SteamGameServer()->SetProduct( "SteamworksExample" ); + SteamGameServer()->SetGameDescription( "Steamworks Example" ); + + // We don't support specators in our game. + // .... but if we did: + //SteamGameServer()->SetSpectatorPort( ... ); + //SteamGameServer()->SetSpectatorServerName( ... ); + + // Initiate Anonymous logon. + // Coming soon: Logging into authenticated, persistent game server account + SteamGameServer()->LogOnAnonymous(); + + // Initialize the peer to peer connection process. This is not required, but we do it + // because we cannot accept connections until this initialization completes, and so we + // want to start it as soon as possible. + SteamNetworkingUtils()->InitRelayNetworkAccess(); + + // We want to actively update the master server with our presence so players can + // find us via the steam matchmaking/server browser interfaces + #ifdef USE_GS_AUTH_API + SteamGameServer()->SetAdvertiseServerActive( true ); + #endif + } + else + { + OutputDebugString( "SteamGameServer() interface is invalid\n" ); + } + + m_uPlayerCount = 0; + m_pGameEngine = pGameEngine; + m_eGameState = k_EServerWaitingForPlayers; + + for( uint32 i = 0; i < MAX_PLAYERS_PER_SERVER; ++i ) + { + m_rguPlayerScores[i] = 0; + m_rgpShips[i] = NULL; + } + + // No one has won + m_uPlayerWhoWonGame = 0; + m_ulStateTransitionTime = m_pGameEngine->GetGameTickCount(); + m_ulLastServerUpdateTick = 0; + + // zero the client connection data + memset( &m_rgClientData, 0, sizeof( m_rgClientData ) ); + memset( &m_rgPendingClientData, 0, sizeof( m_rgPendingClientData ) ); + + // Seed random num generator + srand( (uint32)time( NULL ) ); + + // Initialize sun + m_pSun = new CSun( pGameEngine ); + + // Initialize ships + ResetPlayerShips(); + + // create the listen socket for listening for players connecting + m_hListenSocket = SteamGameServerNetworkingSockets()->CreateListenSocketP2P(0, 0, nullptr); + + // create the poll group + m_hNetPollGroup = SteamGameServerNetworkingSockets()->CreatePollGroup(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Destructor +//----------------------------------------------------------------------------- +CSpaceWarServer::~CSpaceWarServer() +{ + delete m_pSun; + + for( uint32 i=0; i < MAX_PLAYERS_PER_SERVER; ++i ) + { + if ( m_rgpShips[i] ) + { + // Tell this client we are exiting + MsgServerExiting_t msg; + BSendDataToClient( i, (char*)&msg, sizeof(msg) ); + + delete m_rgpShips[i]; + m_rgpShips[i] = NULL; + } + } + + SteamGameServerNetworkingSockets()->CloseListenSocket(m_hListenSocket); + SteamGameServerNetworkingSockets()->DestroyPollGroup(m_hNetPollGroup); + + // Disconnect from the steam servers + SteamGameServer()->LogOff(); + + // release our reference to the steam client library + SteamGameServer_Shutdown(); +} + +//----------------------------------------------------------------------------- +// Purpose: Handle any connection status change +//----------------------------------------------------------------------------- +void CSpaceWarServer::OnNetConnectionStatusChanged(SteamNetConnectionStatusChangedCallback_t* pCallback) +{ + /// Connection handle + HSteamNetConnection hConn = pCallback->m_hConn; + + /// Full connection info + SteamNetConnectionInfo_t info = pCallback->m_info; + + /// Previous state. (Current state is in m_info.m_eState) + ESteamNetworkingConnectionState eOldState = pCallback->m_eOldState; + + // Parse information to know what was changed + + // Check if a client has connected + if (info.m_hListenSocket && + eOldState == k_ESteamNetworkingConnectionState_None && + info.m_eState == k_ESteamNetworkingConnectionState_Connecting) + { + // Connection from a new client + // Search for an available slot + for (uint32 i = 0; i < MAX_PLAYERS_PER_SERVER; ++i) + { + if (!m_rgClientData[i].m_bActive && !m_rgPendingClientData[i].m_hConn) + { + + // Found one. "Accept" the connection. + EResult res = SteamGameServerNetworkingSockets()->AcceptConnection( hConn ); + if ( res != k_EResultOK ) + { + char msg[ 256 ]; + sprintf( msg, "AcceptConnection returned %d", res ); + OutputDebugString( msg ); + SteamGameServerNetworkingSockets()->CloseConnection( hConn, k_ESteamNetConnectionEnd_AppException_Generic, "Failed to accept connection", false ); + return; + } + + m_rgPendingClientData[i].m_hConn = hConn; + + // add the user to the poll group + SteamGameServerNetworkingSockets()->SetConnectionPollGroup(hConn, m_hNetPollGroup); + + // Send them the server info as a reliable message + MsgServerSendInfo_t msg; + msg.SetSteamIDServer(SteamGameServer()->GetSteamID().ConvertToUint64()); + #ifdef USE_GS_AUTH_API + // You can only make use of VAC when using the Steam authentication system + msg.SetSecure(SteamGameServer()->BSecure()); + #endif + msg.SetServerName(m_sServerName.c_str()); + SteamGameServerNetworkingSockets()->SendMessageToConnection( hConn, &msg, sizeof(MsgServerSendInfo_t), k_nSteamNetworkingSend_Reliable, nullptr ); + + return; + } + } + + // No empty slots. Server full! + OutputDebugString("Rejecting connection; server full"); + SteamGameServerNetworkingSockets()->CloseConnection( hConn, k_ESteamNetConnectionEnd_AppException_Generic, "Server full!", false ); + } + // Check if a client has disconnected + else if ((eOldState == k_ESteamNetworkingConnectionState_Connecting || eOldState == k_ESteamNetworkingConnectionState_Connected) && + info.m_eState == k_ESteamNetworkingConnectionState_ClosedByPeer) + { + // Handle disconnecting a client + for (uint32 i = 0; i < MAX_PLAYERS_PER_SERVER; ++i) + { + // If there is no ship, skip + if (!m_rgClientData[i].m_bActive) + continue; + + if (m_rgClientData[i].m_SteamIDUser == info.m_identityRemote.GetSteamID())//pCallback->m_steamIDRemote) + { + OutputDebugString("Disconnected dropped user\n"); + RemovePlayerFromServer(i, k_EDRClientDisconnect); + break; + } + } + } +} + +//----------------------------------------------------------------------------- +// Purpose: Handle sending data to a client at a given index +//----------------------------------------------------------------------------- +bool CSpaceWarServer::BSendDataToClient( uint32 uShipIndex, char *pData, uint32 nSizeOfData ) +{ + // Validate index + if ( uShipIndex >= MAX_PLAYERS_PER_SERVER ) + return false; + + int64 messageOut; + if (!SteamGameServerNetworkingSockets()->SendMessageToConnection(m_rgClientData[uShipIndex].m_hConn, pData, nSizeOfData, k_nSteamNetworkingSend_Unreliable, &messageOut)) + { + OutputDebugString("Failed sending data to a client\n"); + return false; + } + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Handle sending data to a pending client at a given index +//----------------------------------------------------------------------------- +bool CSpaceWarServer::BSendDataToPendingClient( uint32 uShipIndex, char *pData, uint32 nSizeOfData ) +{ + // Validate index + if ( uShipIndex >= MAX_PLAYERS_PER_SERVER ) + return false; + + int64 messageOut; + if (!SteamGameServerNetworkingSockets()->SendMessageToConnection(m_rgPendingClientData[uShipIndex].m_hConn, pData, nSizeOfData, k_nSteamNetworkingSend_Unreliable, &messageOut)) + { + OutputDebugString("Failed sending data to a client\n"); + return false; + } + return true; +} + +//----------------------------------------------------------------------------- +// Purpose: Handle a new client connecting +//----------------------------------------------------------------------------- +void CSpaceWarServer::OnClientBeginAuthentication(CSteamID steamIDClient, HSteamNetConnection connectionID, void* pToken, uint32 uTokenLen) +{ + // First, check this isn't a duplicate and we already have a user logged on from the same steamid + for (uint32 i = 0; i < MAX_PLAYERS_PER_SERVER; ++i) + { + if (m_rgClientData[i].m_hConn == connectionID) + { + // We already logged them on... (should maybe tell them again incase they don't know?) + return; + } + } + + // Second, do we have room? + uint32 nPendingOrActivePlayerCount = 0; + for (uint32 i = 0; i < MAX_PLAYERS_PER_SERVER; ++i) + { + if (m_rgPendingClientData[i].m_bActive) + ++nPendingOrActivePlayerCount; + + if (m_rgClientData[i].m_bActive) + ++nPendingOrActivePlayerCount; + } + + // We are full (or will be if the pending players auth), deny new login + if ( nPendingOrActivePlayerCount >= MAX_PLAYERS_PER_SERVER ) + { + SteamGameServerNetworkingSockets()->CloseConnection(connectionID, k_EDRServerFull, "Server full", false); + } + + // If we get here there is room, add the player as pending + for (uint32 i = 0; i < MAX_PLAYERS_PER_SERVER; ++i) + { + if (!m_rgPendingClientData[i].m_bActive) + { + m_rgPendingClientData[i].m_ulTickCountLastData = m_pGameEngine->GetGameTickCount(); +#ifdef USE_GS_AUTH_API + // authenticate the user with the Steam back-end servers + EBeginAuthSessionResult res = SteamGameServer()->BeginAuthSession(pToken, uTokenLen, steamIDClient); + if (res != k_EBeginAuthSessionResultOK) + { + SteamGameServerNetworkingSockets()->CloseConnection(connectionID, k_EDRServerReject, "BeginAuthSession failed", false); + break; + } + + m_rgPendingClientData[i].m_SteamIDUser = steamIDClient; + m_rgPendingClientData[i].m_bActive = true; + m_rgPendingClientData[i].m_hConn = connectionID; + break; +#else + m_rgPendingClientData[i].m_bActive = true; + // we need to tell the server our Steam id in the non-auth case, so we stashed it in the login message, pull it back out + m_rgPendingClientData[i].m_SteamIDUser = *(CSteamID*)pToken; + m_rgPendingClientData[i].m_connection = connectionID; + // You would typically do your own authentication method here and later call OnAuthCompleted + // In this sample we just automatically auth anyone who connects + OnAuthCompleted(true, i); + break; +#endif + } + } +} +//----------------------------------------------------------------------------- +// Purpose: A new client that connected has had their authentication processed +//----------------------------------------------------------------------------- +void CSpaceWarServer::OnAuthCompleted( bool bAuthSuccessful, uint32 iPendingAuthIndex ) +{ + if ( !m_rgPendingClientData[iPendingAuthIndex].m_bActive ) + { + OutputDebugString( "Got auth completed callback for client who is not pending\n" ); + return; + } + + if ( !bAuthSuccessful ) + { +#ifdef USE_GS_AUTH_API + // Tell the GS the user is leaving the server + SteamGameServer()->EndAuthSession( m_rgPendingClientData[iPendingAuthIndex].m_SteamIDUser ); +#endif + // Send a deny for the client, and zero out the pending data + MsgServerFailAuthentication_t msg; + int64 outMessage; + SteamGameServerNetworkingSockets()->SendMessageToConnection(m_rgPendingClientData[iPendingAuthIndex].m_hConn, &msg, sizeof(msg), k_nSteamNetworkingSend_Reliable, &outMessage); + m_rgPendingClientData[iPendingAuthIndex] = ClientConnectionData_t(); + return; + } + + bool bAddedOk = false; + for( uint32 i = 0; i < MAX_PLAYERS_PER_SERVER; ++i ) + { + if ( !m_rgClientData[i].m_bActive ) + { + // copy over the data from the pending array + memcpy( &m_rgClientData[i], &m_rgPendingClientData[iPendingAuthIndex], sizeof( ClientConnectionData_t ) ); + m_rgPendingClientData[iPendingAuthIndex] = ClientConnectionData_t(); + m_rgClientData[i].m_ulTickCountLastData = m_pGameEngine->GetGameTickCount(); + + // Add a new ship, make it dead immediately + AddPlayerShip( i ); + m_rgpShips[i]->SetDisabled( true ); + + MsgServerPassAuthentication_t msg; + msg.SetPlayerPosition( i ); + BSendDataToClient( i, (char*)&msg, sizeof( msg ) ); + + bAddedOk = true; + + break; + } + } + + // If we just successfully added the player, check if they are #2 so we can restart the round + if ( bAddedOk ) + { + uint32 uPlayers = 0; + for( uint32 i = 0; i < MAX_PLAYERS_PER_SERVER; ++i ) + { + if ( m_rgClientData[i].m_bActive ) + ++uPlayers; + } + + // If we just got the second player, immediately reset round as a draw. This will prevent + // the existing player getting a win, and it will cause a new round to start right off + // so that the one player can't just float around not letting the new one get into the game. + if ( uPlayers == 2 ) + { + if ( m_eGameState != k_EServerWaitingForPlayers ) + SetGameState( k_EServerDraw ); + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Used to reset scores (at start of a new game usually) +//----------------------------------------------------------------------------- +void CSpaceWarServer::ResetScores() +{ + for( uint32 i=0; i < MAX_PLAYERS_PER_SERVER; ++i ) + { + m_rguPlayerScores[i] = 0; + } +} + +//----------------------------------------------------------------------------- +// Purpose: Add a new player ship at given position +//----------------------------------------------------------------------------- +void CSpaceWarServer::AddPlayerShip( uint32 uShipPosition ) +{ + if ( uShipPosition >= MAX_PLAYERS_PER_SERVER ) + { + OutputDebugString( "Trying to add ship at invalid positon\n" ); + return; + } + + if ( m_rgpShips[uShipPosition] ) + { + OutputDebugString( "Trying to add a ship where one already exists\n" ); + return; + } + + float flHeight = (float)m_pGameEngine->GetViewportHeight(); + float flWidth = (float)m_pGameEngine->GetViewportWidth(); + float flXOffset = flWidth*0.12f; + float flYOffset = flHeight*0.12f; + + float flAngle = (float)atan( flHeight/flWidth ) + PI_VALUE/2.0f; + switch( uShipPosition ) + { + case 0: + m_rgpShips[uShipPosition] = new CShip( m_pGameEngine, true, flXOffset, flYOffset, g_rgPlayerColors[uShipPosition] ); + m_rgpShips[uShipPosition]->SetInitialRotation( flAngle ); + break; + case 1: + m_rgpShips[uShipPosition] = new CShip( m_pGameEngine, true, flWidth-flXOffset, flYOffset, g_rgPlayerColors[uShipPosition] ); + m_rgpShips[uShipPosition]->SetInitialRotation( -1.0f*flAngle ); + break; + case 2: + m_rgpShips[uShipPosition] = new CShip( m_pGameEngine, true, flXOffset, flHeight-flYOffset, g_rgPlayerColors[uShipPosition] ); + m_rgpShips[uShipPosition]->SetInitialRotation( PI_VALUE-flAngle ); + break; + case 3: + m_rgpShips[uShipPosition] = new CShip( m_pGameEngine, true, flWidth-flXOffset, flHeight-flYOffset, g_rgPlayerColors[uShipPosition] ); + m_rgpShips[uShipPosition]->SetInitialRotation( -1.0f*(PI_VALUE-flAngle) ); + break; + default: + OutputDebugString( "AddPlayerShip() code needs updating for more than 4 players\n" ); + } + + if ( m_rgpShips[uShipPosition] ) + { + // Setup key bindings... don't even really need these on server? + m_rgpShips[uShipPosition]->SetVKBindingLeft( 0x41 ); // A key + m_rgpShips[uShipPosition]->SetVKBindingRight( 0x44 ); // D key + m_rgpShips[uShipPosition]->SetVKBindingForwardThrusters( 0x57 ); // W key + m_rgpShips[uShipPosition]->SetVKBindingReverseThrusters( 0x53 ); // S key + m_rgpShips[uShipPosition]->SetVKBindingFire( VK_SPACE ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Removes a player at the given position +//----------------------------------------------------------------------------- +void CSpaceWarServer::RemovePlayerFromServer( uint32 uShipPosition, EDisconnectReason reason) +{ + if ( uShipPosition >= MAX_PLAYERS_PER_SERVER ) + { + OutputDebugString( "Trying to remove ship at invalid position\n" ); + return; + } + + if ( !m_rgpShips[uShipPosition] ) + { + OutputDebugString( "Trying to remove a ship that does not exist\n" ); + return; + } + + OutputDebugString( "Removing a ship\n" ); + delete m_rgpShips[uShipPosition]; + m_rgpShips[uShipPosition] = NULL; + m_rguPlayerScores[uShipPosition] = 0; + + // close the hNet connection + SteamGameServerNetworkingSockets()->CloseConnection( m_rgClientData[uShipPosition].m_hConn, reason, nullptr, false); + +#ifdef USE_GS_AUTH_API + // Tell the GS the user is leaving the server + SteamGameServer()->EndAuthSession( m_rgClientData[uShipPosition].m_SteamIDUser ); +#endif + m_rgClientData[uShipPosition] = ClientConnectionData_t(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Used to reset player ship positions for a new round +//----------------------------------------------------------------------------- +void CSpaceWarServer::ResetPlayerShips() +{ + // Delete any currently active ships, but immediately recreate + // (which causes all ship state/position to reset) + for( uint32 i=0; i < MAX_PLAYERS_PER_SERVER; ++i ) + { + if ( m_rgpShips[i] ) + { + delete m_rgpShips[i]; + m_rgpShips[i] = NULL; + AddPlayerShip( i ); + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Used to transition game state +//----------------------------------------------------------------------------- +void CSpaceWarServer::SetGameState( EServerGameState eState ) +{ + if ( m_eGameState == eState ) + return; + + // If we were in waiting for players and are now going active clear old scores + if ( m_eGameState == k_EServerWaitingForPlayers && eState == k_EServerActive ) + { + ResetScores(); + ResetPlayerShips(); + } + + m_ulStateTransitionTime = m_pGameEngine->GetGameTickCount(); + m_eGameState = eState; +} + + +//----------------------------------------------------------------------------- +// Purpose: Receives incoming network data +//----------------------------------------------------------------------------- +void CSpaceWarServer::ReceiveNetworkData() +{ + SteamNetworkingMessage_t* msgs[128]; + int numMessages = SteamGameServerNetworkingSockets()->ReceiveMessagesOnPollGroup(m_hNetPollGroup, msgs, 128); + for (int idxMsg = 0; idxMsg < numMessages; idxMsg++) + { + SteamNetworkingMessage_t* message = msgs[idxMsg]; + CSteamID steamIDRemote = message->m_identityPeer.GetSteamID(); + HSteamNetConnection connection = message->m_conn; + + if (message->GetSize() < sizeof(DWORD)) + { + OutputDebugString("Got garbage on server socket, too short\n"); + message->Release(); + message = nullptr; + continue; + } + + EMessage eMsg = (EMessage)LittleDWord(*(DWORD*)message->GetData()); + + switch (eMsg) + { + case k_EMsgClientBeginAuthentication: + { + if (message->GetSize() != sizeof(MsgClientBeginAuthentication_t)) + { + OutputDebugString("Bad connection attempt msg\n"); + message->Release(); + message = nullptr; + continue; + } + MsgClientBeginAuthentication_t* pMsg = (MsgClientBeginAuthentication_t*)message->GetData(); +#ifdef USE_GS_AUTH_API + OnClientBeginAuthentication(steamIDRemote, connection, (void*)pMsg->GetTokenPtr(), pMsg->GetTokenLen()); +#else + OnClientBeginAuthentication(connection, 0); +#endif + } + break; + case k_EMsgClientSendLocalUpdate: + { + if (message->GetSize() != sizeof(MsgClientSendLocalUpdate_t)) + { + OutputDebugString("Bad client update msg\n"); + message->Release(); + message = nullptr; + continue; + } + + // Find the connection that should exist for this users address + bool bFound = false; + for (uint32 i = 0; i < MAX_PLAYERS_PER_SERVER; ++i) + { + if (m_rgClientData[i].m_hConn == connection) + { + bFound = true; + MsgClientSendLocalUpdate_t* pMsg = (MsgClientSendLocalUpdate_t*)message->GetData(); + OnReceiveClientUpdateData(i, pMsg->AccessUpdateData()); + break; + } + } + if (!bFound) + OutputDebugString("Got a client data update, but couldn't find a matching client\n"); + } + break; + + case k_EMsgVoiceChatData: + { + // Received voice chat messages, broadcast to all other players + MsgVoiceChatData_t *pMsg = (MsgVoiceChatData_t *)message->GetData(); + pMsg->SetSteamID( message->m_identityPeer.GetSteamID() ); // Make sure sender steam ID is set. + SendMessageToAll( connection, pMsg, message->GetSize() ); + break; + } + case k_EMsgP2PSendingTicket: + { + // Received a P2P auth ticket, forward it to the intended recipient + MsgP2PSendingTicket_t msgP2PSendingTicket; + memcpy(&msgP2PSendingTicket, message->GetData(), sizeof(MsgP2PSendingTicket_t)); + CSteamID toSteamID = msgP2PSendingTicket.GetSteamID(); + + HSteamNetConnection toHConn = 0; + for (int j = 0; j < MAX_PLAYERS_PER_SERVER; j++) + { + if ( toSteamID == m_rgClientData[j].m_SteamIDUser ) + { + + // Mutate the message, replacing the destination SteamID with the sender's SteamID + msgP2PSendingTicket.SetSteamID( message->m_identityPeer.GetSteamID64() ); + + SteamNetworkingSockets()->SendMessageToConnection( m_rgClientData[j].m_hConn, &msgP2PSendingTicket, sizeof(msgP2PSendingTicket), k_nSteamNetworkingSend_Reliable, nullptr ); + break; + } + } + + if (toHConn == 0) + { + OutputDebugString("msgP2PSendingTicket received with no valid target to send to."); + } + } + break; + + default: + char rgch[128]; + sprintf_safe(rgch, "Invalid message %x\n", eMsg); + rgch[sizeof(rgch) - 1] = 0; + OutputDebugString(rgch); + } + + message->Release(); + message = nullptr; + } +} + +//----------------------------------------------------------------------------- +// Purpose: Main frame function, updates the state of the world and performs rendering +//----------------------------------------------------------------------------- +void CSpaceWarServer::RunFrame() +{ + // Run any Steam Game Server API callbacks + SteamGameServer_RunCallbacks(); + + // Update our server details + SendUpdatedServerDetailsToSteam(); + + // Timeout stale player connections, also update player count data + uint32 uPlayerCount = 0; + for( uint32 i=0; i < MAX_PLAYERS_PER_SERVER; ++i ) + { + // If there is no ship, skip + if ( !m_rgClientData[i].m_bActive ) + continue; + + if ( m_pGameEngine->GetGameTickCount() - m_rgClientData[i].m_ulTickCountLastData > SERVER_TIMEOUT_MILLISECONDS ) + { + OutputDebugString( "Timing out player connection\n" ); + RemovePlayerFromServer( i, k_EDRClientKicked ); + } + else + { + ++uPlayerCount; + } + } + m_uPlayerCount = uPlayerCount; + + switch ( m_eGameState ) + { + case k_EServerWaitingForPlayers: + // Wait a few seconds (so everyone can join if a lobby just started this server) + if ( m_pGameEngine->GetGameTickCount() - m_ulStateTransitionTime >= MILLISECONDS_BETWEEN_ROUNDS ) + { + // Just keep waiting until at least one ship is active + for( uint32 i = 0; i < MAX_PLAYERS_PER_SERVER; ++i ) + { + if ( m_rgClientData[i].m_bActive ) + { + // Transition to active + OutputDebugString( "Server going active after waiting for players\n" ); + SetGameState( k_EServerActive ); + } + } + } + break; + case k_EServerDraw: + case k_EServerWinner: + // Update all the entities... + m_pSun->RunFrame(); + for( uint32 i=0; iRunFrame(); + } + + // NOTE: no collision detection, because the round is really over, objects are now invulnerable + + // After 5 seconds start the next round + if ( m_pGameEngine->GetGameTickCount() - m_ulStateTransitionTime >= MILLISECONDS_BETWEEN_ROUNDS ) + { + ResetPlayerShips(); + SetGameState( k_EServerActive ); + } + + break; + + case k_EServerActive: + // Update all the entities... + m_pSun->RunFrame(); + for( uint32 i=0; iRunFrame(); + } + + // Check for collisions which could lead to a winner this round + CheckForCollisions(); + + break; + case k_EServerExiting: + break; + default: + OutputDebugString( "Unhandled game state in CSpaceWarServer::RunFrame\n" ); + } + + // Send client updates (will internal limit itself to the tick rate desired) + SendUpdateDataToAllClients(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Sends updates to all connected clients +//----------------------------------------------------------------------------- +void CSpaceWarServer::SendUpdateDataToAllClients() +{ + // Limit the rate at which we update, even if our internal frame rate is higher + if ( m_pGameEngine->GetGameTickCount() - m_ulLastServerUpdateTick < 1000.0f/SERVER_UPDATE_SEND_RATE ) + return; + + m_ulLastServerUpdateTick = m_pGameEngine->GetGameTickCount(); + + MsgServerUpdateWorld_t msg; + + msg.AccessUpdateData()->SetServerGameState( m_eGameState ); + for( int i=0; iSetPlayerActive( i, m_rgClientData[i].m_bActive ); + msg.AccessUpdateData()->SetPlayerScore( i, m_rguPlayerScores[i] ); + msg.AccessUpdateData()->SetPlayerSteamID( i, m_rgClientData[i].m_SteamIDUser.ConvertToUint64() ); + + if ( m_rgpShips[i] ) + { + m_rgpShips[i]->BuildServerUpdate( msg.AccessUpdateData()->AccessShipUpdateData( i ) ); + } + } + + msg.AccessUpdateData()->SetPlayerWhoWon( m_uPlayerWhoWonGame ); + + for( int i=0; iSendMessageToConnection(m_rgClientData[i].m_hConn, pubData, cubData, k_nSteamNetworkingSend_UnreliableNoDelay, nullptr ); + } + } +} + +//----------------------------------------------------------------------------- +// Purpose: Receives update data from clients +//----------------------------------------------------------------------------- +void CSpaceWarServer::OnReceiveClientUpdateData( uint32 uShipIndex, ClientSpaceWarUpdateData_t *pUpdateData ) +{ + if ( m_rgClientData[uShipIndex].m_bActive && m_rgpShips[uShipIndex] ) + { + m_rgClientData[uShipIndex].m_ulTickCountLastData = m_pGameEngine->GetGameTickCount(); + m_rgpShips[uShipIndex]->OnReceiveClientUpdate( pUpdateData ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Checks various game objects for collisions and updates state +// appropriately if they have occurred +//----------------------------------------------------------------------------- +void CSpaceWarServer::CheckForCollisions() +{ + // Make the ships check their photons for ones that have hit the sun and remove + // them before we go and check for them hitting the opponent + for ( uint32 i=0; iDestroyPhotonsColldingWith( m_pSun ); + } + + // Array to track who exploded, can't set the ship exploding within the loop below, + // or it will prevent that ship from colliding with later ships in the sequence + bool rgbExplodingShips[MAX_PLAYERS_PER_SERVER]; + memset( rgbExplodingShips, 0, sizeof( rgbExplodingShips ) ); + + // Check each ship for colliding with the sun or another ships photons + for ( uint32 i=0; iBCollidesWith( m_pSun ) ) + { + { + MsgServerPlayerHitSun_t msg; + msg.SetSteamID( m_rgClientData[ i ].m_SteamIDUser ); + BSendDataToClient( i, ( char * )&msg, sizeof( msg ) ); + } + + rgbExplodingShips[i] |= 1; + } + + for( uint32 j=0; jBCollidesWith( m_rgpShips[j] ); + if ( m_rgpShips[j]->BCheckForPhotonsCollidingWith( m_rgpShips[i] ) ) + { + if ( m_rgpShips[i]->GetShieldStrength() > 200 ) + { + // Shield protects from the hit + m_rgpShips[i]->SetShieldStrength( 0 ); + m_rgpShips[j]->DestroyPhotonsColldingWith( m_rgpShips[i] ); + } + else + { + rgbExplodingShips[i] |= 1; + } + } + } + } + + for ( uint32 i=0; iSetExploding( true ); + } + + // Count how many ships are active, and how many are exploding + uint32 uActiveShips = 0; + uint32 uShipsExploding = 0; + uint32 uLastShipFoundAlive = 0; + for ( uint32 i = 0; i < MAX_PLAYERS_PER_SERVER; ++i ) + { + if ( m_rgpShips[i] ) + { + // Disabled ships don't count at all + if ( m_rgpShips[i]->BIsDisabled() ) + continue; + + ++uActiveShips; + + if ( m_rgpShips[i]->BIsExploding() ) + ++uShipsExploding; + else + uLastShipFoundAlive = i; + } + } + + // If exploding == active, then its a draw, everyone is dead + if ( uActiveShips == uShipsExploding ) + { + SetGameState( k_EServerDraw ); + } + else if ( uActiveShips > 1 && uActiveShips - uShipsExploding == 1 ) + { + // If only one ship is alive they win + m_uPlayerWhoWonGame = uLastShipFoundAlive; + m_rguPlayerScores[uLastShipFoundAlive]++; + SetGameState( k_EServerWinner ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Take any action we need to on Steam notifying us we are now logged in +//----------------------------------------------------------------------------- +void CSpaceWarServer::OnSteamServersConnected( SteamServersConnected_t *pLogonSuccess ) +{ + OutputDebugString( "SpaceWarServer connected to Steam successfully\n" ); + m_bConnectedToSteam = true; + + // log on is not finished until OnPolicyResponse() is called + + // Tell Steam about our server details + SendUpdatedServerDetailsToSteam(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Callback from Steam when logon is fully completed and VAC secure policy is set +//----------------------------------------------------------------------------- +void CSpaceWarServer::OnPolicyResponse( GSPolicyResponse_t *pPolicyResponse ) +{ +#ifdef USE_GS_AUTH_API + // Check if we were able to go VAC secure or not + if ( SteamGameServer()->BSecure() ) + { + OutputDebugString( "SpaceWarServer is VAC Secure!\n" ); + } + else + { + OutputDebugString( "SpaceWarServer is not VAC Secure!\n" ); + } + char rgch[128]; + sprintf_safe( rgch, "Game server SteamID: %llu\n", SteamGameServer()->GetSteamID().ConvertToUint64() ); + rgch[ sizeof(rgch) - 1 ] = 0; + OutputDebugString( rgch ); +#endif +} + + +//----------------------------------------------------------------------------- +// Purpose: Called when we were previously logged into steam but get logged out +//----------------------------------------------------------------------------- +void CSpaceWarServer::OnSteamServersDisconnected( SteamServersDisconnected_t *pLoggedOff ) +{ + m_bConnectedToSteam = false; + OutputDebugString( "SpaceWarServer got logged out of Steam\n" ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Called when an attempt to login to Steam fails +//----------------------------------------------------------------------------- +void CSpaceWarServer::OnSteamServersConnectFailure( SteamServerConnectFailure_t *pConnectFailure ) +{ + m_bConnectedToSteam = false; + OutputDebugString( "SpaceWarServer failed to connect to Steam\n" ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Called once we are connected to Steam to tell it about our details +//----------------------------------------------------------------------------- +void CSpaceWarServer::SendUpdatedServerDetailsToSteam() +{ + + // Tell the Steam authentication servers about our game + char rgchServerName[128]; + if ( SpaceWarClient() ) + { + // If a client is running (should always be since we don't support a dedicated server) + // then we'll form the name based off of it + sprintf_safe( rgchServerName, "%s's game", SpaceWarClient()->GetLocalPlayerName() ); + } + else + { + sprintf_safe( rgchServerName, "%s", "Spacewar!" ); + } + m_sServerName = rgchServerName; + + // + // Set state variables, relevant to any master server updates or client pings + // + + // These server state variables may be changed at any time. Note that there is no lnoger a mechanism + // to send the player count. The player count is maintained by steam and you should use the player + // creation/authentication functions to maintain your player count. + SteamGameServer()->SetMaxPlayerCount( 4 ); + SteamGameServer()->SetPasswordProtected( false ); + SteamGameServer()->SetServerName( m_sServerName.c_str() ); + SteamGameServer()->SetBotPlayerCount( 0 ); // optional, defaults to zero + SteamGameServer()->SetMapName( "MilkyWay" ); + +#ifdef USE_GS_AUTH_API + + // Update all the players names/scores + for( uint32 i=0; i < MAX_PLAYERS_PER_SERVER; ++i ) + { + if ( m_rgClientData[i].m_bActive && m_rgpShips[i] ) + { + SteamGameServer()->BUpdateUserData( m_rgClientData[i].m_SteamIDUser, m_rgpShips[i]->GetPlayerName(), m_rguPlayerScores[i] ); + } + } +#endif + + // game type is a special string you can use for your game to differentiate different game play types occurring on the same maps + // When users search for this parameter they do a sub-string search of this string + // (i.e if you report "abc" and a client requests "ab" they return your server) + //SteamGameServer()->SetGameType( "dm" ); + + // update any rule values we publish + //SteamMasterServerUpdater()->SetKeyValue( "rule1_setting", "value" ); + //SteamMasterServerUpdater()->SetKeyValue( "rule2_setting", "value2" ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Tells us Steam3 (VAC and newer license checking) has accepted the user connection +//----------------------------------------------------------------------------- +void CSpaceWarServer::OnValidateAuthTicketResponse( ValidateAuthTicketResponse_t *pResponse ) +{ + if ( pResponse->m_eAuthSessionResponse == k_EAuthSessionResponseOK ) + { + // This is the final approval, and means we should let the client play (find the pending auth by steamid) + for ( uint32 i = 0; im_SteamID ) + { + OutputDebugString( "Auth completed for a client\n" ); + OnAuthCompleted( true, i ); + return; + } + } + } + else + { + // Looks like we shouldn't let this user play, kick them + for ( uint32 i = 0; im_SteamID ) + { + OutputDebugString( "Auth failed for a client\n" ); + OnAuthCompleted( false, i ); + return; + } + } + } +} + + + +//----------------------------------------------------------------------------- +// Purpose: Returns the SteamID of the game server +//----------------------------------------------------------------------------- +CSteamID CSpaceWarServer::GetSteamID() +{ +#ifdef USE_GS_AUTH_API + return SteamGameServer()->GetSteamID(); +#else + // this is a placeholder steam id to use when not making use of Steam auth or matchmaking + return k_steamIDNonSteamGS; +#endif +} + + +//----------------------------------------------------------------------------- +// Purpose: Kicks a player off the server +//----------------------------------------------------------------------------- +void CSpaceWarServer::KickPlayerOffServer( CSteamID steamID ) +{ + uint32 uPlayerCount = 0; + for( uint32 i=0; i < MAX_PLAYERS_PER_SERVER; ++i ) + { + // If there is no ship, skip + if ( !m_rgClientData[i].m_bActive ) + continue; + + if ( m_rgClientData[i].m_SteamIDUser == steamID ) + { + OutputDebugString( "Kicking player\n" ); + RemovePlayerFromServer( i, k_EDRClientKicked); + // send him a kick message + MsgServerFailAuthentication_t msg; + int64 outMessage; + SteamGameServerNetworkingSockets()->SendMessageToConnection(m_rgClientData[i].m_hConn, &msg, sizeof(msg), k_nSteamNetworkingSend_Reliable, &outMessage); + } + else + { + ++uPlayerCount; + } + } + m_uPlayerCount = uPlayerCount; +} diff --git a/external/steamworks/steamworksexample/SpaceWarServer.h b/external/steamworks/steamworksexample/SpaceWarServer.h new file mode 100644 index 0000000..bbbd697 --- /dev/null +++ b/external/steamworks/steamworksexample/SpaceWarServer.h @@ -0,0 +1,179 @@ +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Main class for the space war game server +// +// $NoKeywords: $ +//============================================================================= + +#ifndef SPACEWARSERVER_H +#define SPACEWARSERVER_H + +#include + +#include "GameEngine.h" +#include "SpaceWar.h" +#include "Ship.h" +#include "Sun.h" +#include "steam/isteamnetworkingsockets.h" +#include "steam/steamclientpublic.h" +#include "Messages.h" + +// Forward declaration +class CSpaceWarClient; + +struct ClientConnectionData_t +{ + bool m_bActive; // Is this slot in use? Or is it available for new connections? + CSteamID m_SteamIDUser; // What is the steamid of the player? + uint64 m_ulTickCountLastData; // What was the last time we got data from the player? + HSteamNetConnection m_hConn; // The handle for the connection to the player + + ClientConnectionData_t() { + m_bActive = false; + m_ulTickCountLastData = 0; + m_hConn = 0; + } +}; + +class CSpaceWarServer +{ +public: + //Constructor + CSpaceWarServer( IGameEngine *pEngine ); + + // Destructor + ~CSpaceWarServer(); + + // Run a game frame + void RunFrame(); + + // Set game state + void SetGameState( EServerGameState eState ); + + // Checks for any incoming network data, then dispatches it + void ReceiveNetworkData(); + + // Reset player scores (occurs when starting a new game) + void ResetScores(); + + // Reset player positions (occurs in between rounds as well as at the start of a new game) + void ResetPlayerShips(); + + // Checks various game objects for collisions and updates state appropriately if they have occurred + void CheckForCollisions(); + + // Kicks a given player off the server + void KickPlayerOffServer( CSteamID steamID ); + + // data accessors + bool IsConnectedToSteam() { return m_bConnectedToSteam; } + CSteamID GetSteamID(); + +private: + // + // Various callback functions that Steam will call to let us know about events related to our + // connection to the Steam servers for authentication purposes. + // + + + // Tells us when we have successfully connected to Steam + STEAM_GAMESERVER_CALLBACK( CSpaceWarServer, OnSteamServersConnected, SteamServersConnected_t ); + + // Tells us when there was a failure to connect to Steam + STEAM_GAMESERVER_CALLBACK( CSpaceWarServer, OnSteamServersConnectFailure, SteamServerConnectFailure_t ); + + // Tells us when we have been logged out of Steam + STEAM_GAMESERVER_CALLBACK( CSpaceWarServer, OnSteamServersDisconnected, SteamServersDisconnected_t ); + + // Tells us that Steam has set our security policy (VAC on or off) + STEAM_GAMESERVER_CALLBACK( CSpaceWarServer, OnPolicyResponse, GSPolicyResponse_t ); + + // + // Various callback functions that Steam will call to let us know about whether we should + // allow clients to play or we should kick/deny them. + // + + // Tells us a client has been authenticated and approved to play by Steam (passes auth, license check, VAC status, etc...) + STEAM_GAMESERVER_CALLBACK( CSpaceWarServer, OnValidateAuthTicketResponse, ValidateAuthTicketResponse_t ); + + // client connection state + // All connection changes are handled through this callback + STEAM_GAMESERVER_CALLBACK(CSpaceWarServer, OnNetConnectionStatusChanged, SteamNetConnectionStatusChangedCallback_t); + + // Function to tell Steam about our servers details + void SendUpdatedServerDetailsToSteam(); + + // Receive updates from client + void OnReceiveClientUpdateData( uint32 uShipIndex, ClientSpaceWarUpdateData_t *pUpdateData ); + + // Send data to a client at the given ship index + bool BSendDataToClient( uint32 uShipIndex, char *pData, uint32 nSizeOfData ); + + // Send data to a client at the given pending index + bool BSendDataToPendingClient( uint32 uShipIndex, char *pData, uint32 nSizeOfData ); + + void OnClientBeginAuthentication(CSteamID steamIDClient, HSteamNetConnection connectionID, void* pToken, uint32 uTokenLen); + // Handles authentication completing for a client + void OnAuthCompleted( bool bAuthSuccess, uint32 iPendingAuthIndex ); + + // Adds/initializes a new player ship at the given position + void AddPlayerShip( uint32 uShipPosition ); + + // Removes a player from the server + void RemovePlayerFromServer( uint32 uShipPosition, EDisconnectReason reason); + + // Send world update to all clients + void SendUpdateDataToAllClients(); + + // Send the same message to all clients, except the ignored connection if any + void SendMessageToAll( HSteamNetConnection hConnIgnore, const void* pubData, uint32 cubData ); + + // Track whether our server is connected to Steam ok (meaning we can restrict who plays based on + // ownership and VAC bans, etc...) + bool m_bConnectedToSteam; + + // Ships for players, doubles as a way to check for open slots (pointer is NULL meaning open) + CShip *m_rgpShips[MAX_PLAYERS_PER_SERVER]; + + // Player scores + uint32 m_rguPlayerScores[MAX_PLAYERS_PER_SERVER]; + + // server name + std::string m_sServerName; + + // Who just won the game? Should be set if we go into the k_EGameWinner state + uint32 m_uPlayerWhoWonGame; + + // Last time state changed + uint64 m_ulStateTransitionTime; + + // Last time we sent clients an update + uint64 m_ulLastServerUpdateTick; + + // Number of players currently connected, updated each frame + uint32 m_uPlayerCount; + + // Current game state + EServerGameState m_eGameState; + + // Sun instance + CSun *m_pSun; + + // pointer to game engine instance we are running under + IGameEngine *m_pGameEngine; + + // Vector to keep track of client connections + ClientConnectionData_t m_rgClientData[MAX_PLAYERS_PER_SERVER]; + + // Vector to keep track of client connections which are pending auth + ClientConnectionData_t m_rgPendingClientData[MAX_PLAYERS_PER_SERVER]; + + // Socket to listen for new connections on + HSteamListenSocket m_hListenSocket; + + // Poll group used to receive messages from all clients at once + HSteamNetPollGroup m_hNetPollGroup; +}; + + +#endif // SPACEWARSERVER_H diff --git a/external/steamworks/steamworksexample/StarField.cpp b/external/steamworks/steamworksexample/StarField.cpp new file mode 100644 index 0000000..cc08ecc --- /dev/null +++ b/external/steamworks/steamworksexample/StarField.cpp @@ -0,0 +1,70 @@ +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for rendering the starfield +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" +#include "StarField.h" +#include "stdlib.h" + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CStarField::CStarField( IGameEngine *pGameEngine ) +{ + m_pGameEngine = pGameEngine; + + Init(); +} + +void CStarField::Init() +{ + StarVertex_t StarVertex; + m_nWidth = m_pGameEngine->GetViewportWidth(); + m_nHeight = m_pGameEngine->GetViewportHeight(); + + m_VecStars.clear(); + + // Generate star field data + for( int i=0; i < STARFIELD_STAR_COUNT; ++i ) + { + int32 nRand = (rand()%(255-50))+50; //value between 50 and 255 for shades of gray + StarVertex.color = D3DCOLOR_ARGB( 255, nRand, nRand, nRand ); + + StarVertex.x = (float)(rand()%m_nWidth); + StarVertex.y = (float)(rand()%m_nHeight); + + m_VecStars.push_back( StarVertex ); + + // bugbug jmccaskey - sometimes make "big stars" which are 4 points right next to each other? + } +} + +//----------------------------------------------------------------------------- +// Purpose: Render the star field +//----------------------------------------------------------------------------- +void CStarField::Render() +{ + if ( ( m_pGameEngine->GetViewportWidth() != m_nWidth ) || ( m_pGameEngine->GetViewportHeight() != m_nHeight ) ) + { + Init(); + } + + static int counter; // per starfield draw.. + counter++; + + for( size_t i = 0; i < m_VecStars.size(); ++i ) + { + float x = m_VecStars[i].x; + float y = m_VecStars[i].y; + float scoot = (float)counter * (float)(m_VecStars[i].color & 0xFF) / (4.0f * 255.0f); + float newy = y - scoot; // make things float up + while( newy < 0.0f ) newy += m_nHeight; // keep it on screen + + m_pGameEngine->BDrawPoint( x, newy, m_VecStars[i].color ); + } + + m_pGameEngine->BFlushPointBuffer(); +} \ No newline at end of file diff --git a/external/steamworks/steamworksexample/StarField.h b/external/steamworks/steamworksexample/StarField.h new file mode 100644 index 0000000..9582a0e --- /dev/null +++ b/external/steamworks/steamworksexample/StarField.h @@ -0,0 +1,46 @@ +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for rendering the starfield +// +// $NoKeywords: $ +//============================================================================= + +#ifndef STARFIELD_H +#define STARFIELD_H + +#include +#include "GameEngine.h" + +#define STARFIELD_STAR_COUNT 600 + +struct StarVertex_t +{ + float x, y; + DWORD color; +}; + +class CStarField +{ +public: + // Constructor + CStarField( IGameEngine *pGameEngine ); + + // Render the star field + void Render(); + +private: + + void Init(); + +private: + int m_nWidth; + int m_nHeight; + + // Game engine instance we are running under + IGameEngine *m_pGameEngine; + + // Vector for starfield data + std::vector m_VecStars; +}; + +#endif // STARFIELD_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/StatsAndAchievements.cpp b/external/steamworks/steamworksexample/StatsAndAchievements.cpp new file mode 100644 index 0000000..009c7c3 --- /dev/null +++ b/external/steamworks/steamworksexample/StatsAndAchievements.cpp @@ -0,0 +1,530 @@ +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for tracking stats and achievements +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" +#include "StatsAndAchievements.h" +#include "Inventory.h" +#include +#include "SpaceWarClient.h" + +#define ACHDISP_FONT_HEIGHT 20 +#define ACHDISP_COLUMN_WIDTH 340 +#define ACHDISP_CENTER_SPACING 40 +#define ACHDISP_VERT_SPACING 10 +#define ACHDISP_IMG_SIZE 64 +#define ACHDISP_IMG_PAD 10 + +#define _ACH_ID( id, name ) { id, #id, name, "", 0, 0 } + +Achievement_t g_rgAchievements[] = +{ + _ACH_ID( ACH_WIN_ONE_GAME, "Winner" ), + _ACH_ID( ACH_WIN_100_GAMES, "Champion" ), + _ACH_ID( ACH_TRAVEL_FAR_ACCUM, "Interstellar" ), + _ACH_ID( ACH_TRAVEL_FAR_SINGLE, "Orbiter" ), +}; + + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +#pragma warning( push ) +// warning C4355: 'this' : used in base member initializer list +// This is OK because it's warning on setting up the Steam callbacks, they won't use this until after construction is done +#pragma warning( disable : 4355 ) +CStatsAndAchievements::CStatsAndAchievements( IGameEngine *pGameEngine ) + : + m_pGameEngine( pGameEngine ), + m_pSteamUser( NULL ), + m_pSteamUserStats( NULL ), + m_GameID( SteamUtils()->GetAppID() ), + m_CallbackUserStatsStored( this, &CStatsAndAchievements::OnUserStatsStored ), + m_CallbackAchievementStored( this, &CStatsAndAchievements::OnAchievementStored ) +{ + m_pSteamUser = SteamUser(); + m_pSteamUserStats = SteamUserStats(); + + m_bStatsValid = false; + m_bStoreStats = false; + + m_flGameFeetTraveled = 0; + + m_nTotalGamesPlayed = 0; + m_nTotalNumWins = 0; + m_nTotalNumLosses = 0; + m_flTotalFeetTraveled = 0; + m_flMaxFeetTraveled = 0; + + m_flAverageSpeed = 0; + + m_hDisplayFont = pGameEngine->HCreateFont( ACHDISP_FONT_HEIGHT, FW_MEDIUM, false, "Arial" ); + if ( !m_hDisplayFont ) + OutputDebugString( "Stats font was not created properly, text won't draw\n" ); +} +#pragma warning( pop ) + +//----------------------------------------------------------------------------- +// Purpose: Run a frame for the CStatsAndAchievements. does not need to run at +// full frame rate. +//----------------------------------------------------------------------------- +void CStatsAndAchievements::RunFrame() +{ + if ( !m_bStatsValid ) + LoadUserStats(); + + // Evaluate achievements + for ( int iAch = 0; iAch < ARRAYSIZE( g_rgAchievements ); ++iAch ) + { + EvaluateAchievement( g_rgAchievements[iAch] ); + } + + // Store stats + StoreStatsIfNecessary(); +} + +//----------------------------------------------------------------------------- +// Purpose: Accumulate distance traveled +//----------------------------------------------------------------------------- +void CStatsAndAchievements::AddDistanceTraveled( float flDistance ) +{ + m_flGameFeetTraveled += SpaceWarClient()->PixelsToFeet( flDistance ); +} + +//----------------------------------------------------------------------------- +// Purpose: Game state has changed +//----------------------------------------------------------------------------- +void CStatsAndAchievements::OnGameStateChange( EClientGameState eNewState ) +{ + if ( !m_bStatsValid ) + return; + + switch ( eNewState ) + { + case k_EClientStatsAchievements: + case k_EClientGameStartServer: + case k_EClientGameMenu: + case k_EClientGameQuitMenu: + case k_EClientGameExiting: + case k_EClientGameInstructions: + case k_EClientGameConnecting: + case k_EClientGameConnectionFailure: + default: + break; + case k_EClientGameActive: + // Reset per-game stats + m_flGameFeetTraveled = 0; + m_ulTickCountGameStart = m_pGameEngine->GetGameTickCount(); + break; + case k_EClientFindInternetServers: + break; + case k_EClientGameWinner: + if ( SpaceWarClient()->BLocalPlayerWonLastGame() ) + m_nTotalNumWins++; + else + m_nTotalNumLosses++; + // fall through + case k_EClientGameDraw: + + // Tally games + m_nTotalGamesPlayed++; + + // Accumulate distances + m_flTotalFeetTraveled += m_flGameFeetTraveled; + + // New max? + if ( m_flGameFeetTraveled > m_flMaxFeetTraveled ) + m_flMaxFeetTraveled = m_flGameFeetTraveled; + + // Calc game duration + m_flGameDurationSeconds = ( m_pGameEngine->GetGameTickCount() - m_ulTickCountGameStart ) / 1000.0; + + // We want to update stats the next frame. + m_bStoreStats = true; + + break; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: see if we should unlock this achievement +//----------------------------------------------------------------------------- +void CStatsAndAchievements::EvaluateAchievement( Achievement_t &achievement ) +{ + // Already have it? + if ( achievement.m_bAchieved ) + return; + + switch ( achievement.m_eAchievementID ) + { + case ACH_WIN_ONE_GAME: + if ( m_nTotalNumWins ) + { + UnlockAchievement( achievement ); + } + break; + case ACH_WIN_100_GAMES: + if ( m_nTotalNumWins >= 100 ) + { + UnlockAchievement( achievement ); + } + break; + case ACH_TRAVEL_FAR_ACCUM: + if ( m_flTotalFeetTraveled >= 5280 ) + { + UnlockAchievement( achievement ); + } + break; + case ACH_TRAVEL_FAR_SINGLE: + if ( m_flGameFeetTraveled > 500 ) + { + UnlockAchievement( achievement ); + } + break; + default: + break; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Unlock this achievement +//----------------------------------------------------------------------------- +void CStatsAndAchievements::UnlockAchievement( Achievement_t &achievement ) +{ + achievement.m_bAchieved = true; + + // the icon may change once it's unlocked + achievement.m_iIconImage = 0; + + // mark it down + m_pSteamUserStats->SetAchievement( achievement.m_pchAchievementID ); + + // Store stats end of frame + m_bStoreStats = true; +} + +//----------------------------------------------------------------------------- +// Purpose: Store stats in the Steam database +//----------------------------------------------------------------------------- +void CStatsAndAchievements::StoreStatsIfNecessary() +{ + if ( m_bStoreStats ) + { + // already set any achievements in UnlockAchievement + + // set stats + m_pSteamUserStats->SetStat( "NumGames", m_nTotalGamesPlayed ); + m_pSteamUserStats->SetStat( "NumWins", m_nTotalNumWins ); + m_pSteamUserStats->SetStat( "NumLosses", m_nTotalNumLosses ); + m_pSteamUserStats->SetStat( "FeetTraveled", m_flTotalFeetTraveled ); + m_pSteamUserStats->SetStat( "MaxFeetTraveled", m_flMaxFeetTraveled ); + // Update average feet / second stat + m_pSteamUserStats->UpdateAvgRateStat( "AverageSpeed", m_flGameFeetTraveled, m_flGameDurationSeconds ); + // The averaged result is calculated for us + m_pSteamUserStats->GetStat( "AverageSpeed", &m_flAverageSpeed ); + + bool bSuccess = m_pSteamUserStats->StoreStats(); + // If this failed, we never sent anything to the server, try + // again later. + m_bStoreStats = !bSuccess; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: We have stats data from Steam. It is authoritative, so update +// our data with those results now. +//----------------------------------------------------------------------------- +void CStatsAndAchievements::LoadUserStats() +{ + if ( !m_pSteamUserStats ) + return; + + // load achievements + for ( int iAch = 0; iAch < ARRAYSIZE( g_rgAchievements ); ++iAch ) + { + Achievement_t &ach = g_rgAchievements[iAch]; + m_pSteamUserStats->GetAchievement( ach.m_pchAchievementID, &ach.m_bAchieved ); + sprintf_safe( ach.m_rgchName, "%s", m_pSteamUserStats->GetAchievementDisplayAttribute( ach.m_pchAchievementID, "name" ) ); + sprintf_safe( ach.m_rgchDescription, "%s", m_pSteamUserStats->GetAchievementDisplayAttribute( ach.m_pchAchievementID, "desc" ) ); + } + + // load stats + m_pSteamUserStats->GetStat( "NumGames", &m_nTotalGamesPlayed ); + m_pSteamUserStats->GetStat( "NumWins", &m_nTotalNumWins ); + m_pSteamUserStats->GetStat( "NumLosses", &m_nTotalNumLosses ); + m_pSteamUserStats->GetStat( "FeetTraveled", &m_flTotalFeetTraveled ); + m_pSteamUserStats->GetStat( "MaxFeetTraveled", &m_flMaxFeetTraveled ); + m_pSteamUserStats->GetStat( "AverageSpeed", &m_flAverageSpeed ); + + m_bStatsValid = true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Our stats data was stored! +//----------------------------------------------------------------------------- +void CStatsAndAchievements::OnUserStatsStored( UserStatsStored_t *pCallback ) +{ + // we may get callbacks for other games' stats arriving, ignore them + if ( m_GameID.ToUint64() == pCallback->m_nGameID ) + { + if ( k_EResultOK == pCallback->m_eResult ) + { + OutputDebugString( "StoreStats - success\n" ); + } + else if ( k_EResultInvalidParam == pCallback->m_eResult ) + { + // One or more stats we set broke a constraint. They've been reverted, + // and we should re-iterate the values now to keep in sync. + OutputDebugString( "StoreStats - some failed to validate\n" ); + LoadUserStats(); + } + else + { + char buffer[128]; + sprintf_safe( buffer, "StoreStats - failed, %d\n", pCallback->m_eResult ); + buffer[ sizeof(buffer) - 1 ] = 0; + OutputDebugString( buffer ); + } + } +} + +//----------------------------------------------------------------------------- +// Purpose: An achievement was stored +//----------------------------------------------------------------------------- +void CStatsAndAchievements::OnAchievementStored( UserAchievementStored_t *pCallback ) +{ + // we may get callbacks for other games' stats arriving, ignore them + if ( m_GameID.ToUint64() == pCallback->m_nGameID ) + { + if ( 0 == pCallback->m_nMaxProgress ) + { + char buffer[128]; + sprintf_safe( buffer, "Achievement '%s' unlocked!", pCallback->m_rgchAchievementName ); + buffer[ sizeof(buffer) - 1 ] = 0; + OutputDebugString( buffer ); + } + else + { + char buffer[128]; + sprintf_safe( buffer, "Achievement '%s' progress callback, (%d,%d)\n", + pCallback->m_rgchAchievementName, pCallback->m_nCurProgress, pCallback->m_nMaxProgress ); + buffer[ sizeof(buffer) - 1 ] = 0; + OutputDebugString( buffer ); + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Display the user's stats and achievements +//----------------------------------------------------------------------------- +void CStatsAndAchievements::Render() +{ + const int32 width = m_pGameEngine->GetViewportWidth(); + const int32 height = m_pGameEngine->GetViewportHeight(); + + const int32 pxColumn1Left = width / 2 - ACHDISP_COLUMN_WIDTH - ACHDISP_CENTER_SPACING / 2; + const int32 pxColumn2Left = width / 2 + ACHDISP_CENTER_SPACING / 2; + + RECT rect; + + char rgchBuffer[256]; + if ( m_pGameEngine->BIsSteamInputDeviceActive() ) + { + const char *rgchActionOrigin = m_pGameEngine->GetTextStringForControllerOriginDigital( eControllerActionSet_MenuControls, eControllerDigitalAction_MenuCancel ); + + if ( strcmp( rgchActionOrigin, "None" ) == 0 ) + { + sprintf_safe( rgchBuffer, "Press ESC to return to the Main Menu. No controller button bound" ); + } + else + { + sprintf_safe( rgchBuffer, "Press ESC or '%s' to return the Main Menu", rgchActionOrigin ); + } + } + else + { + sprintf_safe( rgchBuffer, "Press ESC to return to the Main Menu" ); + } + + if ( !m_bStatsValid ) + { + rect.top = 0; + rect.bottom = m_pGameEngine->GetViewportHeight(); + rect.left = 0; + rect.right = width; + + sprintf_safe( rgchBuffer, "Unable to retrieve data from Steam\n" ); + m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_VCENTER, rgchBuffer ); + + + rect.left = 0; + rect.right = width; + rect.top = LONG(m_pGameEngine->GetViewportHeight() * 0.7); + rect.bottom = m_pGameEngine->GetViewportHeight(); + + m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_TOP, rgchBuffer ); + } + else + { + // COLUMN 1 + // Achievements above the midline + int32 pxVertOffset = height / 2 - 3 * ( ACHDISP_IMG_SIZE + ACHDISP_VERT_SPACING ); + rect.top = pxVertOffset; + rect.bottom = rect.top + ACHDISP_IMG_SIZE; + rect.left = pxColumn1Left; + rect.right = rect.left + ACHDISP_COLUMN_WIDTH; + pxVertOffset = rect.bottom + ACHDISP_VERT_SPACING; + + DrawAchievementInfo( rect, g_rgAchievements[0] ); + + rect.top = pxVertOffset; + rect.bottom = rect.top + ACHDISP_IMG_SIZE; + pxVertOffset = rect.bottom + ACHDISP_VERT_SPACING; + + DrawAchievementInfo( rect, g_rgAchievements[1] ); + + // Stats below the midline + pxVertOffset = height / 2 + ACHDISP_VERT_SPACING - 1 * ( ACHDISP_IMG_SIZE + ACHDISP_VERT_SPACING ); + + rect.top = pxVertOffset; + rect.bottom = rect.top + ACHDISP_FONT_HEIGHT; + pxVertOffset = rect.bottom + ACHDISP_VERT_SPACING; + + DrawStatInfo( rect, "Games Played", static_cast( m_nTotalGamesPlayed ) ); + + rect.top = pxVertOffset; + rect.bottom = rect.top + ACHDISP_FONT_HEIGHT; + pxVertOffset = rect.bottom + ACHDISP_VERT_SPACING; + + DrawStatInfo( rect, "Games Won", static_cast( m_nTotalNumWins ) ); + + rect.top = pxVertOffset; + rect.bottom = rect.top + ACHDISP_FONT_HEIGHT; + pxVertOffset = rect.bottom + ACHDISP_VERT_SPACING; + + DrawStatInfo( rect, "Games Lost", static_cast( m_nTotalNumLosses ) ); + + rect.top = pxVertOffset; + rect.bottom = rect.top + ACHDISP_FONT_HEIGHT; + pxVertOffset = rect.bottom + ACHDISP_VERT_SPACING; + + m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_LEFT|TEXTPOS_VCENTER, "Inventory" ); + + std::list::const_iterator iter; + for ( iter = SpaceWarLocalInventory()->GetItemList().begin(); iter != SpaceWarLocalInventory()->GetItemList().end(); ++iter ) + { + rect.top = pxVertOffset; + rect.bottom = rect.top + ACHDISP_FONT_HEIGHT; + pxVertOffset = rect.bottom + ACHDISP_VERT_SPACING; + + DrawInventory( rect, ( *iter )->GetItemId() ); + } + + + // COLUMN 2 + // Achievements above the midline + pxVertOffset = height / 2 - 3 * ( ACHDISP_IMG_SIZE + ACHDISP_VERT_SPACING ); + + rect.top = pxVertOffset; + rect.bottom = rect.top + ACHDISP_IMG_SIZE; + rect.left = pxColumn2Left; + rect.right = rect.left + ACHDISP_COLUMN_WIDTH; + pxVertOffset = rect.bottom + ACHDISP_VERT_SPACING; + + DrawAchievementInfo( rect, g_rgAchievements[2] ); + + rect.top = pxVertOffset; + rect.bottom = rect.top + ACHDISP_IMG_SIZE; + pxVertOffset = rect.bottom + ACHDISP_VERT_SPACING; + + DrawAchievementInfo( rect, g_rgAchievements[3] ); + + // Stats below the midline + pxVertOffset = height / 2 + ACHDISP_VERT_SPACING - 1 * ( ACHDISP_IMG_SIZE + ACHDISP_VERT_SPACING ); + + rect.top = pxVertOffset; + rect.bottom = rect.top + ACHDISP_FONT_HEIGHT; + pxVertOffset = rect.bottom + ACHDISP_VERT_SPACING; + + DrawStatInfo( rect, "Feet Traveled", m_flTotalFeetTraveled ); + + rect.top = pxVertOffset; + rect.bottom = rect.top + ACHDISP_FONT_HEIGHT; + pxVertOffset = rect.bottom + ACHDISP_VERT_SPACING; + + DrawStatInfo( rect, "Max Feet Traveled", m_flMaxFeetTraveled ); + + rect.top = pxVertOffset; + rect.bottom = rect.top + ACHDISP_FONT_HEIGHT; + pxVertOffset = rect.bottom + ACHDISP_VERT_SPACING; + + DrawStatInfo( rect, "Average Inches / Second", m_flAverageSpeed * 12.0f ); + + // Footer + rect.left = 0; + rect.right = width; + rect.top = LONG(m_pGameEngine->GetViewportHeight() * 0.8); + rect.bottom = m_pGameEngine->GetViewportHeight(); + + m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER|TEXTPOS_TOP, rgchBuffer ); + } +} + +void CStatsAndAchievements::DrawAchievementInfo( RECT &rect, Achievement_t &ach ) +{ + if ( ach.m_iIconImage == 0 ) + { + ach.m_iIconImage = m_pSteamUserStats->GetAchievementIcon( ach.m_pchAchievementID ); + } + + HGAMETEXTURE hTexture = SpaceWarClient()->GetSteamImageAsTexture( ach.m_iIconImage ); + + // don't modify the caller's rect, they may use it later to locate something else + RECT rect2 = rect; + + // could still be zero if the image isn't downloaded yet + if (hTexture ) + { + m_pGameEngine->BDrawTexturedRect( (float)rect2.left, (float)rect2.top, (float)rect2.left+ACHDISP_IMG_SIZE, (float)rect2.bottom, + 0.0f, 0.0f, 1.0, 1.0, D3DCOLOR_ARGB( 255, 255, 255, 255 ), hTexture ); + + rect2.left += ACHDISP_IMG_SIZE + ACHDISP_IMG_PAD; + } + + // todo: divide up so can draw image + char rgchBuffer[256]; + sprintf_safe( rgchBuffer, "%s: %s\n%s", + ach.m_rgchName, + ach.m_bAchieved ? "Unlocked" : "Locked", + ach.m_rgchDescription ); + + m_pGameEngine->BDrawString( m_hDisplayFont, rect2, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_LEFT|TEXTPOS_VCENTER, rgchBuffer ); +} + +void CStatsAndAchievements::DrawStatInfo( RECT &rect, const char *pchName, float flValue ) +{ + // todo: divide up so can draw image + char rgchBuffer[256]; + sprintf_safe( rgchBuffer, "%s: %.1f", pchName, flValue ); + m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_LEFT|TEXTPOS_VCENTER, rgchBuffer ); +} + +void CStatsAndAchievements::DrawInventory( RECT &rect, SteamItemInstanceID_t itemid ) +{ + const CSpaceWarItem *pItem = SpaceWarLocalInventory()->GetItem( itemid ); + if ( !pItem ) + return; + + // todo: divide up so can draw image + char rgchBuffer[256]; + sprintf_safe( rgchBuffer, "%s", pItem->GetLocalizedName().c_str() ); + m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_LEFT|TEXTPOS_VCENTER, rgchBuffer ); +} diff --git a/external/steamworks/steamworksexample/StatsAndAchievements.h b/external/steamworks/steamworksexample/StatsAndAchievements.h new file mode 100644 index 0000000..80085f2 --- /dev/null +++ b/external/steamworks/steamworksexample/StatsAndAchievements.h @@ -0,0 +1,113 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for tracking stats and achievements +// +// $NoKeywords: $ +//============================================================================= + +#ifndef STATS_AND_ACHIEVEMENTS_H +#define STATS_AND_ACHIEVEMENTS_H + +#include "SpaceWar.h" +#include "GameEngine.h" +#include "Inventory.h" + +enum EAchievements +{ + ACH_WIN_ONE_GAME = 0, + ACH_WIN_100_GAMES = 1, + ACH_HEAVY_FIRE = 2, + ACH_TRAVEL_FAR_ACCUM = 3, + ACH_TRAVEL_FAR_SINGLE = 4, +}; + +struct Achievement_t +{ + EAchievements m_eAchievementID; + const char *m_pchAchievementID; + char m_rgchName[128]; + char m_rgchDescription[256]; + bool m_bAchieved; + int m_iIconImage; +}; + +class ISteamUser; +class CSpaceWarClient; + +class CStatsAndAchievements +{ +public: + // Constructor + CStatsAndAchievements( IGameEngine *pGameEngine ); + + // Run a frame. Does not need to run at full frame rate. + void RunFrame(); + + // Display the stats and achievements + void Render(); + + // Game state changed + void OnGameStateChange( EClientGameState eNewState ); + + // Accumulators + void AddDistanceTraveled( float flDistance ); + + // accessors + float GetGameFeetTraveled() { return m_flGameFeetTraveled; } + double GetGameDurationSeconds() { return m_flGameDurationSeconds; } + + STEAM_CALLBACK( CStatsAndAchievements, OnUserStatsStored, UserStatsStored_t, m_CallbackUserStatsStored ); + STEAM_CALLBACK( CStatsAndAchievements, OnAchievementStored, UserAchievementStored_t, m_CallbackAchievementStored ); + +private: + + void LoadUserStats(); + + // Determine if we get this achievement now + void EvaluateAchievement( Achievement_t &achievement ); + void UnlockAchievement( Achievement_t &achievement ); + + // Store stats + void StoreStatsIfNecessary(); + + // Render helpers + void DrawAchievementInfo( RECT &rect, Achievement_t &ach ); + void DrawStatInfo( RECT &rect, const char *pchName, float flValue ); + void DrawInventory( RECT &rect, SteamItemInstanceID_t itemid ); + + // our GameID + CGameID m_GameID; + + // Engine + IGameEngine *m_pGameEngine; + + // Steam User interface + ISteamUser *m_pSteamUser; + + // Steam UserStats interface + ISteamUserStats *m_pSteamUserStats; + + // Display font + HGAMEFONT m_hDisplayFont; + + // Did we get the stats from Steam? + bool m_bStatsValid; + + // Should we store stats this frame? + bool m_bStoreStats; + + // Current Stat details + float m_flGameFeetTraveled; + uint64 m_ulTickCountGameStart; + double m_flGameDurationSeconds; + + // Persisted Stat details + int m_nTotalGamesPlayed; + int m_nTotalNumWins; + int m_nTotalNumLosses; + float m_flTotalFeetTraveled; + float m_flMaxFeetTraveled; + float m_flAverageSpeed; +}; + +#endif // STATS_AND_ACHIEVEMENTS_H diff --git a/external/steamworks/steamworksexample/SteamWorksExample.exe.manifest b/external/steamworks/steamworksexample/SteamWorksExample.exe.manifest new file mode 100644 index 0000000..ee93019 --- /dev/null +++ b/external/steamworks/steamworksexample/SteamWorksExample.exe.manifest @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/external/steamworks/steamworksexample/SteamworksExample.sh b/external/steamworks/steamworksexample/SteamworksExample.sh new file mode 100644 index 0000000..86f8bac --- /dev/null +++ b/external/steamworks/steamworksexample/SteamworksExample.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# +# This is a script which runs the SteamworksExample in the Steam runtime + +# The program location +TOP=$(cd "${0%/*}" && echo ${PWD}) + +PROGRAM="${TOP}/SteamworksExampleLinux" + +log () { + ( echo "[$$]: $*" >&2 ) || : +} + +# Require LDLP scout runtime environment +if [ -n "${STEAM_RUNTIME-}" ]; then + log "Detected scout LDLP runtime." + # continue +else + log "Relaunch under scout LDLP runtime." + log exec "$HOME/.steam/bin/steam-runtime/run.sh" "$0" "$@" + exec "$HOME/.steam/bin/steam-runtime/run.sh" "$0" "$@" + # unreachable +fi + +# The public SDK binary links with -Wl,--rpath=$ORIGIN and doesn't need this, +# But the binary produced in-tree at Valve does +export LD_LIBRARY_PATH=${TOP}:${LD_LIBRARY_PATH-} + +cd "${TOP}" + +exec "${PROGRAM}" "$@" + +# vi: ts=4 sw=4 expandtab diff --git a/external/steamworks/steamworksexample/SteamworksExample.sln b/external/steamworks/steamworksexample/SteamworksExample.sln new file mode 100644 index 0000000..9a1b670 --- /dev/null +++ b/external/steamworks/steamworksexample/SteamworksExample.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.34931.43 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "steamworksexample", "SteamworksExample.vcxproj", "{FC177B29-2631-C58B-D723-530DA88155B4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FC177B29-2631-C58B-D723-530DA88155B4}.Debug|x64.ActiveCfg = Debug|x64 + {FC177B29-2631-C58B-D723-530DA88155B4}.Debug|x64.Build.0 = Debug|x64 + {FC177B29-2631-C58B-D723-530DA88155B4}.Debug|x86.ActiveCfg = Debug|Win32 + {FC177B29-2631-C58B-D723-530DA88155B4}.Debug|x86.Build.0 = Debug|Win32 + {FC177B29-2631-C58B-D723-530DA88155B4}.Release|x64.ActiveCfg = Release|x64 + {FC177B29-2631-C58B-D723-530DA88155B4}.Release|x64.Build.0 = Release|x64 + {FC177B29-2631-C58B-D723-530DA88155B4}.Release|x86.ActiveCfg = Release|Win32 + {FC177B29-2631-C58B-D723-530DA88155B4}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D30502FB-58C1-4ADF-A153-A9F564A0910A} + EndGlobalSection +EndGlobal diff --git a/external/steamworks/steamworksexample/SteamworksExample.vcxproj b/external/steamworks/steamworksexample/SteamworksExample.vcxproj new file mode 100644 index 0000000..1837205 --- /dev/null +++ b/external/steamworks/steamworksexample/SteamworksExample.vcxproj @@ -0,0 +1,661 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 16.0 + steamworksexample + {FC177B29-2631-C58B-D723-530DA88155B4} + en-US + + + + Application + MultiByte + steamworksexample + v142 + 3.15.3 + + + Application + MultiByte + steamworksexample + v142 + 3.15.3 + + + Application + MultiByte + steamworksexample + v142 + 3.15.3 + + + Application + MultiByte + steamworksexample + v142 + 3.15.3 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + .. + .\Debug\ + .\Debug\ + ..\devtools\vstools;$(ExecutablePath);$(Path) + ..\devtools\vstools;$(ExecutablePath);$(Path) + true + true + true + true + true + true + true + true + true + true + true + true + .\Release\ + .\Release\ + ..\devtools\vstools;$(ExecutablePath);$(Path) + ..\devtools\vstools;$(ExecutablePath);$(Path) + true + true + true + true + true + true + false + false + true + true + true + true + + + $(SolutionDir)win64\$(Configuration)\ + + + $(SolutionDir)win64\$(Configuration)\ + + + + + + + + /std:c++17 /bigobj /Zc:__cplusplus + Disabled + OnlyExplicitInline + $(DXSDK_DIR)Include;..\public; + WIN32;_CRT_SECURE_NO_WARNINGS;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions);_DEBUG;_EXTERNAL_DLL_EXT=.dll;VPCGAMECAPS=VALVE;PROJECTDIR=D:\dev\Steam\main\src\SteamWorksExample;_DLL_EXT=.dll;VPCGAME=valve + true + false + Async + Default + MultiThreadedDebug + true + true + StreamingSIMDExtensions + Precise + false + true + true + false + $(IntDir)\ + $(IntDir)\ + $(IntDir)\ + false + false + Level3 + true + OldStyle + CompileAsCpp + ;4577;4091 + true + $(IntDir)\ + Prompt + + + + + /ignore:4221 + ;legacy_stdio_definitions.lib;%(AdditionalDependencies) + NotSet + $(OutDir)\steamworksexample.exe + true + ;$(DXSDK_DIR)Lib\x86; + libc;libcd;libcmt + DebugFastLink + $(OutDir)\$(TargetName).pdb + false + $(OutDir)\$(TargetName).map + Windows + + + MachineX86 + PromptImmediately + false + true + + + true + $(OutDir)\steamworksexample.bsc + + + + + Default + . + + + _DEBUG;%(PreprocessorDefinitions);_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE + 1033 + + + true + SteamWorksExample.exe.manifest + + + true + + + + + + + /std:c++17 /bigobj /Zc:__cplusplus + Disabled + OnlyExplicitInline + $(DXSDK_DIR)Include;..\public; + WIN32;_CRT_SECURE_NO_WARNINGS;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions);_DEBUG;_EXTERNAL_DLL_EXT=.dll;VPCGAMECAPS=VALVE;PROJECTDIR=D:\dev\Steam\main\src\SteamWorksExample;_DLL_EXT=.dll;VPCGAME=valve + true + false + Async + Default + MultiThreadedDebug + true + true + + + Precise + false + true + true + false + $(IntDir)\ + $(IntDir)\ + $(IntDir)\ + false + false + Level3 + true + OldStyle + CompileAsCpp + ;4577;4091 + true + $(IntDir)\ + Prompt + + + + /ignore:4221 + ;legacy_stdio_definitions.lib;%(AdditionalDependencies) + NotSet + $(OutDir)\steamworksexample.exe + true + ;$(DXSDK_DIR)Lib\x64; + libc;libcd;libcmt + DebugFastLink + $(OutDir)\$(TargetName).pdb + false + $(OutDir)\$(TargetName).map + Windows + + + PromptImmediately + false + + + + + true + $(OutDir)\steamworksexample.bsc + + + + Default + . + + + _DEBUG;%(PreprocessorDefinitions);_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE + 1033 + + + true + SteamWorksExample.exe.manifest + + + true + + + + + + + + + /std:c++17 /bigobj /d2Zi+ /Zc:__cplusplus + MaxSpeed + AnySuitable + true + Speed + $(DXSDK_DIR)Include;..\public; + WIN32;_CRT_SECURE_NO_WARNINGS;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions);NDEBUG;_EXTERNAL_DLL_EXT=.dll;VPCGAMECAPS=VALVE;PROJECTDIR=D:\dev\Steam\main\src\SteamWorksExample;_DLL_EXT=.dll;VPCGAME=valve + true + Async + MultiThreaded + false + true + StreamingSIMDExtensions + Precise + false + true + true + false + NotUsing + $(IntDir)\ + $(IntDir)\ + $(IntDir)\ + false + false + Level3 + true + OldStyle + CompileAsCpp + ;4577;4091 + false + true + $(IntDir)\ + Prompt + + + + + /ignore:4221 + ;legacy_stdio_definitions.lib;%(AdditionalDependencies) + NotSet + $(OutDir)\steamworksexample.exe + true + ;$(DXSDK_DIR)Lib\x86; + libc;libcd;libcmtd + true + $(OutDir)\$(TargetName).pdb + false + $(OutDir)\$(TargetName).map + Windows + true + true + + + MachineX86 + PromptImmediately + false + true + + + true + $(OutDir)\steamworksexample.bsc + + + + + Default + . + + + NDEBUG;%(PreprocessorDefinitions);_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE + 1033 + + + true + SteamWorksExample.exe.manifest + + + true + + + + + + + /std:c++17 /bigobj /d2Zi+ /Zc:__cplusplus + MaxSpeed + AnySuitable + true + Speed + $(DXSDK_DIR)Include;..\public; + WIN32;_CRT_SECURE_NO_WARNINGS;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions);NDEBUG;_EXTERNAL_DLL_EXT=.dll;VPCGAMECAPS=VALVE;PROJECTDIR=D:\dev\Steam\main\src\SteamWorksExample;_DLL_EXT=.dll;VPCGAME=valve + true + Async + MultiThreaded + false + true + + + Precise + false + true + true + false + NotUsing + $(IntDir)\ + $(IntDir)\ + $(IntDir)\ + false + false + Level3 + true + OldStyle + CompileAsCpp + ;4577;4091 + false + true + $(IntDir)\ + Prompt + + + + /ignore:4221 + ;legacy_stdio_definitions.lib;%(AdditionalDependencies) + NotSet + $(OutDir)\steamworksexample.exe + true + ;$(DXSDK_DIR)Lib\x64; + libc;libcd;libcmtd + true + $(OutDir)\$(TargetName).pdb + false + $(OutDir)\$(TargetName).map + Windows + true + true + + + PromptImmediately + false + + + + + true + $(OutDir)\steamworksexample.bsc + + + + Default + . + + + NDEBUG;%(PreprocessorDefinitions);_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE + 1033 + + + true + SteamWorksExample.exe.manifest + + + true + + + + + + + true + true + true + true + + + true + true + true + true + + + + true + true + true + true + + + + + + + + + + + + + + true + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + + + + true + true + true + true + + + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + + true + true + true + true + + + true + true + true + true + + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + + + + + + + true + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + true + true + + + true + true + + + true + true + + + true + true + + + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + + + + diff --git a/external/steamworks/steamworksexample/SteamworksExample.vcxproj.filters b/external/steamworks/steamworksexample/SteamworksExample.vcxproj.filters new file mode 100644 index 0000000..1950dc5 --- /dev/null +++ b/external/steamworks/steamworksexample/SteamworksExample.vcxproj.filters @@ -0,0 +1,323 @@ + + + + + {1680C80B-FF1E-EA4D-9817-CC12254F2E40} + + + {A9977944-E96C-5354-00E9-10543AF3AD45} + + + {D228CF81-3F1C-A342-56D3-9CFD97D8D5F0} + + + {C5D73B3A-C648-896C-B7CE-F174808E5BA5} + + + {FA3635CE-6C7C-7DE5-DDEB-60602507503F} + + + {BA03E055-4FA2-FCE3-8A1C-D348547D379C} + + + {3BC5273C-D80A-3936-3D84-35FC7E6269AE} + + + {84F38993-4EB4-8F80-2E2C-37AA0D9C662A} + + + + + Link Libraries + + + Link Libraries + + + Link Libraries + + + Link Libraries + + + Link Libraries + + + Link Libraries + + + + + Header Files + + + Header Files\Engine + + + Header Files\Engine + + + Header Files\Engine + + + Header Files\Engine + + + Header Files\Engine + + + Header Files\Engine + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + Header Files\Game + + + + + Source Files + + + Source Files + + + Source Files\Engine + + + Source Files\Engine + + + Source Files\Engine + + + Source Files\Engine + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + Source Files\Game + + + + + Resource Files + + + + + + + Source Files\Engine + + + Source Files\Engine + + + Source Files\Game + + + diff --git a/external/steamworks/steamworksexample/Sun.cpp b/external/steamworks/steamworksexample/Sun.cpp new file mode 100644 index 0000000..ff19bde --- /dev/null +++ b/external/steamworks/steamworksexample/Sun.cpp @@ -0,0 +1,42 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for rendering the sun +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" +#include "Sun.h" +#include + + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CSun::CSun( IGameEngine *pGameEngine ) : CSpaceWarEntity( pGameEngine, 2*SUN_VECTOR_SCALE_FACTOR, false ) +{ + float xcenter = (float)pGameEngine->GetViewportWidth()/2; + float ycenter = (float)pGameEngine->GetViewportHeight()/2; + float sqrtof2 = (float)sqrt( 2.0 ); + + DWORD dwColor = D3DCOLOR_ARGB( 255, 255, 255, 102 ); + + // Initialize our geometry + AddLine( (2.0f*SUN_VECTOR_SCALE_FACTOR), 0.0f, (-2.0f*SUN_VECTOR_SCALE_FACTOR), 0.0f, dwColor ); + AddLine( 0.0f, (2.0f*SUN_VECTOR_SCALE_FACTOR), 0.0f, (-2.0f*SUN_VECTOR_SCALE_FACTOR), dwColor ); + AddLine( -1.0f*sqrtof2*SUN_VECTOR_SCALE_FACTOR, sqrtof2*SUN_VECTOR_SCALE_FACTOR, sqrtof2*SUN_VECTOR_SCALE_FACTOR, -1.0f*sqrtof2*SUN_VECTOR_SCALE_FACTOR, dwColor ); + AddLine( sqrtof2*SUN_VECTOR_SCALE_FACTOR, sqrtof2*SUN_VECTOR_SCALE_FACTOR, -1.0f*sqrtof2*SUN_VECTOR_SCALE_FACTOR, -1.0f*sqrtof2*SUN_VECTOR_SCALE_FACTOR, dwColor ); + + // Has to be after unlock since the base class will lock in this call + SetPosition( xcenter, ycenter ); +} + +//----------------------------------------------------------------------------- +// Purpose: Run a frame for the sun +//----------------------------------------------------------------------------- +void CSun::RunFrame() +{ + // We want to rotate 90 degrees every 800ms (1.57 is 1/2pi, or 90 degrees in radians) + SetRotationDeltaNextFrame( (PI_VALUE/2.0f) * (float)m_pGameEngine->GetGameTicksFrameDelta()/800.0f ); + CVectorEntity::RunFrame(); +} diff --git a/external/steamworks/steamworksexample/Sun.h b/external/steamworks/steamworksexample/Sun.h new file mode 100644 index 0000000..f64cecf --- /dev/null +++ b/external/steamworks/steamworksexample/Sun.h @@ -0,0 +1,27 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for rendering the sun +// +// $NoKeywords: $ +//============================================================================= + +#ifndef SUN_H +#define SUN_H + +#include "GameEngine.h" +#include "SpaceWarEntity.h" + +#define SUN_VECTOR_SCALE_FACTOR 14 + +class CSun : public CSpaceWarEntity +{ +public: + // Constructor + CSun( IGameEngine *pGameEngine ); + + // Run a frame + void RunFrame(); + +}; + +#endif // SUN_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/VectorEntity.cpp b/external/steamworks/steamworksexample/VectorEntity.cpp new file mode 100644 index 0000000..14a469b --- /dev/null +++ b/external/steamworks/steamworksexample/VectorEntity.cpp @@ -0,0 +1,304 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Base class for representation objects in the game which are drawn as +// vector art (ie, a series of lines) +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" +#include "VectorEntity.h" +#include "stdlib.h" +#include + + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CVectorEntity::CVectorEntity( IGameEngine *pGameEngine, uint32 uCollisionRadius ) +{ + m_uCollisionRadius = uCollisionRadius; + m_pGameEngine = pGameEngine; + m_flRotationDeltaNextFrame = 0.0; + m_flAccumulatedRotation = 0.0; + m_flXAccel = 0.0; + m_flYAccel = 0.0; + m_flXAccelLastFrame = 0.0; + m_flYAccelLastFrame = 0.0; + m_flXPos = 0.0; + m_flYPos = 0.0; + m_flXVelocity = 0.0; + m_flYVelocity = 0.0; + m_bDisableCollisions = false; + m_flRotationDeltaLastFrame = 0.0; + + // we should have at least one frame Run before + // anyone asks for a delta, so this shouldn't cause + // a large initial delta to our starting position, in theory + m_flXPosLastFrame = 0; + m_flYPosLastFrame = 0; + + m_flMaximumVelocity = DEFAULT_MAXIMUM_VELOCITY; +} + +//----------------------------------------------------------------------------- +// Purpose: Destructor +//----------------------------------------------------------------------------- +CVectorEntity::~CVectorEntity() +{ + +} + + +//----------------------------------------------------------------------------- +// Purpose: Add a line to our geometry +//----------------------------------------------------------------------------- +void CVectorEntity::AddLine( float xPos0, float yPos0, float xPos1, float yPos1, DWORD dwColor ) +{ + VectorEntityVertex_t vert; + vert.x = xPos0; + vert.y = yPos0; + vert.color = dwColor; + + m_VecVertexes.push_back( vert ); + + vert.x = xPos1; + vert.y = yPos1; + vert.color = dwColor; + + m_VecVertexes.push_back( vert ); +} + +void CVectorEntity::ClearVertexes() +{ + m_VecVertexes.clear(); +} + +//----------------------------------------------------------------------------- +// Purpose: Set the current position for the object +//----------------------------------------------------------------------------- +void CVectorEntity::SetPosition( float xPos, float yPos ) +{ + m_flXPos = xPos; + m_flYPos = yPos; +} + + +//----------------------------------------------------------------------------- +// Purpose: Set the rotation to be applied next frame (in radians) +//----------------------------------------------------------------------------- +void CVectorEntity::SetRotationDeltaNextFrame( float flRotationInRadians ) +{ + m_flRotationDeltaNextFrame = flRotationInRadians; +} + + +//----------------------------------------------------------------------------- +// Purpose: Set the acceleration to be applied next frame +//----------------------------------------------------------------------------- +void CVectorEntity::SetAcceleration( float flXAccel, float flYAccel ) +{ + m_flXAccel = flXAccel; + m_flYAccel = flYAccel; +} + + +//----------------------------------------------------------------------------- +// Purpose: Run a frame for the vector entity (ie, compute rotation, position, etc...) +//----------------------------------------------------------------------------- +void CVectorEntity::RunFrame() +{ + // Accumulate the rotation so we know our current rotation total at all times + m_flAccumulatedRotation += m_flRotationDeltaNextFrame; + m_flRotationDeltaLastFrame = m_flRotationDeltaNextFrame; + m_flRotationDeltaNextFrame = 0.0f; + + m_flXPosLastFrame = m_flXPos; + m_flYPosLastFrame = m_flYPos; + + // If the accumulated rotation is > 2pi (360) then wrap it (same for negative direction) + // This prevents the value getting really large and losing precision + int nInfiniteLoopProtector = 0; + while ( m_flAccumulatedRotation >= 2.0f*PI_VALUE && ++nInfiniteLoopProtector < 100 ) + m_flAccumulatedRotation -= 2.0f*PI_VALUE; + nInfiniteLoopProtector = 0; + while ( m_flAccumulatedRotation <= -2.0f*PI_VALUE && ++nInfiniteLoopProtector < 100 ) + m_flAccumulatedRotation += 2.0f*PI_VALUE; + + + // Update our acceleration, velocity, and finally position + // Note: The min here is so we don't get massive acceleration if frames for some reason don't run for a bit + float ulElapsedSeconds = MIN( (float)m_pGameEngine->GetGameTicksFrameDelta() / 1000.0f, 0.1f ); + m_flXVelocity += m_flXAccel * ulElapsedSeconds; + m_flYVelocity += m_flYAccel * ulElapsedSeconds; + + // Make sure velocity does not exceed maximum allowed + + float flVelocity = (float)sqrt( m_flXVelocity*m_flXVelocity + m_flYVelocity*m_flYVelocity ); + + if ( flVelocity > m_flMaximumVelocity ) + { + float flRatio = m_flMaximumVelocity / flVelocity; + + m_flXVelocity = m_flXVelocity * flRatio; + m_flYVelocity = m_flYVelocity * flRatio; + } + + m_flXPos += m_flXVelocity * ulElapsedSeconds; + m_flYPos += m_flYVelocity * ulElapsedSeconds; + + // Clear acceleration values, child classes should keep reseting it as appropriate each frame + m_flXAccelLastFrame = m_flXAccel; + m_flYAccelLastFrame = m_flYAccel; + m_flXAccel = 0; + m_flYAccel = 0; + + // Check for wrapping around the screen + float width = (float)m_pGameEngine->GetViewportWidth(); + float height = (float)m_pGameEngine->GetViewportHeight(); + + if ( m_flXPos > width ) + m_flXPos -= width; + if ( m_flXPos < 0 ) + m_flXPos += width; + + if ( m_flYPos > height ) + m_flYPos -= height; + if ( m_flYPos < 0 ) + m_flYPos += height; +} + + +//----------------------------------------------------------------------------- +// Purpose: Render the entity +//----------------------------------------------------------------------------- +void CVectorEntity::Render() +{ + // Compute values which will be used for rotation below + float flSinRotation = (float)sin(m_flAccumulatedRotation); + float flCosRotation = (float)cos(m_flAccumulatedRotation); + + if ( m_VecVertexes.size() < 2 ) + return; + + // Iterate our vector of vertexes 2 at a time drawing lines + for( size_t i=0; i < m_VecVertexes.size() - 1; ++i ) + { + DWORD dwColor0, dwColor1; + float xPos0, yPos0, xPos1, yPos1; + float xPrime0, yPrime0, xPrime1, yPrime1; + + // Grab the first point and apply rotation and translation + xPos0 = m_VecVertexes[i].x; + yPos0 = m_VecVertexes[i].y; + dwColor0 = m_VecVertexes[i].color; + + // Apply any needed rotation + xPrime0 = flCosRotation*xPos0 - flSinRotation*yPos0; + yPrime0 = flSinRotation*xPos0 + flCosRotation*yPos0; + + // Apply translation to current position + xPrime0 += m_flXPos; + yPrime0 += m_flYPos; + + // Next vertex, we use 2 per iteration + ++i; + + // Grab the second point and apply rotation and translation + xPos1 = m_VecVertexes[i].x; + yPos1 = m_VecVertexes[i].y; + dwColor1 = m_VecVertexes[i].color; + + // Apply any needed rotation + xPrime1 = flCosRotation*xPos1 - flSinRotation*yPos1; + yPrime1 = flSinRotation*xPos1 + flCosRotation*yPos1; + + // Apply translation to current position + xPrime1 += m_flXPos; + yPrime1 += m_flYPos; + + // Have the game engine draw the actual line (it batches these operations) + m_pGameEngine->BDrawLine( xPrime0, yPrime0, dwColor0, xPrime1, yPrime1, dwColor1 ); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Render the entity with an override color instead of the vertex color +//----------------------------------------------------------------------------- +void CVectorEntity::Render(DWORD overrideColor) +{ + // Compute values which will be used for rotation below + float flSinRotation = (float)sin(m_flAccumulatedRotation); + float flCosRotation = (float)cos(m_flAccumulatedRotation); + + // Iterate our vector of vertexes 2 at a time drawing lines + for( size_t i=0; i < m_VecVertexes.size() - 1; ++i ) + { + DWORD dwColor0, dwColor1; + float xPos0, yPos0, xPos1, yPos1; + float xPrime0, yPrime0, xPrime1, yPrime1; + + // Grab the first point and apply rotation and translation + xPos0 = m_VecVertexes[i].x; + yPos0 = m_VecVertexes[i].y; + dwColor0 = overrideColor; + + // Apply any needed rotation + xPrime0 = flCosRotation*xPos0 - flSinRotation*yPos0; + yPrime0 = flSinRotation*xPos0 + flCosRotation*yPos0; + + // Apply translation to current position + xPrime0 += m_flXPos; + yPrime0 += m_flYPos; + + // Next vertex, we use 2 per iteration + ++i; + + // Grab the second point and apply rotation and translation + xPos1 = m_VecVertexes[i].x; + yPos1 = m_VecVertexes[i].y; + dwColor1 = overrideColor; + + // Apply any needed rotation + xPrime1 = flCosRotation*xPos1 - flSinRotation*yPos1; + yPrime1 = flSinRotation*xPos1 + flCosRotation*yPos1; + + // Apply translation to current position + xPrime1 += m_flXPos; + yPrime1 += m_flYPos; + + // Have the game engine draw the actual line (it batches these operations) + m_pGameEngine->BDrawLine( xPrime0, yPrime0, dwColor0, xPrime1, yPrime1, dwColor1 ); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Check if the entity is colliding with the other given entity +//----------------------------------------------------------------------------- +bool CVectorEntity::BCollidesWith ( CVectorEntity * pTarget ) +{ + + // Note: Yes, this is a lame way to do collision detection just using a set radius. + // I don't care for the moment, just want it running! + + if ( m_bDisableCollisions ) + return false; + else if ( pTarget->BCollisionDetectionDisabled() ) + return false; + + // Compute distance between the center of the two objects + float distance = (float)sqrt( pow( m_flXPos - pTarget->GetXPos(), 2 ) + pow( m_flYPos - pTarget->GetYPos(), 2 ) ); + + if ( distance < m_uCollisionRadius + pTarget->GetCollisionRadius() ) + return true; + + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: Check if the entity is colliding with the other given entity +//----------------------------------------------------------------------------- +float CVectorEntity::GetDistanceTraveledLastFrame() +{ + return (float)sqrt( pow( m_flXPos - m_flXPosLastFrame, 2 ) + pow( m_flYPos - m_flYPosLastFrame, 2 ) ); +} diff --git a/external/steamworks/steamworksexample/VectorEntity.h b/external/steamworks/steamworksexample/VectorEntity.h new file mode 100644 index 0000000..8a77df5 --- /dev/null +++ b/external/steamworks/steamworksexample/VectorEntity.h @@ -0,0 +1,158 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Base class for representation objects in the game which are drawn as +// vector art (ie, a series of lines) +// +// $NoKeywords: $ +//============================================================================= + +#ifndef VECTORENTITY_H +#define VECTORENTITY_H + +#include "GameEngine.h" +#include + +struct VectorEntityVertex_t +{ + float x, y; + DWORD color; +}; + +#define DEFAULT_MAXIMUM_VELOCITY 450.0f + +#define PI_VALUE 3.14159265f + +class CVectorEntity +{ +public: + // Constructor + CVectorEntity( IGameEngine *pGameEngine, uint32 uCollisionRadius ); + + // Destructor + virtual ~CVectorEntity(); + + // Run a frame + virtual void RunFrame(); + + // Render the sun field + virtual void Render(); + + // Render with an explicit color + virtual void Render(DWORD overrideColor); + + // Check if the entity is colliding with another given entity + bool BCollidesWith( CVectorEntity * pTarget ); + + // Get the rotation value that is to be applied next frame + float GetRotationDeltaNextFrame() { return m_flRotationDeltaNextFrame; } + + // Get the rotation value that was applied last frame + float GetRotationDeltaLastFrame() { return m_flRotationDeltaLastFrame; } + + // Get the cumulative rotation for this entity + float GetAccumulatedRotation() { return m_flAccumulatedRotation; } + + // Get the acceleration to be applied next frame + float GetXAcceleration() { return m_flXAccel; } + float GetYAcceleration() { return m_flYAccel; } + + // Get the acceleration applied last frame + float GetXAccelerationLastFrame() { return m_flXAccelLastFrame; } + float GetYAccelerationLastFrame() { return m_flYAccelLastFrame; } + + // Get the current velocity + float GetXVelocity() { return m_flXVelocity; } + float GetYVelocity() { return m_flYVelocity; } + + // Get the current position of the object + float GetXPos() { return m_flXPos; } + float GetYPos() { return m_flYPos; } + + // Get the distance traveled each frame + float GetDistanceTraveledLastFrame(); + + // Add a line to the entity + void AddLine(float xPos0, float yPos0, float xPos1, float yPos1, DWORD dwColor); + + // Clear all lines in the entity + void ClearVertexes(); + + // Set the objects current position + void SetPosition(float xPos, float yPos); + + // Set the velocity of the entity (normally you should just set acceleration and this will be computed) + void SetVelocity(float xVelocity, float yVelocity) { m_flXVelocity = xVelocity; m_flYVelocity = yVelocity; } + +protected: + + // Set the rotation to be applied next frame + void SetRotationDeltaNextFrame( float flRotationInRadians ); + + // Set the acceleration to be applied next frame + void SetAcceleration( float xAccel, float yAccel ); + // Set the cumulative rotation for this entity (overriding any existing value) + void SetAccumulatedRotation( float flRotation ) { m_flAccumulatedRotation = flRotation; } + + // Reset velocity of the entity + void ResetVelocity() { m_flXVelocity = 0; m_flYVelocity = 0; } + + // Get the collision radius for the entity + uint32 GetCollisionRadius() { return m_uCollisionRadius; } + + // Enable/Disable collision detection for this entity + void SetCollisionDetectionDisabled( bool bDisabled ) { m_bDisableCollisions = bDisabled; } + + // Check whether collision detection has been disabled for the entity + bool BCollisionDetectionDisabled() { return m_bDisableCollisions; } + + // Set a maximum velocity other than the default + void SetMaximumVelocity( float flMaximumVelocity ) { m_flMaximumVelocity = flMaximumVelocity; } + +protected: + // Game engine instance we are running under + IGameEngine *m_pGameEngine; + +private: + // Vector of points (always built 2 at a time so it's actually lines) + std::vector< VectorEntityVertex_t > m_VecVertexes; + + // Previous position + float m_flXPosLastFrame; + float m_flYPosLastFrame; + + // current position (position is at the center of the object) + float m_flXPos; + float m_flYPos; + + // maximum velocity the object can have in either x/y + float m_flMaximumVelocity; + + // acceleration to be applied next frame + float m_flXAccel; + float m_flYAccel; + + // acceleration applied last frame + float m_flXAccelLastFrame; + float m_flYAccelLastFrame; + + // current velocity (affected by acceleration changes) + float m_flXVelocity; + float m_flYVelocity; + + // rotation to apply this frame (in radians) + float m_flRotationDeltaNextFrame; + + // rotation which was applied last frame + float m_flRotationDeltaLastFrame; + + // total cumulative rotation that has been applied to this entity + float m_flAccumulatedRotation; + + // radius to use for collisions, this is applied from the center of the object out + uint32 m_uCollisionRadius; + + // bool to disable collision detection for this object + bool m_bDisableCollisions; +}; + +#endif // VECTORENTITY_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/clanchatroom.cpp b/external/steamworks/steamworksexample/clanchatroom.cpp new file mode 100644 index 0000000..687f65b --- /dev/null +++ b/external/steamworks/steamworksexample/clanchatroom.cpp @@ -0,0 +1,77 @@ +//========= Copyright Valve LLC, All rights reserved. ============ +// +// Purpose: Class for joining and showing clan chats +// +//================================================================ + +#include "stdafx.h" +#include "clanchatroom.h" +#include "BaseMenu.h" +#include + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CClanChatRoom::CClanChatRoom( IGameEngine *pGameEngine ) : m_pGameEngine( pGameEngine ) +{ +} + + +//----------------------------------------------------------------------------- +// Purpose: Run a frame for the CClanChatRoom +//----------------------------------------------------------------------------- +void CClanChatRoom::RunFrame() +{ +} + + +//----------------------------------------------------------------------------- +// Purpose: Shows / Refreshes the chat room +//----------------------------------------------------------------------------- +void CClanChatRoom::Show() +{ + // start joining a chat, if we aren't in one already + if ( !m_steamIDChat.IsValid() || !m_SteamCallResultJoinChatRoom.IsActive() ) + { + // pick a clan to join from the users current data + CSteamID steamIDBestClan; + for ( int i = 0; i < SteamFriends()->GetClanCount(); i++ ) + { + CSteamID steamIDClan = SteamFriends()->GetClanByIndex( i ); + int online, ingame, chatting; + if ( SteamFriends()->GetClanActivityCounts( steamIDClan, &online, &ingame, &chatting ) ) + { + if ( chatting > 0 ) + { + steamIDBestClan = steamIDClan; + break; + } + else if ( online ) + { + steamIDBestClan = steamIDClan; + } + } + } + + if ( steamIDBestClan.IsValid() ) + { + SteamAPICall_t hCall = SteamFriends()->JoinClanChatRoom( steamIDBestClan ); + m_SteamCallResultJoinChatRoom.Set( hCall, this, &CClanChatRoom::OnJoinChatRoom ); + OutputDebugString( "joining clan chat...\n" ); + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Called when SteamFriends()->JoinClanChatRoom() returns asynchronously +//----------------------------------------------------------------------------- +void CClanChatRoom::OnJoinChatRoom( JoinClanChatRoomCompletionResult_t *pResult, bool bIOFailure ) +{ + if ( pResult->m_eChatRoomEnterResponse == k_EChatRoomEnterResponseSuccess ) + { + // we've entered + OutputDebugString( "succesfully joined clan chat\n" ); + } + +} diff --git a/external/steamworks/steamworksexample/clanchatroom.h b/external/steamworks/steamworksexample/clanchatroom.h new file mode 100644 index 0000000..b4aedea --- /dev/null +++ b/external/steamworks/steamworksexample/clanchatroom.h @@ -0,0 +1,42 @@ +//========= Copyright © 1996-2009, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for joining and showing clan chat rooms +// +//============================================================================= + +#ifndef CLANCHATROOM_H +#define CLANCHATROOM_H + +#include "SpaceWar.h" +#include "GameEngine.h" +#include "StatsAndAchievements.h" +#include "SpaceWarClient.h" + + +class ISteamUser; + +class CClanChatRoom +{ +public: + // Constructor + CClanChatRoom( IGameEngine *pGameEngine ); + + // Run a frame + void RunFrame(); + + // shows / refreshes chat + void Show(); + +private: + // Engine + IGameEngine *m_pGameEngine; + + // Called when SteamFriends()->JoinClanChatRoom() returns asynchronously + void OnJoinChatRoom( JoinClanChatRoomCompletionResult_t *pResult, bool bIOFailure ); + CCallResult m_SteamCallResultJoinChatRoom; + + CSteamID m_steamIDChat; + +}; + +#endif // CLANCHATROOM_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/debug/steam_appid.txt b/external/steamworks/steamworksexample/debug/steam_appid.txt new file mode 100644 index 0000000..7ad8022 --- /dev/null +++ b/external/steamworks/steamworksexample/debug/steam_appid.txt @@ -0,0 +1 @@ +480 \ No newline at end of file diff --git a/external/steamworks/steamworksexample/flags.mak b/external/steamworks/steamworksexample/flags.mak new file mode 100644 index 0000000..57df6ed --- /dev/null +++ b/external/steamworks/steamworksexample/flags.mak @@ -0,0 +1,87 @@ +ifeq "$(DOCKER_IMAGE_ALIAS)" "" + # This is setup when using Valve's docker scripts, but not when using podman/toolbox, so try to guess + $(shell grep -q -F VARIANT_ID=\"com.valvesoftware.steamruntime.sdk-amd64_i386-scout\" /etc/os-release) + ifeq ($(.SHELLSTATUS),0) + DOCKER_IMAGE_ALIAS := steamrt-scout-amd64 + endif +endif + +ifeq "$(DOCKER_IMAGE_ALIAS)" "" + $(info WARNING: No Steam for Linux runtime SDK detected - unsupported configuration.) + $(info See tools/linux/README.md) + $(info) +else + DOCKER_IMAGE_BASE:=$(DOCKER_IMAGE_ALIAS:-fastlink=) + DOCKER_IMAGE_BASE:=$(DOCKER_IMAGE_BASE:-i386=) + DOCKER_IMAGE_BASE:=$(DOCKER_IMAGE_BASE:-amd64=) + + ifeq ($(DOCKER_IMAGE_BASE), steamrt-scout) + $(info Configuring for Steam for Linux runtime 1.0 (scout)) + CC := gcc-9 + CXX := g++-9 + CXXFLAGS += -std=gnu++17 + # unlike gcc 4.8, gcc 9 is not native to the scout runtime, it is recommended to statically link + LDFLAGS += -static-libgcc -static-libstdc++ + endif +endif + +ifeq ($(ARCH), 32) + ARCH_DIR := linux32 +else + ARCH_DIR := linux64 +endif + +INCLUDE_DIRS := $(PWD)/../public +LIBRARY_DIRS := $(PWD)/../../client/$(ARCH_DIR) +LIBRARY_NAMES := steam_api +STEAM_API := libsteam_api.so + +ifeq (,$(wildcard $(LIBRARY_DIRS)/$(STEAM_API))) + # Does not exist, substitue with a path valid for the public, zip version of the SDK + LIBRARY_DIRS := $(PWD)/../redistributable_bin/$(ARCH_DIR) +endif + +CC ?= gcc +CXX ?= g++ +LD := $(CXX) +AR := ar +OBJCOPY := objcopy +CP := cp +SDL_CONFIG := sdl2-config + +# Since this is an example, we'll build Debug by default +CONFIG ?= DEBUG + +COMMON_MACROS := +DEBUG_MACROS := DEBUG +RELEASE_MACROS := NDEBUG RELEASE + +MCUFLAGS := + +CFLAGS += -g -DPOSIX -DSDL $(shell $(SDL_CONFIG) --cflags) -DGNUC +CXXFLAGS += -g -DPOSIX -DSDL $(shell $(SDL_CONFIG) --cflags) -DGNUC + +# Valve uses SDL3 internally (the default if USE_SDL2 is not specified) +# The zip version of the SDK uses the SDL2 package from the runtime SDK +CXXFLAGS += -DUSE_SDL2 + +DEBUG_CFLAGS := -O0 +RELEASE_CFLAGS := -O3 +DEBUG_CXXFLAGS := $(DEBUG_CFLAGS) +RELEASE_CXXFLAGS := $(RELEASE_CFLAGS) + +MACOS_FRAMEWORKS := + +LDFLAGS := $(shell $(SDL_CONFIG) --libs) -lSDL2_ttf -lfreetype -lz -lGL -lopenal +DEBUG_LDFLAGS := +RELEASE_LDGLAGS := + +START_GROUP := -Wl,--start-group +END_GROUP := -Wl,--end-group + +USE_DEL_TO_CLEAN := 0 +GENERATE_BIN_FILE := 0 +ADDITIONAL_MAKE_FILES := +IS_LINUX_PROJECT := 1 + +include $(ADDITIONAL_MAKE_FILES) diff --git a/external/steamworks/steamworksexample/gameengineosx.h b/external/steamworks/steamworksexample/gameengineosx.h new file mode 100644 index 0000000..f20c821 --- /dev/null +++ b/external/steamworks/steamworksexample/gameengineosx.h @@ -0,0 +1,523 @@ +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Main class for the game engine -- osx implementation +// +// $NoKeywords: $ +//============================================================================= + +#ifndef GAMEENGINEOSX_H +#define GAMEENGINEOSX_H + +#ifdef __OBJC__ +#define OBJC_ENABLED 1 +#else +#define OBJC_ENABLED 0 +#endif + +typedef unsigned char byte; + +#include "steam/steam_api.h" +#include "GameEngine.h" +#include +#include +#include +#include +#include +#include + + + +// How big is the vertex buffer for batching lines in total? +// NOTE: This must be a multiple of the batch size below!!! (crashes will occur if it isn't) +#define LINE_BUFFER_TOTAL_SIZE 1000 + +// How many lines do we put in the buffer in between flushes? +// +// This should be enough smaller than the total size so that draw calls +// can finish using the data before we wrap around and discard it. +#define LINE_BUFFER_BATCH_SIZE 250 + +// How big is the vertex buffer for batching points in total? +// NOTE: This must be a multiple of the batch size below!!! (crashes will occur if it isn't) +#define POINT_BUFFER_TOTAL_SIZE 1800 + +// How many points do we put in the buffer in between flushes? +// +// This should be enough smaller than the total size so that draw calls +// can finish using the data before we wrap around and discard it. +#define POINT_BUFFER_BATCH_SIZE 600 + +// How big is the vertex buffer for batching quads in total? +// NOTE: This must be a multiple of the batch size below!!! (crashes will occur if it isn't) +#define QUAD_BUFFER_TOTAL_SIZE 1000 + +// How many quads do we put in the buffer in between flushes? +// +// This should be enough smaller than the total size so that draw calls +// can finish using the data before we wrap around and discard it. +#define QUAD_BUFFER_BATCH_SIZE 250 + + + + +#ifndef DX9MODE +#define DX9MODE 0 // change to 1 to turn on the DX9 mode +#endif + +#if DX9MODE +#include "../glmgr/dxabstract.h" + +class CShowPixelsParams +{ +public: + GLuint m_srcTexName; + int m_width,m_height; +}; + +// Vertex struct for line batches +struct LineVertex_t +{ + float x, y, z, rhw; + DWORD color; +}; + + +// Vertex struct for point batches +struct PointVertex_t +{ + float x, y, z, rhw; + DWORD color; +}; + +// Vertex struct for textured quads +struct TexturedQuadVertex_t +{ + float x, y, z, rhw; + DWORD color; + float u, v; // texture coordinates +}; + +#endif + + +class CVoiceContext; + +class CGameEngineGL : public IGameEngine +{ +public: + + // Constructor + CGameEngineGL(); + + // Destructor + ~CGameEngineGL() { Shutdown(); } + + // Check if the game engine is initialized ok and ready for use + bool BReadyForUse() { return m_bEngineReadyForUse; } + + // Check if the engine is shutting down + bool BShuttingDown() { return m_bShuttingDown; } + + // Set the background color + void SetBackgroundColor( short a, short r, short g, short b ); + + // Start a frame, clear(), beginscene(), etc + bool StartFrame(); + + // Finish a frame, endscene(), present(), etc. + void EndFrame(); + + // Shutdown the game engine + void Shutdown(); + + // Pump messages from the OS + void MessagePump(); + + // Accessors for game screen size + int32 GetViewportWidth() { return m_nWindowWidth; } + int32 GetViewportHeight() { return m_nWindowHeight; } + + // Function for drawing text to the screen, dwFormat is a combination of flags like DT_LEFT, TEXTPOS_VCENTER etc... + // on OSX client with DX9MODE=1, the HGAMEFONT is a texture with the glyphs in a 16x16 grid (see "g_glmDebugFontMap" in glmgrbasics.cpp) + bool BDrawString( HGAMEFONT hFont, RECT rect, DWORD dwColor, DWORD dwFormat, const char *pchText ); + + // Create a new font returning our internal handle value for it (0 means failure) + HGAMEFONT HCreateFont( int nHeight, int nFontWeight, bool bItalic, const char * pchFont ); + + // Create a new texture returning our internal handle value for it (0 means failure) + HGAMETEXTURE HCreateTexture( byte *pRGBAData, uint32 uWidth, uint32 uHeight, ETEXTUREFORMAT eTextureFormat = eTextureFormat_RGBA ); + + // update an existing texture + bool UpdateTexture( HGAMETEXTURE texture, byte *pRGBAData, uint32 uWidth, uint32 uHeight, ETEXTUREFORMAT eTextureFormat ); + + // Draw a line, the engine itself will manage batching these (although you can explicitly flush if you need to) + bool BDrawLine( float xPos0, float yPos0, DWORD dwColor0, float xPos1, float yPos1, DWORD dwColor1 ); + + // Flush the line buffer + bool BFlushLineBuffer(); + + // Draw a point, the engine itself will manage batching these (although you can explicitly flush if you need to) + bool BDrawPoint( float xPos, float yPos, DWORD dwColor ); + + // Flush the point buffer + bool BFlushPointBuffer(); + + // Draw a filled quad + bool BDrawFilledRect( float xPos0, float yPos0, float xPos1, float yPos1, DWORD dwColor ); + + // Draw a textured rectangle + bool BDrawTexturedRect( float xPos0, float yPos0, float xPos1, float yPos1, + float u0, float v0, float u1, float v1, DWORD dwColor, HGAMETEXTURE hTexture ); + + // Draw a textured arbitrary quad + bool BDrawTexturedQuad( float xPos0, float yPos0, float xPos1, float yPos1, float xPos2, float yPos2, float xPos3, float yPos3, + float u0, float v0, float u1, float v1, DWORD dwColor, HGAMETEXTURE hTexture ); + + // Flush any still cached quad buffers + bool BFlushQuadBuffer(); + + // Get the current state of a key + bool BIsKeyDown( DWORD dwVK ); + + // Get the first (in some arbitrary order) key down, if any + bool BGetFirstKeyDown( DWORD *pdwVK ); + + // Return true if there is an active Steam Input device + bool BIsSteamInputDeviceActive( ); + + // Find the active device + void FindActiveSteamInputDevice( ); + + // Get the current state of a controller action + bool BIsControllerActionActive( ECONTROLLERDIGITALACTION dwAction ); + + // Get the current state of a controller action + void GetControllerAnalogAction( ECONTROLLERANALOGACTION dwAction, float *x, float *y ); + + // Set the current Steam Controller Action set + void SetSteamControllerActionSet( ECONTROLLERACTIONSET dwActionSet ); + + // Set an Action Set Layer for Steam Input + virtual void ActivateSteamControllerActionSetLayer( ECONTROLLERACTIONSET dwActionSet ); + virtual void DeactivateSteamControllerActionSetLayer( ECONTROLLERACTIONSET dwActionSet ); + + // Returns whether a given action set layer is active + virtual bool BIsActionSetLayerActive( ECONTROLLERACTIONSET dwActionSetLayer ); + + // These calls return a string describing which controller button the action is currently bound to + const char *GetTextStringForControllerOriginDigital( ECONTROLLERACTIONSET dwActionSet, ECONTROLLERDIGITALACTION dwDigitalAction ); + const char *GetTextStringForControllerOriginAnalog( ECONTROLLERACTIONSET dwActionSet, ECONTROLLERANALOGACTION dwDigitalAction ); + + // Set the controller LED Color, if available + void SetControllerColor( uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ); + + // Set the trigger effect on DualSense controllers + void SetTriggerEffect( bool bEnabled ); + + // Trigger a vibration on the controller, if available + void TriggerControllerVibration( unsigned short nLeftSpeed, unsigned short nRightSpeed ); + + // Trigger haptics on the specified pad of the controller, if available + void TriggerControllerHaptics( ESteamControllerPad ePad, unsigned short usOnMicroSec, unsigned short usOffMicroSec, unsigned short usRepeat ); + + // Initialize the Steam Input interface + void InitSteamInput( ); + + // Called each frame to update the Steam Input interface + void PollSteamInput(); + + // Get current tick count for the game engine + uint64 GetGameTickCount() { return m_ulGameTickCount; } + + // Get the tick count elapsed since the previous frame + // bugbug - We use this time to compute things like thrust and acceleration in the game, + // so it's important in doesn't jump ahead by large increments... Need a better + // way to handle that. + uint64 GetGameTicksFrameDelta() { return m_ulGameTickCount - m_ulPreviousGameTickCount; } + + // Tell the game engine to update current tick count + void UpdateGameTickCount(); + + // Tell the game engine to sleep for a bit if needed to limit frame rate + bool BSleepForFrameRateLimit( uint32 ulMaxFrameRate ); + + // Check if the game engine hwnd currently has focus (and a working d3d device) + bool BGameEngineHasFocus() { return true; } + + // Voice chat functions + virtual HGAMEVOICECHANNEL HCreateVoiceChannel(); + virtual void DestroyVoiceChannel( HGAMEVOICECHANNEL hChannel ); + virtual bool AddVoiceData( HGAMEVOICECHANNEL hChannel, const uint8 *pVoiceData, uint32 uLength ); + + #if DX9MODE + #else + void AdjustViewport(); + + #endif + + // Initialize graphics in either GL or DX9 form + bool BInitializeGraphics(); + + // Initialize the debug font library + bool BInitializeCellDbgFont(); + + bool BInitializeAudio(); + + void RunAudio(); + + void UpdateKey( uint32_t vkKey, int nDown ); + + // Tracks whether the engine is ready for use + bool m_bEngineReadyForUse; + + // Tracks if we are shutting down + bool m_bShuttingDown; + + // Size of the window to display the game in + int32 m_nWindowWidth; + int32 m_nWindowHeight; + + // Current game time in milliseconds + uint64 m_ulGameTickCount; + + // Game time at the start of the previous frame + uint64 m_ulPreviousGameTickCount; + + #if DX9MODE + // Windows code transplants-------------------------------------------------------- + + // Resets all the render, texture, and sampler states to our defaults + void ResetRenderStates(); + + // Create a new vertex buffer returning our internal handle for it (0 means failure) + HGAMEVERTBUF HCreateVertexBuffer( uint32 nSizeInBytes, DWORD dwUsage, DWORD dwFVF ); + + // Lock an entire vertex buffer with the specified flags + bool BLockEntireVertexBuffer( HGAMEVERTBUF hVertBuf, void **ppVoid, DWORD dwFlags ); + + // Unlock a vertex buffer + bool BUnlockVertexBuffer( HGAMEVERTBUF hVertBuf ); + + // Release a vertex buffer and free its resources + bool BReleaseVertexBuffer( HGAMEVERTBUF hVertBuf ); + + // set vertex decl + bool BSetVertexDeclaration( IDirect3DVertexDeclaration9 *decl ); + + // Set stream source + bool BSetStreamSource( uint streamNumber, HGAMEVERTBUF hVertBuf, uint32 uOffset, uint32 uStride ); + + // Set shaders + bool BSetShaders( IDirect3DVertexShader9 *vsh, IDirect3DPixelShader9 *psh ); + + // Render primitives out of the current stream source + bool BRenderPrimitive( D3DPRIMITIVETYPE primType, uint32 uStartVertex, uint32 uCount ); + + bool BUberRenderPrimitive( IDirect3DVertexShader9 *vsh, + IDirect3DPixelShader9 *psh, + IDirect3DVertexDeclaration9 *decl, + uint streamNumber, + HGAMEVERTBUF hVertBuf, + uint32 uOffset, + uint32 uStride, + D3DPRIMITIVETYPE primType, + uint32 uStartVertex, + uint32 uCount ); + + // fake hwnd is a WindowRef ( = [m_window windowRef] ) + void *m_hwnd; + + // IDirect3D9 interface + IDirect3D9 *m_pD3D9Interface; + + // IDirect3DDevice9 interface + IDirect3DDevice9 *m_pD3D9Device; + + // Presentation parameters - device resets don't happen on OS X, but just for commonality with windows code + D3DPRESENT_PARAMETERS m_d3dpp; + + // vertex declarations - one per vertex layout used + IDirect3DVertexDeclaration9 *m_decl_P4C1; // aka D3DFVF_XYZRHW | D3DFVF_DIFFUSE + // (4 floats pos, one ubyte4 color) - 20 bytes / vert + + IDirect3DVertexDeclaration9 *m_decl_P4C1T2; // aka D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1 + // (4 floats pos, one ubyte4 color, 2 floats texc) - 28 bytes / vert + + // vertex and pixel shaders - one per vertex layout + IDirect3DVertexShader9 *m_vsh_P4C1; + IDirect3DVertexShader9 *m_vsh_P4C1T2; + IDirect3DPixelShader9 *m_psh_P4C1; + IDirect3DPixelShader9 *m_psh_P4C1T2; + + + // Color we clear the background of the window to each frame + DWORD m_dwBackgroundColor; + + // Next vertex buffer handle value to give out + HGAMEVERTBUF m_nNextVertBufferHandle; + + // Map of handles to vertex buffer objects + struct VertBufData_t + { + bool m_bIsLocked; + IDirect3DVertexBuffer9 * m_pBuffer; + }; + std::map m_MapVertexBuffers; + + HGAMETEXTURE m_nNextTextureHandle; + + // Map of handles to texture objects + struct TextureData_t + { + byte *m_pRGBAData; // We keep a copy of the raw data so we can rebuild textures after a device is lost + uint32 m_uWidth; + uint32 m_uHeight; + LPDIRECT3DTEXTURE9 m_pTexture; + }; + std::map m_MapTextures; + + // Internal vertex buffer for batching line drawing + HGAMEVERTBUF m_hLineBuffer; + + // Pointer to actual line buffer memory (valid only while locked) + LineVertex_t *m_pLineVertexes; + + // Track how many lines are awaiting flushing in our line buffer + DWORD m_dwLinesToFlush; + + // Track where the current batch starts in the vert buffer + DWORD m_dwLineBufferBatchPos; + + // Internal vertex buffer for batching point drawing + HGAMEVERTBUF m_hPointBuffer; + + // Pointer to actual point buffer memory (valid only while locked) + PointVertex_t *m_pPointVertexes; + + // Track how many points are awaiting flushing in our line buffer + DWORD m_dwPointsToFlush; + + // Track where the current batch starts in the vert buffer + DWORD m_dwPointBufferBatchPos; + + // Vertex buffer for textured quads + HGAMEVERTBUF m_hQuadBuffer; + + // Last texture used in drawing a batched quad + HGAMETEXTURE m_hLastTexture; + + // Pointer to quad vertex data + TexturedQuadVertex_t *m_pQuadVertexes; + + // How many quads are awaiting flushing + DWORD m_dwQuadsToFlush; + + // Where does the current batch begin + DWORD m_dwQuadBufferBatchPos; + + // White texture used when drawing filled quads + HGAMETEXTURE m_hTextureWhite; + + // font stuff + HGAMEFONT m_nNextFontHandle; + std::map< HGAMEFONT, HGAMETEXTURE > m_MapGameFonts; + + //CocoaMgr transplants------------------------------------------------------------- + GLMDisplayDB *GetDisplayDB ( void ); + void GetRendererInfo ( GLMRendererInfoFields *rendInfoOut ); + PseudoNSGLContextPtr GetNSGLContextForWindow( void* windowref ); + void RenderedSize ( uint &width, uint &height, bool set ); // either set or retrieve rendered size value (from dxabstract) + void DisplayedSize ( uint &width, uint &height ); // query backbuffer size (window size whether FS or windowed) + void ShowPixels ( CShowPixelsParams *params ); // present + + + GLMDisplayDB *m_displayDB; + #else + // White texture used when drawing filled quads + HGAMETEXTURE m_hTextureWhite; + + // Pointer to actual data for points + GLfloat *m_rgflPointsData; + GLubyte *m_rgflPointsColorData; + + // How many points are outstanding needing flush + DWORD m_dwPointsToFlush; + + // Pointer to actual data for lines + GLfloat *m_rgflLinesData; + GLubyte *m_rgflLinesColorData; + + + // How many lines are outstanding needing flush + DWORD m_dwLinesToFlush; + + // Pointer to actual data for quads + GLfloat *m_rgflQuadsData; + GLubyte *m_rgflQuadsColorData; + GLfloat *m_rgflQuadsTextureData; + + // How many lines are outstanding needing flush + DWORD m_dwQuadsToFlush; + + // Map of font handles we have given out + HGAMEFONT m_nNextFontHandle; + std::map< HGAMEFONT, void* > m_MapGameFonts; + + // Map of handles to texture objects + struct TextureData_t + { + uint32 m_uWidth; + uint32 m_uHeight; + GLuint m_uTextureID; + }; + std::map m_MapTextures; + HGAMETEXTURE m_nNextTextureHandle; + + // Last bound texture, used to know when we must flush + HGAMETEXTURE m_hLastTexture; + #endif + + // Map of button state, translated to VK for win32. + std::set< DWORD > m_SetKeysDown; + + ALCcontext* m_palContext; + ALCdevice* m_palDevice; + + // Map of voice handles + std::map m_MapVoiceChannel; + uint32 m_unVoiceChannelCount; + +#if OBJC_ENABLED + // any objective-c members go at the end of the class in a block + // they are invisible to callers in pure C++ files + // that also means callers in pure C++ files must not try to instantiate or destroy this type of object + + #if DX9MODE + #else + std::map< std::string, GLString * > m_MapStrings; + #endif + + NSOpenGLView *m_view; + NSWindow *m_window; +#endif + + // An array of handles to Steam Controller events that player can bind to controls + InputDigitalActionHandle_t m_ControllerDigitalActionHandles[eControllerDigitalAction_NumActions]; + + // An array of handles to Steam Controller events that player can bind to controls + InputAnalogActionHandle_t m_ControllerAnalogActionHandles[eControllerAnalogAction_NumActions]; + + // An array of handles to different Steam Controller action set configurations + InputActionSetHandle_t m_ControllerActionSetHandles[eControllerActionSet_NumSets]; + + // A handle to the currently active Steam Controller. + InputHandle_t m_ActiveControllerHandle; + + // Origins for all the Steam Input actions. The 'origin' is where the action is currently bound to, + // ie 'jump' is currently bound to the Steam Controller 'A' button. + EInputActionOrigin m_ControllerDigitalActionOrigins[eControllerDigitalAction_NumActions]; + EInputActionOrigin m_ControllerAnalogActionOrigins[eControllerDigitalAction_NumActions]; + +}; + +#endif // GAMEENGINEOSX_H diff --git a/external/steamworks/steamworksexample/gameengineosx.mm b/external/steamworks/steamworksexample/gameengineosx.mm new file mode 100644 index 0000000..ecc5705 --- /dev/null +++ b/external/steamworks/steamworksexample/gameengineosx.mm @@ -0,0 +1,2705 @@ +//========= Copyright 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Main class for the game engine -- osx implementation +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" + +#include +#include +#include +#include + +#include "glstringosx.h" +#include "gameengineosx.h" + +#include "steam/isteamdualsense.h" + +#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400 +#define NSOpenGLContextParameterSwapInterval NSOpenGLCPSwapInterval + +#if MAC_OS_X_VERSION_MIN_REQUIRED < 101200 +#define NSWindowStyleMaskTitled NSTitledWindowMask +#define NSWindowStyleMaskClosable NSClosableWindowMask +#define NSWindowStyleMaskResizable NSResizableWindowMask + +#define NSEventTypeKeyDown NSKeyDown +#define NSEventTypeKeyUp NSKeyUp +#define NSEventTypeFlagsChanged NSFlagsChanged + +#define NSEventModifierFlagShift NSShiftKeyMask +#define NSEventModifierFlagControl NSControlKeyMask +#define NSEventModifierFlagOption NSAlternateKeyMask + +#define NSEventMaskAny NSAnyEventMask +#endif + +#endif + +CGameEngineGL *g_engine; // dxabstract will use this.. it is set by the engine constructor + +IGameEngine *CreateGameEngineOSX() +{ + static CGameEngineGL* s_pGameEngine = NULL; + + if (!s_pGameEngine) + { + s_pGameEngine = new CGameEngineGL(); + } + + return s_pGameEngine; +} + +uint64_t GetTickCount() +{ + timeval time; + gettimeofday(&time, NULL); + return (time.tv_sec * 1000ULL) + (time.tv_usec / 1000ULL); +} + +void OutputDebugString( const char *pchMsg ) +{ + fprintf( stderr, "%s", pchMsg ); +} + +struct Packet_t +{ + uint32 unSize; + void *pData; +}; + +class CVoiceContext +{ +public: + CVoiceContext() + { + alGenBuffers( ARRAYSIZE(m_buffers), m_buffers ); + alGenSources( 1, &m_nSource ); + + alSourcei( m_nSource, AL_LOOPING, AL_FALSE ); + + for (int i = 0; i < ARRAYSIZE(m_buffers); i++ ) + alSourcei( m_nSource, AL_BUFFER, m_buffers[i] ); + + m_nNextFreeBuffer = 0; + } + virtual ~CVoiceContext() + { + // + } + + ALuint m_buffers[4]; + ALuint m_nSource; + size_t m_nNextFreeBuffer; + std::queue m_pending; +}; + +class AutoReleasePool +{ +public: + AutoReleasePool() + { + pool = [[NSAutoreleasePool alloc] init]; + } + ~AutoReleasePool() + { + [pool release]; + } + + NSAutoreleasePool *pool; +}; + + +@interface GLApplication : NSApplication +{ + +} +- (void)sendEvent:(NSEvent *)anEvent; +- (void)windowWillClose:(NSNotification *)notification; +@end + +@implementation GLApplication +- (void)sendEvent:(NSEvent *)anEvent +{ + //fprintf( stderr, "sendEvent: %s\n", [[anEvent description] UTF8String] ); + + [super sendEvent:anEvent]; +} + +- (void)windowWillClose:(NSNotification *)notification +{ + CreateGameEngineOSX()->Shutdown(); +} + +@end + + +//----------------------------------------------------------------------------- +// Purpose: Constructor for game engine instance +//----------------------------------------------------------------------------- +CGameEngineGL::CGameEngineGL() +{ + g_engine = this; + + m_bEngineReadyForUse = false; + m_bShuttingDown = false; + m_nWindowWidth = 0; + m_nWindowHeight = 0; + m_ulPreviousGameTickCount = 0; + m_ulGameTickCount = 0; + m_unVoiceChannelCount = 0; + + + #if DX9MODE + + m_hwnd = NULL; + m_pD3D9Interface = NULL; + m_pD3D9Device = NULL; + + m_displayDB = NULL; + + m_dwBackgroundColor = D3DCOLOR_ARGB(0, 255, 255, 255 ); + + m_nNextVertBufferHandle = 1; + m_nNextTextureHandle = 1; + + m_hLineBuffer = 0; + m_pLineVertexes = NULL; + m_dwLinesToFlush = 0; + m_dwLineBufferBatchPos = 0; + + m_hPointBuffer = NULL; + m_pPointVertexes = NULL; + m_dwPointsToFlush = 0; + m_dwPointBufferBatchPos = 0; + + m_hQuadBuffer = NULL; + m_pQuadVertexes = NULL; + m_dwQuadsToFlush = 0; + m_dwQuadBufferBatchPos = 0; + + m_hTextureWhite = NULL; + + m_nNextFontHandle = 1; + #else + + m_hTextureWhite = 0; + m_nNextFontHandle = 1; + m_nNextTextureHandle = 1; + m_hLastTexture = 0; + + m_rgflPointsData = new GLfloat[ 3*POINT_BUFFER_TOTAL_SIZE ]; + m_rgflPointsColorData = new GLubyte[ 4*POINT_BUFFER_TOTAL_SIZE ]; + m_dwPointsToFlush = 0; + + m_rgflLinesData = new GLfloat[ 6*LINE_BUFFER_TOTAL_SIZE ]; + m_rgflLinesColorData = new GLubyte[ 8*LINE_BUFFER_TOTAL_SIZE ]; + m_dwLinesToFlush = 0; + + m_rgflQuadsData = new GLfloat [ 12*QUAD_BUFFER_TOTAL_SIZE ]; + m_rgflQuadsColorData = new GLubyte[ 16*QUAD_BUFFER_TOTAL_SIZE ]; + m_rgflQuadsTextureData = new GLfloat[ 8*QUAD_BUFFER_TOTAL_SIZE ]; + m_dwQuadsToFlush = 0; + + #endif + + if( !BInitializeGraphics() ) + { + OutputDebugString( "!! Initializing graphics failed\n" ); + return; + } + + if ( !BInitializeAudio() ) + { + OutputDebugString( "!! Initializing audio failed\n" ); + return; + } + + m_bEngineReadyForUse = true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Shutdown the game engine +//----------------------------------------------------------------------------- +void CGameEngineGL::Shutdown() +{ + // Flag that we are shutting down so the frame loop will stop running + m_bShuttingDown = true; + + #if DX9MODE + #else + if ( m_rgflPointsData ) + { + delete[] m_rgflPointsData; + m_rgflPointsData = NULL; + } + + if ( m_rgflPointsColorData ) + { + delete[] m_rgflPointsColorData; + m_rgflPointsColorData = NULL; + } + + if ( m_rgflLinesData ) + { + delete[] m_rgflLinesData; + m_rgflLinesData = NULL; + } + + if ( m_rgflLinesColorData ) + { + delete[] m_rgflLinesColorData; + m_rgflLinesColorData = NULL; + } + + if ( m_rgflQuadsData ) + { + delete[] m_rgflQuadsData; + m_rgflQuadsData = NULL; + } + + if ( m_rgflQuadsColorData ) + { + delete[] m_rgflQuadsColorData; + m_rgflQuadsColorData = NULL; + } + + if ( m_rgflQuadsTextureData ) + { + delete[] m_rgflQuadsTextureData; + m_rgflQuadsTextureData = NULL; + } + + std::map::const_iterator i; + for (i = m_MapStrings.begin(); i != m_MapStrings.end(); ++i) + { + [i->second release]; + } + + m_MapStrings.clear(); + + m_dwLinesToFlush = 0; + m_dwPointsToFlush = 0; + m_dwQuadsToFlush = 0; + #endif +} + + +//----------------------------------------------------------------------------- +// Purpose: Initialize voice/audio interfaces +//----------------------------------------------------------------------------- +bool CGameEngineGL::BInitializeAudio() +{ + m_palDevice = alcOpenDevice(NULL); + if ( m_palDevice ) + { + m_palContext = alcCreateContext( m_palDevice, NULL ); + alcMakeContextCurrent( m_palContext ); + return true; + } + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: Initialize the GL rendering interfaces and default state +//----------------------------------------------------------------------------- +#define D3DADAPTER_DEFAULT 0 + +bool CGameEngineGL::BInitializeGraphics() +{ + m_nWindowWidth = 1024; + m_nWindowHeight = 768; + + AutoReleasePool pool; + + ProcessSerialNumber psn = { 0, kCurrentProcess }; + TransformProcessType( &psn, kProcessTransformToForegroundApplication ); + [[GLApplication sharedApplication] activateIgnoringOtherApps: YES]; + + uint32_t mask = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskResizable; + + GLuint attribs[] = + { + NSOpenGLPFAAccelerated, + NSOpenGLPFADoubleBuffer, + NSOpenGLPFANoRecovery, + NSOpenGLPFABackingStore, + NSOpenGLPFAColorSize, 32, + NSOpenGLPFADepthSize, 16, + 0 + }; + + NSOpenGLPixelFormat* pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes: (NSOpenGLPixelFormatAttribute*) attribs]; + + NSApplicationLoad(); + + m_view = [[NSOpenGLView alloc] initWithFrame:NSMakeRect( 0, 0, m_nWindowWidth, m_nWindowHeight ) + pixelFormat:pixelFormat]; + + m_view.wantsBestResolutionOpenGLSurface = NO; + + + int wherex = 50; + int wherey = 50; + m_window = [[NSWindow alloc] initWithContentRect:NSMakeRect( wherex, wherey, m_nWindowWidth, m_nWindowHeight ) + styleMask:mask + backing:NSBackingStoreBuffered + defer:NO]; + + [m_window setAcceptsMouseMovedEvents:YES]; + + GLint swapInt = 1; + [[m_view openGLContext] setValues:&swapInt forParameter:NSOpenGLContextParameterSwapInterval]; + [[m_view openGLContext] makeCurrentContext]; + + [m_window setContentView:m_view]; + + [m_window makeKeyAndOrderFront:nil]; + // [m_view setPostsFrameChangedNotifications:YES]; + +#if DX9MODE + GLMgr::NewGLMgr(); // init GL manager + + m_hwnd = (void*) [m_window windowRef]; + + // code transplanted from Windows sample. + if ( !m_pD3D9Interface ) + { + // Initialize the d3d interface + m_pD3D9Interface = Direct3DCreate9( D3D_SDK_VERSION ); + if ( m_pD3D9Interface == NULL ) + { + OutputDebugString( "Direct3DCreate9 failed\n" ); + return false; + } + } + + if ( !m_pD3D9Device ) + { + D3DDISPLAYMODE d3ddisplaymode; + + // Get the current desktop display mode, only needed if running in a window. + HRESULT hRes = m_pD3D9Interface->GetAdapterDisplayMode( D3DADAPTER_DEFAULT, &d3ddisplaymode ); + if (FAILED(hRes)) + { + OutputDebugString( "GetAdapterDisplayMode failed\n"); + return false; + } + + // Setup presentation parameters + ZeroMemory( &m_d3dpp, sizeof( m_d3dpp ) ); + m_d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; + m_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; // no v-sync + m_d3dpp.hDeviceWindow = m_hwnd; + m_d3dpp.BackBufferCount = 1; + m_d3dpp.EnableAutoDepthStencil = TRUE; + m_d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8; + m_d3dpp.Windowed = TRUE; // bugbug jmccaskey - make a parameter? + + m_d3dpp.BackBufferWidth = m_nWindowWidth; + m_d3dpp.BackBufferHeight = m_nWindowHeight; // get it officially later on + m_d3dpp.BackBufferFormat = d3ddisplaymode.Format; + m_d3dpp.BackBufferCount = 1; + + m_d3dpp.MultiSampleType = (D3DMULTISAMPLE_TYPE)0; + m_d3dpp.MultiSampleQuality = 0; + + // Create Direct3D9 device + // (if it fails to create hardware vertex processing, then go with the software alternative). + hRes = m_pD3D9Interface->CreateDevice( + D3DADAPTER_DEFAULT, + D3DDEVTYPE_HAL, + m_hwnd, + D3DCREATE_HARDWARE_VERTEXPROCESSING, + &m_d3dpp, + &m_pD3D9Device ); + + // Could not create a hardware device, create a software one instead (slow....) + if ( FAILED( hRes ) ) + { + hRes = m_pD3D9Interface->CreateDevice( + D3DADAPTER_DEFAULT, + D3DDEVTYPE_HAL, + m_hwnd, + D3DCREATE_SOFTWARE_VERTEXPROCESSING, + &m_d3dpp, + &m_pD3D9Device ); + } + + // If we couldn't create a device even with software vertex processing then + // it's a fatal error + if ( FAILED( hRes ) ) + { + // Make sure the pointer is NULL after failures (seems it sometimes gets modified even when failing) + m_pD3D9Device = NULL; + + OutputDebugString( "Failed to create D3D9 device\n" ); + return false; + } + + //Initialize our render, texture, and sampler stage states + ResetRenderStates(); + } + + [[m_view openGLContext] update]; + +#else + // Clear any errors + glGetError(); + + glClearDepth( 1.0f ); + glClearColor( 0.0f, 0.0f, 0.0f, 1.0f ); + + glEnable( GL_BLEND ); + glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); + + glDisable( GL_CULL_FACE ); + glDisable( GL_ALPHA_TEST ); + glDisable( GL_STENCIL_TEST ); + glDisable( GL_SCISSOR_TEST ); + glDisable( GL_LIGHTING ); + glDisable( GL_DEPTH_TEST ); + glDisable( GL_FOG ); + + glDepthMask( GL_FALSE ); + + // We always need these two + glEnableClientState( GL_COLOR_ARRAY ); + glEnableClientState( GL_VERTEX_ARRAY ); + + // This we'll enable as needed + glDisableClientState( GL_TEXTURE_COORD_ARRAY ); + + glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef( 0, 0, 0 ); + + glMatrixMode( GL_TEXTURE ); + glLoadIdentity(); + glTranslatef( 0, 0, 0 ); + + glDepthRange( 0.0f, 1.0f ); + + AdjustViewport(); +#endif + + return true; +} + +#if DX9MODE + + void CGameEngineGL::ResetRenderStates() + { + // Since we are just a really basic rendering engine we'll setup our initial + // render states here and we can just assume that they don't change later + m_pD3D9Device->SetRenderState( D3DRS_LIGHTING, FALSE ); + m_pD3D9Device->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE ); + m_pD3D9Device->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA ); + m_pD3D9Device->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA ); + + m_pD3D9Device->SetRenderState( D3DRS_ZENABLE, FALSE ); + m_pD3D9Device->SetRenderState( D3DRS_ZWRITEENABLE, FALSE ); + m_pD3D9Device->SetRenderState( D3DRS_COLORWRITEENABLE, (D3DCOLORWRITEENABLE_RED | D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_BLUE | D3DCOLORWRITEENABLE_ALPHA ) ); + m_pD3D9Device->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE ); + + m_pD3D9Device->SetRenderState( D3DRS_ALPHATESTENABLE, FALSE ); + m_pD3D9Device->SetRenderState( D3DRS_STENCILENABLE, FALSE ); + m_pD3D9Device->SetRenderState( D3DRS_FOGENABLE, FALSE ); + m_pD3D9Device->SetRenderState( D3DRS_SCISSORTESTENABLE, FALSE ); + m_pD3D9Device->SetRenderState( D3DRS_CLIPPING, FALSE ); + + + m_pD3D9Device->SetRenderState( D3DRS_LIGHTING, 0 ); + + // texture stage state - not meaningful on all-shader impl + #if 0 + m_pD3D9Device->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE ); + m_pD3D9Device->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE ); + m_pD3D9Device->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_CURRENT ); + m_pD3D9Device->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE ); + m_pD3D9Device->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE ); + m_pD3D9Device->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_CURRENT ); + #endif + + // sampler state + m_pD3D9Device->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR ); + m_pD3D9Device->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR ); + m_pD3D9Device->SetSamplerState( 0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR ); + + // vertex decls + static D3DVERTEXELEMENT9 s_elems_P4C1[] = + { + // stream offset type method usage usageindex + { 0, 0, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_POSITION, 0 }, + { 0, 16, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 0 }, + { 0xFF, 0, 0, 0, 0, 0 } // end marker + }; + + static D3DVERTEXELEMENT9 s_elems_P4C1T2[] = + { + // stream offset type method usage usageindex + { 0, 0, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_POSITION, 0 }, + { 0, 16, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 0 }, + { 0, 20, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_TEXCOORD, 0 }, + { 0xFF, 0, 0, 0, 0, 0 } // end marker + }; + + m_pD3D9Device->CreateVertexDeclaration( s_elems_P4C1, &m_decl_P4C1 ); + m_pD3D9Device->CreateVertexDeclaration( s_elems_P4C1T2, &m_decl_P4C1T2 ); + + // vertex shaders + + static char s_vsh_P4C1[] = + "//GLSLvp\n" + "#version 120 \n" + "//ATTRIBMAP-00-A0-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx \n" + "attribute vec4 v0; \n" + "attribute vec4 v1; \n" + "//SAMPLERMASK-0 \n" + "//HIGHWATER-1 \n" + "uniform vec4 vc[1]; \n" + "varying vec4 oColor; \n" + "void main() \n" + "{ \n" + "vec4 consts = vec4( 0.0, 0.5, 1.0, 2.0 ); \n" + "vec4 bias = vec4( -1.0, -1.0, 0.0, 0.0 ); \n" + "vec4 scaling = vec4( 2.0/800.0, 2.0/600.0, 1.0, 1.0 ); \n" + "vec4 r0; \n" + "vec4 r1; \n" + "vec4 vTempPos; \n" + "oColor = v1; //.wzyx; \n" // flip the channels + "vTempPos = (v0 * scaling) + bias; \n" + "vTempPos.z = vTempPos.z * consts.w - vTempPos.w; // z' = (2*z)-w \n" + "//vTempPos.y = -vTempPos.y; // y' = -y \n" + "gl_Position = vTempPos; \n" + "} \n"; + + static char s_vsh_P4C1T2[] = + "//GLSLvp\n" + "#version 120 \n" + "//ATTRIBMAP-00-A0-50-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx \n" + "attribute vec4 v0; \n" + "attribute vec4 v1; \n" + "attribute vec2 v2; \n" + "//SAMPLERMASK-1 \n" + "//HIGHWATER-1 \n" + "uniform vec4 vc[1]; \n" + "varying vec4 oColor; \n" + "varying vec2 oTexC0; \n" + "void main() \n" + "{ \n" + "vec4 consts = vec4( 0.0, 0.5, 1.0, 2.0 ); \n" + "vec4 bias = vec4( -1.0, -1.0, 0.0, 0.0 ); \n" + "vec4 scaling = vec4( 2.0/800.0, 2.0/600.0, 1.0, 1.0 ); \n" + "vec4 r0; \n" + "vec4 r1; \n" + "vec4 vTempPos; \n" + "oColor = v1; //.wzyx; \n" // flip the channels + "oTexC0 = v2; \n" + "vTempPos = (v0 * scaling)+bias; \n" + "vTempPos.z = vTempPos.z * consts.w - vTempPos.w; // z' = (2*z)-w \n" + "//vTempPos.y = -vTempPos.y; // y' = -y \n" + "gl_Position = vTempPos; \n" + "} \n"; + + + m_pD3D9Device->CreateVertexShader( (const DWORD*) s_vsh_P4C1, &m_vsh_P4C1, "vsh-P4C1", NULL); + m_pD3D9Device->CreateVertexShader( (const DWORD*) s_vsh_P4C1T2, &m_vsh_P4C1T2, "vsh-P4C1T2", NULL); + + static char s_psh_P4C1[] = + "//GLSLfp\n" + "#version 120 \n" + "//SAMPLERMASK-0 \n" + "//HIGHWATER-1 \n" + "varying vec4 oColor; \n" + "uniform vec4 pc[1]; \n" + "void main() \n" + "{ \n" + "gl_FragColor = oColor;\n" + "} \n"; + + static char s_psh_P4C1T2[] = + "//GLSLfp\n" + "#version 120 \n" + "//SAMPLERMASK-1 \n" + "//HIGHWATER-1 \n" + "varying vec4 oColor; \n" + "varying vec2 oTexC0; \n" + "uniform vec4 pc[1]; \n" + "uniform sampler2D sampler0; \n" + "void main() \n" + "{ \n" + "vec4 r0; \n" + "r0 = texture2D( sampler0, oTexC0.xy ); \n" + "r0 = r0 * oColor; \n" + "gl_FragColor = r0; \n" + "} \n"; + + m_pD3D9Device->CreatePixelShader( (const DWORD*) s_psh_P4C1, &m_psh_P4C1, "psh-P4C1", NULL); + m_pD3D9Device->CreatePixelShader( (const DWORD*) s_psh_P4C1T2, &m_psh_P4C1T2, "psh-P4C1T2", NULL); + } + +#else + void CGameEngineGL::AdjustViewport() + { + NSRect viewBounds = [m_view convertRectToBacking:m_view.bounds]; + m_nWindowWidth = viewBounds.size.width; + m_nWindowHeight = viewBounds.size.height; + + // Perspective + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho( 0, m_nWindowWidth, m_nWindowHeight, 0, -1.0f, 1.0f ); + glTranslatef( 0, 0, 0 ); + + // View port has changed as well + glMatrixMode(GL_MODELVIEW); + + glViewport( 0, 0, m_nWindowWidth, m_nWindowHeight ); + glScissor( 0, 0, m_nWindowWidth, m_nWindowHeight ); + + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT ); + glFlush(); + } +#endif + +//----------------------------------------------------------------------------- +// Purpose: Updates current tick count for the game engine +//----------------------------------------------------------------------------- +void CGameEngineGL::UpdateGameTickCount() +{ + m_ulPreviousGameTickCount = m_ulGameTickCount; + m_ulGameTickCount = GetTickCount(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Tell the game engine to sleep for a bit if needed to limit frame rate. You must keep +// calling this repeatedly until it returns false. If it returns true it's slept a little, but more +// time may be needed. +//----------------------------------------------------------------------------- +bool CGameEngineGL::BSleepForFrameRateLimit( uint32 ulMaxFrameRate ) +{ + // Frame rate limiting + float flDesiredFrameMilliseconds = 1000.0f/ulMaxFrameRate; + + uint64 ulGameTickCount = GetTickCount(); + + float flMillisecondsElapsed = (float)(ulGameTickCount - m_ulGameTickCount); + if ( flMillisecondsElapsed < flDesiredFrameMilliseconds ) + { + // If enough time is left sleep, otherwise just keep spinning so we don't go over the limit... + if ( flDesiredFrameMilliseconds - flMillisecondsElapsed > 3.0f ) + { + usleep( 5000 ); + } + else + { + // Just return right away so we busy loop, don't want to sleep too long and go over + } + + return true; + } + else + { + return false; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Set the background color to clear to +//----------------------------------------------------------------------------- +void CGameEngineGL::SetBackgroundColor( short a, short r, short g, short b ) +{ + #if DX9MODE + m_dwBackgroundColor = D3DCOLOR_ARGB( a, r, g, b ); + #else + glClearColor( (float)r/255.0f, (float)g/255.0f, (float)b/255.0f, (float)a/255.0f ); + #endif +} + +//----------------------------------------------------------------------------- +// Purpose: Start a new frame +//----------------------------------------------------------------------------- +bool CGameEngineGL::StartFrame() +{ + #if DX9MODE + m_pD3D9Device->BeginScene(); + #else + AdjustViewport(); + #endif + + // Pump system callbacks + MessagePump(); + + // We may now be shutting down, check and don't start a frame then + if ( BShuttingDown() ) + return false; + + // Poll Steam Input devices + PollSteamInput(); + + #if DX9MODE + uint bkcolor = m_dwBackgroundColor; + + #if 0 // for debug + static unsigned char counter; + counter++; + bkcolor = ((uint)counter * 0x01010101) | 0xFF000000; + + bkcolor = 0x20202020; + #endif + + m_pD3D9Device->Clear( 0, NULL, D3DCLEAR_TARGET, bkcolor, 0, 0 ); + #else + #if 0 // for debug + static unsigned char counter; + counter++; + glClearColor( (float)counter/255.0f, (float)counter/255.0f, (float)counter/255.0f, (float)1.0f ); + #endif + + // Clear the screen for the new frame + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT ); + #endif + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: End the current frame +//----------------------------------------------------------------------------- +void CGameEngineGL::EndFrame() +{ + if ( BShuttingDown() ) + return; + + // Flush point buffer + BFlushPointBuffer(); + + // Flush line buffer + BFlushLineBuffer(); + + // Flush quad buffer + BFlushQuadBuffer(); + + #if DX9MODE + m_pD3D9Device->EndScene(); + m_pD3D9Device->Present( NULL, NULL, NULL, NULL ); + #else + // Swap buffers now that everything is flushed + [[m_view openGLContext] flushBuffer]; + #endif + + RunAudio(); +} + +#if DX9MODE + +//----------------------------------------------------------------------------- +// Purpose: Creates a new vertex buffer +//----------------------------------------------------------------------------- +HGAMEVERTBUF CGameEngineGL::HCreateVertexBuffer( uint32 nSizeInBytes, DWORD dwUsage, DWORD dwFVF ) +{ + if ( !m_pD3D9Device ) + return false; + + // Create a vertex buffer object + IDirect3DVertexBuffer9 *pVertBuffer; + HRESULT hRes = m_pD3D9Device->CreateVertexBuffer( nSizeInBytes, dwUsage, + dwFVF, D3DPOOL_DEFAULT, &pVertBuffer, NULL ); + if ( FAILED( hRes ) ) + { + OutputDebugString( "Failed creating vertex buffer\n" ); + return 0; + } + + HGAMEVERTBUF hVertBuf = m_nNextVertBufferHandle; + ++m_nNextVertBufferHandle; + + VertBufData_t data; + data.m_bIsLocked = false; + data.m_pBuffer = pVertBuffer; + + m_MapVertexBuffers[ hVertBuf ] = data; + return hVertBuf; +} + + +//----------------------------------------------------------------------------- +// Purpose: Locks an entire vertex buffer with the specified flags into memory +//----------------------------------------------------------------------------- +bool CGameEngineGL::BLockEntireVertexBuffer( HGAMEVERTBUF hVertBuf, void **ppVoid, DWORD dwFlags ) +{ + if ( !m_pD3D9Device ) + return false; + + if ( !hVertBuf ) + { + OutputDebugString( "Someone is calling BLockEntireVertexBuffer() with a null handle\n" ); + return false; + } + + // Find the vertex buffer object for the passed handle + std::map::iterator iter; + iter = m_MapVertexBuffers.find( hVertBuf ); + if ( iter == m_MapVertexBuffers.end() ) + { + OutputDebugString( "Invalid vertex buffer handle passed to BLockEntireVertexBuffer()\n" ); + return false; + } + + // Make sure the pointer is valid + if ( !iter->second.m_pBuffer ) + { + OutputDebugString( "Pointer to vertex buffer is invalid (lost device and not recreated?)!\n" ); + return false; + } + + + // Make sure its not already locked + if ( iter->second.m_bIsLocked ) + { + OutputDebugString( "Trying to lock an already locked vertex buffer!\n" ); + return false; + } + + // we have the buffer, try to lock it + if( FAILED( iter->second.m_pBuffer->Lock( 0, 0, ppVoid, dwFlags ) ) ) + { + OutputDebugString( "BLockEntireVertexBuffer call failed\n" ); + return false; + } + + // Track that we are now locked + iter->second.m_bIsLocked = true; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Unlocks a vertex buffer +//----------------------------------------------------------------------------- +bool CGameEngineGL::BUnlockVertexBuffer( HGAMEVERTBUF hVertBuf ) +{ + if ( !m_pD3D9Device ) + return false; + + if ( !hVertBuf ) + { + OutputDebugString( "Someone is calling BUnlockVertexBuffer() with a null handle\n" ); + return false; + } + + // Find the vertex buffer for the passed handle + std::map::iterator iter; + iter = m_MapVertexBuffers.find( hVertBuf ); + if ( iter == m_MapVertexBuffers.end() ) + { + OutputDebugString( "Invalid vertex buffer handle passed to BUnlockVertexBuffer()\n" ); + return false; + } + + // Make sure the pointer is valid + if ( !iter->second.m_pBuffer ) + { + OutputDebugString( "Pointer to vertex buffer is invalid (lost device and not recreated?)!\n" ); + return false; + } + + // Make sure we are locked if someone is trying to unlock + if ( !iter->second.m_bIsLocked ) + { + OutputDebugString( "Trying to unlock a vertex buffer that is not locked!\n" ); + return false; + } + + // we have the buffer, try to lock it + if( FAILED( iter->second.m_pBuffer->Unlock() ) ) + { + OutputDebugString( "BUnlockVertexBuffer call failed\n" ); + return false; + } + + // Track that we are now unlocked + iter->second.m_bIsLocked = false; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Release a vertex buffer and free its resources +//----------------------------------------------------------------------------- +bool CGameEngineGL::BReleaseVertexBuffer( HGAMEVERTBUF hVertBuf ) +{ + if ( !m_pD3D9Device ) + return false; + + if ( !hVertBuf ) + { + OutputDebugString( "Someone is calling BReleaseVertexBuffer() with a null handle\n" ); + return false; + } + + // Find the vertex buffer object for the passed handle + std::map::iterator iter; + iter = m_MapVertexBuffers.find( hVertBuf ); + if ( iter == m_MapVertexBuffers.end() ) + { + OutputDebugString( "Invalid vertex buffer handle passed to BReleaseVertexBuffer()\n" ); + return false; + } + + // Make sure the pointer is valid + if ( !iter->second.m_pBuffer ) + { + OutputDebugString( "Pointer to vertex buffer is invalid (lost device and not recreated?)!\n" ); + return false; + } + + // Make sure its unlocked, if it isn't locked this will just fail quietly + if ( iter->second.m_bIsLocked ) + iter->second.m_pBuffer->Unlock(); + + // Release the resources + iter->second.m_pBuffer->Release(); + + // Remove from the map + m_MapVertexBuffers.erase( iter ); + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: set vertex decl +//----------------------------------------------------------------------------- +bool CGameEngineGL::BSetVertexDeclaration( IDirect3DVertexDeclaration9 *decl ) +{ + if ( !m_pD3D9Device ) + return false; + + m_pD3D9Device->SetVertexDeclaration( decl ); + + return true; +} + +//----------------------------------------------------------------------------- +// Purpose: set stream source +//----------------------------------------------------------------------------- +bool CGameEngineGL::BSetStreamSource( uint streamNumber, HGAMEVERTBUF hVertBuf, uint32 uOffset, uint32 uStride ) +{ + if ( !m_pD3D9Device ) + return false; + + std::map::iterator iter; + iter = m_MapVertexBuffers.find( hVertBuf ); + if ( iter == m_MapVertexBuffers.end() ) + { + OutputDebugString( "Invalid vertex buffer handle passed to BSetStreamSource()\n" ); + return false; + } + + // Make sure the pointer is valid + if ( !iter->second.m_pBuffer ) + { + OutputDebugString( "Pointer to vertex buffer is invalid (lost device and not recreated?)!\n" ); + return false; + } + + // buffer located, pass it to set stream source call + m_pD3D9Device->SetStreamSource( streamNumber, iter->second.m_pBuffer, uOffset, uStride ); + + return true; +} + +//----------------------------------------------------------------------------- +// Purpose: Set shader pair for rendering +//----------------------------------------------------------------------------- +bool CGameEngineGL::BSetShaders( IDirect3DVertexShader9 *vsh, IDirect3DPixelShader9 *psh ) +{ + if ( !m_pD3D9Device ) + return false; + + m_pD3D9Device->SetVertexShader( vsh ); + m_pD3D9Device->SetPixelShader( psh ); + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Render primitives out of the current stream source +//----------------------------------------------------------------------------- +bool CGameEngineGL::BRenderPrimitive( D3DPRIMITIVETYPE primType, uint32 uStartVertex, uint32 uCount ) +{ + if ( !m_pD3D9Device ) + return false; + + if ( FAILED( m_pD3D9Device->DrawPrimitive( primType, uStartVertex, uCount ) ) ) + { + OutputDebugString( "BRenderPrimitive() call failed\n" ); + return false; + } + + return true; +} + +bool CGameEngineGL::BUberRenderPrimitive( IDirect3DVertexShader9 *vsh, + IDirect3DPixelShader9 *psh, + IDirect3DVertexDeclaration9 *decl, + uint streamNumber, + HGAMEVERTBUF hVertBuf, + uint32 uOffset, + uint32 uStride, + D3DPRIMITIVETYPE primType, + uint32 uStartVertex, + uint32 uCount ) +{ + if ( !m_pD3D9Device ) + return false; + + bool bRes = false; + bRes |= BSetShaders ( vsh, psh ); + bRes |= BSetVertexDeclaration ( decl ); + bRes |= BSetStreamSource ( streamNumber, hVertBuf, 0 /*uOffset*/, uStride ); // streams are based at start of buffer + bRes |= BRenderPrimitive ( primType, uStartVertex, uCount ); // uStartVertex advances the fetch offset from the base + + return bRes; +} + + + +#endif + +//----------------------------------------------------------------------------- +// Purpose: Draw a line, the engine internally manages a vertex buffer for batching these +//----------------------------------------------------------------------------- +bool CGameEngineGL::BDrawLine( float xPos0, float yPos0, DWORD dwColor0, float xPos1, float yPos1, DWORD dwColor1 ) +{ + if ( m_bShuttingDown ) + return false; + + #if DX9MODE + if ( !m_pD3D9Device ) + return false; + + if ( !m_hLineBuffer ) + { + // Create the line buffer + m_hLineBuffer = HCreateVertexBuffer( sizeof( LineVertex_t ) * LINE_BUFFER_TOTAL_SIZE * 2, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFVF_XYZRHW | D3DFVF_DIFFUSE ); + + if ( !m_hLineBuffer ) + { + OutputDebugString( "Can't BDrawLine() because vertex buffer creation failed\n" ); + return false; + } + } + + // Check if we are out of room and need to flush the buffer + if ( m_dwLinesToFlush == LINE_BUFFER_BATCH_SIZE ) + { + BFlushLineBuffer(); + } + + // Lock the vertex buffer into memory + if ( !m_pLineVertexes ) + { + if ( !BLockEntireVertexBuffer( m_hLineBuffer, (void**)&m_pLineVertexes, m_dwLineBufferBatchPos ? D3DLOCK_NOOVERWRITE : D3DLOCK_DISCARD ) ) + { + m_pLineVertexes = NULL; + OutputDebugString( "BDrawLine failed because locking vertex buffer failed\n" ); + return false; + } + } + + LineVertex_t *pVertData = &m_pLineVertexes[ m_dwLineBufferBatchPos*2+m_dwLinesToFlush*2 ]; + pVertData[0].rhw = 1.0; + pVertData[0].z = 1.0; + pVertData[0].x = xPos0; + pVertData[0].y = yPos0; + pVertData[0].color = dwColor0; + + pVertData[1].rhw = 1.0; + pVertData[1].z = 1.0; + pVertData[1].x = xPos1; + pVertData[1].y = yPos1; + pVertData[1].color = dwColor1; + + ++m_dwLinesToFlush; + #else + // Check if we are out of room and need to flush the buffer + if ( m_dwLinesToFlush == LINE_BUFFER_TOTAL_SIZE ) + { + BFlushLineBuffer(); + } + + DWORD dwOffset = m_dwLinesToFlush*6; + m_rgflLinesData[dwOffset] = xPos0; + m_rgflLinesData[dwOffset+1] = yPos0; + m_rgflLinesData[dwOffset+2] = 1.0; + m_rgflLinesData[dwOffset+3] = xPos1; + m_rgflLinesData[dwOffset+4] = yPos1; + m_rgflLinesData[dwOffset+5] = 1.0; + + dwOffset = m_dwLinesToFlush*8; + m_rgflLinesColorData[dwOffset] = COLOR_RED( dwColor0 ); + m_rgflLinesColorData[dwOffset+1] = COLOR_GREEN( dwColor0 ); + m_rgflLinesColorData[dwOffset+2] = COLOR_BLUE( dwColor0 ); + m_rgflLinesColorData[dwOffset+3] = COLOR_ALPHA( dwColor0 ); + m_rgflLinesColorData[dwOffset+4] = COLOR_RED( dwColor1 ); + m_rgflLinesColorData[dwOffset+5] = COLOR_GREEN( dwColor1 ); + m_rgflLinesColorData[dwOffset+6] = COLOR_BLUE( dwColor1 ); + m_rgflLinesColorData[dwOffset+7] = COLOR_ALPHA( dwColor1 ); + + ++m_dwLinesToFlush; + #endif + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Flush batched lines to the screen +//----------------------------------------------------------------------------- +bool CGameEngineGL::BFlushLineBuffer() +{ + #if DX9MODE + // If the vert buffer isn't already locked into memory, then there is nothing to flush + if ( m_pLineVertexes == NULL ) + return true; // consider this successful since there was no error + + // OK, it is locked, so unlock now + if ( !BUnlockVertexBuffer( m_hLineBuffer ) ) + { + OutputDebugString( "Failed flushing line buffer because BUnlockVertexBuffer failed\n" ); + return false; + } + + // Clear the memory pointer as its invalid now that we unlocked + m_pLineVertexes = NULL; + + // If there is nothing to actual flush, we are done + if ( m_dwLinesToFlush == 0 ) + return true; + + BUberRenderPrimitive( m_vsh_P4C1, m_psh_P4C1, m_decl_P4C1, 0, m_hLineBuffer, 0, sizeof( LineVertex_t ), D3DPT_LINELIST, m_dwLineBufferBatchPos*2, m_dwLinesToFlush ); + + m_dwLinesToFlush = 0; + m_dwLineBufferBatchPos += LINE_BUFFER_BATCH_SIZE; + if ( m_dwLineBufferBatchPos >= LINE_BUFFER_TOTAL_SIZE ) + { + m_dwLineBufferBatchPos = 0; + } + + return true; + #else + if ( !m_rgflLinesColorData || !m_rgflLinesData || m_bShuttingDown ) + return false; + + if ( m_dwLinesToFlush ) + { + glColorPointer( 4, GL_UNSIGNED_BYTE, 0, m_rgflLinesColorData ); + glVertexPointer( 3, GL_FLOAT, 0, m_rgflLinesData ); + glDrawArrays( GL_LINES, 0, m_dwLinesToFlush*2 ); + + m_dwLinesToFlush = 0; + } + #endif + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Draw a point, the engine internally manages a vertex buffer for batching these +//----------------------------------------------------------------------------- +bool CGameEngineGL::BDrawPoint( float xPos, float yPos, DWORD dwColor ) +{ + if ( m_bShuttingDown ) + return false; + + + #if DX9MODE + if ( !m_pD3D9Device ) + return false; + + if ( !m_hPointBuffer ) + { + // Create the point buffer + m_hPointBuffer = HCreateVertexBuffer( sizeof( PointVertex_t ) * POINT_BUFFER_TOTAL_SIZE * 2, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFVF_XYZRHW | D3DFVF_DIFFUSE ); + + if ( !m_hPointBuffer ) + { + OutputDebugString( "Can't BDrawPoint() because vertex buffer creation failed\n" ); + return false; + } + } + + // Check if we are out of room and need to flush the buffer + if ( m_dwPointsToFlush == POINT_BUFFER_BATCH_SIZE ) + { + BFlushPointBuffer(); + } + + // Set FVF + //if ( !BSetFVF( D3DFVF_XYZRHW | D3DFVF_DIFFUSE ) ) + // return false; + + // Lock the vertex buffer into memory + if ( !m_pPointVertexes ) + { + if ( !BLockEntireVertexBuffer( m_hPointBuffer, (void**)&m_pPointVertexes, m_dwPointBufferBatchPos+m_dwPointsToFlush ? D3DLOCK_NOOVERWRITE : D3DLOCK_DISCARD ) ) + { + m_pPointVertexes = NULL; + OutputDebugString( "BDrawPoint failed because locking vertex buffer failed\n" ); + return false; + } + } + + PointVertex_t *pVertData = &m_pPointVertexes[ m_dwPointBufferBatchPos+m_dwPointsToFlush ]; + pVertData[0].rhw = 1.0; + pVertData[0].z = 1.0; + pVertData[0].x = xPos; + pVertData[0].y = yPos; + pVertData[0].color = dwColor; + + ++m_dwPointsToFlush; + + #else + // Check if we are out of room and need to flush the buffer + if ( m_dwPointsToFlush == POINT_BUFFER_TOTAL_SIZE ) + { + BFlushPointBuffer(); + } + + DWORD dwOffset = m_dwPointsToFlush*3; + m_rgflPointsData[dwOffset] = xPos; + m_rgflPointsData[dwOffset+1] = yPos; + m_rgflPointsData[dwOffset+2] = 1.0; + + dwOffset = m_dwPointsToFlush*4; + m_rgflPointsColorData[dwOffset] = COLOR_RED( dwColor ); + m_rgflPointsColorData[dwOffset+1] = COLOR_GREEN( dwColor ); + m_rgflPointsColorData[dwOffset+2] = COLOR_BLUE( dwColor ); + m_rgflPointsColorData[dwOffset+3] = COLOR_ALPHA( dwColor ); + + ++m_dwPointsToFlush; + #endif + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Flush batched points to the screen +//----------------------------------------------------------------------------- +bool CGameEngineGL::BFlushPointBuffer() +{ + #if DX9MODE + #if 1 + // If the vert buffer isn't already locked into memory, then there is nothing to flush + if ( m_pPointVertexes == NULL ) + return true; // consider this successful since there was no error + + // OK, it is locked, so unlock now + if ( !BUnlockVertexBuffer( m_hPointBuffer ) ) + { + OutputDebugString( "Failed flushing point buffer because BUnlockVertexBuffer failed\n" ); + return false; + } + + // Clear the memory pointer as its invalid now that we unlocked + m_pPointVertexes = NULL; + + // If there is nothing to actual flush, we are done + if ( m_dwPointsToFlush == 0 ) + return true; + + BUberRenderPrimitive( m_vsh_P4C1, m_psh_P4C1, m_decl_P4C1, 0, m_hPointBuffer, 0, sizeof( PointVertex_t ), D3DPT_POINTLIST, m_dwPointBufferBatchPos, m_dwPointsToFlush ); + + m_dwPointsToFlush = 0; + m_dwPointBufferBatchPos += POINT_BUFFER_BATCH_SIZE; + if ( m_dwPointBufferBatchPos >= POINT_BUFFER_TOTAL_SIZE ) + { + m_dwPointBufferBatchPos = 0; + } + #endif + m_dwPointsToFlush = 0; + #else + if ( !m_rgflPointsColorData || !m_rgflPointsData || m_bShuttingDown ) + return false; + + if ( m_dwPointsToFlush ) + { + glColorPointer( 4, GL_UNSIGNED_BYTE, 0, m_rgflPointsColorData ); + glVertexPointer( 3, GL_FLOAT, 0, m_rgflPointsData ); + glDrawArrays( GL_POINTS, 0, m_dwPointsToFlush ); + + m_dwPointsToFlush = 0; + } + #endif + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Draw a filled quad +//----------------------------------------------------------------------------- +bool CGameEngineGL::BDrawFilledRect( float xPos0, float yPos0, float xPos1, float yPos1, DWORD dwColor ) +{ + #if DX9MODE + if ( !m_hTextureWhite ) + { + #if 0 // debug gradient + byte *pRGBAData = new byte[ 16 * 16 * 4 ]; + for( uint y = 0; y< 16; y++) + { + for( uint x = 0; x< 16; x++) + { + byte *dest = pRGBAData + (y*64) + (x*4); + dest[0] = 0xFF; + dest[1] = y * 0x11; + dest[2] = x * 0x11; + dest[3] = 0xFF; + } + } + m_hTextureWhite = HCreateTexture( pRGBAData, 16, 16 ); + #else + byte *pRGBAData = new byte[ 1 * 1 * 4 ]; + memset( pRGBAData, 255, 1*1*4 ); + m_hTextureWhite = HCreateTexture( pRGBAData, 1, 1 ); + #endif + + delete[] pRGBAData; + } + + return BDrawTexturedRect( xPos0, yPos0, xPos1, yPos1, 0.0f, 0.0f, 1.0f, 1.0f, dwColor, m_hTextureWhite ); + #else + if ( !m_hTextureWhite ) + { + byte *pRGBAData = new byte[ 1 * 1 * 4 ]; + memset( pRGBAData, 255, 1*1*4 ); + m_hTextureWhite = HCreateTexture( pRGBAData, 1, 1 ); + delete[] pRGBAData; + } + + return BDrawTexturedRect( xPos0, yPos0, xPos1, yPos1, 0.0f, 0.0f, 1.0f, 1.0f, dwColor, m_hTextureWhite ); + #endif +} + + +//----------------------------------------------------------------------------- +// Purpose: Draw a textured rect +//----------------------------------------------------------------------------- +bool CGameEngineGL::BDrawTexturedRect( float xPos0, float yPos0, float xPos1, float yPos1, float u0, float v0, float u1, float v1, DWORD dwColor, HGAMETEXTURE hTexture ) +{ + if ( m_bShuttingDown ) + return false; + + #if DX9MODE + if ( !m_pD3D9Device ) + return false; + + // Find the texture + std::map::iterator iter; + iter = m_MapTextures.find( hTexture ); + if ( iter == m_MapTextures.end() ) + { + OutputDebugString( "BDrawTexturedRect called with invalid hTexture value\n" ); + return false; + } + + if ( !m_hQuadBuffer ) + { + // Create the line buffer + m_hQuadBuffer = HCreateVertexBuffer( sizeof( TexturedQuadVertex_t ) * QUAD_BUFFER_TOTAL_SIZE * 4, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1 ); + + if ( !m_hQuadBuffer ) + { + OutputDebugString( "Can't BDrawTexturedRect() because vertex buffer creation failed\n" ); + return false; + } + } + + // Check if we are out of room and need to flush the buffer + if ( m_dwQuadsToFlush == QUAD_BUFFER_BATCH_SIZE ) + { + BFlushQuadBuffer(); + } + + // Check if the texture changed so we need to flush the buffer + if ( m_hLastTexture != hTexture ) + { + BFlushQuadBuffer(); + } + + // Save the texture to use for next flush + m_hLastTexture = hTexture; + + // Lock the vertex buffer into memory + if ( !m_pQuadVertexes ) + { + if ( !BLockEntireVertexBuffer( m_hQuadBuffer, (void**)&m_pQuadVertexes, m_dwQuadBufferBatchPos ? D3DLOCK_NOOVERWRITE : D3DLOCK_DISCARD ) ) + { + m_pQuadVertexes = NULL; + OutputDebugString( "BDrawTexturedRect failed because locking vertex buffer failed\n" ); + return false; + } + } + + TexturedQuadVertex_t *pVertData = &m_pQuadVertexes[ m_dwQuadBufferBatchPos*4+m_dwQuadsToFlush*4 ]; + + #if GLMDEBUG && 0 + GLMPRINTF(("-D- m_dwQuadBufferBatchPos = %d, m_dwQuadsToFlush = %d, net vertex index = %d(offset $%08x), m_pQuadVertexes is %08x, pVertData is %08x " , + m_dwQuadBufferBatchPos, + m_dwQuadsToFlush, + m_dwQuadBufferBatchPos*4+m_dwQuadsToFlush*4, + (m_dwQuadBufferBatchPos*4+m_dwQuadsToFlush*4) * sizeof( m_pQuadVertexes[0] ), + m_pQuadVertexes, + pVertData + )); + #endif + pVertData[0].color = dwColor; + pVertData[0].rhw = 1.0f; + pVertData[0].z = 1.0f; + pVertData[0].x = xPos0; + pVertData[0].y = yPos0; + pVertData[0].u = u0; + pVertData[0].v = v0; + + pVertData[1].color = dwColor; + pVertData[1].rhw = 1.0f; + pVertData[1].z = 1.0f; + pVertData[1].x = xPos1; + pVertData[1].y = yPos0; + pVertData[1].u = u1; + pVertData[1].v = v0; + + pVertData[2].color = dwColor; + pVertData[2].rhw = 1.0f; + pVertData[2].z = 1.0f; + pVertData[2].x = xPos0; + pVertData[2].y = yPos1; + pVertData[2].u = u0; + pVertData[2].v = v1; + + pVertData[3].color = dwColor; + pVertData[3].rhw = 1.0f; + pVertData[3].z = 1.0f; + pVertData[3].x = xPos1; + pVertData[3].y = yPos1; + pVertData[3].u = u1; + pVertData[3].v = v1; + + ++m_dwQuadsToFlush; + #else + // Find the texture + std::map::iterator iter; + iter = m_MapTextures.find( hTexture ); + if ( iter == m_MapTextures.end() ) + { + OutputDebugString( "BDrawTexturedQuad called with invalid hTexture value\n" ); + return false; + } + + // Check if we are out of room and need to flush the buffer, or if our texture is changing + // then we also need to flush the buffer. + if ( m_dwQuadsToFlush == QUAD_BUFFER_TOTAL_SIZE || m_hLastTexture != hTexture ) + { + BFlushQuadBuffer(); + } + + // Bind the new texture + glBindTexture( GL_TEXTURE_2D, iter->second.m_uTextureID ); + + DWORD dwOffset = m_dwQuadsToFlush*12; + m_rgflQuadsData[dwOffset] = xPos0; + m_rgflQuadsData[dwOffset+1] = yPos0; + m_rgflQuadsData[dwOffset+2] = 1.0; + m_rgflQuadsData[dwOffset+3] = xPos1; + m_rgflQuadsData[dwOffset+4] = yPos0; + m_rgflQuadsData[dwOffset+5] = 1.0; + m_rgflQuadsData[dwOffset+6] = xPos1; + m_rgflQuadsData[dwOffset+7] = yPos1; + m_rgflQuadsData[dwOffset+8] = 1.0; + m_rgflQuadsData[dwOffset+9] = xPos0; + m_rgflQuadsData[dwOffset+10] = yPos1; + m_rgflQuadsData[dwOffset+11] = 1.0; + + dwOffset = m_dwQuadsToFlush*16; + m_rgflQuadsColorData[dwOffset] = COLOR_RED( dwColor ); + m_rgflQuadsColorData[dwOffset+1] = COLOR_GREEN( dwColor ); + m_rgflQuadsColorData[dwOffset+2] = COLOR_BLUE( dwColor ); + m_rgflQuadsColorData[dwOffset+3] = COLOR_ALPHA( dwColor ); + m_rgflQuadsColorData[dwOffset+4] = COLOR_RED( dwColor ); + m_rgflQuadsColorData[dwOffset+5] = COLOR_GREEN( dwColor ); + m_rgflQuadsColorData[dwOffset+6] = COLOR_BLUE( dwColor ); + m_rgflQuadsColorData[dwOffset+7] = COLOR_ALPHA( dwColor ); + m_rgflQuadsColorData[dwOffset+8] = COLOR_RED( dwColor ); + m_rgflQuadsColorData[dwOffset+9] = COLOR_GREEN( dwColor ); + m_rgflQuadsColorData[dwOffset+10] = COLOR_BLUE( dwColor ); + m_rgflQuadsColorData[dwOffset+11] = COLOR_ALPHA( dwColor ); + m_rgflQuadsColorData[dwOffset+12] = COLOR_RED( dwColor ); + m_rgflQuadsColorData[dwOffset+13] = COLOR_GREEN( dwColor ); + m_rgflQuadsColorData[dwOffset+14] = COLOR_BLUE( dwColor ); + m_rgflQuadsColorData[dwOffset+15] = COLOR_ALPHA( dwColor ); + + dwOffset = m_dwQuadsToFlush*8; + m_rgflQuadsTextureData[dwOffset] = u0; + m_rgflQuadsTextureData[dwOffset+1] = v0; + m_rgflQuadsTextureData[dwOffset+2] = u1; + m_rgflQuadsTextureData[dwOffset+3] = v0; + m_rgflQuadsTextureData[dwOffset+4] = u1; + m_rgflQuadsTextureData[dwOffset+5] = v1; + m_rgflQuadsTextureData[dwOffset+6] = u0; + m_rgflQuadsTextureData[dwOffset+7] = v1; + + + ++m_dwQuadsToFlush; + #endif + + return true; +} + +//----------------------------------------------------------------------------- +// Purpose: Draw a textured rect +//----------------------------------------------------------------------------- +bool CGameEngineGL::BDrawTexturedQuad( float xPos0, float yPos0, float xPos1, float yPos1, float xPos2, float yPos2, float xPos3, float yPos3, + float u0, float v0, float u1, float v1, DWORD dwColor, HGAMETEXTURE hTexture ) +{ + if ( m_bShuttingDown ) + return false; + + #if DX9MODE + if ( !m_pD3D9Device ) + return false; + + // Find the texture + std::map::iterator iter; + iter = m_MapTextures.find( hTexture ); + if ( iter == m_MapTextures.end() ) + { + OutputDebugString( "BDrawTexturedRect called with invalid hTexture value\n" ); + return false; + } + + if ( !m_hQuadBuffer ) + { + // Create the line buffer + m_hQuadBuffer = HCreateVertexBuffer( sizeof( TexturedQuadVertex_t ) * QUAD_BUFFER_TOTAL_SIZE * 4, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1 ); + + if ( !m_hQuadBuffer ) + { + OutputDebugString( "Can't BDrawTexturedRect() because vertex buffer creation failed\n" ); + return false; + } + } + + // Check if we are out of room and need to flush the buffer + if ( m_dwQuadsToFlush == QUAD_BUFFER_BATCH_SIZE ) + { + BFlushQuadBuffer(); + } + + // Check if the texture changed so we need to flush the buffer + if ( m_hLastTexture != hTexture ) + { + BFlushQuadBuffer(); + } + + // Save the texture to use for next flush + m_hLastTexture = hTexture; + + // Lock the vertex buffer into memory + if ( !m_pQuadVertexes ) + { + if ( !BLockEntireVertexBuffer( m_hQuadBuffer, (void**)&m_pQuadVertexes, m_dwQuadBufferBatchPos ? D3DLOCK_NOOVERWRITE : D3DLOCK_DISCARD ) ) + { + m_pQuadVertexes = NULL; + OutputDebugString( "BDrawTexturedRect failed because locking vertex buffer failed\n" ); + return false; + } + } + + TexturedQuadVertex_t *pVertData = &m_pQuadVertexes[ m_dwQuadBufferBatchPos*4+m_dwQuadsToFlush*4 ]; + + #if GLMDEBUG && 0 + GLMPRINTF(("-D- m_dwQuadBufferBatchPos = %d, m_dwQuadsToFlush = %d, net vertex index = %d(offset $%08x), m_pQuadVertexes is %08x, pVertData is %08x " , + m_dwQuadBufferBatchPos, + m_dwQuadsToFlush, + m_dwQuadBufferBatchPos*4+m_dwQuadsToFlush*4, + (m_dwQuadBufferBatchPos*4+m_dwQuadsToFlush*4) * sizeof( m_pQuadVertexes[0] ), + m_pQuadVertexes, + pVertData + )); + #endif + pVertData[0].color = dwColor; + pVertData[0].rhw = 1.0f; + pVertData[0].z = 1.0f; + pVertData[0].x = xPos0; + pVertData[0].y = yPos0; + pVertData[0].u = u0; + pVertData[0].v = v0; + + pVertData[1].color = dwColor; + pVertData[1].rhw = 1.0f; + pVertData[1].z = 1.0f; + pVertData[1].x = xPos1; + pVertData[1].y = yPos1; + pVertData[1].u = u1; + pVertData[1].v = v0; + + pVertData[2].color = dwColor; + pVertData[2].rhw = 1.0f; + pVertData[2].z = 1.0f; + pVertData[2].x = xPos2; + pVertData[2].y = yPos2; + pVertData[2].u = u0; + pVertData[2].v = v1; + + pVertData[3].color = dwColor; + pVertData[3].rhw = 1.0f; + pVertData[3].z = 1.0f; + pVertData[3].x = xPos3; + pVertData[3].y = yPos3; + pVertData[3].u = u1; + pVertData[3].v = v1; + + ++m_dwQuadsToFlush; + #else + // Find the texture + std::map::iterator iter; + iter = m_MapTextures.find( hTexture ); + if ( iter == m_MapTextures.end() ) + { + OutputDebugString( "BDrawTexturedQuad called with invalid hTexture value\n" ); + return false; + } + + // Check if we are out of room and need to flush the buffer, or if our texture is changing + // then we also need to flush the buffer. + if ( m_dwQuadsToFlush == QUAD_BUFFER_TOTAL_SIZE || m_hLastTexture != hTexture ) + { + BFlushQuadBuffer(); + } + + // Bind the new texture + glBindTexture( GL_TEXTURE_2D, iter->second.m_uTextureID ); + + DWORD dwOffset = m_dwQuadsToFlush*12; + m_rgflQuadsData[dwOffset] = xPos0; + m_rgflQuadsData[dwOffset+1] = yPos0; + m_rgflQuadsData[dwOffset+2] = 1.0; + m_rgflQuadsData[dwOffset+3] = xPos1; + m_rgflQuadsData[dwOffset+4] = yPos1; + m_rgflQuadsData[dwOffset+5] = 1.0; + m_rgflQuadsData[dwOffset+6] = xPos2; + m_rgflQuadsData[dwOffset+7] = yPos2; + m_rgflQuadsData[dwOffset+8] = 1.0; + m_rgflQuadsData[dwOffset+9] = xPos3; + m_rgflQuadsData[dwOffset+10] = yPos3; + m_rgflQuadsData[dwOffset+11] = 1.0; + + dwOffset = m_dwQuadsToFlush*16; + m_rgflQuadsColorData[dwOffset] = COLOR_RED( dwColor ); + m_rgflQuadsColorData[dwOffset+1] = COLOR_GREEN( dwColor ); + m_rgflQuadsColorData[dwOffset+2] = COLOR_BLUE( dwColor ); + m_rgflQuadsColorData[dwOffset+3] = COLOR_ALPHA( dwColor ); + m_rgflQuadsColorData[dwOffset+4] = COLOR_RED( dwColor ); + m_rgflQuadsColorData[dwOffset+5] = COLOR_GREEN( dwColor ); + m_rgflQuadsColorData[dwOffset+6] = COLOR_BLUE( dwColor ); + m_rgflQuadsColorData[dwOffset+7] = COLOR_ALPHA( dwColor ); + m_rgflQuadsColorData[dwOffset+8] = COLOR_RED( dwColor ); + m_rgflQuadsColorData[dwOffset+9] = COLOR_GREEN( dwColor ); + m_rgflQuadsColorData[dwOffset+10] = COLOR_BLUE( dwColor ); + m_rgflQuadsColorData[dwOffset+11] = COLOR_ALPHA( dwColor ); + m_rgflQuadsColorData[dwOffset+12] = COLOR_RED( dwColor ); + m_rgflQuadsColorData[dwOffset+13] = COLOR_GREEN( dwColor ); + m_rgflQuadsColorData[dwOffset+14] = COLOR_BLUE( dwColor ); + m_rgflQuadsColorData[dwOffset+15] = COLOR_ALPHA( dwColor ); + + dwOffset = m_dwQuadsToFlush*8; + m_rgflQuadsTextureData[dwOffset] = u0; + m_rgflQuadsTextureData[dwOffset+1] = v0; + m_rgflQuadsTextureData[dwOffset+2] = u1; + m_rgflQuadsTextureData[dwOffset+3] = v0; + m_rgflQuadsTextureData[dwOffset+4] = u1; + m_rgflQuadsTextureData[dwOffset+5] = v1; + m_rgflQuadsTextureData[dwOffset+6] = u0; + m_rgflQuadsTextureData[dwOffset+7] = v1; + + + ++m_dwQuadsToFlush; + #endif + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Flush buffered quads +//----------------------------------------------------------------------------- +bool CGameEngineGL::BFlushQuadBuffer() +{ + #if DX9MODE + // If the vert buffer isn't already locked into memory, then there is nothing to flush + if ( m_pQuadVertexes == NULL ) + return true; // consider this successful since there was no error + + // OK, it is locked, so unlock now + if ( !BUnlockVertexBuffer( m_hQuadBuffer ) ) + { + OutputDebugString( "Failed flushing quad buffer because BUnlockVertexBuffer failed\n" ); + return false; + } + + // Clear the memory pointer as its invalid now that we unlocked + m_pQuadVertexes = NULL; + + // If there is nothing to actual flush, we are done + if ( m_dwQuadsToFlush == 0 ) + return true; + + // Find the texture + std::map::iterator iter; + iter = m_MapTextures.find( m_hLastTexture ); + if ( iter == m_MapTextures.end() ) + { + OutputDebugString( "BFlushQuadBuffer failed with invalid m_hLastTexture value\n" ); + return false; + } + + // See if we need to actually create the d3d texture + if ( !iter->second.m_pTexture ) + { + //HRESULT CreateTexture(UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,VD3DHANDLE* pSharedHandle, char *debugLabel=NULL); + HRESULT hRes = m_pD3D9Device->CreateTexture( + (UINT)iter->second.m_uWidth, + (UINT)iter->second.m_uHeight, + (UINT)1, // mip map levels (0 = generate all levels down to 1x1 if supported) + (DWORD)0, // have to set the right flag here if you want to autogen mipmaps... we don't + (D3DFORMAT)D3DFMT_A8R8G8B8, + (D3DPOOL)D3DPOOL_MANAGED, + (IDirect3DTexture9** )&iter->second.m_pTexture, + (VD3DHANDLE*)NULL, + "debuglabel" ); + + if( FAILED( hRes ) ) + { + OutputDebugString( "BFlushQuadBuffer failed because CreateTexture() call failed\n" ); + iter->second.m_pTexture = NULL; + return false; + } + + // Put the data into the texture + D3DLOCKED_RECT rect; + hRes = iter->second.m_pTexture->LockRect( 0, &rect, NULL, 0 ); + if( FAILED( hRes ) ) + { + OutputDebugString( "LockRect call failed\n" ); + iter->second.m_pTexture->Release(); + iter->second.m_pTexture = NULL; + return false; + } + + DWORD *pARGB = (DWORD *) rect.pBits; + byte *pRGBA = (byte *) iter->second.m_pRGBAData; + + byte r,g,b,a; + for( uint32 y = 0; y < iter->second.m_uHeight; ++y ) + { + for( uint32 x = 0; x < iter->second.m_uWidth; ++x ) + { + // swap position of alpha value from back to front to be in correct format for d3d... + r = *pRGBA++; + g = *pRGBA++; + b = *pRGBA++; + a = *pRGBA++; + + *pARGB++ = D3DCOLOR_ARGB( a, r, g, b ); + } + } + + hRes = iter->second.m_pTexture->UnlockRect( 0 ); + if( FAILED( hRes ) ) + { + OutputDebugString( "UnlockRect call failed\n" ); + iter->second.m_pTexture->Release(); + iter->second.m_pTexture = NULL; + return false; + } + } + + // Ok, texture should be created ok, do the drawing work + if ( FAILED( m_pD3D9Device->SetTexture( 0, iter->second.m_pTexture ) ) ) + { + OutputDebugString( "BFlushQuadBuffer failed setting texture\n" ); + return false; + } + + for ( DWORD i=0; i < m_dwQuadsToFlush*4; i += 4 ) + { + BUberRenderPrimitive( m_vsh_P4C1T2, m_psh_P4C1T2, m_decl_P4C1T2, 0, m_hQuadBuffer, 0, sizeof( TexturedQuadVertex_t ), D3DPT_TRIANGLESTRIP, (m_dwQuadBufferBatchPos*4)+i, 2 ); + } + + m_pD3D9Device->SetTexture( 0, NULL ); // need to clear the texture before other drawing ops + + + m_dwQuadsToFlush = 0; + m_dwQuadBufferBatchPos += QUAD_BUFFER_BATCH_SIZE; + if ( m_dwQuadBufferBatchPos >= QUAD_BUFFER_TOTAL_SIZE ) + { + m_dwQuadBufferBatchPos = 0; + } + #else + if ( !m_rgflPointsColorData || !m_rgflPointsData || m_bShuttingDown ) + return false; + + if ( m_dwQuadsToFlush ) + { + glEnable( GL_TEXTURE_2D ); + glEnableClientState( GL_TEXTURE_COORD_ARRAY ); + + glColorPointer( 4, GL_UNSIGNED_BYTE, 0, m_rgflQuadsColorData ); + glVertexPointer( 3, GL_FLOAT, 0, m_rgflQuadsData ); + glTexCoordPointer( 2, GL_FLOAT, 0, m_rgflQuadsTextureData ); + glDrawArrays( GL_QUADS, 0, m_dwQuadsToFlush*4 ); + + glDisable( GL_TEXTURE_2D ); + glDisableClientState( GL_TEXTURE_COORD_ARRAY ); + + m_dwQuadsToFlush = 0; + } + #endif + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Creates a new texture +//----------------------------------------------------------------------------- +HGAMETEXTURE CGameEngineGL::HCreateTexture( byte *pRGBAData, uint32 uWidth, uint32 uHeight, ETEXTUREFORMAT eTextureFormat ) +{ + #if DX9MODE + if ( !m_pD3D9Device ) + return 0; + + TextureData_t TexData; + TexData.m_uWidth = uWidth; + TexData.m_uHeight = uHeight; + TexData.m_pRGBAData = new byte[uWidth*uHeight*4]; + memcpy( TexData.m_pRGBAData, pRGBAData, uWidth*uHeight*4 ); + TexData.m_pTexture = NULL; + + int nHandle = m_nNextTextureHandle; + ++m_nNextTextureHandle; + m_MapTextures[nHandle] = TexData; + + return nHandle; + #else + if ( m_bShuttingDown ) + return 0; + + TextureData_t TexData; + TexData.m_uWidth = uWidth; + TexData.m_uHeight = uHeight; + TexData.m_uTextureID = 0; + + glEnable( GL_TEXTURE_2D ); + glGenTextures( 1, &TexData.m_uTextureID ); + glBindTexture( GL_TEXTURE_2D, TexData.m_uTextureID ); + + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0 ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0 ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); + + // build our texture mipmaps + glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, uWidth, uHeight, 0, eTextureFormat == eTextureFormat_RGBA ? GL_RGBA : GL_BGRA, GL_UNSIGNED_BYTE, (void *)pRGBAData ); + glDisable( GL_TEXTURE_2D ); + + int nHandle = m_nNextTextureHandle; + ++m_nNextTextureHandle; + m_MapTextures[nHandle] = TexData; + + return nHandle; + #endif +} + + +//----------------------------------------------------------------------------- +// Purpose: update an exiting textue +//----------------------------------------------------------------------------- +bool CGameEngineGL::UpdateTexture( HGAMETEXTURE texture, byte *pRGBAData, uint32 uWidth, uint32 uHeight, ETEXTUREFORMAT eTextureFormat ) +{ +#if DX9MODE + + return false; +#else + if ( m_bShuttingDown ) + return false; + + std::map::iterator iter; + iter = m_MapTextures.find( texture ); + if ( iter == m_MapTextures.end() ) + { + OutputDebugString( "BDrawTexturedQuad called with invalid hTexture value\n" ); + return false; + } + + glEnable( GL_TEXTURE_2D ); + glBindTexture( GL_TEXTURE_2D, iter->second.m_uTextureID ); + + // build our texture mipmaps + glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, uWidth, uHeight, 0, eTextureFormat == eTextureFormat_RGBA ? GL_RGBA : GL_BGRA, GL_UNSIGNED_BYTE, (void *)pRGBAData ); + glDisable( GL_TEXTURE_2D ); + + return true; +#endif + +} + + +//----------------------------------------------------------------------------- +// Purpose: Creates a new font +//----------------------------------------------------------------------------- +HGAMEFONT CGameEngineGL::HCreateFont( int nHeight, int nFontWeight, bool bItalic, const char * pchFont ) +{ + #if DX9MODE + extern unsigned char g_glmDebugFontMap[ 128 * 128 ]; // raster order + + #if GLMDEBUG + GLMPRINTF(("-D- CGameEngineGL::HCreateFont nHeight=%d, nFontWeight=%d, bItalic=%s, fontname=%s", nHeight, nFontWeight, bItalic?"T":"F", pchFont )); + #endif + + byte *pRGBAData = new byte[ 128 * 128 * 4]; + + byte *src = (byte*)g_glmDebugFontMap; + byte *dst = pRGBAData; + + for( uint y = 0; y< 128; y++) + { + for( uint x = 0; x< 128; x++) + { + if (*src == ' ') + { + dst[0] = 0; + dst[1] = 0; + dst[2] = 0; + dst[3] = 0; + } + else + { + dst[0] = 0xFF; + dst[1] = 0xFF; + dst[2] = 0xFF; + dst[3] = 0xFF; + } + src++; + dst += 4; + } + } + HGAMETEXTURE font = HCreateTexture( pRGBAData, 128, 128 ); + + delete[] pRGBAData; + + HGAMEFONT hFont = m_nNextFontHandle; + ++m_nNextFontHandle; + + m_MapGameFonts[ hFont ] = font; + + return hFont; + #else + AutoReleasePool pool; + + HGAMEFONT hFont = m_nNextFontHandle; + ++m_nNextFontHandle; + + NSString *fontName = [NSString stringWithUTF8String:pchFont]; + + NSFont *font = [NSFont fontWithName: fontName size: nHeight]; + [font retain]; + + m_MapGameFonts[ hFont ] = font; + + return hFont; + #endif +} + + +//----------------------------------------------------------------------------- +// Purpose: Draws text to the screen inside the given rectangular region, using the given font +//----------------------------------------------------------------------------- +bool CGameEngineGL::BDrawString( HGAMEFONT hFont, RECT rect, DWORD dwColor, DWORD dwFormat, const char *pchText ) +{ + #if DX9MODE + HGAMETEXTURE font = (HGAMETEXTURE)m_MapGameFonts[ hFont ]; + + int stringlen = strlen( pchText ); + + float stringwidth = stringlen * 7.0f; + float stringheight = 11.0f; + + float stringleft = rect.left + floor( ((rect.right - rect.left) - stringwidth) / 2.0f ); + float stringtop = rect.top + floor( ((rect.bottom - rect.top) - stringheight) / 2.0f ); + + for( int charindex = 0; charindex < stringlen; charindex++ ) + { + float leftU,rightU,topV,bottomV; + + int character = (int)pchText[charindex]; + character -= 0x20; + if ( (character<0) || (character > 0x7F) ) + { + character = '*' - 0x20; + } + + leftU = ((character & 0x0F) * 6.0f ) / 128.0f; + rightU = leftU + (6.0f / 128.0f); + + topV = ((character >> 4) * 11.0f ) / 128.0f; + bottomV = topV + (11.0f / 128.0f); + + float posx,posy; + + posx = stringleft + (7.0f * (float)charindex); + posy = stringtop; + + BDrawTexturedRect( posx, posy, posx + 6.0f, posy + 11.0f, leftU, topV, rightU, bottomV, dwColor, font ); + } + + #else + if ( !hFont ) + { + OutputDebugString( "Someone is calling BDrawString with a null font handle\n" ); + return false; + } + + AutoReleasePool pool; + + NSFont *pFont = (NSFont*) m_MapGameFonts[ hFont ]; + NSRect box = { { static_cast(rect.left), static_cast(rect.top) }, { static_cast(rect.right-rect.left), static_cast(rect.bottom-rect.top) } }; + NSColor *pColor = [NSColor colorWithCalibratedRed:COLOR_RED(dwColor)/255.0 + green:COLOR_GREEN(dwColor)/255.0 + blue:COLOR_BLUE(dwColor)/255.0 + alpha:COLOR_ALPHA(dwColor)/255.0 ]; + + GLString *&string = m_MapStrings[ std::string(pchText) ]; + + NSString *nsString = [NSString stringWithUTF8String:pchText]; + + if ( string == NULL) + { + string = [[GLString alloc] initWithString:nsString + withFont:pFont + withTextColor:pColor + inBox:&box + withFlags:dwFormat]; + } + else + { + [string setFont: pFont]; + [string setColor: pColor]; + [string setBox: &box]; + } + + [string drawWithBounds: box]; + + #endif + return true; +} + +void CGameEngineGL::UpdateKey( uint32_t vkKey, int nDown ) +{ + if ( nDown ) + m_SetKeysDown.insert( vkKey ); + else + m_SetKeysDown.erase( vkKey ); +} + +//----------------------------------------------------------------------------- +// Purpose: Message pump for OS messages +//----------------------------------------------------------------------------- +void CGameEngineGL::MessagePump() +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + NSApplication *pApp = [GLApplication sharedApplication]; + do + { + NSEvent *event = [pApp nextEventMatchingMask:NSEventMaskAny untilDate:nil inMode:NSDefaultRunLoopMode dequeue:YES]; + if ( event == nil ) + break; + + // fprintf( stderr, ": %s\n", [[event description] UTF8String] ); + + uint32_t c = 0; + switch ( [event type] ) + { + case NSEventTypeKeyDown: + case NSEventTypeKeyUp: + c = [[event charactersIgnoringModifiers] characterAtIndex:0]; + + switch ( c ) + { + case NSUpArrowFunctionKey: + c = VK_UP; + break; + case NSDownArrowFunctionKey: + c = VK_DOWN; + break; + case NSLeftArrowFunctionKey: + c = VK_LEFT; + break; + case NSRightArrowFunctionKey: + c = VK_RIGHT; + break; + case 127: // on mac 'del' is backspace + c = VK_BACK; + break; + } + + c = toupper(c); + + if ( [event type] == NSEventTypeKeyDown ) + m_SetKeysDown.insert( c ); + else + m_SetKeysDown.erase( c ); + continue; + + case NSEventTypeFlagsChanged: + c = [event modifierFlags]; + UpdateKey( VK_SHIFT, c & NSEventModifierFlagShift ); + UpdateKey( VK_CONTROL, c & NSEventModifierFlagControl ); + UpdateKey( VK_SELECT, c & NSEventModifierFlagOption ); + continue; + + default: + break; + } + + [pApp sendEvent:event]; + [pApp updateWindows]; + } while ( !BShuttingDown() ); + + [pool release]; +} + +//----------------------------------------------------------------------------- +// Purpose: Find out if a key is currently down +//----------------------------------------------------------------------------- +bool CGameEngineGL::BIsKeyDown( DWORD dwVK ) +{ + std::set::iterator iter; + iter = m_SetKeysDown.find( dwVK ); + if ( iter != m_SetKeysDown.end() ) + return true; + + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: Get a down key value +//----------------------------------------------------------------------------- +bool CGameEngineGL::BGetFirstKeyDown( DWORD *pdwVK ) +{ + std::set::iterator iter; + iter = m_SetKeysDown.begin(); + if ( iter != m_SetKeysDown.end() ) + { + *pdwVK = *iter; + m_SetKeysDown.erase( iter ); + return true; + } + else + { + return false; + } +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +HGAMEVOICECHANNEL CGameEngineGL::HCreateVoiceChannel() +{ + m_unVoiceChannelCount++; + CVoiceContext* pVoiceContext = new CVoiceContext; + + m_MapVoiceChannel[m_unVoiceChannelCount] = pVoiceContext; + + return m_unVoiceChannelCount; +} + +void CGameEngineGL::RunAudio() +{ + std::map::iterator iter; + + for( iter = m_MapVoiceChannel.begin(); iter!=m_MapVoiceChannel.end(); ++iter) + { + CVoiceContext* pVoice = iter->second; + + const int nBufferCount = ARRAYSIZE( pVoice->m_buffers ); + ALint nQueued, nProcessed; + alGetSourcei( pVoice->m_nSource, AL_BUFFERS_QUEUED, &nQueued ); + alGetSourcei( pVoice->m_nSource, AL_BUFFERS_PROCESSED, &nProcessed ); + + if ( ( nQueued == nBufferCount ) && ( nProcessed == 0 ) ) + { // No room at the inn + continue; + } + + ALuint nBufferID; + for ( int i = 0; i < nProcessed; i++ ) + alSourceUnqueueBuffers( pVoice->m_nSource, 1, &nBufferID ); + + int nMaxToQueue = nBufferCount - nQueued + nProcessed; + bool bQueued = false; + + while ( nMaxToQueue && !pVoice->m_pending.empty() ) + { + Packet_t &packet = pVoice->m_pending.front(); + + nBufferID = pVoice->m_buffers[ pVoice->m_nNextFreeBuffer ]; + alBufferData( nBufferID, AL_FORMAT_MONO16, packet.pData, packet.unSize, VOICE_OUTPUT_SAMPLE_RATE_IDEAL ); + pVoice->m_nNextFreeBuffer = (pVoice->m_nNextFreeBuffer + 1 ) % nBufferCount; + + alSourceQueueBuffers( pVoice->m_nSource, 1, &nBufferID); + + nMaxToQueue--; + free( packet.pData ); + pVoice->m_pending.pop(); + bQueued = true; + } + + if ( bQueued && ( (nQueued-nProcessed) == 0 ) ) + { + alSourcePlay( pVoice->m_nSource ); + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CGameEngineGL::DestroyVoiceChannel( HGAMEVOICECHANNEL hChannel ) +{ + std::map::iterator iter; + iter = m_MapVoiceChannel.find( hChannel ); + if ( iter != m_MapVoiceChannel.end() ) + { + CVoiceContext* pVoiceContext = iter->second; + + // free outstanding voice packets + + while( !pVoiceContext->m_pending.empty() ) + { + free( pVoiceContext->m_pending.front().pData ); + pVoiceContext->m_pending.pop(); + } + + delete pVoiceContext; + m_MapVoiceChannel.erase( iter ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +bool CGameEngineGL::AddVoiceData( HGAMEVOICECHANNEL hChannel, const uint8 *pVoiceData, uint32 uLength ) +{ + std::map::iterator iter; + iter = m_MapVoiceChannel.find( hChannel ); + if ( iter == m_MapVoiceChannel.end() ) + return false; // channel not found + + CVoiceContext* pVoiceContext = iter->second; + + Packet_t packet; + + packet.pData = malloc ( uLength ); + memcpy( packet.pData, pVoiceData, uLength ); + packet.unSize = uLength; + + pVoiceContext->m_pending.push( packet ); + + return true; +} + + +#if DX9MODE + +//----------------------------------------------------------------------------- +// Purpose: return a pointer to a display db object, created on demand +//----------------------------------------------------------------------------- + +GLMDisplayDB *CGameEngineGL::GetDisplayDB( void ) +{ + if (!m_displayDB) + { + m_displayDB = new GLMDisplayDB; + m_displayDB->Populate(); + } + + return m_displayDB; +} + +//----------------------------------------------------------------------------- +// Purpose: allow dxabstract to read back the capabilities of the selected renderer +//----------------------------------------------------------------------------- + +void CGameEngineGL::GetRendererInfo( GLMRendererInfoFields *rendInfoOut ) +{ + // hardwired to renderer 0 which is fine on any single monitor system + if (rendInfoOut) + { + GLMDisplayDB *db = GetDisplayDB(); + *rendInfoOut = ((*db->m_renderers)[ 0 ])->m_info; + } +} + +PseudoNSGLContextPtr CGameEngineGL::GetNSGLContextForWindow ( void* windowref ) +{ + WindowRef win = (WindowRef)windowref; + + if (win==[m_window windowRef]) + { + PseudoNSGLContextPtr nsctx = [ m_view openGLContext ]; + + Assert( nsctx != NULL ); + + return nsctx; + } + else + { + return NULL; // sorry, no idea + } +} + + +//----------------------------------------------------------------------------- +// Purpose: either set or get the rendered size +//----------------------------------------------------------------------------- + +void CGameEngineGL::RenderedSize( uint &width, uint &height, bool set ) +{ + if (set) + { + Assert( 0 ); // not impl'd yet + } + else + { + width = m_nWindowWidth; + height = m_nWindowHeight; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: get the displayed size which need not match the rendered size +//----------------------------------------------------------------------------- + +void CGameEngineGL::DisplayedSize( uint &width, uint &height ) +{ + width = m_nWindowWidth; + height = m_nWindowHeight; +} + +//----------------------------------------------------------------------------- +// Purpose: display completed frame - assumes GLM/DXA already blitted final bits into back buffer of m_view's context +//----------------------------------------------------------------------------- + +void CGameEngineGL::ShowPixels ( CShowPixelsParams *params ) +{ + Assert( m_window != NULL ); + Assert( m_view != NULL ); + + [ [ m_view openGLContext ] makeCurrentContext ]; + + //if (!params->m_onlySyncView) + { + // save old context + NSOpenGLContext *oldctx = [ NSOpenGLContext currentContext ]; + + // get target context + NSOpenGLContext *newctx = [ m_view openGLContext ]; + + // make it current + [newctx makeCurrentContext]; + + [newctx flushBuffer]; + + [oldctx makeCurrentContext]; + } +} + +#endif + +//----------------------------------------------------------------------------- +// Purpose: Return true if there is an active Steam Controller +//----------------------------------------------------------------------------- +bool CGameEngineGL::BIsSteamInputDeviceActive( ) +{ + if ( m_ActiveControllerHandle ) + { + return true; + } + + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: Initialize the steam controller actions +//----------------------------------------------------------------------------- +void CGameEngineGL::InitSteamInput( ) +{ + // Digital game actions + m_ControllerDigitalActionHandles[eControllerDigitalAction_TurnLeft] = SteamInput()->GetDigitalActionHandle( "turn_left" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_TurnRight] = SteamInput()->GetDigitalActionHandle( "turn_right" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_ForwardThrust] = SteamInput()->GetDigitalActionHandle( "forward_thrust" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_ReverseThrust] = SteamInput()->GetDigitalActionHandle( "backward_thrust" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_FireLasers] = SteamInput()->GetDigitalActionHandle( "fire_lasers" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_PauseMenu] = SteamInput()->GetDigitalActionHandle( "pause_menu" ); + + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuUp] = SteamInput()->GetDigitalActionHandle( "menu_up" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuDown] = SteamInput()->GetDigitalActionHandle( "menu_down" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuLeft] = SteamInput()->GetDigitalActionHandle( "menu_left" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuRight] = SteamInput()->GetDigitalActionHandle( "menu_right" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuSelect] = SteamInput()->GetDigitalActionHandle( "menu_select" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuCancel] = SteamInput()->GetDigitalActionHandle( "menu_cancel" ); + + // Analog game actions + m_ControllerAnalogActionHandles[eControllerAnalogAction_AnalogControls] = SteamInput()->GetAnalogActionHandle( "analog_controls" ); + + // Action set handles + m_ControllerActionSetHandles[eControllerActionSet_ShipControls] = SteamInput()->GetActionSetHandle( "ship_controls" ); + m_ControllerActionSetHandles[eControllerActionSet_MenuControls] = SteamInput()->GetActionSetHandle( "menu_controls" ); + +} + +//----------------------------------------------------------------------------- +// Purpose: Find an active Steam controller +//----------------------------------------------------------------------------- +void CGameEngineGL::FindActiveSteamInputDevice( ) +{ + // Use the first available steam controller for all interaction. We can call this each frame to handle + // a controller disconnecting and a different one reconnecting. Handles are guaranteed to be unique for + // a given controller, even across power cycles. + + // See how many Steam Controllers are active. + ControllerHandle_t pHandles[STEAM_CONTROLLER_MAX_COUNT]; + int nNumActive = SteamInput()->GetConnectedControllers( pHandles ); + + // If there's an active controller, and if we're not already using it, select the first one. + if ( nNumActive && (m_ActiveControllerHandle != pHandles[0]) ) + { + m_ActiveControllerHandle = pHandles[0]; + } +} + + +//-------------------------------------------------------------------------------------------------------------- +// Purpose: For a given in-game action in a given action set, return a human-reaadable string to use as a prompt. +//-------------------------------------------------------------------------------------------------------------- +const char *CGameEngineGL::GetTextStringForControllerOriginDigital( ECONTROLLERACTIONSET dwActionSet, ECONTROLLERDIGITALACTION dwDigitalAction ) +{ + EInputActionOrigin origins[STEAM_CONTROLLER_MAX_ORIGINS]; + int nNumOrigins = SteamInput()->GetDigitalActionOrigins( m_ActiveControllerHandle, m_ControllerActionSetHandles[dwActionSet], m_ControllerDigitalActionHandles[dwDigitalAction], origins ); + + if ( nNumOrigins ) + { + // We should handle the case where this action is bound to multiple buttons, but + // here we just grab the first. + return SteamInput()->GetStringForActionOrigin( origins[0] ); + } + + return SteamInput()->GetStringForActionOrigin( k_EInputActionOrigin_None ); // Return "None" +} + +//-------------------------------------------------------------------------------------------------------------- +// Purpose: For a given in-game action in a given action set, return a human-reaadable string to use as a prompt. +//-------------------------------------------------------------------------------------------------------------- +const char *CGameEngineGL::GetTextStringForControllerOriginAnalog( ECONTROLLERACTIONSET dwActionSet, ECONTROLLERANALOGACTION dwDigitalAction ) +{ + EInputActionOrigin origins[STEAM_CONTROLLER_MAX_ORIGINS]; + int nNumOrigins = SteamInput()->GetAnalogActionOrigins( m_ActiveControllerHandle, m_ControllerActionSetHandles[dwActionSet], m_ControllerDigitalActionHandles[dwDigitalAction], origins ); + + if ( nNumOrigins ) + { + // We should handle the case where this action is bound to multiple buttons, but + // here we just grab the first. + return SteamInput()->GetStringForActionOrigin( origins[0] ); + } + + return SteamInput()->GetStringForActionOrigin( k_EInputActionOrigin_None ); // Return "None" +} + +//----------------------------------------------------------------------------- +// Purpose: Called each frame +//----------------------------------------------------------------------------- +void CGameEngineGL::PollSteamInput( ) +{ + // There's a bug where the action handles aren't non-zero until a config is done loading. Soon config + // information will be available immediately. Until then try to init as long as the handles are invalid. + if ( m_ControllerDigitalActionHandles[eControllerDigitalAction_TurnLeft] == 0 ) + { + InitSteamInput( ); + return; + } + + // Each frame check our active controller handle + FindActiveSteamInputDevice( ); + +} + +//----------------------------------------------------------------------------- +// Purpose: Set the LED color on the controller, if supported by controller +//----------------------------------------------------------------------------- +void CGameEngineGL::SetControllerColor( uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ) +{ + SteamInput()->SetLEDColor( m_ActiveControllerHandle, nColorR, nColorG, nColorB, nFlags ); +} + +//----------------------------------------------------------------------------- +// Purpose: Set the trigger effect on DualSense controllers +//----------------------------------------------------------------------------- +void CGameEngineGL::SetTriggerEffect( bool bEnabled ) +{ + ScePadTriggerEffectParam param; + + memset( ¶m, 0, sizeof( param ) ); + param.triggerMask = SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2; + + // Clear any existing effect + param.command[ SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 ].mode = SCE_PAD_TRIGGER_EFFECT_MODE_OFF; + SteamInput()->SetDualSenseTriggerEffect( m_ActiveControllerHandle, ¶m ); + + if ( bEnabled ) + { + param.command[ SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 ].mode = SCE_PAD_TRIGGER_EFFECT_MODE_VIBRATION; + param.command[ SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 ].commandData.vibrationParam.position = 5; + param.command[ SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 ].commandData.vibrationParam.amplitude = 5; + param.command[ SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 ].commandData.vibrationParam.frequency = 8; + SteamInput()->SetDualSenseTriggerEffect( m_ActiveControllerHandle, ¶m ); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Trigger vibration on the controller, if supported by controller +//----------------------------------------------------------------------------- +void CGameEngineGL::TriggerControllerVibration( unsigned short nLeftSpeed, unsigned short nRightSpeed ) +{ + SteamInput()->TriggerVibration( m_ActiveControllerHandle, nLeftSpeed, nRightSpeed ); +} + +//----------------------------------------------------------------------------- +// Purpose: Trigger haptics on the controller, if supported by controller +//----------------------------------------------------------------------------- +void CGameEngineGL::TriggerControllerHaptics( ESteamControllerPad ePad, unsigned short usOnMicroSec, unsigned short usOffMicroSec, unsigned short usRepeat ) +{ + SteamInput()->Legacy_TriggerRepeatedHapticPulse( m_ActiveControllerHandle, ePad, usOnMicroSec, usOffMicroSec, usRepeat, 0 ); +} + +//----------------------------------------------------------------------------- +// Purpose: Find out if a controller event is currently active +//----------------------------------------------------------------------------- +bool CGameEngineGL::BIsControllerActionActive( ECONTROLLERDIGITALACTION dwAction ) +{ + ControllerDigitalActionData_t digitalData = SteamInput()->GetDigitalActionData( m_ActiveControllerHandle, m_ControllerDigitalActionHandles[dwAction] ); + + // Actions are only 'active' when they're assigned to a control in an action set, and that action set is active. + if ( digitalData.bActive ) + return digitalData.bState; + + return false; +} + +//--------------------------------------------------------------------------------------------------------------------------------------------------- +// Purpose: Get the current x,y state of the analog action. Examples of an analog action are a virtual joystick on the trackpad or the real joystick. +//--------------------------------------------------------------------------------------------------------------------------------------------------- +void CGameEngineGL::GetControllerAnalogAction( ECONTROLLERANALOGACTION dwAction, float *x, float *y ) +{ + ControllerAnalogActionData_t analogData = SteamInput()->GetAnalogActionData( m_ActiveControllerHandle, m_ControllerAnalogActionHandles[dwAction] ); + + // Actions are only 'active' when they're assigned to a control in an action set, and that action set is active. + if ( analogData.bActive ) + { + *x = analogData.x; + *y = analogData.y; + } + else + { + *x = 0.0f; + *y = 0.0f; + } +} + +//----------------------------------------------------------------------------------------------------------------------------------------------------- +// Purpose: Put the controller into a specific action set. Action sets are collections of game-context actions ie "walking", "flying" or "menu" +//----------------------------------------------------------------------------------------------------------------------------------------------------- +void CGameEngineGL::SetSteamControllerActionSet( ECONTROLLERACTIONSET dwActionSet ) +{ + if ( m_ActiveControllerHandle == 0 ) + return; + + // This call is low-overhead and can be called repeatedly from game code that is active in a specific mode. + SteamInput()->ActivateActionSet( m_ActiveControllerHandle, m_ControllerActionSetHandles[dwActionSet] ); +} + +//----------------------------------------------------------------------------------------------------------------------------------------------------- +// Purpose: Put the controller into a specific action set layer. Action sets layers apply modifications to an existing action set. +//----------------------------------------------------------------------------------------------------------------------------------------------------- +void CGameEngineGL::ActivateSteamControllerActionSetLayer( ECONTROLLERACTIONSET dwActionSetLayer ) +{ + if ( m_ActiveControllerHandle == 0 ) + return; + + // This call is low-overhead and can be called repeatedly from game code that is active in a specific mode. + SteamInput()->ActivateActionSetLayer( m_ActiveControllerHandle, m_ControllerActionSetHandles[ dwActionSetLayer ] ); +} + +//----------------------------------------------------------------------------------------------------------------------------------------------------- +// Purpose: Deactivate an existing action set layer +//----------------------------------------------------------------------------------------------------------------------------------------------------- +void CGameEngineGL::DeactivateSteamControllerActionSetLayer( ECONTROLLERACTIONSET dwActionSetLayer ) +{ + if ( m_ActiveControllerHandle == 0 ) + return; + + // This call is low-overhead and can be called repeatedly from game code that is active in a specific mode. + SteamInput()->DeactivateActionSetLayer( m_ActiveControllerHandle, m_ControllerActionSetHandles[ dwActionSetLayer ] ); +} + + +//----------------------------------------------------------------------------------------------------------------------------------------------------- +// Purpose: Determine whether an action set layer is currently active +//----------------------------------------------------------------------------------------------------------------------------------------------------- +bool CGameEngineGL::BIsActionSetLayerActive( ECONTROLLERACTIONSET dwActionSetLayer ) +{ + if ( m_ActiveControllerHandle == 0 ) + return false; + + ControllerActionSetHandle_t pActionSetLayerHandles[ 32 ]; + int nActiveLayerCount = SteamInput()->GetActiveActionSetLayers( m_ActiveControllerHandle, pActionSetLayerHandles ); + + for ( int i = 0; i < nActiveLayerCount; i++ ) + { + if ( pActionSetLayerHandles[ i ] == m_ControllerActionSetHandles[ dwActionSetLayer ] ) + return true; + } + + return false; +} diff --git a/external/steamworks/steamworksexample/gameengineps3.cpp b/external/steamworks/steamworksexample/gameengineps3.cpp new file mode 100644 index 0000000..2c5355c --- /dev/null +++ b/external/steamworks/steamworksexample/gameengineps3.cpp @@ -0,0 +1,1840 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Main class for the game engine -- win32 implementation +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" +#include "steam/isteamps3overlayrenderer.h" +#include "GameEnginePS3.h" +#include "steam/steamps3params_internal.h" +#include +#include +#include +#include +#include + + +#define DebuggerBreak() { __asm volatile ("tw 31,1,1"); } + +// Allocate static member +std::map CGameEnginePS3::m_MapEngineInstances; + +// How big is the vertex buffer for batching lines in total? +#define LINE_BUFFER_TOTAL_SIZE 1000 + +// How big is the vertex buffer for batching points in total? +#define POINT_BUFFER_TOTAL_SIZE 1800 + +// How big is the vertex buffer for batching quads in total? +#define QUAD_BUFFER_TOTAL_SIZE 1000 + +// Only a single global console can be setup for output, track that here +CellDbgFontConsoleId g_DbgFontConsoleID = -1; + +// Global for PS3 params +SteamPS3Params_t g_SteamPS3Params; + +void RunGameLoop( IGameEngine *pGameEngine, const char *pchServerAddress, const char *pchLobbyID ); +extern "C" void __cdecl SteamAPIDebugTextHook( int nSeverity, const char *pchDebugText ); + +void OutputDebugString( const char *pchMsg ) +{ +#ifndef _CERT + fprintf( stderr, "%s", pchMsg ); + cellDbgFontConsolePrintf( g_DbgFontConsoleID, "%s", pchMsg ); +#endif +} + +// taken from sample +static const char s_npCommunicationSignature[STEAM_PS3_COMMUNICATION_SIG_MAX] = { + 0xb9,0xdd,0xe1,0x3b,0x01,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x1d,0x3c,0x55,0x0f, + 0x35,0xb5,0x54,0xfe,0x4e,0x97,0x1a,0x01, + 0x23,0x38,0xaa,0xd6,0x3d,0xda,0x6a,0xac, + 0x3e,0x95,0xff,0x09,0x49,0xd7,0xb3,0xda, + 0x11,0xae,0xf0,0xde,0xd6,0x2b,0x70,0x96, + 0x40,0x09,0x0e,0xed,0x8c,0x38,0x1d,0xa4, + 0xc3,0x0e,0xc9,0x30,0xc1,0xcc,0x66,0x92, + 0xd1,0xb0,0x6e,0x01,0xc0,0x44,0xb2,0xa2, + 0xd0,0x62,0x88,0xa8,0x26,0x7f,0x91,0xb5, + 0x7b,0x40,0x0c,0x6a,0xc9,0x3b,0x5c,0x89, + 0x43,0x22,0x16,0x4e,0x27,0x56,0x46,0x4a, + 0x63,0xc4,0x55,0xce,0xb3,0xce,0xf7,0x92, + 0x07,0x71,0x13,0x60,0x6e,0xcb,0xad,0xd5, + 0xf0,0x60,0xd6,0x71,0x3a,0x45,0xaa,0x25, + 0x38,0x60,0x11,0x1a,0xa5,0x0e,0xcf,0xa4, + 0x21,0xc8,0x94,0x6d,0xf2,0x0d,0xac,0xcf, + 0x67,0x8d,0x4a,0x14,0x14,0x4e,0xed,0x45, + 0x67,0x40,0x60,0x93,0x2b,0x00,0xeb,0xb7, + 0xf3,0x2f,0x09,0x36,0xb6,0x59,0x84,0x0e + }; + +//----------------------------------------------------------------------------- +// Purpose: Loads the Steam PS3 module +//----------------------------------------------------------------------------- +sys_prx_id_t g_sys_prx_id_steam = -1; +static bool LoadSteamPS3Module() +{ + g_sys_prx_id_steam = sys_prx_load_module( SYS_APP_HOME "/steam_api_ps3.sprx", 0, NULL ); + if ( g_sys_prx_id_steam < CELL_OK ) + { + OutputDebugString( "LoadSteamModule() - failed to load steam_api_ps3\n" ); + return false; + } + + int modres; + int res = sys_prx_start_module( g_sys_prx_id_steam, 0, NULL, &modres, 0, NULL); + if ( res < CELL_OK ) + { + OutputDebugString( "LoadSteamModule() - failed to start steam_api_ps3\n" ); + return false; + } + return true; +} + +//----------------------------------------------------------------------------- +// Purpose: Unloads the Steam PS3 module +//----------------------------------------------------------------------------- +static bool UnloadSteamPS3Module() +{ + // check if loaded + if ( g_sys_prx_id_steam < CELL_OK ) + return false; + + int modres; + int res = sys_prx_stop_module( g_sys_prx_id_steam, 0, NULL, &modres, 0, NULL); + if ( res < CELL_OK ) + { + OutputDebugString( "LoadSteamModule() - failed to stop steam_api_ps3\n" ); + return false; + } + + res = sys_prx_unload_module( g_sys_prx_id_steam, 0, NULL ); + if ( res < CELL_OK ) + { + OutputDebugString( "LoadSteamModule() - failed to unload steam_api_ps3\n" ); + return false; + } + + g_sys_prx_id_steam = -1; + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Initializes Steam PS3 params for our application +// This is very similar to CPs3ContentPathInfo::Init +//----------------------------------------------------------------------------- +SteamPS3ParamsInternal_t g_steamPS3ParamsInternal = { STEAM_PS3_PARAMS_INTERNAL_VERSION, k_EUniverseBeta, "", true }; +bool SetSteamPS3Params( SteamPS3Params_t *pParams ) +{ + char bootdir[CELL_GAME_DIRNAME_SIZE] = { 0 }; + char gameHDDataPath[CELL_GAME_DIRNAME_SIZE]; + char gameTitle[CELL_GAME_SYSP_TITLE_SIZE]; + char gameTitleID[CELL_GAME_SYSP_TITLEID_SIZE]; // CELL_GAME_PARAMID_TITLE_ID + char gameAppVer[CELL_GAME_SYSP_VERSION_SIZE]; // CELL_GAME_PARAMID_APP_VER + char gameContentPath[CELL_GAME_PATH_MAX]; // as returned by contentPermit but usually meaningless (?) + char gameBasePath[CELL_GAME_PATH_MAX]; + + unsigned int nBootType = 0; /// either CELL_GAME_GAMETYPE_DISC or CELL_GAME_GAMETYPE_HDD + unsigned int nBootAttribs = 0; /// some combination of attribute masks -- see .cpp for details + + CellSysCacheParam sysCacheParams; + memset( &sysCacheParams, 0, sizeof( CellSysCacheParam ) ); + + CellGameContentSize size; + memset(&size, 0, sizeof(CellGameContentSize)); + + + ///////////////////////////////////////////////////////////////////////// + // + // load sysutil GAME + // + ////////////////////////////////////////////////////////////////////////// + + // we'll need to haul libsysutil into memory ( CELL_SYSMODULE_SYSUTIL_GAME ) + bool bSysModuleIsLoaded = cellSysmoduleIsLoaded( CELL_SYSMODULE_SYSUTIL_GAME ) == CELL_SYSMODULE_LOADED ; + // if this assert trips, then: + // 1) look at where the sysutil_game module is loaded to make sure it still needs to be loaded at this point (maybe you can dump it to save memory) + // 2) if it's being taken care of somewhere else, we don't need to load the module here. + if ( !bSysModuleIsLoaded ) + { + // SYSUTIL_GAME module not loaded yet + if ( CELL_OK != cellSysmoduleLoadModule( CELL_SYSMODULE_SYSUTIL_GAME ) ) + return false; + } + + // get the base to the content directory. + bool bSuccess = CELL_GAME_RET_OK == cellGameBootCheck( &nBootType, &nBootAttribs, &size, bootdir ); + + if ( bSuccess ) + { + + bSuccess &= CELL_GAME_RET_OK == cellGameGetParamString( CELL_GAME_PARAMID_TITLE, gameTitle, sizeof( gameTitle ) ); + bSuccess &= CELL_GAME_RET_OK == cellGameGetParamString( CELL_GAME_PARAMID_TITLE_ID, gameTitleID, sizeof( gameTitleID ) ); + bSuccess &= CELL_GAME_RET_OK == cellGameGetParamString( CELL_GAME_PARAMID_APP_VER, gameAppVer, sizeof( gameAppVer ) ); + } + + if ( bSuccess ) + { + bSuccess = CELL_GAME_RET_OK == cellGameContentPermit( gameContentPath, gameBasePath ) ; + } + + if ( bSuccess ) + { + // Get the game data directory on the hard disk. + memset(&size, 0, sizeof(CellGameContentSize)); + const int ret = cellGameDataCheck( CELL_GAME_GAMETYPE_GAMEDATA, gameTitleID, &size ); + if ( ret == CELL_GAME_RET_NONE ) + { + // create game directory for the first time + CellGameSetInitParams init; memset( &init, 0, sizeof( init ) ); + memcpy( init.title, gameTitle, sizeof( gameTitle ) ); + memcpy( init.titleId, gameTitleID, sizeof( gameTitleID ) ); + memcpy( init.version, gameAppVer, sizeof( gameAppVer ) ); + + char tmp_contentInfoPath[CELL_GAME_PATH_MAX] = {0}; + char tmp_usrdirPath[CELL_GAME_PATH_MAX] = {0}; + + bSuccess = CELL_GAME_RET_OK == cellGameCreateGameData( &init, tmp_contentInfoPath, tmp_usrdirPath ); + } + else if ( ret != CELL_GAME_RET_OK ) + { + // failure + bSuccess = false; + } + } + + if ( bSuccess ) + { + char contentInfoPath[256]; + bSuccess = CELL_GAME_RET_OK == cellGameContentPermit( contentInfoPath, gameHDDataPath ); + } + + if ( bSuccess ) + { + // Steam needs the system cache path. Passing an empty string so it is always cleared for testing + // memcpy( sysCacheParams.cacheId, gameTitleID, sizeof( gameTitleID ) ); + sysCacheParams.cacheId[0] = '\0'; + + const int ret = cellSysCacheMount( &sysCacheParams ); + bSuccess = ( ret == CELL_SYSCACHE_RET_OK_CLEARED ) || ( ret == CELL_SYSCACHE_RET_OK_RELAYED ); + } + + if ( !bSysModuleIsLoaded ) + { + // actually this means it wasn't loaded when we got into the function. unload again + cellSysmoduleUnloadModule( CELL_SYSMODULE_SYSUTIL_GAME ); + } + + if ( bSuccess ) + { + // Internal params, not used by public games. + pParams->pReserved = &g_steamPS3ParamsInternal; + + // configure the Steamworks PS3 parameters. All params need to be set. + pParams->m_nAppId = 480; + + pParams->m_cSteamInputTTY = SYS_TTYP3; + + strncpy( pParams->m_rgchNpServiceID, "UD0031-NPXX00848_00", STEAM_PS3_SERVICE_ID_MAX ); + strncpy( pParams->m_rgchNpCommunicationID, "NPXS00022", STEAM_PS3_COMMUNICATION_ID_MAX ); + memcpy( pParams->m_rgchNpCommunicationSig, s_npCommunicationSignature, STEAM_PS3_COMMUNICATION_SIG_MAX ); + strncpy( pParams->m_rgchInstallationPath, SYS_APP_HOME, STEAM_PS3_PATH_MAX ); + strncpy( pParams->m_rgchSystemCache, sysCacheParams.getCachePath, STEAM_PS3_PATH_MAX ); + strncpy( pParams->m_rgchGameData, gameHDDataPath, STEAM_PS3_PATH_MAX ); + strncpy( pParams->m_rgchSteamLanguage, "english", STEAM_PS3_LANGUAGE_MAX ); + strncpy( pParams->m_rgchRegionCode, "SCEA", STEAM_PS3_REGION_CODE_MAX ); + + pParams->m_sysNetInitInfo.m_bNeedInit = true; // default network initialization + pParams->m_sysJpgInitInfo.m_bNeedInit = true; + pParams->m_sysSysUtilUserInfo.m_bNeedInit = true; + pParams->m_sysPngInitInfo.m_bNeedInit = true; + } + + return bSuccess; +} + + +//----------------------------------------------------------------------------- +// Purpose: Path to save user data +//----------------------------------------------------------------------------- +static char g_rgchUserDataPath[CELL_GAME_PATH_MAX] = {0}; +bool SetUserSaveDataPath() +{ + // On PS3, we need to save the user's stats & achievement information into the save container. In this example, we are simply + // saving the data to a known location on disk. + + // To get a unique path per user, include the local user id in the file name + + // need the user info module + if ( cellSysmoduleLoadModule( CELL_SYSMODULE_SYSUTIL_USERINFO ) != CELL_OK ) + return false; + + // get local id + CellSysutilUserId unLocalUserID; + if ( cellUserInfoGetList( NULL, NULL, &unLocalUserID ) != CELL_USERINFO_RET_OK ) + return false; + + // can now unload the module + cellSysmoduleUnloadModule( CELL_SYSMODULE_SYSUTIL_USERINFO ); + + // save to the game directory + if ( snprintf( g_rgchUserDataPath, sizeof( g_rgchUserDataPath ), "%s/%u_stats.bin", g_SteamPS3Params.m_rgchGameData, unLocalUserID ) > sizeof( g_rgchUserDataPath ) - 1 ) + return false; + + return true; +} + +const char *GetUserSaveDataPath() +{ + return g_rgchUserDataPath; +} + + +//----------------------------------------------------------------------------- +// Purpose: Main entry point for the program -- ps3 +//----------------------------------------------------------------------------- +int main( int argc, char *argv[] ) +{ +#ifdef PS3_MTT_DEBUG + mttLogInit( "/app_home/libmtt_log.txt" ); +#endif + OutputDebugString( "PS3 main\n" ); + + // Initialize 6 SPUs but reserve 1 SPU as a raw SPU for PSGL + sys_spu_initialize(6, 1); + + // Load Steam + if ( !LoadSteamPS3Module() ) + return EXIT_FAILURE; + + // Construct a new instance of the game engine + // bugbug jmccaskey - make screen resolution dynamic, maybe take it on command line? + CGameEnginePS3 *pGameEngine = new CGameEnginePS3(); + + // No restart app if necessary, or CEG initialization on PS3 + + // Initialize SteamAPI, if this fails we bail out since we depend on Steam for lots of stuff. + // You don't necessarily have to though if you write your code to check whether all the Steam + // interfaces are NULL before using them and provide alternate paths when they are unavailable. + + if ( !SetSteamPS3Params( &g_SteamPS3Params ) ) + { + OutputDebugString( "SetSteamPS3Params() failed\n" ); + return EXIT_FAILURE; + } + + // do before SteamAPI_Init(), so we can load and unload the userinfo module (we will tell Steam it isn't loaded) + if ( !SetUserSaveDataPath() ) + { + OutputDebugString( "SetUserSaveDataPath() failed\n" ); + return EXIT_FAILURE; + } + + if ( !SteamAPI_Init( &g_SteamPS3Params ) ) + { + OutputDebugString( "SteamAPI_Init() failed\n" ); + return EXIT_FAILURE; + } + + // set our debug handler + SteamClient()->SetWarningMessageHook( &SteamAPIDebugTextHook ); + + // set text for Steam to use for PSN game invites + SteamUtils()->SetPSNGameBootInviteStrings( "Spacewar Invite", "You've been invited to join a Spacewar lobby!" ); + + // Setup overlay render interface for PS3 Steam overlay + SteamPS3OverlayRender()->BHostInitialize( pGameEngine->GetViewportWidth(), pGameEngine->GetViewportHeight(), 60, pGameEngine, NULL ); + + // No +connect support on PS3 since Steam isn't launching us, but we check for PSN boot invites, and this may postback a lobby join + // requested callback to us. + + // bugbug jmccaskey - MUST call cellGameBootCheck() to get attributes param to pass here! + SteamMatchmaking()->CheckForPSNGameBootInvite( 0 ); + + // This call will block and run until the game exits + RunGameLoop( pGameEngine, NULL, NULL ); + +#ifdef PS3_MTT_DEBUG + mttLogShutdown(); +#endif + + // Shutdown the SteamAPI + SteamAPI_Shutdown(); + + // Unload Steam + UnloadSteamPS3Module(); + + // exit + return 0; +} + +//----------------------------------------------------------------------------- +// Purpose: PS3 callback handler +//----------------------------------------------------------------------------- +static void PS3SysutilCallback( uint64_t status, uint64_t param, void* userdata ) +{ + (void) param; + + CGameEnginePS3 *pGameEngine = CGameEnginePS3::FindEngineInstanceForPtr( userdata ); + + switch( status ) + { + case CELL_SYSUTIL_REQUEST_EXITGAME: + pGameEngine->Shutdown(); + break; + case CELL_SYSUTIL_DRAWING_BEGIN: + case CELL_SYSUTIL_DRAWING_END: + break; + case CELL_SYSUTIL_SYSTEM_MENU_OPEN: + OutputDebugString( "System menu opened!\n" ); + break; + case CELL_SYSUTIL_SYSTEM_MENU_CLOSE: + OutputDebugString( "System menu closed!\n" ); + break; + default: + // Ok that we don't know them all, Steam handles some that we don't know. + //OutputDebugString( "PS3SysutilCallback: Unknown status received\n" ); + break; + } + + // Must call this to pass along to Steam which may need async status provided by these + // callbacks as well. + SteamUtils()->PostPS3SysutilCallback( status, param, userdata ); +} + +struct PacketQueue_t +{ + uint32 unSize; + void *pData; + uint32 unWritten; + PacketQueue_t *pNext; +}; + +class CVoiceContext +{ +public: + CVoiceContext() + { + m_PortIdInput = 0; + m_PortIdOutput = 0; + m_pQueue = NULL; + } + virtual ~CVoiceContext() + { + // + } + + uint32_t m_PortIdInput; + uint32_t m_PortIdOutput; + PacketQueue_t *m_pQueue; + +}; + + +//----------------------------------------------------------------------------- +// Purpose: Constructor for game engine instance +//----------------------------------------------------------------------------- +CGameEnginePS3::CGameEnginePS3() +{ + m_bEngineReadyForUse = false; + m_bShuttingDown = false; + m_nWindowWidth = 0; + m_nWindowHeight = 0; + m_ulPreviousGameTickCount = 0; + m_ulGameTickCount = 0; + m_hTextureWhite = 0; + m_pPSGLContext = NULL; + m_pPSGLDevice = NULL; + m_DbgFontConsoleID = -1; + m_nNextFontHandle = 1; + m_nNextTextureHandle = 1; + m_hLastTexture = 0; + + m_rgflPointsData = new GLfloat[ 3*POINT_BUFFER_TOTAL_SIZE ]; + m_rgflPointsColorData = new GLubyte[ 4*POINT_BUFFER_TOTAL_SIZE ]; + m_dwPointsToFlush = 0; + + m_rgflLinesData = new GLfloat[ 6*LINE_BUFFER_TOTAL_SIZE ]; + m_rgflLinesColorData = new GLubyte[ 8*LINE_BUFFER_TOTAL_SIZE ]; + m_dwLinesToFlush = 0; + + m_rgflQuadsData = new GLfloat [ 12*QUAD_BUFFER_TOTAL_SIZE ]; + m_rgflQuadsColorData = new GLubyte[ 16*QUAD_BUFFER_TOTAL_SIZE ]; + m_rgflQuadsTextureData = new GLfloat[ 8*QUAD_BUFFER_TOTAL_SIZE ]; + m_dwQuadsToFlush = 0; + m_unVoiceChannelCount = 0; + + + CGameEnginePS3::AddInstanceToPtrMap( this ); + + // Setup timing data + m_ulGameTickCount = cell::fios::FIOSAbstimeToMilliseconds( cell::fios::FIOSGetCurrentTime() ); + + // Register sysutil exit callback + int ret = cellSysutilRegisterCallback( 0, PS3SysutilCallback, this ); + if( ret != CELL_OK ) + { + OutputDebugString( "!! Registering sysutil callback failed...\n" ); + return; + } + + if( !BInitializePSGL() ) + { + OutputDebugString( "!! Initializing PSGL failed\n" ); + return; + } + + if( !BInitializeCellDbgFont() ) + { + OutputDebugString( "!! Initializing CellDbgFont failed\n" ); + return; + } + + if ( !BInitializeLibPad() ) + { + OutputDebugString( "!! Initializing libpad failed\n" ); + return; + } + + if ( !BInitializeAudio() ) + { + OutputDebugString( "!! Initializing audio failed\n" ); + return; + } + + m_bEngineReadyForUse = true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Shutdown the game engine +//----------------------------------------------------------------------------- +void CGameEnginePS3::Shutdown() +{ + // Flag that we are shutting down so the frame loop will stop running + m_bShuttingDown = true; + + // Shutdown dbg font library + if ( m_DbgFontConsoleID >= 0 ) + { + cellDbgFontConsoleClose( m_DbgFontConsoleID ); + cellDbgFontExit(); + } + + // Should be safe to call even if we didn't actually init. + cellPadEnd(); + + // PS3 docs say it's best not to call this and allow the os/vshell to handle it instead to avoid brief noise + // in the video display + + if ( m_rgflPointsData ) + { + delete[] m_rgflPointsData; + m_rgflPointsData = NULL; + } + + if ( m_rgflPointsColorData ) + { + delete[] m_rgflPointsColorData; + m_rgflPointsColorData = NULL; + } + + if ( m_rgflLinesData ) + { + delete[] m_rgflLinesData; + m_rgflLinesData = NULL; + } + + if ( m_rgflLinesColorData ) + { + delete[] m_rgflLinesColorData; + m_rgflLinesColorData = NULL; + } + + if ( m_rgflQuadsData ) + { + delete[] m_rgflQuadsData; + m_rgflQuadsData = NULL; + } + + if ( m_rgflQuadsColorData ) + { + delete[] m_rgflQuadsColorData; + m_rgflQuadsColorData = NULL; + } + + if ( m_rgflQuadsTextureData ) + { + delete[] m_rgflQuadsTextureData; + m_rgflQuadsTextureData = NULL; + } + + m_dwLinesToFlush = 0; + m_dwPointsToFlush = 0; + m_dwQuadsToFlush = 0; + + /* + + // PS3 docs say it's best not to call this and allow the os/vshell to handle it instead to avoid brief noise + // in the video display. Should we not do this then? + // + // bugbug jmccaskey - don't do this? + if ( m_pPSGLDevice ) + { + psglMakeCurrent( NULL, m_pPSGLDevice ); + if ( m_pPSGLContext ) + { + psglDestroyContext( m_pPSGLContext ); + m_pPSGLContext = NULL; + } + + psglDestroyDevice( m_pPSGLDevice ); + m_pPSGLDevice = NULL; + } + + psglExit(); + + */ +} + + +//----------------------------------------------------------------------------- +// Purpose: Initialize voice/audio interfaces +//----------------------------------------------------------------------------- +bool CGameEnginePS3::BInitializeAudio() +{ + int ret = cellSysmoduleLoadModule(CELL_SYSMODULE_VOICE); + if ( ret < 0 ) + return false; + + CellVoiceInitParam Params; + memset(&Params, 0, sizeof(CellVoiceInitParam)); + Params.appType = CELLVOICE_APPTYPE_GAME_1MB; + Params.version = CELLVOICE_VERSION_100; + + ret = cellVoiceInitEx( &Params ); + + if (ret != CELL_OK ) + return false; + + sys_ipc_key_t voiceEventKey; + sys_event_queue_t voiceQueue; + int err = cellVoiceCreateNotifyEventQueue(&voiceQueue, &voiceEventKey); + if (err != CELL_OK) + return false; + + uint64_t source = 12345; + + err = cellVoiceSetNotifyEventQueue(voiceEventKey, source); + + if (err != CELL_OK) + return false; + + return true; +} + +//----------------------------------------------------------------------------- +// Purpose: Initialize libpad for controller input +//----------------------------------------------------------------------------- +bool CGameEnginePS3::BInitializeLibPad() +{ + int ret = cellPadInit( CELL_PAD_MAX_PORT_NUM ); + if ( ret != CELL_OK ) + return false; + + // We don't use pressure sensitivity or sixaxis + for ( int i=0; i orange + g_DbgFontConsoleID = m_DbgFontConsoleID = cellDbgFontConsoleOpen( &ccfg0 ); + if ( g_DbgFontConsoleID < 0 ) + { + OutputDebugString( "Failed creating CellDbgFontConsole\n" ); + } + + return true; +} + +//----------------------------------------------------------------------------- +// Purpose: Updates current tick count for the game engine +//----------------------------------------------------------------------------- +void CGameEnginePS3::UpdateGameTickCount() +{ + m_ulPreviousGameTickCount = m_ulGameTickCount; + m_ulGameTickCount = cell::fios::FIOSAbstimeToMilliseconds( cell::fios::FIOSGetCurrentTime() ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Tell the game engine to sleep for a bit if needed to limit frame rate. You must keep +// calling this repeatedly until it returns false. If it returns true it's slept a little, but more +// time may be needed. +//----------------------------------------------------------------------------- +bool CGameEnginePS3::BSleepForFrameRateLimit( uint32 ulMaxFrameRate ) +{ + // Frame rate limiting + float flDesiredFrameMilliseconds = 1000.0f/ulMaxFrameRate; + + uint64 ulGameTickCount = cell::fios::FIOSAbstimeToMilliseconds( cell::fios::FIOSGetCurrentTime() ); + + float flMillisecondsElapsed = (float)(ulGameTickCount - m_ulGameTickCount); + if ( flMillisecondsElapsed < flDesiredFrameMilliseconds ) + { + // If enough time is left sleep, otherwise just keep spinning so we don't go over the limit... + if ( flDesiredFrameMilliseconds - flMillisecondsElapsed > 3.0f ) + { + sys_timer_usleep( 2000 ); + } + else + { + // Just return right away so we busy loop, don't want to sleep too long and go over + } + + return true; + } + else + { + return false; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Set the background color to clear to +//----------------------------------------------------------------------------- +void CGameEnginePS3::SetBackgroundColor( short a, short r, short g, short b ) +{ + glClearColor( (float)r/255.0f, (float)g/255.0f, (float)b/255.0f, (float)a/255.0f ); +} + +//----------------------------------------------------------------------------- +// Purpose: Start a new frame +//----------------------------------------------------------------------------- +bool CGameEnginePS3::StartFrame() +{ +#ifdef PS3_MTT_DEBUG + mttLogNewFrame(); +#endif + // Pump PS3 system callbacks + MessagePump(); + + // We may now be shutting down, check and don't start a frame then + if ( BShuttingDown() ) + return false; + + // Clear the screen for the new frame + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT ); + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: End the current frame +//----------------------------------------------------------------------------- +void CGameEnginePS3::EndFrame() +{ + if ( BShuttingDown() ) + return; + + if ( !m_pPSGLDevice ) + return; + + if ( !m_pPSGLContext ) + return; + + // Flush point buffer + BFlushPointBuffer(); + + // Flush line buffer + BFlushLineBuffer(); + + // Flush quad buffer + BFlushQuadBuffer(); + + // Flush dbg font data + cellDbgFontDraw(); + + // Tell the Steam overlay to draw now + SteamPS3OverlayRender()->Render(); + + // Draw a few lines, for 10% and 15% safe boundaries + DWORD dwColor = D3DCOLOR_ARGB( 50, 255, 0, 0 ); + + float flXSafe = GetViewportWidth()*0.05f; + float flYSafe = GetViewportHeight()*0.05f; + BDrawLine( flXSafe, flYSafe, dwColor, flXSafe, GetViewportHeight()-flYSafe, dwColor ); + BDrawLine( flXSafe, flYSafe, dwColor, GetViewportWidth()-flXSafe, flYSafe, dwColor ); + BDrawLine( GetViewportWidth()-flXSafe, flYSafe, dwColor, GetViewportWidth()-flXSafe, GetViewportHeight()-flYSafe, dwColor ); + BDrawLine( flXSafe, GetViewportHeight()-flYSafe, dwColor, GetViewportWidth()-flXSafe, GetViewportHeight()-flYSafe, dwColor ); + + dwColor = D3DCOLOR_ARGB( 50, 255, 255, 0 ); + flXSafe = GetViewportWidth()*0.075f; + flYSafe = GetViewportHeight()*0.075f; + BDrawLine( flXSafe, flYSafe, dwColor, flXSafe, GetViewportHeight()-flYSafe, dwColor ); + BDrawLine( flXSafe, flYSafe, dwColor, GetViewportWidth()-flXSafe, flYSafe, dwColor ); + BDrawLine( GetViewportWidth()-flXSafe, flYSafe, dwColor, GetViewportWidth()-flXSafe, GetViewportHeight()-flYSafe, dwColor ); + BDrawLine( flXSafe, GetViewportHeight()-flYSafe, dwColor, GetViewportWidth()-flXSafe, GetViewportHeight()-flYSafe, dwColor ); + + // Flush quads a second time, as Steam may have queued more batches. + BFlushQuadBuffer(); + + // Flush lines again + BFlushLineBuffer(); + + // Swap buffers now that everything is flushed + psglSwap(); + + RunAudio(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Draw a line, the engine internally manages a vertex buffer for batching these +//----------------------------------------------------------------------------- +bool CGameEnginePS3::BDrawLine( float xPos0, float yPos0, DWORD dwColor0, float xPos1, float yPos1, DWORD dwColor1 ) +{ + if ( !m_pPSGLContext || !m_pPSGLDevice || m_bShuttingDown ) + return false; + + + // Check if we are out of room and need to flush the buffer + if ( m_dwLinesToFlush == LINE_BUFFER_TOTAL_SIZE ) + { + BFlushLineBuffer(); + } + + DWORD dwOffset = m_dwLinesToFlush*6; + m_rgflLinesData[dwOffset] = xPos0; + m_rgflLinesData[dwOffset+1] = yPos0; + m_rgflLinesData[dwOffset+2] = 1.0; + m_rgflLinesData[dwOffset+3] = xPos1; + m_rgflLinesData[dwOffset+4] = yPos1; + m_rgflLinesData[dwOffset+5] = 1.0; + + dwOffset = m_dwLinesToFlush*8; + m_rgflLinesColorData[dwOffset] = COLOR_RED( dwColor0 ); + m_rgflLinesColorData[dwOffset+1] = COLOR_GREEN( dwColor0 ); + m_rgflLinesColorData[dwOffset+2] = COLOR_BLUE( dwColor0 ); + m_rgflLinesColorData[dwOffset+3] = COLOR_ALPHA( dwColor0 ); + m_rgflLinesColorData[dwOffset+4] = COLOR_RED( dwColor1 ); + m_rgflLinesColorData[dwOffset+5] = COLOR_GREEN( dwColor1 ); + m_rgflLinesColorData[dwOffset+6] = COLOR_BLUE( dwColor1 ); + m_rgflLinesColorData[dwOffset+7] = COLOR_ALPHA( dwColor1 ); + + ++m_dwLinesToFlush; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Flush batched lines to the screen +//----------------------------------------------------------------------------- +bool CGameEnginePS3::BFlushLineBuffer() +{ + if ( !m_pPSGLContext || !m_pPSGLDevice || !m_rgflLinesColorData || !m_rgflLinesData || m_bShuttingDown ) + return false; + + if ( m_dwLinesToFlush ) + { + glColorPointer( 4, GL_UNSIGNED_BYTE, 0, m_rgflLinesColorData ); + glVertexPointer( 3, GL_FLOAT, 0, m_rgflLinesData ); + glDrawArrays( GL_LINES, 0, m_dwLinesToFlush*2 ); + + m_dwLinesToFlush = 0; + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Draw a point, the engine internally manages a vertex buffer for batching these +//----------------------------------------------------------------------------- +bool CGameEnginePS3::BDrawPoint( float xPos, float yPos, DWORD dwColor ) +{ + + if ( !m_pPSGLContext || !m_pPSGLDevice || m_bShuttingDown ) + return false; + + + // Check if we are out of room and need to flush the buffer + if ( m_dwPointsToFlush == POINT_BUFFER_TOTAL_SIZE ) + { + BFlushPointBuffer(); + } + + DWORD dwOffset = m_dwPointsToFlush*3; + m_rgflPointsData[dwOffset] = xPos; + m_rgflPointsData[dwOffset+1] = yPos; + m_rgflPointsData[dwOffset+2] = 1.0; + + dwOffset = m_dwPointsToFlush*4; + m_rgflPointsColorData[dwOffset] = COLOR_RED( dwColor ); + m_rgflPointsColorData[dwOffset+1] = COLOR_GREEN( dwColor ); + m_rgflPointsColorData[dwOffset+2] = COLOR_BLUE( dwColor ); + m_rgflPointsColorData[dwOffset+3] = COLOR_ALPHA( dwColor ); + + ++m_dwPointsToFlush; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Flush batched points to the screen +//----------------------------------------------------------------------------- +bool CGameEnginePS3::BFlushPointBuffer() +{ + if ( !m_pPSGLContext || !m_pPSGLDevice || !m_rgflPointsColorData || !m_rgflPointsData || m_bShuttingDown ) + return false; + + if ( m_dwPointsToFlush ) + { + glColorPointer( 4, GL_UNSIGNED_BYTE, 0, m_rgflPointsColorData ); + glVertexPointer( 3, GL_FLOAT, 0, m_rgflPointsData ); + glDrawArrays( GL_POINTS, 0, m_dwPointsToFlush ); + + m_dwPointsToFlush = 0; + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Draw a filled quad +//----------------------------------------------------------------------------- +bool CGameEnginePS3::BDrawFilledQuad( float xPos0, float yPos0, float xPos1, float yPos1, DWORD dwColor ) +{ + if ( !m_hTextureWhite ) + { + byte *pRGBAData = new byte[ 1 * 1 * 4 ]; + memset( pRGBAData, 255, 1*1*4 ); + m_hTextureWhite = HCreateTexture( pRGBAData, 1, 1 ); + delete[] pRGBAData; + } + + return BDrawTexturedQuad( xPos0, yPos0, xPos1, yPos1, 0.0f, 0.0f, 1.0f, 1.0f, dwColor, m_hTextureWhite ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Draw a textured quad +//----------------------------------------------------------------------------- +bool CGameEnginePS3::BDrawTexturedQuad( float xPos0, float yPos0, float xPos1, float yPos1, float u0, float v0, float u1, float v1, DWORD dwColor, HGAMETEXTURE hTexture ) +{ + return BDrawTexturedGradientQuad( xPos0, yPos0, xPos1, yPos1, u0, v0, u1, v1, dwColor, dwColor, dwColor, dwColor, hTexture ); +} + +//----------------------------------------------------------------------------- +// Purpose: Draw a textured quad, with different colors at each vertex +//----------------------------------------------------------------------------- +bool CGameEnginePS3::BDrawTexturedGradientQuad( float xPos0, float yPos0, float xPos1, float yPos1, + float u0, float v0, float u1, float v1, + DWORD dwColorTopLeft, DWORD dwColorTopRight, DWORD dwColorBottomLeft, DWORD dwColorBottomRight, HGAMETEXTURE hTexture ) +{ + if ( m_bShuttingDown || !m_pPSGLDevice || !m_pPSGLContext ) + return false; + + // Find the texture + std::map::iterator iter; + iter = m_MapTextures.find( hTexture ); + if ( iter == m_MapTextures.end() ) + { + OutputDebugString( "BDrawTexturedQuad called with invalid hTexture value\n" ); + return false; + } + + // Check if we are out of room and need to flush the buffer, or if our texture is changing + // then we also need to flush the buffer. + if ( m_dwQuadsToFlush == QUAD_BUFFER_TOTAL_SIZE || m_hLastTexture != hTexture ) + { + BFlushQuadBuffer(); + } + + // Bind the new texture + glBindTexture( GL_TEXTURE_2D, iter->second.m_uTextureID ); + + DWORD dwOffset = m_dwQuadsToFlush*12; + m_rgflQuadsData[dwOffset] = xPos0; + m_rgflQuadsData[dwOffset+1] = yPos0; + m_rgflQuadsData[dwOffset+2] = 1.0f; + m_rgflQuadsData[dwOffset+3] = xPos1; + m_rgflQuadsData[dwOffset+4] = yPos0; + m_rgflQuadsData[dwOffset+5] = 1.0f; + m_rgflQuadsData[dwOffset+6] = xPos1; + m_rgflQuadsData[dwOffset+7] = yPos1; + m_rgflQuadsData[dwOffset+8] = 1.0f; + m_rgflQuadsData[dwOffset+9] = xPos0; + m_rgflQuadsData[dwOffset+10] = yPos1; + m_rgflQuadsData[dwOffset+11] = 1.0f; + + dwOffset = m_dwQuadsToFlush*16; + m_rgflQuadsColorData[dwOffset] = COLOR_RED( dwColorTopLeft ); + m_rgflQuadsColorData[dwOffset+1] = COLOR_GREEN( dwColorTopLeft ); + m_rgflQuadsColorData[dwOffset+2] = COLOR_BLUE( dwColorTopLeft ); + m_rgflQuadsColorData[dwOffset+3] = COLOR_ALPHA( dwColorTopLeft ); + m_rgflQuadsColorData[dwOffset+4] = COLOR_RED( dwColorTopRight ); + m_rgflQuadsColorData[dwOffset+5] = COLOR_GREEN( dwColorTopRight ); + m_rgflQuadsColorData[dwOffset+6] = COLOR_BLUE( dwColorTopRight ); + m_rgflQuadsColorData[dwOffset+7] = COLOR_ALPHA( dwColorTopRight ); + m_rgflQuadsColorData[dwOffset+8] = COLOR_RED( dwColorBottomLeft ); + m_rgflQuadsColorData[dwOffset+9] = COLOR_GREEN( dwColorBottomLeft ); + m_rgflQuadsColorData[dwOffset+10] = COLOR_BLUE( dwColorBottomLeft ); + m_rgflQuadsColorData[dwOffset+11] = COLOR_ALPHA( dwColorBottomLeft ); + m_rgflQuadsColorData[dwOffset+12] = COLOR_RED( dwColorBottomRight ); + m_rgflQuadsColorData[dwOffset+13] = COLOR_GREEN( dwColorBottomRight ); + m_rgflQuadsColorData[dwOffset+14] = COLOR_BLUE( dwColorBottomRight ); + m_rgflQuadsColorData[dwOffset+15] = COLOR_ALPHA( dwColorBottomRight ); + + dwOffset = m_dwQuadsToFlush*8; + m_rgflQuadsTextureData[dwOffset] = u0; + m_rgflQuadsTextureData[dwOffset+1] = v0; + m_rgflQuadsTextureData[dwOffset+2] = u1; + m_rgflQuadsTextureData[dwOffset+3] = v0; + m_rgflQuadsTextureData[dwOffset+4] = u1; + m_rgflQuadsTextureData[dwOffset+5] = v1; + m_rgflQuadsTextureData[dwOffset+6] = u0; + m_rgflQuadsTextureData[dwOffset+7] = v1; + + + ++m_dwQuadsToFlush; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Flush buffered quads +//----------------------------------------------------------------------------- +bool CGameEnginePS3::BFlushQuadBuffer() +{ + if ( !m_pPSGLContext || !m_pPSGLDevice || !m_rgflPointsColorData || !m_rgflPointsData || m_bShuttingDown ) + return false; + + if ( m_dwQuadsToFlush ) + { + glEnable( GL_TEXTURE_2D ); + glEnableClientState( GL_TEXTURE_COORD_ARRAY ); + + glColorPointer( 4, GL_UNSIGNED_BYTE, 0, m_rgflQuadsColorData ); + glVertexPointer( 3, GL_FLOAT, 0, m_rgflQuadsData ); + glTexCoordPointer( 2, GL_FLOAT, 0, m_rgflQuadsTextureData ); + glDrawArrays( GL_QUADS, 0, m_dwQuadsToFlush*4 ); + + glDisable( GL_TEXTURE_2D ); + glDisableClientState( GL_TEXTURE_COORD_ARRAY ); + + m_dwQuadsToFlush = 0; + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Creates a new texture +//----------------------------------------------------------------------------- +HGAMETEXTURE CGameEnginePS3::HCreateTexture( byte *pRGBAData, uint32 uWidth, uint32 uHeight ) +{ + if ( m_bShuttingDown || !m_pPSGLDevice || !m_pPSGLContext ) + return 0; + + BFlushQuadBuffer(); + + TextureData_t TexData; + TexData.m_uWidth = uWidth; + TexData.m_uHeight = uHeight; + TexData.m_uTextureID = 0; + + glEnable( GL_TEXTURE_2D ); + glGenTextures( 1, &TexData.m_uTextureID ); + glBindTexture( GL_TEXTURE_2D, TexData.m_uTextureID ); + + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0 ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0 ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); + + // build our texture mipmaps + glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, uWidth, uHeight, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, (void *)pRGBAData ); + glDisable( GL_TEXTURE_2D ); + + int nHandle = m_nNextTextureHandle; + ++m_nNextTextureHandle; + m_MapTextures[nHandle] = TexData; + + return nHandle; +} + + +//----------------------------------------------------------------------------- +// Purpose: Creates a new font +//----------------------------------------------------------------------------- +HGAMEFONT CGameEnginePS3::HCreateFont( int nHeight, int nFontWeight, bool bItalic, const char * pchFont ) +{ + HGAMEFONT hFont = m_nNextFontHandle; + ++m_nNextFontHandle; + + // weight + italic are not supported in our dbg font output on ps3. Neither is specifying font. + // We also have to compute a "scale" relative to screen size, so it may not match pc exactly. + + // 1.0f for scale means 80 characters fit the screen width, 32 lines fit the height. + // We'll call that 1.0 scale font roughly equivalent to 28pt font height on pc/d3d. + + PS3DbgFont_t font; + font.m_nScale = (float)nHeight/28.0f; + m_MapGameFonts[ hFont ] = font; + + return hFont; +} + + +//----------------------------------------------------------------------------- +// Purpose: Draws text to the screen inside the given rectangular region, using the given font +//----------------------------------------------------------------------------- +bool CGameEnginePS3::BDrawString( HGAMEFONT hFont, RECT rect, DWORD dwColor, DWORD dwFormat, const char *pchText ) +{ + if ( !hFont ) + { + OutputDebugString( "Someone is calling BDrawString with a null font handle\n" ); + return false; + } + + float fCharWidth = m_nWindowWidth/80.0f; + float fCharHeight = m_nWindowHeight/32.0f; + + // Find the font object for the passed handle + std::map::iterator iter; + iter = m_MapGameFonts.find( hFont ); + if ( iter == m_MapGameFonts.end() ) + { + OutputDebugString( "Invalid font handle passed to BDrawString()\n" ); + return false; + } + + fCharWidth *= iter->second.m_nScale; + fCharHeight *= iter->second.m_nScale; + + // Compute width/height in chars/lines + int nLinesInText = 1; + int nCharsWideMax = 0; + int nCharsLine = 0; + for( int i=0; i < strlen(pchText); ++i ) + { + if ( pchText[i] == '\n' ) + { + ++nLinesInText; + nCharsWideMax = MAX( nCharsLine, nCharsWideMax ); + nCharsLine = 0; + } + else + { + // We assume all non linebreak chars are printable, don't pass others! + ++nCharsLine; + } + } + nCharsWideMax = MAX( nCharsLine, nCharsWideMax ); + + // Assume top left positioning + float x = (float)rect.left; + float y = (float)rect.top; + + if ( TEXTPOS_CENTER & dwFormat ) + { + float fTextWidth = nCharsWideMax * fCharWidth; + x = (float)rect.left + ((float)( rect.right-rect.left) - fTextWidth)/2.0f; + } + else if ( TEXTPOS_RIGHT &dwFormat ) + { + float fTextWidth = nCharsWideMax * fCharWidth; + x = (float)rect.right - fTextWidth; + } + + if ( TEXTPOS_VCENTER & dwFormat ) + { + float fTextHeight = nLinesInText * fCharHeight; + y = (float)rect.top + ((float)( rect.bottom-rect.top) - fTextHeight)/2.0f; + } + else if ( TEXTPOS_RIGHT &dwFormat ) + { + float fTextHeight = nLinesInText * fCharHeight; + y = (float)rect.bottom - fTextHeight; + } + + // Convert x/y to 0.0->1.0 range vs screen size + x = x/(float)m_nWindowWidth; + y = y/(float)m_nWindowHeight; + + // we have the font, try to draw with it + if( cellDbgFontPuts( x, y, iter->second.m_nScale, DWARGB_TO_DWABGR(dwColor), pchText ) < 0 ) + { + OutputDebugString( "cellDbgFontPuts call failed\n" ); + return false; + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Message pump for OS messages +//----------------------------------------------------------------------------- +void CGameEnginePS3::MessagePump() +{ + cellSysutilCheckCallback(); + + // Running callbacks may have triggered shutdown, if not run input + if ( !m_bShuttingDown ) + { + CellPadInfo2 padInfo; + int ret = cellPadGetInfo2( &padInfo ); + if ( ret == CELL_OK ) + { + if ( padInfo.system_info & CELL_PAD_INFO_INTERCEPTED ) + { + // System has taken control of controller info, we can't currently access it. + } + + bool bControllerFound = false; + m_iCurrentPadIndex = -1; + for( int i=0; i < CELL_PAD_MAX_PORT_NUM; ++i ) + { + if ( padInfo.port_status[i] & CELL_PAD_STATUS_ASSIGN_CHANGES ) + { + if ( (padInfo.port_status[i] & CELL_PAD_STATUS_CONNECTED) == 0 ) + { + char rgchBuffer[512]; + sprintf_safe( rgchBuffer, "Gamepad %d removed\n", i ); + OutputDebugString( rgchBuffer ); + } + else if ( (padInfo.port_status[i] & CELL_PAD_STATUS_CONNECTED) > 0 ) + { + char rgchBuffer[512]; + sprintf_safe( rgchBuffer, "Gamepad %d connected\n", i ); + OutputDebugString( rgchBuffer ); + } + } + + if ( (padInfo.port_status[i] & CELL_PAD_STATUS_CONNECTED ) > 0 && padInfo.device_type[i] == CELL_PAD_DEV_TYPE_STANDARD ) + { + bControllerFound = true; + m_iCurrentPadIndex = i; + break; + } + } + + if ( padInfo.system_info & CELL_PAD_INFO_INTERCEPTED ) + { + // Pass zeroed pad data to overlay to clear it's button state too + SteamPS3OverlayRender()->BResetInputState(); + + // Clear all keys + m_SetKeysDown.clear(); + } + + if ( !bControllerFound ) + { + // Definitely no appropriate controller plugged in, can't do input + static DWORD dwLastSpewTime = 0; + if ( GetGameTickCount() - dwLastSpewTime > 3000 || dwLastSpewTime == 0 || dwLastSpewTime > GetGameTickCount() ) + { + dwLastSpewTime = GetGameTickCount(); + OutputDebugString( "No supported controllers are active, activate one.\n" ); + } + + // Pass zeroed pad data to overlay to clear it's button state too + SteamPS3OverlayRender()->BResetInputState(); + + // Clear all keys + m_SetKeysDown.clear(); + } + else + { + // Get status of the first found controller now + CellPadData padData; + int ret = cellPadGetData( m_iCurrentPadIndex, &padData ); + + // If we got data ok, and if the data is new (len != 0) then process it + if ( ret == CELL_OK && padData.len ) + { + if ( !SteamPS3OverlayRender()->BHandleCellPadData( padData ) ) + { + if ( padData.button[CELL_PAD_BTN_OFFSET_DIGITAL2] & CELL_PAD_CTRL_R2 ) + { + m_SetKeysDown.insert( 0x57 ); // W key, thrusters, mapped to R2 on PS3 + } + else + { + m_SetKeysDown.erase( 0x57 ); + } + + if ( padData.button[CELL_PAD_BTN_OFFSET_DIGITAL2] & CELL_PAD_CTRL_L2 ) + { + m_SetKeysDown.insert( 0x53 ); // S key, reverse thrusters, mapped to L2 on PS3 + } + else + { + m_SetKeysDown.erase( 0x53 ); + } + + if ( padData.button[CELL_PAD_BTN_OFFSET_DIGITAL2] & CELL_PAD_CTRL_CROSS ) + { + // Mapped to both enter in menus, and fire in game + m_SetKeysDown.insert( VK_RETURN ); + m_SetKeysDown.insert( VK_SPACE ); + } + else + { + m_SetKeysDown.erase( VK_RETURN ); + m_SetKeysDown.erase( VK_SPACE ); + } + + if ( padData.button[CELL_PAD_BTN_OFFSET_DIGITAL2] & CELL_PAD_CTRL_CIRCLE ) + { + m_SetKeysDown.insert( VK_ESCAPE ); + } + else + { + m_SetKeysDown.erase( VK_ESCAPE ); + } + + if ( padData.button[CELL_PAD_BTN_OFFSET_DIGITAL1] & CELL_PAD_CTRL_UP || padData.button[CELL_PAD_BTN_OFFSET_ANALOG_LEFT_Y] == 0x00 ) + { + m_SetKeysDown.insert( VK_UP ); + } + else + { + m_SetKeysDown.erase( VK_UP ); + } + + if ( padData.button[CELL_PAD_BTN_OFFSET_DIGITAL1] & CELL_PAD_CTRL_DOWN || padData.button[CELL_PAD_BTN_OFFSET_ANALOG_LEFT_Y] == 0xFF ) + { + m_SetKeysDown.insert( VK_DOWN ); + } + else + { + m_SetKeysDown.erase( VK_DOWN ); + } + + if ( padData.button[CELL_PAD_BTN_OFFSET_DIGITAL1] & CELL_PAD_CTRL_LEFT || padData.button[CELL_PAD_BTN_OFFSET_ANALOG_LEFT_X] == 0x00 ) + { + m_SetKeysDown.insert( 0x41 ); // A Key, mapped to left on PS3 + } + else + { + m_SetKeysDown.erase( 0x41 ); + } + + if ( padData.button[CELL_PAD_BTN_OFFSET_DIGITAL1] & CELL_PAD_CTRL_RIGHT || padData.button[CELL_PAD_BTN_OFFSET_ANALOG_LEFT_X] == 0xFF ) + { + m_SetKeysDown.insert( 0x44 ); // D key, mapped to right on PS3 + } + else + { + m_SetKeysDown.erase( 0x44 ); + } + } + } + } + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Find out if a key is currently down +//----------------------------------------------------------------------------- +bool CGameEnginePS3::BIsKeyDown( DWORD dwVK ) +{ + std::set::iterator iter; + iter = m_SetKeysDown.find( dwVK ); + if ( iter != m_SetKeysDown.end() ) + return true; + + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: Get a down key value +//----------------------------------------------------------------------------- +bool CGameEnginePS3::BGetFirstKeyDown( DWORD *pdwVK ) +{ + std::set::iterator iter; + iter = m_SetKeysDown.begin(); + if ( iter != m_SetKeysDown.end() ) + { + *pdwVK = *iter; + m_SetKeysDown.erase( iter ); + return true; + } + else + { + return false; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Find the engine instance tied to a given ptr +//----------------------------------------------------------------------------- +CGameEnginePS3 * CGameEnginePS3::FindEngineInstanceForPtr( void *ptr ) +{ + std::map::iterator iter; + iter = m_MapEngineInstances.find( ptr ); + if ( iter == m_MapEngineInstances.end() ) + return NULL; + else + return iter->second; +} + + +//----------------------------------------------------------------------------- +// Purpose: Add the engine instance tied to a given ptr to our static map +//----------------------------------------------------------------------------- +void CGameEnginePS3::AddInstanceToPtrMap( CGameEnginePS3 *pInstance ) +{ + m_MapEngineInstances[(void*)pInstance] = pInstance; +} + + +//----------------------------------------------------------------------------- +// Purpose: Removes the instance associated with a given ptr from the map +//----------------------------------------------------------------------------- +void CGameEnginePS3::RemoveInstanceFromPtrMap( void *ptr ) +{ + std::map::iterator iter; + iter = m_MapEngineInstances.find( ptr ); + if ( iter != m_MapEngineInstances.end() ) + m_MapEngineInstances.erase( iter ); +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +HGAMEVOICECHANNEL CGameEnginePS3::HCreateVoiceChannel() +{ + m_unVoiceChannelCount++; + CVoiceContext* pVoiceContext = new CVoiceContext; + + CellVoicePortParam PortArgs; + memset( &PortArgs, 0, sizeof(PortArgs) ); + + PortArgs.portType = CELLVOICE_PORTTYPE_IN_PCMAUDIO; + PortArgs.bMute = false; + PortArgs.threshold = 100; + PortArgs.volume = 1.0f; + PortArgs.pcmaudio.format.sampleRate= CELLVOICE_SAMPLINGRATE_16000; + PortArgs.pcmaudio.format.dataType = CELLVOICE_PCM_SHORT; + PortArgs.pcmaudio.bufSize = 11000; + + int ret= cellVoiceCreatePort( &pVoiceContext->m_PortIdInput, &PortArgs ); + + PortArgs.portType = CELLVOICE_PORTTYPE_OUT_SECONDARY; + PortArgs.bMute = false; + PortArgs.threshold = 100; + PortArgs.volume = 1.0f; + PortArgs.device.playerId = 0; + + ret = cellVoiceCreatePort( &pVoiceContext->m_PortIdOutput, &PortArgs ); + + ret = cellVoiceConnectIPortToOPort( pVoiceContext->m_PortIdInput, pVoiceContext->m_PortIdOutput ); + + if( ret != CELL_OK ) + { + delete pVoiceContext; + return 0; // failed + } + + if ( m_unVoiceChannelCount == 1 ) + { + CellVoiceStartParam startParams; + startParams.container = SYS_MEMORY_CONTAINER_ID_INVALID; + ret = sys_memory_container_create(&startParams.container,1024*1024); + ret = cellVoiceStartEx(&startParams); + } + + m_MapVoiceChannel[m_unVoiceChannelCount] = pVoiceContext; + + return m_unVoiceChannelCount; +} + +void CGameEnginePS3::RunAudio() +{ + std::map::iterator iter; + + for( iter = m_MapVoiceChannel.begin(); iter!=m_MapVoiceChannel.end(); ++iter) + { + CVoiceContext* pVoiceContext = iter->second; + + PacketQueue_t *pVoicePacket = pVoiceContext->m_pQueue; + + if ( pVoicePacket ) + { + CellVoiceBasePortInfo PortInfo; + memset(&PortInfo, 0, sizeof(PortInfo)); + int Result = cellVoiceGetPortInfo( pVoiceContext->m_PortIdInput, &PortInfo ); + if (Result != CELL_OK && Result != CELL_VOICE_ERROR_SERVICE_DETACHED ) + { + printf("cellVoiceGetPortInfo PCMInputPort failed %x\n",Result); + } + + if ( PortInfo.numByte > pVoicePacket->unSize ) + { + uint32_t bytes = pVoicePacket->unSize; + Result = cellVoiceWriteToIPort( pVoiceContext->m_PortIdInput, pVoicePacket->pData, &bytes ); + pVoicePacket->unWritten += bytes; + + if ( pVoicePacket->unWritten >= pVoicePacket->unSize ) + { + pVoiceContext->m_pQueue = pVoicePacket->pNext; + free( pVoicePacket->pData ); + delete pVoicePacket; + } + } + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CGameEnginePS3::DestroyVoiceChannel( HGAMEVOICECHANNEL hChannel ) +{ + std::map::iterator iter; + iter = m_MapVoiceChannel.find( hChannel ); + if ( iter != m_MapVoiceChannel.end() ) + { + CVoiceContext* pVoiceContext = iter->second; + + // free outstanding voice packets + + PacketQueue_t *pVoicePacket = pVoiceContext->m_pQueue; + + while( pVoicePacket ) + { + PacketQueue_t *pNextPacket = pVoicePacket->pNext; + + free( pVoicePacket->pData ); + delete pVoicePacket; + + pVoicePacket = pNextPacket; + } + + // stop voice + + cellVoiceDisconnectIPortFromOPort( pVoiceContext->m_PortIdInput, pVoiceContext->m_PortIdOutput ); + cellVoiceDeletePort( pVoiceContext->m_PortIdInput ); + cellVoiceDeletePort( pVoiceContext->m_PortIdOutput ); + + delete pVoiceContext; + + m_MapVoiceChannel.erase( iter ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +bool CGameEnginePS3::AddVoiceData( HGAMEVOICECHANNEL hChannel, const uint8 *pVoiceData, uint32 uLength ) +{ + std::map::iterator iter; + iter = m_MapVoiceChannel.find( hChannel ); + if ( iter == m_MapVoiceChannel.end() ) + return false; // channel not found + + CVoiceContext* pVoiceContext = iter->second; + + PacketQueue_t *pVoicePacket = new PacketQueue_t; + + pVoicePacket->pData = malloc ( uLength ); + memcpy( pVoicePacket->pData, pVoiceData, uLength ); + pVoicePacket->unSize = uLength; + pVoicePacket->pNext = NULL; + pVoicePacket->unWritten = 0; + + if ( pVoiceContext->m_pQueue == NULL ) + { + // start queue + pVoiceContext->m_pQueue = pVoicePacket; + } + else + { + PacketQueue_t *pLastPacket = pVoiceContext->m_pQueue; + + // find tail + while ( pLastPacket->pNext ) + pLastPacket = pLastPacket->pNext; + + // append to tail + pLastPacket->pNext = pVoicePacket; + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Part of the render host interface for Steam overlay to draw through +//----------------------------------------------------------------------------- +void CGameEnginePS3::DrawTexturedRect( int x0, int y0, int x1, int y1, float u0, float v0, float u1, float v1, int32 iTextureID, DWORD colorStart, DWORD colorEnd, EOverlayGradientDirection eDirection ) +{ + std::map::iterator iter; + iter = m_MapSteamTextures.find( iTextureID ); + if ( iter != m_MapSteamTextures.end() ) + { + if ( eDirection == k_EOverlayGradientHorizontal ) + BDrawTexturedGradientQuad( x0, y0, x1, y1, u0, v0, u1, v1, colorStart, colorEnd, colorEnd, colorStart, iter->second ); + else if ( eDirection == k_EOverlayGradientVertical ) + BDrawTexturedGradientQuad( x0, y0, x1, y1, u0, v0, u1, v1, colorStart, colorStart, colorEnd, colorEnd, iter->second ); + else + BDrawTexturedGradientQuad( x0, y0, x1, y1, u0, v0, u1, v1, colorStart, colorStart, colorStart, colorStart, iter->second ); + + } + else + { + char rgchBuf[512]; + sprintf_safe( rgchBuf, "Steam trying to draw for invalid textureid: %d\n", iTextureID ); + OutputDebugString( rgchBuf ); + + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Part of the render host interface for Steam overlay to draw through +//----------------------------------------------------------------------------- +void CGameEnginePS3::LoadOrUpdateTexture( int32 iTextureID, bool bIsFullTexture, int x0, int y0, uint32 uWidth, uint32 uHeight, int32 iBytes, char *pData ) +{ + BFlushQuadBuffer(); + m_hLastTexture = 0; + + if ( !bIsFullTexture ) + { + bool bUpdated = false; + std::map::iterator iter_steam; + iter_steam = m_MapSteamTextures.find( iTextureID ); + if ( iter_steam != m_MapSteamTextures.end() ) + { + std::map::iterator iter_game; + iter_game = m_MapTextures.find( iter_steam->second ); + if ( iter_game != m_MapTextures.end() ) + { + TextureData_t &TexData = iter_game->second; + + glEnable( GL_TEXTURE_2D ); + glBindTexture( GL_TEXTURE_2D, TexData.m_uTextureID ); + glTexSubImage2D( GL_TEXTURE_2D, 0, x0, y0, uWidth, uHeight, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, pData ); + glDisable( GL_TEXTURE_2D ); + + bUpdated = true; + } + else + { + char rgchBuf[512]; + sprintf_safe( rgchBuf, "Couldn't find texture: %d\n", iTextureID ); + OutputDebugString( rgchBuf ); + } + } + else + { + char rgchBuf[512]; + sprintf_safe( rgchBuf, "Couldn't find Steam mapping for texture: %d\n", iTextureID ); + OutputDebugString( rgchBuf ); + } + + if ( !bUpdated ) + { + char rgchBuf[512]; + sprintf_safe( rgchBuf, "Failed updating texture: %d\n", iTextureID ); + OutputDebugString( rgchBuf ); + } + } + else + { + HGAMETEXTURE hGameTexture = HCreateTexture( (byte*)pData, uWidth, uHeight ); + m_MapSteamTextures[iTextureID] = hGameTexture; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Part of the render host interface for Steam overlay to draw through +//----------------------------------------------------------------------------- +void CGameEnginePS3::DeleteTexture( int32 iTextureID ) +{ + std::map::iterator iter; + iter = m_MapSteamTextures.find( iTextureID ); + if ( iter != m_MapSteamTextures.end() ) + { + // Our game engine doesn't know how to free textures, lol. + m_MapSteamTextures.erase( iter ); + } + else + { + char rgchBuf[512]; + sprintf_safe( rgchBuf, "Got DeleteTexture from Steam for texture we don't have mapped: %d\n", iTextureID ); + OutputDebugString( rgchBuf ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Part of the render host interface for Steam overlay to draw through +//----------------------------------------------------------------------------- +void CGameEnginePS3::DeleteAllTextures() +{ + m_MapSteamTextures.clear(); + + // Don't really know how to delete textures in the engine, lol. +} diff --git a/external/steamworks/steamworksexample/gameengineps3.h b/external/steamworks/steamworksexample/gameengineps3.h new file mode 100644 index 0000000..4b3bcfb --- /dev/null +++ b/external/steamworks/steamworksexample/gameengineps3.h @@ -0,0 +1,235 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Main class for the game engine -- ps3 implementation +// +// $NoKeywords: $ +//============================================================================= + +#ifndef GAMEENGINEPS3_H +#define GAMEENGINEPS3_H + +#include "GameEngine.h" +#include +#include + + +// Font info for PS3 dbg font output +struct PS3DbgFont_t +{ + float m_nScale; +}; + +class CVoiceContext; + +class CGameEnginePS3 : public IGameEngine, public ISteamPS3OverlayRenderHost +{ +public: + + // Static methods for tracing mapping of game engine class instances to hwnds + static CGameEnginePS3 * FindEngineInstanceForPtr( void *ptr ); + static void AddInstanceToPtrMap( CGameEnginePS3* pInstance ); + static void RemoveInstanceFromPtrMap( void *ptr ); + + // Constructor + CGameEnginePS3(); + + // Destructor + ~CGameEnginePS3() { Shutdown(); } + + // Check if the game engine is initialized ok and ready for use + bool BReadyForUse() { return m_bEngineReadyForUse; } + + // Check if the engine is shutting down + bool BShuttingDown() { return m_bShuttingDown; } + + // Set the background color + void SetBackgroundColor( short a, short r, short g, short b ); + + // Start a frame, clear(), beginscene(), etc + bool StartFrame(); + + // Finish a frame, endscene(), present(), etc. + void EndFrame(); + + // Shutdown the game engine + void Shutdown(); + + // Pump messages from the OS + void MessagePump(); + + // Accessors for game screen size + int32 GetViewportWidth() { return m_nWindowWidth; } + int32 GetViewportHeight() { return m_nWindowHeight; } + + // Function for drawing text to the screen, dwFormat is a combination of flags like DT_LEFT, TEXTPOS_VCENTER etc... + bool BDrawString( HGAMEFONT hFont, RECT rect, DWORD dwColor, DWORD dwFormat, const char *pchText ); + + // Create a new font returning our internal handle value for it (0 means failure) + HGAMEFONT HCreateFont( int nHeight, int nFontWeight, bool bItalic, const char * pchFont ); + + // Create a new texture returning our internal handle value for it (0 means failure) + HGAMETEXTURE HCreateTexture( byte *pRGBAData, uint32 uWidth, uint32 uHeight ); + + // Draw a line, the engine itself will manage batching these (although you can explicitly flush if you need to) + bool BDrawLine( float xPos0, float yPos0, DWORD dwColor0, float xPos1, float yPos1, DWORD dwColor1 ); + + // Flush the line buffer + bool BFlushLineBuffer(); + + // Draw a point, the engine itself will manage batching these (although you can explicitly flush if you need to) + bool BDrawPoint( float xPos, float yPos, DWORD dwColor ); + + // Flush the point buffer + bool BFlushPointBuffer(); + + // Draw a filled quad + bool BDrawFilledQuad( float xPos0, float yPos0, float xPos1, float yPos1, DWORD dwColor ); + + // Draw a textured rectangle + bool BDrawTexturedQuad( float xPos0, float yPos0, float xPos1, float yPos1, + float u0, float v0, float u1, float v1, DWORD dwColor, HGAMETEXTURE hTexture ); + + // Flush any still cached quad buffers + bool BFlushQuadBuffer(); + + // Get the current state of a key + bool BIsKeyDown( DWORD dwVK ); + + // Get the first (in some arbitrary order) key down, if any + bool BGetFirstKeyDown( DWORD *pdwVK ); + + // Get current tick count for the game engine + uint64 GetGameTickCount() { return m_ulGameTickCount; } + + // Get the tick count elapsed since the previous frame + // bugbug - We use this time to compute things like thrust and acceleration in the game, + // so it's important in doesn't jump ahead by large increments... Need a better + // way to handle that. + uint64 GetGameTicksFrameDelta() { return m_ulGameTickCount - m_ulPreviousGameTickCount; } + + // Tell the game engine to update current tick count + void UpdateGameTickCount(); + + // Tell the game engine to sleep for a bit if needed to limit frame rate + bool BSleepForFrameRateLimit( uint32 ulMaxFrameRate ); + + // Check if the game engine hwnd currently has focus (and a working d3d device) + bool BGameEngineHasFocus() { return true; } + + // Voice chat functions + virtual HGAMEVOICECHANNEL HCreateVoiceChannel(); + virtual void DestroyVoiceChannel( HGAMEVOICECHANNEL hChannel ); + virtual bool AddVoiceData( HGAMEVOICECHANNEL hChannel, const uint8 *pVoiceData, uint32 uLength ); + + // ISteamPS3OverlayRenderHost implementation + virtual void DrawTexturedRect( int x0, int y0, int x1, int y1, float u0, float v0, float u1, float v1, int32 iTextureID, DWORD colorStart, DWORD colorEnd, EOverlayGradientDirection eDirection ); + virtual void LoadOrUpdateTexture( int32 iTextureID, bool bIsFullTexture, int x0, int y0, uint32 uWidth, uint32 uHeight, int32 iBytes, char *pData ); + virtual void DeleteTexture( int32 iTextureID ); + virtual void DeleteAllTextures(); + +private: + + // Draw a textured rectangle + bool BDrawTexturedGradientQuad( float xPos0, float yPos0, float xPos1, float yPos1, + float u0, float v0, float u1, float v1, + DWORD dwColorTopLeft, DWORD dwColorTopRight, DWORD dwColorBottomLeft, DWORD dwColorBottomRight, HGAMETEXTURE hTexture ); + + + // Initialize the PSGL rendering interfaces and default state + bool BInitializePSGL(); + + // Initialize the debug font library + bool BInitializeCellDbgFont(); + + // Initialize libpad for controller input + bool BInitializeLibPad(); + + bool BInitializeAudio(); + + void RunAudio(); + + +private: + // Tracks whether the engine is ready for use + bool m_bEngineReadyForUse; + + // Tracks if we are shutting down + bool m_bShuttingDown; + + // Size of the window to display the game in + int32 m_nWindowWidth; + int32 m_nWindowHeight; + + // Current game time in milliseconds + uint64 m_ulGameTickCount; + + // Game time at the start of the previous frame + uint64 m_ulPreviousGameTickCount; + + // White texture used when drawing filled quads + HGAMETEXTURE m_hTextureWhite; + + // PSGL and CellDbgFont objects + PSGLcontext * m_pPSGLContext; + PSGLdevice * m_pPSGLDevice; + CellDbgFontConsoleId m_DbgFontConsoleID; + + // Pointer to actual data for points + GLfloat *m_rgflPointsData; + GLubyte *m_rgflPointsColorData; + + // How many points are outstanding needing flush + DWORD m_dwPointsToFlush; + + // Pointer to actual data for lines + GLfloat *m_rgflLinesData; + GLubyte *m_rgflLinesColorData; + + + // How many lines are outstanding needing flush + DWORD m_dwLinesToFlush; + + // Pointer to actual data for quads + GLfloat *m_rgflQuadsData; + GLubyte *m_rgflQuadsColorData; + GLfloat *m_rgflQuadsTextureData; + + // How many lines are outstanding needing flush + DWORD m_dwQuadsToFlush; + + // Currently active PS3 pad index to use for input + int m_iCurrentPadIndex; + + // Map of engine instances by ptr, used in ps3 sys callbacks to find engine instance to handle callback + static std::map m_MapEngineInstances; + + // Map of font handles we have given out + HGAMEFONT m_nNextFontHandle; + std::map< HGAMEFONT, PS3DbgFont_t > m_MapGameFonts; + + // Map of handles to texture objects + struct TextureData_t + { + uint32 m_uWidth; + uint32 m_uHeight; + GLuint m_uTextureID; + }; + std::map m_MapTextures; + HGAMETEXTURE m_nNextTextureHandle; + + // Last bound texture, used to know when we must flush + HGAMETEXTURE m_hLastTexture; + + // Map of button state, translated to VK for win32. + std::set< DWORD > m_SetKeysDown; + + // Map of voice handles + std::map m_MapVoiceChannel; + uint32 m_unVoiceChannelCount; + + // Map of Steam texture ids to our engine texture handles + std::map< int, HGAMETEXTURE> m_MapSteamTextures; + +}; + +#endif // GAMEENGINEPS3_H diff --git a/external/steamworks/steamworksexample/gameenginesdl.cpp b/external/steamworks/steamworksexample/gameenginesdl.cpp new file mode 100644 index 0000000..928717e --- /dev/null +++ b/external/steamworks/steamworksexample/gameenginesdl.cpp @@ -0,0 +1,1471 @@ +//========= Copyright 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Main class for the game engine -- win32 implementation +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" + +#include +#include +#include +#include + +#include + +#include "gameenginesdl.h" + +#include "steam/isteamdualsense.h" + +CGameEngineGL *g_engine; // dxabstract will use this.. it is set by the engine constructor + +IGameEngine *CreateGameEngineSDL( ) +{ + static CGameEngineGL* s_pGameEngine = NULL; + + if (!s_pGameEngine) + { + s_pGameEngine = new CGameEngineGL( ); + } + + return s_pGameEngine; +} + +void OutputDebugString( const char *pchMsg ) +{ + fprintf( stderr, "%s", pchMsg ); +} + +struct Packet_t +{ + uint32 unSize; + void *pData; +}; + +class CVoiceContext +{ +public: + CVoiceContext() + { + alGenBuffers( ARRAYSIZE(m_buffers), m_buffers ); + alGenSources( 1, &m_nSource ); + + alSourcei( m_nSource, AL_LOOPING, AL_FALSE ); + + for (int i = 0; i < ARRAYSIZE(m_buffers); i++ ) + alSourcei( m_nSource, AL_BUFFER, m_buffers[i] ); + + m_nNextFreeBuffer = 0; + } + virtual ~CVoiceContext() + { + // + } + + ALuint m_buffers[4]; + ALuint m_nSource; + size_t m_nNextFreeBuffer; + std::queue m_pending; +}; + +/* Quick utility function for texture creation */ +static int +power_of_two(int input) +{ + int value = 1; + + while (value < input) { + value <<= 1; + } + return value; +} + +//----------------------------------------------------------------------------- +// Purpose: Constructor for game engine instance +//----------------------------------------------------------------------------- +CGameEngineGL::CGameEngineGL( ) +{ + g_engine = this; + + m_bEngineReadyForUse = false; + m_bShuttingDown = false; + m_window = NULL; + m_context = NULL; + m_nWindowWidth = 0; + m_nWindowHeight = 0; + m_ulPreviousGameTickCount = 0; + m_ulGameTickCount = 0; + m_unVoiceChannelCount = 0; + + m_hTextureWhite = 0; + m_nNextFontHandle = 1; + m_nNextTextureHandle = 1; + m_hLastTexture = 0; + + m_rgflPointsData = new GLfloat[ 3*POINT_BUFFER_TOTAL_SIZE ]; + m_rgflPointsColorData = new GLubyte[ 4*POINT_BUFFER_TOTAL_SIZE ]; + m_dwPointsToFlush = 0; + + m_rgflLinesData = new GLfloat[ 6*LINE_BUFFER_TOTAL_SIZE ]; + m_rgflLinesColorData = new GLubyte[ 8*LINE_BUFFER_TOTAL_SIZE ]; + m_dwLinesToFlush = 0; + + m_rgflQuadsData = new GLfloat [ 12*QUAD_BUFFER_TOTAL_SIZE ]; + m_rgflQuadsColorData = new GLubyte[ 16*QUAD_BUFFER_TOTAL_SIZE ]; + m_rgflQuadsTextureData = new GLfloat[ 8*QUAD_BUFFER_TOTAL_SIZE ]; + m_dwQuadsToFlush = 0; + + // clear the action handles + for ( int i = 0; i ::const_iterator i; + for (i = m_MapGameFonts.begin(); i != m_MapGameFonts.end(); ++i) + { + TTF_CloseFont( i->second ); + } + m_MapGameFonts.clear(); + + TTF_Quit(); + + m_MapStrings.clear(); + m_MapTextures.clear(); + + m_dwLinesToFlush = 0; + m_dwPointsToFlush = 0; + m_dwQuadsToFlush = 0; +} + + +//----------------------------------------------------------------------------- +// Purpose: Initialize voice/audio interfaces +//----------------------------------------------------------------------------- +bool CGameEngineGL::BInitializeAudio() +{ + m_palDevice = alcOpenDevice(NULL); + if ( m_palDevice ) + { + m_palContext = alcCreateContext( m_palDevice, NULL ); + alcMakeContextCurrent( m_palContext ); + return true; + } + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: Initialize the GL rendering interfaces and default state +//----------------------------------------------------------------------------- +#define D3DADAPTER_DEFAULT 0 + +bool CGameEngineGL::BInitializeGraphics() +{ + int nWindowWidth, nWindowHeight; + nWindowWidth = m_nWindowWidth = 1024; + nWindowHeight = m_nWindowHeight = 768; + + SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); + SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 ); + +#if defined(USE_SDL2) + int windowX = SDL_WINDOWPOS_CENTERED; + int windowY = SDL_WINDOWPOS_CENTERED; + m_window = SDL_CreateWindow( "SteamworksExample", + windowX, + windowY, + nWindowWidth, + nWindowHeight, + SDL_WINDOW_OPENGL ); +#else + m_window = SDL_CreateWindow( "SteamworksExample", + nWindowWidth, + nWindowHeight, + SDL_WINDOW_OPENGL ); +#endif + if ( !m_window ) { + OutputDebugString( "Couldn't create SDL window: " ); + OutputDebugString( SDL_GetError() ); + OutputDebugString( "\n" ); + return false; + } + + m_context = SDL_GL_CreateContext( m_window ); + if ( !m_context ) { + OutputDebugString( "Couldn't create OpenGL context: " ); + OutputDebugString( SDL_GetError() ); + OutputDebugString( "\n" ); + return false; + } + + GLenum err = glewInit(); + if( err != GLEW_OK ) + { + fprintf(stderr, "glewInit failed with %s\n", glewGetErrorString( err ) ); + return false; + } + + SDL_GL_SetSwapInterval( 1 ); + + // Clear any errors + glGetError(); + + glClearDepth( 1.0f ); + glClearColor( 0.0f, 0.0f, 0.0f, 1.0f ); + + glEnable( GL_BLEND ); + glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); + + glDisable( GL_CULL_FACE ); + glDisable( GL_ALPHA_TEST ); + glDisable( GL_STENCIL_TEST ); + glDisable( GL_SCISSOR_TEST ); + glDisable( GL_LIGHTING ); + glDisable( GL_DEPTH_TEST ); + glDisable( GL_FOG ); + + glDepthMask( GL_FALSE ); + + // We always need these two + glEnableClientState( GL_COLOR_ARRAY ); + glEnableClientState( GL_VERTEX_ARRAY ); + + // This we'll enable as needed + glDisableClientState( GL_TEXTURE_COORD_ARRAY ); + + glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef( 0, 0, 0 ); + + glMatrixMode( GL_TEXTURE ); + glLoadIdentity(); + glTranslatef( 0, 0, 0 ); + + glDepthRange( 0.0f, 1.0f ); + + AdjustViewport(); + + return true; +} + +void CGameEngineGL::AdjustViewport() +{ + SDL_GetWindowSize( m_window, &m_nWindowWidth, &m_nWindowHeight ); + glBindFramebuffer(GL_FRAMEBUFFER, 0 ); + + // Perspective + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho( 0, m_nWindowWidth, m_nWindowHeight, 0, -1.0f, 1.0f ); + glTranslatef( 0, 0, 0 ); + + // View port has changed as well + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef( 0, 0, 0 ); + + glViewport( 0, 0, m_nWindowWidth, m_nWindowHeight ); + glScissor( 0, 0, m_nWindowWidth, m_nWindowHeight ); + + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT ); + glFlush(); +} + +//----------------------------------------------------------------------------- +// Purpose: Updates current tick count for the game engine +//----------------------------------------------------------------------------- +void CGameEngineGL::UpdateGameTickCount() +{ + m_ulPreviousGameTickCount = m_ulGameTickCount; +#if defined(USE_SDL2) + m_ulGameTickCount = SDL_GetTicks64(); +#else + m_ulGameTickCount = SDL_GetTicks(); +#endif +} + + +//----------------------------------------------------------------------------- +// Purpose: Tell the game engine to sleep for a bit if needed to limit frame rate. You must keep +// calling this repeatedly until it returns false. If it returns true it's slept a little, but more +// time may be needed. +//----------------------------------------------------------------------------- +bool CGameEngineGL::BSleepForFrameRateLimit( uint32 ulMaxFrameRate ) +{ + // Frame rate limiting + float flDesiredFrameMilliseconds = 1000.0f/ulMaxFrameRate; + +#if defined(USE_SDL2) + uint64 ulGameTickCount = SDL_GetTicks64(); +#else + uint64 ulGameTickCount = SDL_GetTicks(); +#endif + + float flMillisecondsElapsed = (float)(ulGameTickCount - m_ulGameTickCount); + if ( flMillisecondsElapsed < flDesiredFrameMilliseconds ) + { + // If enough time is left sleep, otherwise just keep spinning so we don't go over the limit... + if ( flDesiredFrameMilliseconds - flMillisecondsElapsed > 3.0f ) + { + usleep( 5000 ); + } + else + { + // Just return right away so we busy loop, don't want to sleep too long and go over + } + + return true; + } + else + { + return false; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Set the background color to clear to +//----------------------------------------------------------------------------- +void CGameEngineGL::SetBackgroundColor( short a, short r, short g, short b ) +{ + glClearColor( (float)r/255.0f, (float)g/255.0f, (float)b/255.0f, (float)a/255.0f ); +} + +//----------------------------------------------------------------------------- +// Purpose: Start a new frame +//----------------------------------------------------------------------------- +bool CGameEngineGL::StartFrame() +{ + AdjustViewport(); + + // Pump system callbacks + MessagePump(); + + // Poll Steam Input devices + PollSteamInput(); + + // We may now be shutting down, check and don't start a frame then + if ( BShuttingDown() ) + return false; + + #if 0 // for debug + static unsigned char counter; + counter++; + glClearColor( (float)counter/255.0f, (float)counter/255.0f, (float)counter/255.0f, (float)1.0f ); + #endif + + // Clear the screen for the new frame + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT ); + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: End the current frame +//----------------------------------------------------------------------------- +void CGameEngineGL::EndFrame() +{ + if ( BShuttingDown() ) + return; + + // Flush point buffer + BFlushPointBuffer(); + + // Flush line buffer + BFlushLineBuffer(); + + // Flush quad buffer + BFlushQuadBuffer(); + + // Swap buffers now that everything is flushed + SDL_GL_SwapWindow( m_window ); + + RunAudio(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Draw a line, the engine internally manages a vertex buffer for batching these +//----------------------------------------------------------------------------- +bool CGameEngineGL::BDrawLine( float xPos0, float yPos0, DWORD dwColor0, float xPos1, float yPos1, DWORD dwColor1 ) +{ + if ( m_bShuttingDown ) + return false; + + // Check if we are out of room and need to flush the buffer + if ( m_dwLinesToFlush == LINE_BUFFER_TOTAL_SIZE ) + { + BFlushLineBuffer(); + } + + DWORD dwOffset = m_dwLinesToFlush*6; + m_rgflLinesData[dwOffset] = xPos0; + m_rgflLinesData[dwOffset+1] = yPos0; + m_rgflLinesData[dwOffset+2] = 1.0; + m_rgflLinesData[dwOffset+3] = xPos1; + m_rgflLinesData[dwOffset+4] = yPos1; + m_rgflLinesData[dwOffset+5] = 1.0; + + dwOffset = m_dwLinesToFlush*8; + m_rgflLinesColorData[dwOffset] = COLOR_RED( dwColor0 ); + m_rgflLinesColorData[dwOffset+1] = COLOR_GREEN( dwColor0 ); + m_rgflLinesColorData[dwOffset+2] = COLOR_BLUE( dwColor0 ); + m_rgflLinesColorData[dwOffset+3] = COLOR_ALPHA( dwColor0 ); + m_rgflLinesColorData[dwOffset+4] = COLOR_RED( dwColor1 ); + m_rgflLinesColorData[dwOffset+5] = COLOR_GREEN( dwColor1 ); + m_rgflLinesColorData[dwOffset+6] = COLOR_BLUE( dwColor1 ); + m_rgflLinesColorData[dwOffset+7] = COLOR_ALPHA( dwColor1 ); + + ++m_dwLinesToFlush; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Flush batched lines to the screen +//----------------------------------------------------------------------------- +bool CGameEngineGL::BFlushLineBuffer() +{ + if ( !m_rgflLinesColorData || !m_rgflLinesData || m_bShuttingDown ) + return false; + + if ( m_dwLinesToFlush ) + { + glColorPointer( 4, GL_UNSIGNED_BYTE, 0, m_rgflLinesColorData ); + glVertexPointer( 3, GL_FLOAT, 0, m_rgflLinesData ); + glDrawArrays( GL_LINES, 0, m_dwLinesToFlush*2 ); + + m_dwLinesToFlush = 0; + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Draw a point, the engine internally manages a vertex buffer for batching these +//----------------------------------------------------------------------------- +bool CGameEngineGL::BDrawPoint( float xPos, float yPos, DWORD dwColor ) +{ + if ( m_bShuttingDown ) + return false; + + // Check if we are out of room and need to flush the buffer + if ( m_dwPointsToFlush == POINT_BUFFER_TOTAL_SIZE ) + { + BFlushPointBuffer(); + } + + DWORD dwOffset = m_dwPointsToFlush*3; + m_rgflPointsData[dwOffset] = xPos; + m_rgflPointsData[dwOffset+1] = yPos; + m_rgflPointsData[dwOffset+2] = 1.0; + + dwOffset = m_dwPointsToFlush*4; + m_rgflPointsColorData[dwOffset] = COLOR_RED( dwColor ); + m_rgflPointsColorData[dwOffset+1] = COLOR_GREEN( dwColor ); + m_rgflPointsColorData[dwOffset+2] = COLOR_BLUE( dwColor ); + m_rgflPointsColorData[dwOffset+3] = COLOR_ALPHA( dwColor ); + + ++m_dwPointsToFlush; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Flush batched points to the screen +//----------------------------------------------------------------------------- +bool CGameEngineGL::BFlushPointBuffer() +{ + if ( !m_rgflPointsColorData || !m_rgflPointsData || m_bShuttingDown ) + return false; + + if ( m_dwPointsToFlush ) + { + glColorPointer( 4, GL_UNSIGNED_BYTE, 0, m_rgflPointsColorData ); + glVertexPointer( 3, GL_FLOAT, 0, m_rgflPointsData ); + glDrawArrays( GL_POINTS, 0, m_dwPointsToFlush ); + + m_dwPointsToFlush = 0; + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Draw a filled quad +//----------------------------------------------------------------------------- +bool CGameEngineGL::BDrawFilledRect( float xPos0, float yPos0, float xPos1, float yPos1, DWORD dwColor ) +{ + if ( !m_hTextureWhite ) + { + byte *pRGBAData = new byte[ 1 * 1 * 4 ]; + memset( pRGBAData, 255, 1*1*4 ); + m_hTextureWhite = HCreateTexture( pRGBAData, 1, 1 ); + delete[] pRGBAData; + } + + return BDrawTexturedRect( xPos0, yPos0, xPos1, yPos1, 0.0f, 0.0f, 1.0f, 1.0f, dwColor, m_hTextureWhite ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Draw a textured rect +//----------------------------------------------------------------------------- +bool CGameEngineGL::BDrawTexturedRect( float xPos0, float yPos0, float xPos1, float yPos1, float u0, float v0, float u1, float v1, DWORD dwColor, HGAMETEXTURE hTexture ) +{ + if ( m_bShuttingDown ) + return false; + + // Find the texture + std::map::iterator iter; + iter = m_MapTextures.find( hTexture ); + if ( iter == m_MapTextures.end() ) + { + OutputDebugString( "BDrawTexturedQuad called with invalid hTexture value\n" ); + return false; + } + + // Check if we are out of room and need to flush the buffer, or if our texture is changing + // then we also need to flush the buffer. + if ( m_dwQuadsToFlush == QUAD_BUFFER_TOTAL_SIZE || m_hLastTexture != hTexture ) + { + BFlushQuadBuffer(); + } + + // Bind the new texture + glBindTexture( GL_TEXTURE_2D, iter->second.m_uTextureID ); + + DWORD dwOffset = m_dwQuadsToFlush*12; + m_rgflQuadsData[dwOffset] = xPos0; + m_rgflQuadsData[dwOffset+1] = yPos0; + m_rgflQuadsData[dwOffset+2] = 1.0; + m_rgflQuadsData[dwOffset+3] = xPos1; + m_rgflQuadsData[dwOffset+4] = yPos0; + m_rgflQuadsData[dwOffset+5] = 1.0; + m_rgflQuadsData[dwOffset+6] = xPos1; + m_rgflQuadsData[dwOffset+7] = yPos1; + m_rgflQuadsData[dwOffset+8] = 1.0; + m_rgflQuadsData[dwOffset+9] = xPos0; + m_rgflQuadsData[dwOffset+10] = yPos1; + m_rgflQuadsData[dwOffset+11] = 1.0; + + dwOffset = m_dwQuadsToFlush*16; + m_rgflQuadsColorData[dwOffset] = COLOR_RED( dwColor ); + m_rgflQuadsColorData[dwOffset+1] = COLOR_GREEN( dwColor ); + m_rgflQuadsColorData[dwOffset+2] = COLOR_BLUE( dwColor ); + m_rgflQuadsColorData[dwOffset+3] = COLOR_ALPHA( dwColor ); + m_rgflQuadsColorData[dwOffset+4] = COLOR_RED( dwColor ); + m_rgflQuadsColorData[dwOffset+5] = COLOR_GREEN( dwColor ); + m_rgflQuadsColorData[dwOffset+6] = COLOR_BLUE( dwColor ); + m_rgflQuadsColorData[dwOffset+7] = COLOR_ALPHA( dwColor ); + m_rgflQuadsColorData[dwOffset+8] = COLOR_RED( dwColor ); + m_rgflQuadsColorData[dwOffset+9] = COLOR_GREEN( dwColor ); + m_rgflQuadsColorData[dwOffset+10] = COLOR_BLUE( dwColor ); + m_rgflQuadsColorData[dwOffset+11] = COLOR_ALPHA( dwColor ); + m_rgflQuadsColorData[dwOffset+12] = COLOR_RED( dwColor ); + m_rgflQuadsColorData[dwOffset+13] = COLOR_GREEN( dwColor ); + m_rgflQuadsColorData[dwOffset+14] = COLOR_BLUE( dwColor ); + m_rgflQuadsColorData[dwOffset+15] = COLOR_ALPHA( dwColor ); + + dwOffset = m_dwQuadsToFlush*8; + m_rgflQuadsTextureData[dwOffset] = u0; + m_rgflQuadsTextureData[dwOffset+1] = v0; + m_rgflQuadsTextureData[dwOffset+2] = u1; + m_rgflQuadsTextureData[dwOffset+3] = v0; + m_rgflQuadsTextureData[dwOffset+4] = u1; + m_rgflQuadsTextureData[dwOffset+5] = v1; + m_rgflQuadsTextureData[dwOffset+6] = u0; + m_rgflQuadsTextureData[dwOffset+7] = v1; + + + ++m_dwQuadsToFlush; + + return true; +} + +//----------------------------------------------------------------------------- +// Purpose: Draw a textured quad +//----------------------------------------------------------------------------- +bool CGameEngineGL::BDrawTexturedQuad( float xPos0, float yPos0, float xPos1, float yPos1, float xPos2, float yPos2, float xPos3, float yPos3, + float u0, float v0, float u1, float v1, DWORD dwColor, HGAMETEXTURE hTexture ) +{ + if ( m_bShuttingDown ) + return false; + + // Find the texture + std::map::iterator iter; + iter = m_MapTextures.find( hTexture ); + if ( iter == m_MapTextures.end() ) + { + OutputDebugString( "BDrawTexturedQuad called with invalid hTexture value\n" ); + return false; + } + + // Check if we are out of room and need to flush the buffer, or if our texture is changing + // then we also need to flush the buffer. + if ( m_dwQuadsToFlush == QUAD_BUFFER_TOTAL_SIZE || m_hLastTexture != hTexture ) + { + BFlushQuadBuffer(); + } + + // Bind the new texture + glBindTexture( GL_TEXTURE_2D, iter->second.m_uTextureID ); + + DWORD dwOffset = m_dwQuadsToFlush*12; + m_rgflQuadsData[dwOffset] = xPos0; + m_rgflQuadsData[dwOffset+1] = yPos0; + m_rgflQuadsData[dwOffset+2] = 1.0; + m_rgflQuadsData[dwOffset+3] = xPos1; + m_rgflQuadsData[dwOffset+4] = yPos1; + m_rgflQuadsData[dwOffset+5] = 1.0; + m_rgflQuadsData[dwOffset+6] = xPos2; + m_rgflQuadsData[dwOffset+7] = yPos2; + m_rgflQuadsData[dwOffset+8] = 1.0; + m_rgflQuadsData[dwOffset+9] = xPos3; + m_rgflQuadsData[dwOffset+10] = yPos3; + m_rgflQuadsData[dwOffset+11] = 1.0; + + dwOffset = m_dwQuadsToFlush*16; + m_rgflQuadsColorData[dwOffset] = COLOR_RED( dwColor ); + m_rgflQuadsColorData[dwOffset+1] = COLOR_GREEN( dwColor ); + m_rgflQuadsColorData[dwOffset+2] = COLOR_BLUE( dwColor ); + m_rgflQuadsColorData[dwOffset+3] = COLOR_ALPHA( dwColor ); + m_rgflQuadsColorData[dwOffset+4] = COLOR_RED( dwColor ); + m_rgflQuadsColorData[dwOffset+5] = COLOR_GREEN( dwColor ); + m_rgflQuadsColorData[dwOffset+6] = COLOR_BLUE( dwColor ); + m_rgflQuadsColorData[dwOffset+7] = COLOR_ALPHA( dwColor ); + m_rgflQuadsColorData[dwOffset+8] = COLOR_RED( dwColor ); + m_rgflQuadsColorData[dwOffset+9] = COLOR_GREEN( dwColor ); + m_rgflQuadsColorData[dwOffset+10] = COLOR_BLUE( dwColor ); + m_rgflQuadsColorData[dwOffset+11] = COLOR_ALPHA( dwColor ); + m_rgflQuadsColorData[dwOffset+12] = COLOR_RED( dwColor ); + m_rgflQuadsColorData[dwOffset+13] = COLOR_GREEN( dwColor ); + m_rgflQuadsColorData[dwOffset+14] = COLOR_BLUE( dwColor ); + m_rgflQuadsColorData[dwOffset+15] = COLOR_ALPHA( dwColor ); + + dwOffset = m_dwQuadsToFlush*8; + m_rgflQuadsTextureData[dwOffset] = u0; + m_rgflQuadsTextureData[dwOffset+1] = v0; + m_rgflQuadsTextureData[dwOffset+2] = u1; + m_rgflQuadsTextureData[dwOffset+3] = v0; + m_rgflQuadsTextureData[dwOffset+4] = u1; + m_rgflQuadsTextureData[dwOffset+5] = v1; + m_rgflQuadsTextureData[dwOffset+6] = u0; + m_rgflQuadsTextureData[dwOffset+7] = v1; + + + ++m_dwQuadsToFlush; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Flush buffered quads +//----------------------------------------------------------------------------- +bool CGameEngineGL::BFlushQuadBuffer() +{ + if ( !m_rgflPointsColorData || !m_rgflPointsData || m_bShuttingDown ) + return false; + + if ( m_dwQuadsToFlush ) + { + glEnable( GL_TEXTURE_2D ); + glEnableClientState( GL_TEXTURE_COORD_ARRAY ); + + glColorPointer( 4, GL_UNSIGNED_BYTE, 0, m_rgflQuadsColorData ); + glVertexPointer( 3, GL_FLOAT, 0, m_rgflQuadsData ); + glTexCoordPointer( 2, GL_FLOAT, 0, m_rgflQuadsTextureData ); + glDrawArrays( GL_QUADS, 0, m_dwQuadsToFlush*4 ); + + glDisable( GL_TEXTURE_2D ); + glDisableClientState( GL_TEXTURE_COORD_ARRAY ); + + m_dwQuadsToFlush = 0; + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Creates a new texture +//----------------------------------------------------------------------------- +HGAMETEXTURE CGameEngineGL::HCreateTexture( byte *pRGBAData, uint32 uWidth, uint32 uHeight, ETEXTUREFORMAT eTextureFormat ) +{ + if ( m_bShuttingDown ) + return 0; + + TextureData_t TexData; + TexData.m_uWidth = uWidth; + TexData.m_uHeight = uHeight; + TexData.m_uTextureID = 0; + + glEnable( GL_TEXTURE_2D ); + glGenTextures( 1, &TexData.m_uTextureID ); + glBindTexture( GL_TEXTURE_2D, TexData.m_uTextureID ); + + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0 ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0 ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); + + // build our texture mipmaps + glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, uWidth, uHeight, 0, eTextureFormat == eTextureFormat_RGBA ? GL_RGBA : GL_BGRA, GL_UNSIGNED_BYTE, (void *)pRGBAData ); + glDisable( GL_TEXTURE_2D ); + + int nHandle = m_nNextTextureHandle; + ++m_nNextTextureHandle; + m_MapTextures[nHandle] = TexData; + + return nHandle; +} + + +//----------------------------------------------------------------------------- +// Purpose: update an exiting textue +//----------------------------------------------------------------------------- +bool CGameEngineGL::UpdateTexture( HGAMETEXTURE texture, byte *pRGBAData, uint32 uWidth, uint32 uHeight, ETEXTUREFORMAT eTextureFormat ) +{ + if ( m_bShuttingDown ) + return false; + + std::map::iterator iter; + iter = m_MapTextures.find( texture ); + if ( iter == m_MapTextures.end() ) + { + OutputDebugString( "BDrawTexturedQuad called with invalid hTexture value\n" ); + return false; + } + + glEnable( GL_TEXTURE_2D ); + glBindTexture( GL_TEXTURE_2D, iter->second.m_uTextureID ); + + // build our texture mipmaps + glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, uWidth, uHeight, 0, eTextureFormat == eTextureFormat_RGBA ? GL_RGBA : GL_BGRA, GL_UNSIGNED_BYTE, (void *)pRGBAData ); + glDisable( GL_TEXTURE_2D ); + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Creates a new font +//----------------------------------------------------------------------------- +HGAMEFONT CGameEngineGL::HCreateFont( int nHeight, int nFontWeight, bool bItalic, const char * pchFont ) +{ + // For this sample we include a single font + pchFont = "DejaVuSans.ttf"; + + TTF_Font *font = TTF_OpenFont( pchFont, nHeight ); + if ( !font ) + { + OutputDebugString( "Couldn't create font: " ); + OutputDebugString( pchFont ); + OutputDebugString( "\n" ); + return 0; + } + + HGAMEFONT hFont = m_nNextFontHandle; + ++m_nNextFontHandle; + + int nStyle = TTF_STYLE_NORMAL; + if ( nFontWeight & FW_BOLD ) + { + nStyle |= TTF_STYLE_BOLD; + } + if ( bItalic ) + { + nStyle |= TTF_STYLE_ITALIC; + } + TTF_SetFontStyle( font, nStyle ); + + m_MapGameFonts[ hFont ] = font; + + return hFont; +} + + +//----------------------------------------------------------------------------- +// Purpose: Draws text to the screen inside the given rectangular region, using the given font +//----------------------------------------------------------------------------- +bool CGameEngineGL::BDrawString( HGAMEFONT hFont, RECT rect, DWORD dwColor, DWORD dwFormat, const char *pchText ) +{ + if ( !hFont ) + { + OutputDebugString( "Someone is calling BDrawString with a null font handle\n" ); + return false; + } + + if ( !pchText || !*pchText ) + { + return true; + } + + // Very simple cache of complete strings as whole textures. + // There are much better ways of doing efficient text rendering. + // If nothing else we should expire the strings not being used. + HGAMETEXTURE hTexture; + char szFontPrefix[32]; + sprintf( szFontPrefix, "%d:", hFont ); + std::map< std::string, HGAMETEXTURE >::iterator iter; + iter = m_MapStrings.find( std::string(szFontPrefix) + std::string(pchText) ); + if ( iter == m_MapStrings.end() ) + { + static SDL_Color white = { 0xff, 0xff, 0xff, 0xff }; + + // Calculate the text block size + SDL_Surface *surface = TTF_RenderUTF8_Blended( m_MapGameFonts[ hFont ], pchText, white ); + if ( !surface ) + { + OutputDebugString( "Out of memory\n" ); + return false; + } + + uint32 uWidth = power_of_two( surface->w ); + uint32 uHeight = power_of_two( surface->h ); + byte *pRGBAData = (byte *)malloc( uWidth*uHeight*4 ); + if ( !pRGBAData ) + { + OutputDebugString( "Out of memory\n" ); + return false; + } + memset( pRGBAData, 0, uWidth*uHeight*4 ); + + byte *src = (byte*)surface->pixels; + byte *dst = pRGBAData; + memset(dst, 0xff, uWidth*4); + for ( uint32 row = 0; row < surface->h; ++row ) + { + memcpy( dst, src, surface->w * 4 ); + src += surface->pitch; + dst += uWidth * 4; + } + + hTexture = HCreateTexture( pRGBAData, uWidth, uHeight ); + free( pRGBAData ); + + // Record the actual text width and height + m_MapTextures[ hTexture ].m_uWidth = surface->w; + m_MapTextures[ hTexture ].m_uHeight = surface->h; + +#if defined(USE_SDL2) + SDL_FreeSurface( surface ); +#else + SDL_DestroySurface( surface ); +#endif + + m_MapStrings[ std::string(szFontPrefix) + std::string(pchText) ] = hTexture; + } + else + { + hTexture = iter->second; + } + + int nWidth = m_MapTextures[ hTexture ].m_uWidth; + int nHeight = m_MapTextures[ hTexture ].m_uHeight; + float u = (float)nWidth / power_of_two(nWidth); + float v = (float)nHeight / power_of_two(nHeight); + + // Get text position + int nLeft = rect.left, nTop = rect.top; + if ( dwFormat & TEXTPOS_TOP ) + { + nTop = rect.top; + } + else if ( dwFormat & TEXTPOS_VCENTER ) + { + nTop = rect.top + ((rect.bottom - rect.top) - nHeight) / 2; + } + else if ( dwFormat & TEXTPOS_BOTTOM ) + { + nTop = rect.bottom - nHeight; + } + if ( dwFormat & TEXTPOS_LEFT ) + { + nLeft = rect.left; + } + else if ( dwFormat & TEXTPOS_CENTER ) + { + nLeft = rect.left + ((rect.right - rect.left) - nWidth) / 2; + } + else if ( dwFormat & TEXTPOS_RIGHT ) + { + nLeft = rect.right - nWidth; + } + + //dprintf(2, "Drawing text '%s' at %d,%d %dx%d {%ld,%ld %ld,%ld}\n", pchText, nLeft, nTop, nWidth, nHeight, rect.left, rect.top, rect.right, rect.bottom); + return BDrawTexturedRect( nLeft, nTop, nLeft + nWidth, nTop + nHeight, 0.0f, 0.0f, u, v, dwColor, hTexture ); +} + +void CGameEngineGL::UpdateKey( uint32_t vkKey, int nDown ) +{ + if ( nDown ) + m_SetKeysDown.insert( vkKey ); + else + m_SetKeysDown.erase( vkKey ); +} + +//----------------------------------------------------------------------------- +// Purpose: Message pump for OS messages +//----------------------------------------------------------------------------- +void CGameEngineGL::MessagePump() +{ +#if defined(USE_SDL2) + #define SDL_EVENT_KEY_DOWN SDL_KEYDOWN + #define SDL_EVENT_KEY_UP SDL_KEYUP + #define SDL_EVENT_QUIT SDL_QUIT +#endif + SDL_Event event; + + do + { + if ( SDL_PollEvent(&event) <= 0 ) + break; + + if ( event.type == SDL_EVENT_KEY_DOWN || event.type == SDL_EVENT_KEY_UP ) + { + DWORD dwVK = 0; + switch (event.key.keysym.sym) + { + case SDLK_BACKSPACE: dwVK = VK_BACK; break; + case SDLK_TAB: dwVK = VK_TAB; break; + case SDLK_RETURN: dwVK = VK_RETURN; break; + case SDLK_LSHIFT: dwVK = VK_SHIFT; break; + case SDLK_RSHIFT: dwVK = VK_SHIFT; break; + case SDLK_LCTRL: dwVK = VK_CONTROL; break; + case SDLK_RCTRL: dwVK = VK_CONTROL; break; + case SDLK_ESCAPE: dwVK = VK_ESCAPE; break; + case SDLK_SPACE: dwVK = VK_SPACE; break; + case SDLK_LEFT: dwVK = VK_LEFT; break; + case SDLK_UP: dwVK = VK_UP; break; + case SDLK_RIGHT: dwVK = VK_RIGHT; break; + case SDLK_DOWN: dwVK = VK_DOWN; break; + case SDLK_SELECT: dwVK = VK_SELECT; break; + case SDLK_F5: dwVK = VK_F5; break; + default: + { + if ( event.key.keysym.sym >= SDLK_a && event.key.keysym.sym <= SDLK_z ) + { + dwVK = 'A' + event.key.keysym.sym - SDLK_a; + } + } + break; + } + + if (dwVK) + { + if ( event.type == SDL_EVENT_KEY_DOWN ) + { + m_SetKeysDown.insert( dwVK ); + } + else + { + m_SetKeysDown.erase( dwVK ); + } + } + } + else if ( event.type == SDL_EVENT_QUIT ) + { + CreateGameEngineSDL( )->Shutdown(); + } + + } while ( !BShuttingDown() ); +} + +//----------------------------------------------------------------------------- +// Purpose: Find out if a key is currently down +//----------------------------------------------------------------------------- +bool CGameEngineGL::BIsKeyDown( DWORD dwVK ) +{ + std::set::iterator iter; + iter = m_SetKeysDown.find( dwVK ); + if ( iter != m_SetKeysDown.end() ) + return true; + + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: Get a down key value +//----------------------------------------------------------------------------- +bool CGameEngineGL::BGetFirstKeyDown( DWORD *pdwVK ) +{ + std::set::iterator iter; + iter = m_SetKeysDown.begin(); + if ( iter != m_SetKeysDown.end() ) + { + *pdwVK = *iter; + m_SetKeysDown.erase( iter ); + return true; + } + else + { + return false; + } +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +HGAMEVOICECHANNEL CGameEngineGL::HCreateVoiceChannel() +{ + m_unVoiceChannelCount++; + CVoiceContext* pVoiceContext = new CVoiceContext; + + m_MapVoiceChannel[m_unVoiceChannelCount] = pVoiceContext; + + return m_unVoiceChannelCount; +} + +void CGameEngineGL::RunAudio() +{ + std::map::iterator iter; + + for( iter = m_MapVoiceChannel.begin(); iter!=m_MapVoiceChannel.end(); ++iter) + { + CVoiceContext* pVoice = iter->second; + + const int nBufferCount = ARRAYSIZE( pVoice->m_buffers ); + ALint nQueued, nProcessed; + alGetSourcei( pVoice->m_nSource, AL_BUFFERS_QUEUED, &nQueued ); + alGetSourcei( pVoice->m_nSource, AL_BUFFERS_PROCESSED, &nProcessed ); + + if ( ( nQueued == nBufferCount ) && ( nProcessed == 0 ) ) + { // No room at the inn + continue; + } + + ALuint nBufferID; + for ( int i = 0; i < nProcessed; i++ ) + alSourceUnqueueBuffers( pVoice->m_nSource, 1, &nBufferID ); + + int nMaxToQueue = nBufferCount - nQueued + nProcessed; + bool bQueued = false; + + while ( nMaxToQueue && !pVoice->m_pending.empty() ) + { + Packet_t &packet = pVoice->m_pending.front(); + + nBufferID = pVoice->m_buffers[ pVoice->m_nNextFreeBuffer ]; + alBufferData( nBufferID, AL_FORMAT_MONO16, packet.pData, packet.unSize, VOICE_OUTPUT_SAMPLE_RATE_IDEAL ); + pVoice->m_nNextFreeBuffer = (pVoice->m_nNextFreeBuffer + 1 ) % nBufferCount; + + alSourceQueueBuffers( pVoice->m_nSource, 1, &nBufferID); + + nMaxToQueue--; + free( packet.pData ); + pVoice->m_pending.pop(); + bQueued = true; + } + + if ( bQueued && ( (nQueued-nProcessed) == 0 ) ) + { + alSourcePlay( pVoice->m_nSource ); + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CGameEngineGL::DestroyVoiceChannel( HGAMEVOICECHANNEL hChannel ) +{ + std::map::iterator iter; + iter = m_MapVoiceChannel.find( hChannel ); + if ( iter != m_MapVoiceChannel.end() ) + { + CVoiceContext* pVoiceContext = iter->second; + + // free outstanding voice packets + + while( !pVoiceContext->m_pending.empty() ) + { + free( pVoiceContext->m_pending.front().pData ); + pVoiceContext->m_pending.pop(); + } + + delete pVoiceContext; + m_MapVoiceChannel.erase( iter ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +bool CGameEngineGL::AddVoiceData( HGAMEVOICECHANNEL hChannel, const uint8 *pVoiceData, uint32 uLength ) +{ + std::map::iterator iter; + iter = m_MapVoiceChannel.find( hChannel ); + if ( iter == m_MapVoiceChannel.end() ) + return false; // channel not found + + CVoiceContext* pVoiceContext = iter->second; + + Packet_t packet; + + packet.pData = malloc ( uLength ); + memcpy( packet.pData, pVoiceData, uLength ); + packet.unSize = uLength; + + pVoiceContext->m_pending.push( packet ); + + return true; +} + +//----------------------------------------------------------------------------- +// Purpose: Return true if there is an active Steam Controller +//----------------------------------------------------------------------------- +bool CGameEngineGL::BIsSteamInputDeviceActive( ) +{ + if ( m_ActiveControllerHandle ) + { + return true; + } + + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: Initialize the steam controller actions +//----------------------------------------------------------------------------- +void CGameEngineGL::InitSteamInput( ) +{ + // Digital game actions + m_ControllerDigitalActionHandles[eControllerDigitalAction_TurnLeft] =SteamInput()->GetDigitalActionHandle( "turn_left" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_TurnRight] =SteamInput()->GetDigitalActionHandle( "turn_right" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_ForwardThrust] =SteamInput()->GetDigitalActionHandle( "forward_thrust" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_ReverseThrust] =SteamInput()->GetDigitalActionHandle( "backward_thrust" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_FireLasers] =SteamInput()->GetDigitalActionHandle( "fire_lasers" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_PauseMenu] =SteamInput()->GetDigitalActionHandle( "pause_menu" ); + + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuUp] =SteamInput()->GetDigitalActionHandle( "menu_up" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuDown] =SteamInput()->GetDigitalActionHandle( "menu_down" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuLeft] =SteamInput()->GetDigitalActionHandle( "menu_left" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuRight] =SteamInput()->GetDigitalActionHandle( "menu_right" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuSelect] =SteamInput()->GetDigitalActionHandle( "menu_select" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuCancel] =SteamInput()->GetDigitalActionHandle( "menu_cancel" ); + + // Analog game actions + m_ControllerAnalogActionHandles[eControllerAnalogAction_AnalogControls] =SteamInput()->GetAnalogActionHandle( "analog_controls" ); + + // Action set handles + m_ControllerActionSetHandles[eControllerActionSet_ShipControls] =SteamInput()->GetActionSetHandle( "ship_controls" ); + m_ControllerActionSetHandles[eControllerActionSet_MenuControls] =SteamInput()->GetActionSetHandle( "menu_controls" ); + +} + +//----------------------------------------------------------------------------- +// Purpose: Find an active Steam controller +//----------------------------------------------------------------------------- +void CGameEngineGL::FindActiveSteamInputDevice( ) +{ + // Use the first available steam controller for all interaction. We can call this each frame to handle + // a controller disconnecting and a different one reconnecting. Handles are guaranteed to be unique for + // a given controller, even across power cycles. + + // See how many Steam Controllers are active. + ControllerHandle_t pHandles[STEAM_CONTROLLER_MAX_COUNT]; + int nNumActive = SteamInput()->GetConnectedControllers( pHandles ); + + // If there's an active controller, and if we're not already using it, select the first one. + if ( nNumActive && (m_ActiveControllerHandle != pHandles[0]) ) + { + m_ActiveControllerHandle = pHandles[0]; + } +} + + +//-------------------------------------------------------------------------------------------------------------- +// Purpose: For a given in-game action in a given action set, return a human-reaadable string to use as a prompt. +//-------------------------------------------------------------------------------------------------------------- +const char *CGameEngineGL::GetTextStringForControllerOriginDigital( ECONTROLLERACTIONSET dwActionSet, ECONTROLLERDIGITALACTION dwDigitalAction ) +{ + EInputActionOrigin origins[STEAM_CONTROLLER_MAX_ORIGINS]; + int nNumOrigins =SteamInput()->GetDigitalActionOrigins( m_ActiveControllerHandle, m_ControllerActionSetHandles[dwActionSet], m_ControllerDigitalActionHandles[dwDigitalAction], origins ); + + if ( nNumOrigins ) + { + // We should handle the case where this action is bound to multiple buttons, but + // here we just grab the first. + return SteamInput()->GetStringForActionOrigin( origins[0] ); + } + + return SteamInput()->GetStringForActionOrigin( k_EInputActionOrigin_None ); // Return "None" +} + +//-------------------------------------------------------------------------------------------------------------- +// Purpose: For a given in-game action in a given action set, return a human-reaadable string to use as a prompt. +//-------------------------------------------------------------------------------------------------------------- +const char *CGameEngineGL::GetTextStringForControllerOriginAnalog( ECONTROLLERACTIONSET dwActionSet, ECONTROLLERANALOGACTION dwDigitalAction ) +{ + EInputActionOrigin origins[STEAM_CONTROLLER_MAX_ORIGINS]; + int nNumOrigins =SteamInput()->GetAnalogActionOrigins( m_ActiveControllerHandle, m_ControllerActionSetHandles[dwActionSet], m_ControllerDigitalActionHandles[dwDigitalAction], origins ); + + if ( nNumOrigins ) + { + // We should handle the case where this action is bound to multiple buttons, but + // here we just grab the first. + return SteamInput()->GetStringForActionOrigin( origins[0] ); + } + + return SteamInput()->GetStringForActionOrigin( k_EInputActionOrigin_None ); // Return "None" +} + +//----------------------------------------------------------------------------- +// Purpose: Called each frame +//----------------------------------------------------------------------------- +void CGameEngineGL::PollSteamInput( ) +{ + // There's a bug where the action handles aren't non-zero until a config is done loading. Soon config + // information will be available immediately. Until then try to init as long as the handles are invalid. + if ( m_ControllerDigitalActionHandles[eControllerDigitalAction_TurnLeft] == 0 ) + { + InitSteamInput( ); + return; + } + + // Each frame check our active controller handle + FindActiveSteamInputDevice( ); + +} + +//----------------------------------------------------------------------------- +// Purpose: Set the LED color on the controller, if supported by controller +//----------------------------------------------------------------------------- +void CGameEngineGL::SetControllerColor( uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ) +{ + SteamInput()->SetLEDColor( m_ActiveControllerHandle, nColorR, nColorG, nColorB, nFlags ); +} + +//----------------------------------------------------------------------------- +// Purpose: Set the trigger effect on DualSense controllers +//----------------------------------------------------------------------------- +void CGameEngineGL::SetTriggerEffect( bool bEnabled ) +{ + ScePadTriggerEffectParam param; + + memset( ¶m, 0, sizeof( param ) ); + param.triggerMask = SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2; + + // Clear any existing effect + param.command[ SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 ].mode = SCE_PAD_TRIGGER_EFFECT_MODE_OFF; + SteamInput()->SetDualSenseTriggerEffect( m_ActiveControllerHandle, ¶m ); + + if ( bEnabled ) + { + param.command[ SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 ].mode = SCE_PAD_TRIGGER_EFFECT_MODE_VIBRATION; + param.command[ SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 ].commandData.vibrationParam.position = 5; + param.command[ SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 ].commandData.vibrationParam.amplitude = 5; + param.command[ SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 ].commandData.vibrationParam.frequency = 8; + SteamInput()->SetDualSenseTriggerEffect( m_ActiveControllerHandle, ¶m ); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Trigger vibration on the controller, if supported by controller +//----------------------------------------------------------------------------- +void CGameEngineGL::TriggerControllerVibration( unsigned short nLeftSpeed, unsigned short nRightSpeed ) +{ + SteamInput()->TriggerVibration( m_ActiveControllerHandle, nLeftSpeed, nRightSpeed ); +} + +//----------------------------------------------------------------------------- +// Purpose: Trigger haptics on the controller, if supported by controller +//----------------------------------------------------------------------------- +void CGameEngineGL::TriggerControllerHaptics( ESteamControllerPad ePad, unsigned short usOnMicroSec, unsigned short usOffMicroSec, unsigned short usRepeat ) +{ + SteamInput()->Legacy_TriggerRepeatedHapticPulse( m_ActiveControllerHandle, ePad, usOnMicroSec, usOffMicroSec, usRepeat, 0 ); +} + +//----------------------------------------------------------------------------- +// Purpose: Find out if a controller event is currently active +//----------------------------------------------------------------------------- +bool CGameEngineGL::BIsControllerActionActive( ECONTROLLERDIGITALACTION dwAction ) +{ + ControllerDigitalActionData_t digitalData =SteamInput()->GetDigitalActionData( m_ActiveControllerHandle, m_ControllerDigitalActionHandles[dwAction] ); + + // Actions are only 'active' when they're assigned to a control in an action set, and that action set is active. + if ( digitalData.bActive ) + return digitalData.bState; + + return false; +} + +//--------------------------------------------------------------------------------------------------------------------------------------------------- +// Purpose: Get the current x,y state of the analog action. Examples of an analog action are a virtual joystick on the trackpad or the real joystick. +//--------------------------------------------------------------------------------------------------------------------------------------------------- +void CGameEngineGL::GetControllerAnalogAction( ECONTROLLERANALOGACTION dwAction, float *x, float *y ) +{ + ControllerAnalogActionData_t analogData =SteamInput()->GetAnalogActionData( m_ActiveControllerHandle, m_ControllerAnalogActionHandles[dwAction] ); + + // Actions are only 'active' when they're assigned to a control in an action set, and that action set is active. + if ( analogData.bActive ) + { + *x = analogData.x; + *y = analogData.y; + } + else + { + *x = 0.0f; + *y = 0.0f; + } +} + +//----------------------------------------------------------------------------------------------------------------------------------------------------- +// Purpose: Put the controller into a specific action set. Action sets are collections of game-context actions ie "walking", "flying" or "menu" +//----------------------------------------------------------------------------------------------------------------------------------------------------- +void CGameEngineGL::SetSteamControllerActionSet( ECONTROLLERACTIONSET dwActionSet ) +{ + if ( m_ActiveControllerHandle == 0 ) + return; + + // This call is low-overhead and can be called repeatedly from game code that is active in a specific mode. + SteamController( )->ActivateActionSet( m_ActiveControllerHandle, m_ControllerActionSetHandles[dwActionSet] ); +} + + +//----------------------------------------------------------------------------------------------------------------------------------------------------- +// Purpose: Put the controller into a specific action set layer. Action sets layers apply modifications to an existing action set. +//----------------------------------------------------------------------------------------------------------------------------------------------------- +void CGameEngineGL::ActivateSteamControllerActionSetLayer( ECONTROLLERACTIONSET dwActionSetLayer ) +{ + if ( m_ActiveControllerHandle == 0 ) + return; + + // This call is low-overhead and can be called repeatedly from game code that is active in a specific mode. + SteamInput()->ActivateActionSetLayer( m_ActiveControllerHandle, m_ControllerActionSetHandles[ dwActionSetLayer ] ); +} + +//----------------------------------------------------------------------------------------------------------------------------------------------------- +// Purpose: Deactivate an existing action set layer +//----------------------------------------------------------------------------------------------------------------------------------------------------- +void CGameEngineGL::DeactivateSteamControllerActionSetLayer( ECONTROLLERACTIONSET dwActionSetLayer ) +{ + if ( m_ActiveControllerHandle == 0 ) + return; + + // This call is low-overhead and can be called repeatedly from game code that is active in a specific mode. + SteamInput()->DeactivateActionSetLayer( m_ActiveControllerHandle, m_ControllerActionSetHandles[ dwActionSetLayer ] ); +} + + +//----------------------------------------------------------------------------------------------------------------------------------------------------- +// Purpose: Determine whether an action set layer is currently active +//----------------------------------------------------------------------------------------------------------------------------------------------------- +bool CGameEngineGL::BIsActionSetLayerActive( ECONTROLLERACTIONSET dwActionSetLayer ) +{ + if ( m_ActiveControllerHandle == 0 ) + return false; + + ControllerActionSetHandle_t pActionSetLayerHandles[ 32 ]; + int nActiveLayerCount = SteamInput()->GetActiveActionSetLayers( m_ActiveControllerHandle, pActionSetLayerHandles ); + + for ( int i = 0; i < nActiveLayerCount; i++ ) + { + if ( pActionSetLayerHandles[ i ] == m_ControllerActionSetHandles[ dwActionSetLayer ] ) + return true; + } + + return false; +} + diff --git a/external/steamworks/steamworksexample/gameenginesdl.h b/external/steamworks/steamworksexample/gameenginesdl.h new file mode 100644 index 0000000..b0ee1f1 --- /dev/null +++ b/external/steamworks/steamworksexample/gameenginesdl.h @@ -0,0 +1,324 @@ +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Main class for the game engine -- SDL implementation +// +// $NoKeywords: $ +//============================================================================= + +#ifndef GAMEENGINESDL_H +#define GAMEENGINESDL_H + +typedef unsigned char byte; + +#include "GameEngine.h" + +#include +#include + +#if defined(USE_SDL2) +#include +#include +#include +#else +#include +#include +#include +#endif + +#include +#include +#include + + + +// How big is the vertex buffer for batching lines in total? +// NOTE: This must be a multiple of the batch size below!!! (crashes will occur if it isn't) +#define LINE_BUFFER_TOTAL_SIZE 1000 + +// How many lines do we put in the buffer in between flushes? +// +// This should be enough smaller than the total size so that draw calls +// can finish using the data before we wrap around and discard it. +#define LINE_BUFFER_BATCH_SIZE 250 + +// How big is the vertex buffer for batching points in total? +// NOTE: This must be a multiple of the batch size below!!! (crashes will occur if it isn't) +#define POINT_BUFFER_TOTAL_SIZE 1800 + +// How many points do we put in the buffer in between flushes? +// +// This should be enough smaller than the total size so that draw calls +// can finish using the data before we wrap around and discard it. +#define POINT_BUFFER_BATCH_SIZE 600 + +// How big is the vertex buffer for batching quads in total? +// NOTE: This must be a multiple of the batch size below!!! (crashes will occur if it isn't) +#define QUAD_BUFFER_TOTAL_SIZE 1000 + +// How many quads do we put in the buffer in between flushes? +// +// This should be enough smaller than the total size so that draw calls +// can finish using the data before we wrap around and discard it. +#define QUAD_BUFFER_BATCH_SIZE 250 + + + +class CVoiceContext; +class GLString; + +class CGameEngineGL : public IGameEngine +{ +public: + + // Constructor + CGameEngineGL( ); + + // Destructor + ~CGameEngineGL() { Shutdown(); } + + // Check if the game engine is initialized ok and ready for use + bool BReadyForUse() { return m_bEngineReadyForUse; } + + // Check if the engine is shutting down + bool BShuttingDown() { return m_bShuttingDown; } + + // Set the background color + void SetBackgroundColor( short a, short r, short g, short b ); + + // Start a frame, clear(), beginscene(), etc + bool StartFrame(); + + // Finish a frame, endscene(), present(), etc. + void EndFrame(); + + // Shutdown the game engine + void Shutdown(); + + // Pump messages from the OS + void MessagePump(); + + // Accessors for game screen size + int32 GetViewportWidth() { return m_nWindowWidth; } + int32 GetViewportHeight() { return m_nWindowHeight; } + + // Function for drawing text to the screen, dwFormat is a combination of flags like DT_LEFT, TEXTPOS_VCENTER etc... + bool BDrawString( HGAMEFONT hFont, RECT rect, DWORD dwColor, DWORD dwFormat, const char *pchText ); + + // Create a new font returning our internal handle value for it (0 means failure) + HGAMEFONT HCreateFont( int nHeight, int nFontWeight, bool bItalic, const char * pchFont ); + + // Create a new texture returning our internal handle value for it (0 means failure) + HGAMETEXTURE HCreateTexture( byte *pRGBAData, uint32 uWidth, uint32 uHeight, ETEXTUREFORMAT eTextureFormat = eTextureFormat_RGBA ); + + // update an existing texture + bool UpdateTexture( HGAMETEXTURE texture, byte *pRGBAData, uint32 uWidth, uint32 uHeight, ETEXTUREFORMAT eTextureFormat ); + + // Draw a line, the engine itself will manage batching these (although you can explicitly flush if you need to) + bool BDrawLine( float xPos0, float yPos0, DWORD dwColor0, float xPos1, float yPos1, DWORD dwColor1 ); + + // Flush the line buffer + bool BFlushLineBuffer(); + + // Draw a point, the engine itself will manage batching these (although you can explicitly flush if you need to) + bool BDrawPoint( float xPos, float yPos, DWORD dwColor ); + + // Flush the point buffer + bool BFlushPointBuffer(); + + // Draw a filled quad + bool BDrawFilledRect( float xPos0, float yPos0, float xPos1, float yPos1, DWORD dwColor ); + + // Draw a textured rectangle + bool BDrawTexturedRect( float xPos0, float yPos0, float xPos1, float yPos1, + float u0, float v0, float u1, float v1, DWORD dwColor, HGAMETEXTURE hTexture ); + + // Draw a textured arbitrary quad + bool BDrawTexturedQuad( float xPos0, float yPos0, float xPos1, float yPos1, float xPos2, float yPos2, float xPos3, float yPos3, + float u0, float v0, float u1, float v1, DWORD dwColor, HGAMETEXTURE hTexture ); + + // Flush any still cached quad buffers + bool BFlushQuadBuffer(); + + // Get the current state of a key + bool BIsKeyDown( DWORD dwVK ); + + // Get the first (in some arbitrary order) key down, if any + bool BGetFirstKeyDown( DWORD *pdwVK ); + + // Return true if there is an active Steam Controller + bool BIsSteamInputDeviceActive( ); + + // Find an active Steam controller + void FindActiveSteamInputDevice( ); + + // Get the current state of a controller action + bool BIsControllerActionActive( ECONTROLLERDIGITALACTION dwAction ); + + // Get the current state of a controller action + void GetControllerAnalogAction( ECONTROLLERANALOGACTION dwAction, float *x, float *y ); + + // Set the current Steam Controller Action set + void SetSteamControllerActionSet( ECONTROLLERACTIONSET dwActionSet ); + + // Set an Action Set Layer for Steam Input + virtual void ActivateSteamControllerActionSetLayer( ECONTROLLERACTIONSET dwActionSet ); + virtual void DeactivateSteamControllerActionSetLayer( ECONTROLLERACTIONSET dwActionSet ); + + // Returns whether a given action set layer is active + virtual bool BIsActionSetLayerActive( ECONTROLLERACTIONSET dwActionSetLayer ); + + // These calls return a string describing which controller button the action is currently bound to + const char *GetTextStringForControllerOriginDigital( ECONTROLLERACTIONSET dwActionSet, ECONTROLLERDIGITALACTION dwDigitalAction ); + const char *GetTextStringForControllerOriginAnalog( ECONTROLLERACTIONSET dwActionSet, ECONTROLLERANALOGACTION dwDigitalAction ); + + // Set the controller LED Color, if available + void SetControllerColor( uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ); + + // Set the trigger effect on DualSense controllers + void SetTriggerEffect( bool bEnabled ); + + // Trigger a vibration on the controller, if available + void TriggerControllerVibration( unsigned short nLeftSpeed, unsigned short nRightSpeed ); + + // Trigger haptics on the specified pad of the controller, if available + void TriggerControllerHaptics( ESteamControllerPad ePad, unsigned short usOnMicroSec, unsigned short usOffMicroSec, unsigned short usRepeat ); + + // Initialize the Steam Controller interfaces + void InitSteamInput( ); + + // Called each frame to update the Steam Input interface + void PollSteamInput(); + + // Get current tick count for the game engine + uint64 GetGameTickCount() { return m_ulGameTickCount; } + + // Get the tick count elapsed since the previous frame + // bugbug - We use this time to compute things like thrust and acceleration in the game, + // so it's important in doesn't jump ahead by large increments... Need a better + // way to handle that. + uint64 GetGameTicksFrameDelta() { return m_ulGameTickCount - m_ulPreviousGameTickCount; } + + // Tell the game engine to update current tick count + void UpdateGameTickCount(); + + // Tell the game engine to sleep for a bit if needed to limit frame rate + bool BSleepForFrameRateLimit( uint32 ulMaxFrameRate ); + + // Check if the game engine hwnd currently has focus (and a working d3d device) + bool BGameEngineHasFocus() { return true; } + + // Voice chat functions + virtual HGAMEVOICECHANNEL HCreateVoiceChannel(); + virtual void DestroyVoiceChannel( HGAMEVOICECHANNEL hChannel ); + virtual bool AddVoiceData( HGAMEVOICECHANNEL hChannel, const uint8 *pVoiceData, uint32 uLength ); + + void AdjustViewport(); + + // Initialize graphics + bool BInitializeGraphics(); + + // Initialize the debug font library + bool BInitializeCellDbgFont(); + + bool BInitializeAudio(); + + void RunAudio(); + + void UpdateKey( uint32_t vkKey, int nDown ); + + // Tracks whether the engine is ready for use + bool m_bEngineReadyForUse; + + // Tracks if we are shutting down + bool m_bShuttingDown; + + // The SDL window + SDL_Window *m_window; + SDL_GLContext m_context; + + // Size of the window to display the game in + int32 m_nWindowWidth; + int32 m_nWindowHeight; + + // Current game time in milliseconds + uint64 m_ulGameTickCount; + + // Game time at the start of the previous frame + uint64 m_ulPreviousGameTickCount; + + // White texture used when drawing filled quads + HGAMETEXTURE m_hTextureWhite; + + // Pointer to actual data for points + GLfloat *m_rgflPointsData; + GLubyte *m_rgflPointsColorData; + + // How many points are outstanding needing flush + DWORD m_dwPointsToFlush; + + // Pointer to actual data for lines + GLfloat *m_rgflLinesData; + GLubyte *m_rgflLinesColorData; + + + // How many lines are outstanding needing flush + DWORD m_dwLinesToFlush; + + // Pointer to actual data for quads + GLfloat *m_rgflQuadsData; + GLubyte *m_rgflQuadsColorData; + GLfloat *m_rgflQuadsTextureData; + + // How many lines are outstanding needing flush + DWORD m_dwQuadsToFlush; + + // Map of font handles we have given out + HGAMEFONT m_nNextFontHandle; + std::map< HGAMEFONT, TTF_Font * > m_MapGameFonts; + std::map< std::string, HGAMETEXTURE > m_MapStrings; + + // Map of handles to texture objects + struct TextureData_t + { + uint32 m_uWidth; + uint32 m_uHeight; + GLuint m_uTextureID; + }; + std::map m_MapTextures; + HGAMETEXTURE m_nNextTextureHandle; + + // Last bound texture, used to know when we must flush + HGAMETEXTURE m_hLastTexture; + + // Map of button state, translated to VK for win32. + std::set< DWORD > m_SetKeysDown; + + ALCcontext* m_palContext; + ALCdevice* m_palDevice; + + // Map of voice handles + std::map m_MapVoiceChannel; + uint32 m_unVoiceChannelCount; + + // An array of handles to Steam Controller events that player can bind to controls + InputDigitalActionHandle_t m_ControllerDigitalActionHandles[eControllerDigitalAction_NumActions]; + + // An array of handles to Steam Controller events that player can bind to controls + InputAnalogActionHandle_t m_ControllerAnalogActionHandles[eControllerAnalogAction_NumActions]; + + // An array of handles to different Steam Controller action set configurations + InputActionSetHandle_t m_ControllerActionSetHandles[eControllerActionSet_NumSets]; + + // A handle to the currently active Steam Controller. + InputHandle_t m_ActiveControllerHandle; + + // Origins for all the Steam Input actions. The 'origin' is where the action is currently bound to, + // ie 'jump' is currently bound to the Steam Controller 'A' button. + EInputActionOrigin m_ControllerDigitalActionOrigins[eControllerDigitalAction_NumActions]; + EInputActionOrigin m_ControllerAnalogActionOrigins[eControllerDigitalAction_NumActions]; + + static const char *pOriginStrings[k_EControllerActionOrigin_Count]; + +}; + +#endif // GAMEENGINESDL_H diff --git a/external/steamworks/steamworksexample/gameenginewin32.cpp b/external/steamworks/steamworksexample/gameenginewin32.cpp new file mode 100644 index 0000000..7bd6805 --- /dev/null +++ b/external/steamworks/steamworksexample/gameenginewin32.cpp @@ -0,0 +1,2603 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Main class for the game engine -- win32 implementation +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" +#include "GameEngineWin32.h" +#include +#include "steam\isteaminput.h" +#include "steam\isteamdualsense.h" + +#ifdef WIN32 +#include +#else +#define MAX_PATH PATH_MAX +#define _getcwd getcwd +#endif + +#ifndef SAFE_RELEASE +#define SAFE_RELEASE( x ) if ( 0 != ( x ) ) { ( x )->Release(); x = 0; } +#endif + +// Allocate static member +std::map CGameEngineWin32::m_MapEngineInstances; + +//----------------------------------------------------------------------------- +// Purpose: WndProc +//----------------------------------------------------------------------------- +LRESULT CALLBACK GameWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) +{ + switch ( msg ) + { + case WM_CLOSE: + case WM_DESTROY: + case WM_QUIT: + { + CGameEngineWin32 *pGameEngine = CGameEngineWin32::FindEngineInstanceForHWND( hWnd ); + if ( pGameEngine ) + pGameEngine->Shutdown(); + else + OutputDebugString( "Failed to find game engine instance for hwnd\n" ); + + PostQuitMessage( 0 ); + return(0); + } break; + case WM_KEYDOWN: + case WM_SYSKEYDOWN: + { + CGameEngineWin32 *pGameEngine = CGameEngineWin32::FindEngineInstanceForHWND( hWnd ); + if ( pGameEngine ) + { + pGameEngine->RecordKeyDown( (DWORD) wParam ); + return 0; + } + else + { + OutputDebugString( "Failed to find game engine for hwnd, key down event lost\n" ); + } + } + break; + case WM_KEYUP: + case WM_SYSKEYUP: + { + CGameEngineWin32 *pGameEngine = CGameEngineWin32::FindEngineInstanceForHWND( hWnd ); + if ( pGameEngine ) + { + pGameEngine->RecordKeyUp( (DWORD) wParam ); + return 0; + } + else + { + OutputDebugString( "Failed to find game engine for hwnd, key up event lost\n" ); + } + } + break; + + // Add additional handlers for things like input here... + default: + break; + } + + return DefWindowProc(hWnd, msg, wParam, lParam); +} + +class CVoiceContext : public IXAudio2VoiceCallback +{ +public: + CVoiceContext() : m_hBufferEndEvent( CreateEvent( NULL, FALSE, FALSE, NULL ) ) + { + m_pSourceVoice = NULL; + } + virtual ~CVoiceContext() + { + CloseHandle( m_hBufferEndEvent ); + } + + STDMETHOD_( void, OnVoiceProcessingPassStart )( UINT32 ) + { + } + STDMETHOD_( void, OnVoiceProcessingPassEnd )() + { + } + STDMETHOD_( void, OnStreamEnd )() + { + } + STDMETHOD_( void, OnBufferStart )( void* ) + { + } + STDMETHOD_( void, OnBufferEnd )( void* pContext ) + { + free( pContext ); // free the sound buffer + SetEvent( m_hBufferEndEvent ); + } + STDMETHOD_( void, OnLoopEnd )( void* ) + { + } + STDMETHOD_( void, OnVoiceError )( void*, HRESULT ) + { + } + + HANDLE m_hBufferEndEvent; + IXAudio2SourceVoice* m_pSourceVoice; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Constructor for game engine instance +//----------------------------------------------------------------------------- +CGameEngineWin32::CGameEngineWin32( HINSTANCE hInstance, int nShowCommand, int32 nWindowWidth, int32 nWindowHeight ) +{ + m_bEngineReadyForUse = false; + m_bShuttingDown = false; + m_hInstance = hInstance; + m_hWnd = NULL; + m_pD3D9Interface = NULL; + m_pD3D9Device = NULL; + m_pXAudio2 = NULL; + m_pMasteringVoice = NULL; + m_unVoiceChannelCount = 0; // 0 == invalid handle + m_nWindowWidth = nWindowWidth; + m_nWindowHeight = nWindowHeight; + m_nNextFontHandle = 1; + m_nNextVertBufferHandle = 1; + m_nNextTextureHandle = 1; + m_hLineBuffer = NULL; + m_pLineVertexes = NULL; + m_dwLinesToFlush = 0; + m_dwLineBufferBatchPos = 0; + m_hPointBuffer = NULL; + m_pPointVertexes = NULL; + m_dwPointsToFlush = 0; + m_dwPointBufferBatchPos = 0; + + m_hQuadBuffer = NULL; + m_pQuadVertexes = NULL; + m_dwQuadsToFlush = 0; + m_dwQuadBufferBatchPos = 0; + + m_h3DQuadBuffer = NULL; + m_p3DQuadVertexes = NULL; + m_dw3DQuadsToFlush = 0; + m_dw3DQuadBufferBatchPos = 0; + + m_hTextureWhite = NULL; + m_bDeviceLost = false; + m_hLastTexture = NULL; + m_ulPreviousGameTickCount = 0; + m_ulGameTickCount = 0; + m_dwBackgroundColor = D3DCOLOR_ARGB(0, 255, 255, 255 ); + m_pBackbufferDepth = NULL; + + // for XAudio2 + CoInitializeEx( NULL, COINIT_MULTITHREADED ); + + // restrict this main game thread to the first processor, so query performance counter won't jump on crappy AMD cpus + DWORD dwThreadAffinityMask = 0x01; + ::SetThreadAffinityMask( ::GetCurrentThread(), dwThreadAffinityMask ); + + // Setup timing data + LARGE_INTEGER l; + ::QueryPerformanceFrequency( &l ); + m_ulPerfCounterToMillisecondsDivisor = l.QuadPart/1000; + + ::QueryPerformanceCounter( &l ); + m_ulFirstQueryPerformanceCounterValue = l.QuadPart; + + if ( !BCreateGameWindow( nShowCommand ) || !m_hWnd ) + { + OutputDebugString( "Failed creating game window\n" ); + return; + } + + CGameEngineWin32::AddInstanceToHWNDMap( this, m_hWnd ); + + if ( !BInitializeD3D9() ) + { + ::MessageBoxA( NULL, "Failed to initialize D3D9.\n\nGame will now exit.", "SteamworksExample - Fatal error", MB_OK | MB_ICONERROR ); + return; + } + + RECT r; + ::GetClientRect( m_hWnd, &r ); + m_nViewportWidth = r.right - r.left; + m_nViewportHeight = r.bottom - r.top; + + // initialize XAudio2 interface + if( FAILED( XAudio2Create( &m_pXAudio2, 0 ) ) ) + { + ::MessageBoxA( NULL, "Failed to init XAudio2 engine (grab the latest \"DirectX End-User Runtime Web Installer\" )", "SteamworksExample - Fatal error", MB_OK | MB_ICONERROR ); + return; + } + + // Create a mastering voice + if( FAILED( m_pXAudio2->CreateMasteringVoice( &m_pMasteringVoice, XAUDIO2_DEFAULT_CHANNELS, VOICE_OUTPUT_SAMPLE_RATE ) ) ) + { + ::MessageBoxA( NULL, "Failed to create mastering voice", "SteamworksExample", MB_OK | MB_ICONERROR ); + } + + + // clear the action handles + for ( int i = 0; i ::iterator iter; + for( iter = m_MapFontInstances.begin(); iter != m_MapFontInstances.end(); ++iter ) + { + SAFE_RELEASE( iter->second ); + } + m_MapFontInstances.clear(); + } + + // Cleanup D3D vertex buffers + { + std::map::iterator iter; + for( iter = m_MapVertexBuffers.begin(); iter != m_MapVertexBuffers.end(); ++iter ) + { + if ( iter->second.m_bIsLocked ) + iter->second.m_pBuffer->Unlock(); + SAFE_RELEASE( iter->second.m_pBuffer ); + } + m_MapVertexBuffers.clear(); + } + + // Cleanup D3D textures + { + std::map::iterator iter; + for( iter = m_MapTextures.begin(); iter != m_MapTextures.end(); ++iter ) + { + if ( iter->second.m_pRGBAData ) + { + delete[] iter->second.m_pRGBAData; + iter->second.m_pRGBAData = NULL; + } + if ( iter->second.m_pTexture ) + { + SAFE_RELEASE( iter->second.m_pTexture ); + } + } + m_MapTextures.clear(); + } + + // All XAudio2 interfaces are released when the engine is destroyed, but being tidy + if ( m_pMasteringVoice ) + { + m_pMasteringVoice->DestroyVoice(); + m_pMasteringVoice = NULL; + } + + // Cleanup D3D + SAFE_RELEASE( m_pBackbufferDepth ); + SAFE_RELEASE( m_pD3D9Device ); + SAFE_RELEASE( m_pD3D9Interface ); + SAFE_RELEASE( m_pXAudio2 ); + + // Destroy our window + if ( m_hWnd ) + { + if ( !DestroyWindow( m_hWnd ) ) + { + // We failed to destroy our window. This shouldn't ever happen. + OutputDebugString( "Failed destroying window\n" ); + } + else + { + // Clean up any pending messages. + MSG msg; + while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) + { + DispatchMessage(&msg); + } + } + + CGameEngineWin32::RemoveInstanceFromHWNDMap( m_hWnd ); + m_hWnd = NULL; + } + + // Unregister our window class + if ( m_hInstance ) + { + if ( !UnregisterClass( "SteamworksExample", m_hInstance ) ) + { + OutputDebugString( "Failed unregistering window class\n" ); + } + m_hInstance = NULL; + } + + CoUninitialize(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handle losing the d3d device (ie, release resources) +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BHandleLostDevice() +{ + bool bFullySuccessful = true; + + // Clear our saved FVF so that we will manually reset it once we re-acquire the device + m_dwCurrentFVF = NULL; + + // Clear our internal buffers and batching data + m_dwLinesToFlush = 0; + m_dwLineBufferBatchPos = 0; + m_pLineVertexes = NULL; + m_hLineBuffer = NULL; + m_dwPointsToFlush = 0; + m_dwPointBufferBatchPos = 0; + m_pPointVertexes = NULL; + m_hPointBuffer = NULL; + m_dwQuadsToFlush = 0; + m_dwQuadBufferBatchPos = 0; + m_pQuadVertexes = NULL; + m_hQuadBuffer = NULL; + + // Fonts are easy since we used d3dx, they have their own handlers + { + std::map::iterator iter; + for( iter = m_MapFontInstances.begin(); iter != m_MapFontInstances.end(); ++iter ) + { + if ( FAILED( iter->second->OnLostDevice() ) ) + { + bFullySuccessful = false; + OutputDebugString( "Failed OnLostDevice on a font object\n" ); + } + } + } + + // Vertex buffers we have to release and then re-create later, since we only use them internal + // to the engine we can just free them all, and we'll know how to recreate them later on demand + { + std::map::iterator iter; + for( iter = m_MapVertexBuffers.begin(); iter != m_MapVertexBuffers.end(); ++iter ) + { + if ( iter->second.m_pBuffer ) + { + if ( iter->second.m_bIsLocked ) + iter->second.m_pBuffer->Unlock(); + iter->second.m_bIsLocked = false; + iter->second.m_pBuffer->Release(); + iter->second.m_pBuffer = NULL; + } + } + m_MapVertexBuffers.clear(); + } + + // Textures we can just release, and they will be recreated on demand when used again + { + std::map::iterator iter; + for( iter = m_MapTextures.begin(); iter != m_MapTextures.end(); ++iter ) + { + if ( iter->second.m_pTexture ) + { + iter->second.m_pTexture->Release(); + iter->second.m_pTexture = NULL; + } + if ( iter->second.m_pDepthSurface ) + { + iter->second.m_pDepthSurface->Release( ); + iter->second.m_pDepthSurface = NULL; + } + } + } + + return bFullySuccessful; +} + +//----------------------------------------------------------------------------- +// Purpose: Handle device reset after losing it +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BHandleResetDevice() +{ + bool bFullySuccessful = true; + + ResetRenderStates(); + + // Fonts are easy since we used d3dx, they have their own handlers + { + std::map::iterator iter; + for( iter = m_MapFontInstances.begin(); iter != m_MapFontInstances.end(); ++iter ) + { + if ( FAILED( iter->second->OnResetDevice() ) ) + { + OutputDebugString( "Reset for a font object failed\n" ); + bFullySuccessful = false; + } + } + } + + // Vertex buffers we only use internal to the class, so we know + // how to recreate them on demand. Nothing to do here for them. + + return bFullySuccessful; +} + + +//----------------------------------------------------------------------------- +// Purpose: Updates current tick count for the game engine +//----------------------------------------------------------------------------- +void CGameEngineWin32::UpdateGameTickCount() +{ + LARGE_INTEGER l; + ::QueryPerformanceCounter( &l ); + + m_ulPreviousGameTickCount = m_ulGameTickCount; + m_ulGameTickCount = (l.QuadPart - m_ulFirstQueryPerformanceCounterValue) / m_ulPerfCounterToMillisecondsDivisor; +} + + +//----------------------------------------------------------------------------- +// Purpose: Tell the game engine to sleep for a bit if needed to limit frame rate. You must keep +// calling this repeatedly until it returns false. If it returns true it's slept a little, but more +// time may be needed. +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BSleepForFrameRateLimit( uint32 ulMaxFrameRate ) +{ + // Frame rate limiting + float flDesiredFrameMilliseconds = 1000.0f/ulMaxFrameRate; + + LARGE_INTEGER l; + ::QueryPerformanceCounter( &l ); + + uint64 ulGameTickCount = (l.QuadPart - m_ulFirstQueryPerformanceCounterValue) / m_ulPerfCounterToMillisecondsDivisor; + + float flMillisecondsElapsed = (float)(ulGameTickCount - m_ulGameTickCount); + if ( flMillisecondsElapsed < flDesiredFrameMilliseconds ) + { + // If enough time is left sleep, otherwise just keep spinning so we don't go over the limit... + if ( flDesiredFrameMilliseconds - flMillisecondsElapsed > 3.0f ) + { + Sleep( 2 ); + } + else + { + // Just return right away so we busy loop, don't want to sleep too long and go over + } + + return true; + } + else + { + return false; + } +} + + + +//----------------------------------------------------------------------------- +// Purpose: Resets all the render, texture, and sampler states to our defaults +//----------------------------------------------------------------------------- +void CGameEngineWin32::ResetRenderStates() +{ + // Since we are just a really basic rendering engine we'll setup our initial + // render states here and we can just assume that they don't change later + m_pD3D9Device->SetRenderState( D3DRS_LIGHTING, FALSE ); + m_pD3D9Device->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE ); + m_pD3D9Device->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_BOTHSRCALPHA ); + m_pD3D9Device->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA ); + + // texture stage state + m_pD3D9Device->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE ); + m_pD3D9Device->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE ); + m_pD3D9Device->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_CURRENT ); + m_pD3D9Device->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE ); + m_pD3D9Device->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE ); + m_pD3D9Device->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_CURRENT ); + + // sampler state + m_pD3D9Device->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR ); + m_pD3D9Device->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR ); + m_pD3D9Device->SetSamplerState( 0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR ); + m_pD3D9Device->SetSamplerState( 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP ); + m_pD3D9Device->SetSamplerState( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP ); + m_pD3D9Device->SetSamplerState( 1, D3DSAMP_MINFILTER, D3DTEXF_LINEAR ); + m_pD3D9Device->SetSamplerState( 1, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR ); + m_pD3D9Device->SetSamplerState( 1, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR ); + m_pD3D9Device->SetSamplerState( 1, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP ); + m_pD3D9Device->SetSamplerState( 1, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Creates the window for the game to use +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BCreateGameWindow( int nShowCommand ) +{ + int windowX = 0; + int windowY = 0; + + WNDCLASS wc; + DWORD style; + + // Register the window class. + wc.lpszClassName = "SteamworksExample"; + wc.lpfnWndProc = GameWndProc; + wc.style = 0; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = m_hInstance; + wc.hIcon = LoadIcon(NULL,IDI_APPLICATION); + wc.hCursor = LoadCursor(NULL,IDC_ARROW); + wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); + wc.lpszMenuName = NULL; + + if ( !RegisterClass( &wc ) ) + { + OutputDebugString( "Failure registering window class\n" ); + return false; + } + + // Set parent window mode (normal system window with overlap/draw-ordering) + style = WS_OVERLAPPED|WS_SYSMENU; + + // Create actual window + m_hWnd = CreateWindow( "SteamworksExample", + "SteamworksExample", + style, + windowX, + windowY, + m_nWindowWidth, + m_nWindowHeight, + NULL, + NULL, + m_hInstance, + NULL ); + + if ( m_hWnd == NULL ) + { + OutputDebugString( "Failed to create window for CGameEngine\n" ); + return false; + } + + // Give focus to newly created app window. + ::ShowWindow( m_hWnd, nShowCommand ); + ::UpdateWindow( m_hWnd ); + ::SetFocus( m_hWnd ); + + return true; +} + +bool CGameEngineWin32::BInitializeD3D9() +{ + if ( !m_pD3D9Interface ) + { + // Initialize the d3d interface + m_pD3D9Interface = Direct3DCreate9( D3D_SDK_VERSION ); + if ( m_pD3D9Interface == NULL ) + { + OutputDebugString( "Direct3DCreate9 failed\n" ); + return false; + } + } + + if ( !m_pD3D9Device ) + { + D3DDISPLAYMODE d3ddisplaymode; + + // Get the current desktop display mode, only needed if running in a window. + HRESULT hRes = m_pD3D9Interface->GetAdapterDisplayMode( D3DADAPTER_DEFAULT, &d3ddisplaymode ); + if (FAILED(hRes)) + { + OutputDebugString( "GetAdapterDisplayMode failed\n"); + return false; + } + + // Setup presentation parameters + ZeroMemory( &m_d3dpp, sizeof( m_d3dpp ) ); + m_d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; + m_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; // no v-sync + m_d3dpp.hDeviceWindow = m_hWnd; + m_d3dpp.BackBufferCount = 1; + m_d3dpp.EnableAutoDepthStencil = TRUE; + m_d3dpp.AutoDepthStencilFormat = D3DFMT_D16; + m_d3dpp.Windowed = TRUE; // bugbug jmccaskey - make a parameter? + m_d3dpp.BackBufferFormat = d3ddisplaymode.Format; + + UINT nAdapter = D3DADAPTER_DEFAULT; + + // Create Direct3D9 device + // (if it fails to create hardware vertex processing, then go with the software alternative). + hRes = m_pD3D9Interface->CreateDevice( + nAdapter, + D3DDEVTYPE_HAL, + m_hWnd, + D3DCREATE_HARDWARE_VERTEXPROCESSING, + &m_d3dpp, + &m_pD3D9Device ); + + // Could not create a hardware device, create a software one instead (slow....) + if ( FAILED( hRes ) ) + { + hRes = m_pD3D9Interface->CreateDevice( + D3DADAPTER_DEFAULT, + D3DDEVTYPE_HAL, + m_hWnd, + D3DCREATE_SOFTWARE_VERTEXPROCESSING, + &m_d3dpp, + &m_pD3D9Device ); + } + + // If we couldn't create a device even with software vertex processing then + // it's a fatal error + if ( FAILED( hRes ) ) + { + // Make sure the pointer is NULL after failures (seems it sometimes gets modified even when failing) + m_pD3D9Device = NULL; + + OutputDebugString( "Failed to create D3D9 device\n" ); + return false; + } + + if ( FAILED( m_pD3D9Device->GetDepthStencilSurface( &m_pBackbufferDepth ) ) ) + { + m_pBackbufferDepth = NULL; + OutputDebugString( "Failed to get the backbuffer depth buffer\n" ); + return false; + } + + //Initialize our render, texture, and sampler stage states + ResetRenderStates(); + + } + + return true; +} + +//----------------------------------------------------------------------------- +// Purpose: Set the background color to clear to +//----------------------------------------------------------------------------- +void CGameEngineWin32::SetBackgroundColor( short a, short r, short g, short b ) +{ + m_dwBackgroundColor = D3DCOLOR_ARGB( a, r, g, b ); +} + +//----------------------------------------------------------------------------- +// Purpose: Start a new frame +//----------------------------------------------------------------------------- +bool CGameEngineWin32::StartFrame() +{ + // Before doing anything else pump messages + MessagePump(); + + // Detect if we lose focus and cause all keys do go up so they aren't stuck + if ( ::GetForegroundWindow() != m_hWnd ) + { + m_SetKeysDown.clear(); + } + + // Message pump may have lead us to shutdown, check + if ( BShuttingDown() ) + return false; + + if ( !m_pD3D9Device ) + return false; + + // Poll Steam Controllers + PollSteamInput(); + + // Test that we haven't lost the device + HRESULT hRes = m_pD3D9Device->TestCooperativeLevel(); + if ( hRes == D3DERR_DEVICELOST ) + { + // Device is currently lost, can't render frames, but lets just let things continue so the + // simulation keeps running, the game should probably pause itself + + // If it is newly lost then release resources + if ( !m_bDeviceLost ) + { + OutputDebugString( "Device lost\n" ); + + // HandleLostDevice() will free all our resources + if ( !BHandleLostDevice() ) + OutputDebugString( "Failed to release all resources for lost device\n" ); + } + m_bDeviceLost = true; + + } + else if ( hRes == D3DERR_DEVICENOTRESET ) + { + OutputDebugString( "Getting ready to reset device\n" ); + + // Reset the device + hRes = m_pD3D9Device->Reset( &m_d3dpp ); + if ( !FAILED( hRes ) ) + { + m_bDeviceLost = false; + // Acquire all our resources again + if ( !BHandleResetDevice() ) + { + OutputDebugString( "Failed to acquire all resources again after device reset\n" ); + } + } + else + { + OutputDebugString( "Reset() call on device failed\n" ); + ::MessageBox( m_hWnd, "m_pD3D9Device->Reset() call has failed unexpectedly\n", "Fatal Error", MB_OK ); + Shutdown(); + return false; + } + } + + // Return true even though we can't render, frames can still run otherwise + // and the game should continue its simulation or choose to pause on its own + if ( m_bDeviceLost ) + return true; + + hRes = m_pD3D9Device->BeginScene(); + if ( FAILED( hRes ) ) + return false; + + // Clear the back buffer and z-buffer + hRes = m_pD3D9Device->Clear( 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, m_dwBackgroundColor, 1.0f, 0 ); + if ( FAILED( hRes ) ) + return false; + + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: End the current frame +//----------------------------------------------------------------------------- +void CGameEngineWin32::EndFrame() +{ + if ( BShuttingDown() ) + return; + + if ( !m_pD3D9Device ) + return; + + if ( m_bDeviceLost ) + return; + + // See if we lost the device in the middle of the frame + HRESULT hRes = m_pD3D9Device->TestCooperativeLevel(); + if ( hRes == D3DERR_DEVICELOST ) + { + // Ok, StartFrame will handle this next time through, but bail out early here + return; + } + + // Flush point buffer + BFlushPointBuffer(); + + // Flush line buffer + BFlushLineBuffer(); + + // Flush quad buffer + BFlushQuadBuffer(); + + // draw the VR mode offscreen render target on a quad somewhere + hRes = m_pD3D9Device->EndScene(); + if ( FAILED( hRes ) ) + { + OutputDebugString( "EndScene() call failed\n" ); + return; + } + + hRes = m_pD3D9Device->Present( NULL, NULL, NULL, NULL ); + if ( FAILED( hRes ) ) + { + OutputDebugString( "Present() call failed\n" ); + return; + } +} + +//----------------------------------------------------------------------------- +// Purpose: Creates a new vertex buffer +//----------------------------------------------------------------------------- +HGAMEVERTBUF CGameEngineWin32::HCreateVertexBuffer( uint32 nSizeInBytes, DWORD dwUsage, DWORD dwFVF ) +{ + if ( !m_pD3D9Device ) + return false; + + // Create a vertex buffer object + IDirect3DVertexBuffer9 *pVertBuffer; + HRESULT hRes = m_pD3D9Device->CreateVertexBuffer( nSizeInBytes, dwUsage, + dwFVF, D3DPOOL_DEFAULT, &pVertBuffer, NULL ); + if ( FAILED( hRes ) ) + { + OutputDebugString( "Failed creating vertex buffer\n" ); + return 0; + } + + HGAMEFONT hVertBuf = m_nNextVertBufferHandle; + ++m_nNextVertBufferHandle; + + VertBufData_t data; + data.m_bIsLocked = false; + data.m_pBuffer = pVertBuffer; + + m_MapVertexBuffers[ hVertBuf ] = data; + return hVertBuf; +} + + +//----------------------------------------------------------------------------- +// Purpose: Locks an entire vertex buffer with the specified flags into memory +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BLockEntireVertexBuffer( HGAMEVERTBUF hVertBuf, void **ppVoid, DWORD dwFlags ) +{ + if ( !m_pD3D9Device ) + return false; + + if ( m_bDeviceLost ) + return false; + + if ( !hVertBuf ) + { + OutputDebugString( "Someone is calling BLockEntireVertexBuffer() with a null handle\n" ); + return false; + } + + // Find the font object for the passed handle + std::map::iterator iter; + iter = m_MapVertexBuffers.find( hVertBuf ); + if ( iter == m_MapVertexBuffers.end() ) + { + OutputDebugString( "Invalid vertex buffer handle passed to BLockEntireVertexBuffer()\n" ); + return false; + } + + // Make sure the pointer is valid + if ( !iter->second.m_pBuffer ) + { + OutputDebugString( "Pointer to vertex buffer is invalid (lost device and not recreated?)!\n" ); + return false; + } + + + // Make sure its not already locked + if ( iter->second.m_bIsLocked ) + { + OutputDebugString( "Trying to lock an already locked vertex buffer!\n" ); + return false; + } + + // we have the buffer, try to lock it + if( FAILED( iter->second.m_pBuffer->Lock( 0, 0, ppVoid, dwFlags ) ) ) + { + OutputDebugString( "BLockEntireVertexBuffer call failed\n" ); + return false; + } + + // Track that we are now locked + iter->second.m_bIsLocked = true; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Unlocks a vertex buffer +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BUnlockVertexBuffer( HGAMEVERTBUF hVertBuf ) +{ + if ( !m_pD3D9Device ) + return false; + + if ( m_bDeviceLost ) + return false; + + if ( !hVertBuf ) + { + OutputDebugString( "Someone is calling BUnlockVertexBuffer() with a null handle\n" ); + return false; + } + + // Find the vertex buffer for the passed handle + std::map::iterator iter; + iter = m_MapVertexBuffers.find( hVertBuf ); + if ( iter == m_MapVertexBuffers.end() ) + { + OutputDebugString( "Invalid vertex buffer handle passed to BUnlockVertexBuffer()\n" ); + return false; + } + + // Make sure the pointer is valid + if ( !iter->second.m_pBuffer ) + { + OutputDebugString( "Pointer to vertex buffer is invalid (lost device and not recreated?)!\n" ); + return false; + } + + // Make sure we are locked if someone is trying to unlock + if ( !iter->second.m_bIsLocked ) + { + OutputDebugString( "Trying to unlock a vertex buffer that is not locked!\n" ); + return false; + } + + // we have the buffer, try to lock it + if( FAILED( iter->second.m_pBuffer->Unlock() ) ) + { + OutputDebugString( "BUnlockVertexBuffer call failed\n" ); + return false; + } + + // Track that we are now unlocked + iter->second.m_bIsLocked = false; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Release a vertex buffer and free its resources +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BReleaseVertexBuffer( HGAMEVERTBUF hVertBuf ) +{ + if ( !m_pD3D9Device ) + return false; + + if ( m_bDeviceLost ) + return false; + + if ( !hVertBuf ) + { + OutputDebugString( "Someone is calling BReleaseVertexBuffer() with a null handle\n" ); + return false; + } + + // Find the vertex buffer object for the passed handle + std::map::iterator iter; + iter = m_MapVertexBuffers.find( hVertBuf ); + if ( iter == m_MapVertexBuffers.end() ) + { + OutputDebugString( "Invalid vertex buffer handle passed to BReleaseVertexBuffer()\n" ); + return false; + } + + // Make sure the pointer is valid + if ( !iter->second.m_pBuffer ) + { + OutputDebugString( "Pointer to vertex buffer is invalid (lost device and not recreated?)!\n" ); + return false; + } + + // Make sure its unlocked, if it isn't locked this will just fail quietly + if ( iter->second.m_bIsLocked ) + iter->second.m_pBuffer->Unlock(); + + // Release the resources + iter->second.m_pBuffer->Release(); + + // Remove from the map + m_MapVertexBuffers.erase( iter ); + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Set the FVF +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BSetFVF( DWORD dwFormat ) +{ + if ( !m_pD3D9Device ) + return false; + + // Can't set the FVF when the device is lost + if ( m_bDeviceLost ) + return false; + + // Short circuit if the request is a noop + if ( m_dwCurrentFVF == dwFormat ) + return true; + + if ( FAILED( m_pD3D9Device->SetFVF( dwFormat ) ) ) + { + OutputDebugString( "SetFVF() call failed\n" ); + return false; + } + + m_dwCurrentFVF = dwFormat; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Draw a line, the engine internally manages a vertex buffer for batching these +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BDrawLine( float xPos0, float yPos0, DWORD dwColor0, float xPos1, float yPos1, DWORD dwColor1 ) +{ + if ( !m_pD3D9Device ) + return false; + + if ( m_bDeviceLost ) + return true; // Fail silently in this case + + if ( !m_hLineBuffer ) + { + // Create the line buffer + m_hLineBuffer = HCreateVertexBuffer( sizeof( LineVertex_t ) * LINE_BUFFER_TOTAL_SIZE * 2, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFVF_XYZRHW | D3DFVF_DIFFUSE ); + + if ( !m_hLineBuffer ) + { + OutputDebugString( "Can't BDrawLine() because vertex buffer creation failed\n" ); + return false; + } + } + + // Check if we are out of room and need to flush the buffer + if ( m_dwLinesToFlush == LINE_BUFFER_BATCH_SIZE ) + { + BFlushLineBuffer(); + } + + // Set FVF + if ( !BSetFVF( D3DFVF_XYZRHW | D3DFVF_DIFFUSE ) ) + return false; + + // Lock the vertex buffer into memory + if ( !m_pLineVertexes ) + { + if ( !BLockEntireVertexBuffer( m_hLineBuffer, (void**)&m_pLineVertexes, m_dwLineBufferBatchPos ? D3DLOCK_NOOVERWRITE : D3DLOCK_DISCARD ) ) + { + m_pLineVertexes = NULL; + OutputDebugString( "BDrawLine failed because locking vertex buffer failed\n" ); + return false; + } + } + + LineVertex_t *pVertData = &m_pLineVertexes[ m_dwLineBufferBatchPos*2+m_dwLinesToFlush*2 ]; + pVertData[0].rhw = 1.0; + pVertData[0].z = 1.0; + pVertData[0].x = xPos0; + pVertData[0].y = yPos0; + pVertData[0].color = dwColor0; + + pVertData[1].rhw = 1.0; + pVertData[1].z = 1.0; + pVertData[1].x = xPos1; + pVertData[1].y = yPos1; + pVertData[1].color = dwColor1; + + ++m_dwLinesToFlush; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Flush batched lines to the screen +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BFlushLineBuffer() +{ + // If the vert buffer isn't already locked into memory, then there is nothing to flush + if ( m_pLineVertexes == NULL ) + return true; // consider this successful since there was no error + + // OK, it is locked, so unlock now + if ( !BUnlockVertexBuffer( m_hLineBuffer ) ) + { + OutputDebugString( "Failed flushing line buffer because BUnlockVertexBuffer failed\n" ); + return false; + } + + // Clear the memory pointer as its invalid now that we unlocked + m_pLineVertexes = NULL; + + // If there is nothing to actual flush, we are done + if ( m_dwLinesToFlush == 0 ) + return true; + + // Set FVF (will short circuit if this is already the set FVF) + if ( !BSetFVF( D3DFVF_XYZRHW | D3DFVF_DIFFUSE ) ) + { + OutputDebugString( "Failed flushing line buffer because BSetFVF failed\n" ); + return false; + } + + if ( !BSetStreamSource( m_hLineBuffer, 0, sizeof( LineVertex_t ) ) ) + { + OutputDebugString( "Failed flushing line buffer because BSetStreamSource failed\n" ); + return false; + } + + // Actual render calls + if ( !BRenderPrimitive( D3DPT_LINELIST, m_dwLineBufferBatchPos*2, m_dwLinesToFlush ) ) + { + OutputDebugString( "Failed flushing line buffer because BRenderPrimitive failed\n" ); + return false; + } + + m_dwLinesToFlush = 0; + m_dwLineBufferBatchPos += LINE_BUFFER_BATCH_SIZE; + if ( m_dwLineBufferBatchPos >= LINE_BUFFER_TOTAL_SIZE ) + { + m_dwLineBufferBatchPos = 0; + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Draw a point, the engine internally manages a vertex buffer for batching these +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BDrawPoint( float xPos, float yPos, DWORD dwColor ) +{ + if ( !m_pD3D9Device ) + return false; + + if ( m_bDeviceLost ) + return true; // Fail silently in this case + + if ( !m_hPointBuffer ) + { + // Create the point buffer + m_hPointBuffer = HCreateVertexBuffer( sizeof( PointVertex_t ) * POINT_BUFFER_TOTAL_SIZE * 2, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFVF_XYZRHW | D3DFVF_DIFFUSE ); + + if ( !m_hPointBuffer ) + { + OutputDebugString( "Can't BDrawPoint() because vertex buffer creation failed\n" ); + return false; + } + } + + // Check if we are out of room and need to flush the buffer + if ( m_dwPointsToFlush == POINT_BUFFER_BATCH_SIZE ) + { + BFlushPointBuffer(); + } + + // Set FVF + if ( !BSetFVF( D3DFVF_XYZRHW | D3DFVF_DIFFUSE ) ) + return false; + + // Lock the vertex buffer into memory + if ( !m_pPointVertexes ) + { + if ( !BLockEntireVertexBuffer( m_hPointBuffer, (void**)&m_pPointVertexes, (m_dwPointBufferBatchPos+m_dwPointsToFlush) ? D3DLOCK_NOOVERWRITE : D3DLOCK_DISCARD ) ) + { + m_pPointVertexes = NULL; + OutputDebugString( "BDrawPoint failed because locking vertex buffer failed\n" ); + return false; + } + } + + PointVertex_t *pVertData = &m_pPointVertexes[ m_dwPointBufferBatchPos+m_dwPointsToFlush ]; + pVertData[0].rhw = 1.0; + pVertData[0].z = 1.0; + pVertData[0].x = xPos; + pVertData[0].y = yPos; + pVertData[0].color = dwColor; + + ++m_dwPointsToFlush; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Flush batched points to the screen +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BFlushPointBuffer() +{ + // If the vert buffer isn't already locked into memory, then there is nothing to flush + if ( m_pPointVertexes == NULL ) + return true; // consider this successful since there was no error + + // OK, it is locked, so unlock now + if ( !BUnlockVertexBuffer( m_hPointBuffer ) ) + { + OutputDebugString( "Failed flushing point buffer because BUnlockVertexBuffer failed\n" ); + return false; + } + + // Clear the memory pointer as its invalid now that we unlocked + m_pPointVertexes = NULL; + + // If there is nothing to actual flush, we are done + if ( m_dwPointsToFlush == 0 ) + return true; + + // Set FVF (will short circuit if this is already the set FVF) + if ( !BSetFVF( D3DFVF_XYZRHW | D3DFVF_DIFFUSE ) ) + { + OutputDebugString( "Failed flushing point buffer because BSetFVF failed\n" ); + return false; + } + + if ( !BSetStreamSource( m_hPointBuffer, 0, sizeof( PointVertex_t ) ) ) + { + OutputDebugString( "Failed flushing point buffer because BSetStreamSource failed\n" ); + return false; + } + + // Actual render calls + if ( !BRenderPrimitive( D3DPT_POINTLIST, m_dwPointBufferBatchPos, m_dwPointsToFlush ) ) + { + OutputDebugString( "Failed flushing point buffer because BRenderPrimitive failed\n" ); + return false; + } + + m_dwPointsToFlush = 0; + m_dwPointBufferBatchPos += POINT_BUFFER_BATCH_SIZE; + if ( m_dwPointBufferBatchPos >= POINT_BUFFER_TOTAL_SIZE ) + { + m_dwPointBufferBatchPos = 0; + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Draw a filled quad +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BDrawFilledRect( float xPos0, float yPos0, float xPos1, float yPos1, DWORD dwColor ) +{ + if ( !m_hTextureWhite ) + { + byte *pRGBAData = new byte[ 1 * 1 * 4 ]; + memset( pRGBAData, 255, 1*1*4 ); + m_hTextureWhite = HCreateTexture( pRGBAData, 1, 1 ); + delete[] pRGBAData; + } + + return BDrawTexturedRect( xPos0, yPos0, xPos1, yPos1, 0.0f, 0.0f, 1.0f, 1.0f, dwColor, m_hTextureWhite ); +} + +//----------------------------------------------------------------------------- +// Purpose: Draw a textured quad +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BDrawTexturedRect( float xPos0, float yPos0, float xPos1, float yPos1, float u0, float v0, float u1, float v1, DWORD dwColor, HGAMETEXTURE hTexture ) +{ + if ( !m_pD3D9Device ) + return false; + + if ( m_bDeviceLost ) + return true; // Fail silently in this case + + // Find the texture + std::map::iterator iter; + iter = m_MapTextures.find( hTexture ); + if ( iter == m_MapTextures.end() ) + { + OutputDebugString( "BDrawTexturedQuad called with invalid hTexture value\n" ); + return false; + } + + if ( !m_hQuadBuffer ) + { + // Create the line buffer + m_hQuadBuffer = HCreateVertexBuffer( sizeof(TexturedQuadVertex_t)* QUAD_BUFFER_TOTAL_SIZE * 4, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1 ); + + if ( !m_hQuadBuffer ) + { + OutputDebugString( "Can't BDrawTexturedQuad() because vertex buffer creation failed\n" ); + return false; + } + } + + // Check if we are out of room and need to flush the buffer + if ( m_dwQuadsToFlush == QUAD_BUFFER_BATCH_SIZE ) + { + BFlushQuadBuffer(); + } + + // Check if the texture changed so we need to flush the buffer + if ( m_hLastTexture != hTexture ) + { + BFlushQuadBuffer(); + } + + // Save the texture to use for next flush + m_hLastTexture = hTexture; + + if ( !BSetFVF( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1 ) ) + { + OutputDebugString( "Setting FVF failed for textured rect drawing\n" ); + return false; + } + + // Lock the vertex buffer into memory + if ( !m_pQuadVertexes ) + { + if ( !BLockEntireVertexBuffer( m_hQuadBuffer, (void**)&m_pQuadVertexes, m_dwQuadBufferBatchPos ? D3DLOCK_NOOVERWRITE : D3DLOCK_DISCARD ) ) + { + m_pQuadVertexes = NULL; + OutputDebugString( "BDrawTexturedQuad failed because locking vertex buffer failed\n" ); + return false; + } + } + + TexturedQuadVertex_t *pVertData = &m_pQuadVertexes[m_dwQuadBufferBatchPos * 4 + m_dwQuadsToFlush * 4]; + + pVertData[0].color = dwColor; + pVertData[0].rhw = 1.0f; + pVertData[0].z = 1.0f; + pVertData[0].x = xPos0; + pVertData[0].y = yPos0; + pVertData[0].u = u0; + pVertData[0].v = v0; + + pVertData[1].color = dwColor; + pVertData[1].rhw = 1.0f; + pVertData[1].z = 1.0f; + pVertData[1].x = xPos1; + pVertData[1].y = yPos0; + pVertData[1].u = u1; + pVertData[1].v = v0; + + pVertData[2].color = dwColor; + pVertData[2].rhw = 1.0f; + pVertData[2].z = 1.0f; + pVertData[2].x = xPos0; + pVertData[2].y = yPos1; + pVertData[2].u = u0; + pVertData[2].v = v1; + + pVertData[3].color = dwColor; + pVertData[3].rhw = 1.0f; + pVertData[3].z = 1.0f; + pVertData[3].x = xPos1; + pVertData[3].y = yPos1; + pVertData[3].u = u1; + pVertData[3].v = v1; + + ++m_dwQuadsToFlush; + + return true; +} + +//----------------------------------------------------------------------------- +// Purpose: Draw a textured quad +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BDrawTexturedQuad( float xPos0, float yPos0, float xPos1, float yPos1, float xPos2, float yPos2 , float xPos3, float yPos3, + float u0, float v0, float u1, float v1, DWORD dwColor, HGAMETEXTURE hTexture ) +{ + if ( !m_pD3D9Device ) + return false; + + if ( m_bDeviceLost ) + return true; // Fail silently in this case + + // Find the texture + std::map::iterator iter; + iter = m_MapTextures.find( hTexture ); + if ( iter == m_MapTextures.end() ) + { + OutputDebugString( "BDrawTexturedQuad called with invalid hTexture value\n" ); + return false; + } + + if ( !m_hQuadBuffer ) + { + // Create the line buffer + m_hQuadBuffer = HCreateVertexBuffer( sizeof(TexturedQuadVertex_t)* QUAD_BUFFER_TOTAL_SIZE * 4, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1 ); + + if ( !m_hQuadBuffer ) + { + OutputDebugString( "Can't BDrawTexturedQuad() because vertex buffer creation failed\n" ); + return false; + } + } + + // Check if we are out of room and need to flush the buffer + if ( m_dwQuadsToFlush == QUAD_BUFFER_BATCH_SIZE ) + { + BFlushQuadBuffer(); + } + + // Check if the texture changed so we need to flush the buffer + if ( m_hLastTexture != hTexture ) + { + BFlushQuadBuffer(); + } + + // Save the texture to use for next flush + m_hLastTexture = hTexture; + + if ( !BSetFVF( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1 ) ) + { + OutputDebugString( "Setting FVF failed for textured rect drawing\n" ); + return false; + } + + // Lock the vertex buffer into memory + if ( !m_pQuadVertexes ) + { + if ( !BLockEntireVertexBuffer( m_hQuadBuffer, (void**)&m_pQuadVertexes, m_dwQuadBufferBatchPos ? D3DLOCK_NOOVERWRITE : D3DLOCK_DISCARD ) ) + { + m_pQuadVertexes = NULL; + OutputDebugString( "BDrawTexturedQuad failed because locking vertex buffer failed\n" ); + return false; + } + } + + TexturedQuadVertex_t *pVertData = &m_pQuadVertexes[m_dwQuadBufferBatchPos * 4 + m_dwQuadsToFlush * 4]; + + pVertData[0].color = dwColor; + pVertData[0].rhw = 1.0f; + pVertData[0].z = 1.0f; + pVertData[0].x = xPos0; + pVertData[0].y = yPos0; + pVertData[0].u = u0; + pVertData[0].v = v0; + + pVertData[1].color = dwColor; + pVertData[1].rhw = 1.0f; + pVertData[1].z = 1.0f; + pVertData[1].x = xPos1; + pVertData[1].y = yPos1; + pVertData[1].u = u1; + pVertData[1].v = v0; + + pVertData[2].color = dwColor; + pVertData[2].rhw = 1.0f; + pVertData[2].z = 1.0f; + pVertData[2].x = xPos2; + pVertData[2].y = yPos2; + pVertData[2].u = u0; + pVertData[2].v = v1; + + pVertData[3].color = dwColor; + pVertData[3].rhw = 1.0f; + pVertData[3].z = 1.0f; + pVertData[3].x = xPos3; + pVertData[3].y = yPos3; + pVertData[3].u = u1; + pVertData[3].v = v1; + + ++m_dwQuadsToFlush; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Draw a 3D textured quad +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BDraw3DTexturedQuad( Textured3DQuadVertex_t vert[4], HGAMETEXTURE hTexture ) +{ + if ( !m_pD3D9Device ) + return false; + + if ( m_bDeviceLost ) + return true; // Fail silently in this case + + // Find the texture + std::map::iterator iter; + iter = m_MapTextures.find( hTexture ); + if ( iter == m_MapTextures.end() ) + { + OutputDebugString( "BDrawTexturedQuad called with invalid hTexture value\n" ); + return false; + } + + if ( !m_h3DQuadBuffer ) + { + // Create the line buffer + m_h3DQuadBuffer = HCreateVertexBuffer( sizeof(Textured3DQuadVertex_t)* QUAD_BUFFER_TOTAL_SIZE * 4, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1 ); + + if ( !m_h3DQuadBuffer ) + { + OutputDebugString( "Can't BDraw3DTexturedQuad() because vertex buffer creation failed\n" ); + return false; + } + } + + // Check if we are out of room and need to flush the buffer + if ( m_dw3DQuadsToFlush == QUAD_BUFFER_BATCH_SIZE ) + { + BFlush3DQuadBuffer(); + } + + // Check if the texture changed so we need to flush the buffer + if ( m_h3DLastTexture != hTexture ) + { + BFlush3DQuadBuffer( ); + } + + // Save the texture to use for next flush + m_h3DLastTexture = hTexture; + + if ( !BSetFVF( D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1 ) ) + { + OutputDebugString( "Setting FVF failed for textured rect drawing\n" ); + return false; + } + + // Lock the vertex buffer into memory + if ( !m_p3DQuadVertexes ) + { + if ( !BLockEntireVertexBuffer( m_h3DQuadBuffer, (void**)&m_p3DQuadVertexes, m_dw3DQuadBufferBatchPos ? D3DLOCK_NOOVERWRITE : D3DLOCK_DISCARD ) ) + { + m_p3DQuadVertexes = NULL; + OutputDebugString( "BDrawTexturedQuad failed because locking vertex buffer failed\n" ); + return false; + } + } + + Textured3DQuadVertex_t *pVertData = &m_p3DQuadVertexes[m_dw3DQuadBufferBatchPos * 4 + m_dw3DQuadsToFlush * 4]; + + for ( int i = 0; i < 4; i++ ) + { + pVertData[i] = vert[i]; + } + + ++m_dw3DQuadsToFlush; + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Flush buffered quads +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BFlushQuadBuffer() +{ + // If the vert buffer isn't already locked into memory, then there is nothing to flush + if ( m_pQuadVertexes == NULL ) + return true; // consider this successful since there was no error + + // OK, it is locked, so unlock now + if ( !BUnlockVertexBuffer( m_hQuadBuffer ) ) + { + OutputDebugString( "Failed flushing quad buffer because BUnlockVertexBuffer failed\n" ); + return false; + } + + // Clear the memory pointer as its invalid now that we unlocked + m_pQuadVertexes = NULL; + + // If there is nothing to actual flush, we are done + if ( m_dwQuadsToFlush == 0 ) + return true; + + // Set FVF (will short circuit if this is already the set FVF) + if ( !BSetFVF( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1 ) ) + { + OutputDebugString( "Failed flushing quad buffer because BSetFVF failed\n" ); + return false; + } + + // Find the texture + if ( !BSetTexture( m_hLastTexture ) ) + return false; + + if ( !BSetStreamSource( m_hQuadBuffer, 0, sizeof(TexturedQuadVertex_t) ) ) + { + OutputDebugString( "Failed flushing quad buffer because BSetStreamSource failed\n" ); + m_pD3D9Device->SetTexture( 0, NULL ); // need to clear the texture before other drawing ops + return false; + } + + // Actual render calls + for ( DWORD i=0; i < m_dwQuadsToFlush*4; i += 4 ) + { + if ( !BRenderPrimitive( D3DPT_TRIANGLESTRIP, (m_dwQuadBufferBatchPos*4)+i, 2 ) ) + { + OutputDebugString( "Failed flushing line buffer because BRenderPrimitive failed\n" ); + m_pD3D9Device->SetTexture( 0, NULL ); // need to clear the texture before other drawing ops + return false; + } + } + + m_pD3D9Device->SetTexture( 0, NULL ); // need to clear the texture before other drawing ops + + m_dwQuadsToFlush = 0; + m_dwQuadBufferBatchPos += QUAD_BUFFER_BATCH_SIZE; + if ( m_dwQuadBufferBatchPos >= QUAD_BUFFER_TOTAL_SIZE ) + { + m_dwQuadBufferBatchPos = 0; + } + + return true; + + +} + +//----------------------------------------------------------------------------- +// Purpose: Flush buffered 3D quads +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BFlush3DQuadBuffer() +{ + // If the vert buffer isn't already locked into memory, then there is nothing to flush + if ( m_p3DQuadVertexes == NULL ) + return true; // consider this successful since there was no error + + // OK, it is locked, so unlock now + if ( !BUnlockVertexBuffer( m_h3DQuadBuffer ) ) + { + OutputDebugString( "Failed flushing quad buffer because BUnlockVertexBuffer failed\n" ); + return false; + } + + // Clear the memory pointer as its invalid now that we unlocked + m_p3DQuadVertexes = NULL; + + // If there is nothing to actual flush, we are done + if ( m_dw3DQuadsToFlush == 0 ) + return true; + + // Set FVF (will short circuit if this is already the set FVF) + if ( !BSetFVF( D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1 ) ) + { + OutputDebugString( "Failed flushing quad buffer because BSetFVF failed\n" ); + return false; + } + + // Find the texture + if ( !BSetTexture( m_h3DLastTexture ) ) + return false; + + if ( !BSetStreamSource( m_h3DQuadBuffer, 0, sizeof(Textured3DQuadVertex_t) ) ) + { + OutputDebugString( "Failed flushing 3D quad buffer because BSetStreamSource failed\n" ); + m_pD3D9Device->SetTexture( 0, NULL ); // need to clear the texture before other drawing ops + return false; + } + + // Actual render calls + for ( DWORD i = 0; i < m_dw3DQuadsToFlush * 4; i += 4 ) + { + if ( !BRenderPrimitive( D3DPT_TRIANGLESTRIP, (m_dw3DQuadBufferBatchPos * 4) + i, 2 ) ) + { + OutputDebugString( "Failed flushing line buffer because BRenderPrimitive failed\n" ); + m_pD3D9Device->SetTexture( 0, NULL ); // need to clear the texture before other drawing ops + return false; + } + } + + m_pD3D9Device->SetTexture( 0, NULL ); // need to clear the texture before other drawing ops + + m_dw3DQuadsToFlush = 0; + m_dw3DQuadBufferBatchPos += QUAD_BUFFER_BATCH_SIZE; + if ( m_dw3DQuadBufferBatchPos >= QUAD_BUFFER_TOTAL_SIZE ) + { + m_dw3DQuadBufferBatchPos = 0; + } + + return true; + + +} + +//----------------------------------------------------------------------------- +// Purpose: Set the current stream source (this always set stream 0, we don't support more than 1 stream presently) +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BSetStreamSource( HGAMEVERTBUF hVertBuf, uint32 uOffset, uint32 uStride ) +{ + if ( !m_pD3D9Device ) + return false; + + if ( m_bDeviceLost ) + return false; + + if ( !hVertBuf ) + { + OutputDebugString( "Someone is calling BSetStreamSource() with a null handle\n" ); + return false; + } + + // Find the vertex buffer for the passed handle + std::map::iterator iter; + iter = m_MapVertexBuffers.find( hVertBuf ); + if ( iter == m_MapVertexBuffers.end() ) + { + OutputDebugString( "Invalid vertex buffer handle passed to BSetStreamSource()\n" ); + return false; + } + + // Make sure the pointer is valid + if ( !iter->second.m_pBuffer ) + { + OutputDebugString( "Pointer to vertex buffer is invalid (lost device and not recreated?)!\n" ); + return false; + } + + if ( FAILED( m_pD3D9Device->SetStreamSource( 0, iter->second.m_pBuffer, uOffset, uStride ) ) ) + { + OutputDebugString( "SetStreamSource() call failed\n" ); + return false; + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Renders primitives using the current stream source +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BRenderPrimitive( D3DPRIMITIVETYPE primType, uint32 uStartVertex, uint32 uCount ) +{ + if ( !m_pD3D9Device ) + return false; + + if ( m_bDeviceLost ) + return true; // Fail silently in this case + + if ( FAILED( m_pD3D9Device->DrawPrimitive( primType, uStartVertex, uCount ) ) ) + { + OutputDebugString( "BRenderPrimtive() call failed\n" ); + return false; + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Creates a new texture +//----------------------------------------------------------------------------- +HGAMETEXTURE CGameEngineWin32::HCreateTexture( byte *pRGBAData, uint32 uWidth, uint32 uHeight, ETEXTUREFORMAT eTextureFormat ) +{ + if ( !m_pD3D9Device ) + return 0; + + D3DFORMAT eD3DDeviceFormat = D3DFMT_A8R8G8B8; + + switch ( eTextureFormat ) + { + case eTextureFormat_RGBA: + case eTextureFormat_BGRA: + eD3DDeviceFormat = D3DFMT_A8R8G8B8; + break; + case eTextureFormat_BGRA16: + eD3DDeviceFormat = D3DFMT_A16B16G16R16; + } + + TextureData_t TexData; + TexData.m_uWidth = uWidth; + TexData.m_uHeight = uHeight; + if ( pRGBAData ) + { + size_t dataSize = 0; + if ( eD3DDeviceFormat == D3DFMT_A8R8G8B8 ) + { + dataSize = uWidth*uHeight * 4; + } + else if ( eD3DDeviceFormat == D3DFMT_A16B16G16R16 ) + { + dataSize = sizeof(uint16)* 4 * uWidth * uHeight; + } + TexData.m_pRGBAData = new byte[dataSize]; + memcpy( TexData.m_pRGBAData, pRGBAData, dataSize ); + } + else + { + TexData.m_pRGBAData = NULL; + } + TexData.m_pTexture = NULL; + TexData.m_pDepthSurface = NULL; + TexData.m_eFormat = eD3DDeviceFormat; + TexData.m_eTextureFormat = eTextureFormat; + + int nHandle = m_nNextTextureHandle; + ++m_nNextTextureHandle; + m_MapTextures[nHandle] = TexData; + + return nHandle; +} + + +//----------------------------------------------------------------------------- +// Purpose: Creates a new font +//----------------------------------------------------------------------------- +HGAMEFONT CGameEngineWin32::HCreateFont( int nHeight, int nFontWeight, bool bItalic, const char * pchFont ) +{ + if ( !m_pD3D9Device ) + return 0; + + // Create a D3DX font object + LPD3DXFONT pFont; + HRESULT hRes = D3DXCreateFont( m_pD3D9Device, nHeight, 0, nFontWeight, 0, bItalic, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, pchFont, &pFont ); + if ( FAILED( hRes ) ) + { + OutputDebugString( "Failed creating font via D3DXCreateFont\n" ); + return 0; + } + + HGAMEFONT hFont = m_nNextFontHandle; + ++m_nNextFontHandle; + + m_MapFontInstances[ hFont ] = pFont; + return hFont; +} + + +//----------------------------------------------------------------------------- +// Purpose: Draws text to the screen inside the given rectangular region, using the given font +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BDrawString( HGAMEFONT hFont, RECT rect, DWORD dwColor, DWORD dwFormat, const char *pchText ) +{ + if ( !m_pD3D9Device ) + return false; + + if ( m_bDeviceLost ) + return true; // Fail silently in this case + + if ( !hFont ) + { + OutputDebugString( "Someone is calling BDrawString with a null font handle\n" ); + return false; + } + + // Find the font object for the passed handle + std::map::iterator iter; + iter = m_MapFontInstances.find( hFont ); + if ( iter == m_MapFontInstances.end() ) + { + OutputDebugString( "Invalid font handle passed to BDrawString()\n" ); + return false; + } + + // we have the font, try to draw with it + if( !iter->second->DrawText( NULL, pchText, -1, &rect, dwFormat, dwColor ) ) + { + OutputDebugString( "DrawText call failed\n" ); + return false; + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: Message pump for OS messages +//----------------------------------------------------------------------------- +void CGameEngineWin32::MessagePump() +{ + MSG msg; + BOOL bRet; + while( PeekMessage( &msg, m_hWnd, 0, 0, PM_NOREMOVE ) ) + { + bRet = GetMessage( &msg, m_hWnd, 0, 0 ); + if( bRet != 0 && bRet != -1 ) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } +} + +//----------------------------------------------------------------------------- +// Purpose: Return true if there is an active Steam Controller +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BIsSteamInputDeviceActive( ) +{ + if ( m_ActiveControllerHandle ) + { + return true; + } + + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: Initialize the steam controller actions +//----------------------------------------------------------------------------- +void CGameEngineWin32::InitSteamInput( ) +{ + // Digital game actions + m_ControllerDigitalActionHandles[eControllerDigitalAction_TurnLeft] = SteamInput()->GetDigitalActionHandle( "turn_left" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_TurnRight] = SteamInput()->GetDigitalActionHandle( "turn_right" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_ForwardThrust] = SteamInput()->GetDigitalActionHandle( "forward_thrust" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_ReverseThrust] = SteamInput()->GetDigitalActionHandle( "backward_thrust" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_FireLasers] = SteamInput()->GetDigitalActionHandle( "fire_lasers" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_PauseMenu] = SteamInput()->GetDigitalActionHandle( "pause_menu" ); + + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuUp] = SteamInput()->GetDigitalActionHandle( "menu_up" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuDown] = SteamInput()->GetDigitalActionHandle( "menu_down" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuLeft] = SteamInput()->GetDigitalActionHandle( "menu_left" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuRight] = SteamInput()->GetDigitalActionHandle( "menu_right" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuSelect] = SteamInput()->GetDigitalActionHandle( "menu_select" ); + m_ControllerDigitalActionHandles[eControllerDigitalAction_MenuCancel] = SteamInput()->GetDigitalActionHandle( "menu_cancel" ); + + // Analog game actions + m_ControllerAnalogActionHandles[eControllerAnalogAction_AnalogControls] = SteamInput()->GetAnalogActionHandle( "analog_controls" ); + + // Action set handles + m_ControllerActionSetHandles[eControllerActionSet_ShipControls] = SteamInput()->GetActionSetHandle( "ship_controls" ); + m_ControllerActionSetHandles[eControllerActionSet_MenuControls] = SteamInput()->GetActionSetHandle( "menu_controls" ); + + // Action set layer handle + m_ControllerActionSetHandles[eControllerActionSet_Layer_Thrust] = SteamInput()->GetActionSetHandle( "thrust_action_layer" ); + +} + +//----------------------------------------------------------------------------- +// Purpose: Find an active Steam controller +//----------------------------------------------------------------------------- +void CGameEngineWin32::FindActiveSteamInputDevice() +{ + // Use the first available steam controller for all interaction. We can call this each frame to handle + // a controller disconnecting and a different one reconnecting. Handles are guaranteed to be unique for + // a given controller, even across power cycles. + + // See how many Steam Controllers are active. + InputHandle_t pHandles[STEAM_CONTROLLER_MAX_COUNT]; + int nNumActive = SteamInput( )->GetConnectedControllers( pHandles ); + + // If there's an active controller, and if we're not already using it, select the first one. + if ( nNumActive && ( m_ActiveControllerHandle != pHandles[0] ) ) + { + m_ActiveControllerHandle = pHandles[ 0 ]; + } + + return; +} + +// These are human-readable names for each of the origin enumerations. It is preferred to +// show the supplied icons in-game, but for a simple application these strings can be useful. + +//-------------------------------------------------------------------------------------------------------------- +// Purpose: For a given in-game action in a given action set, return a human-reaadable string to use as a prompt. +//-------------------------------------------------------------------------------------------------------------- +const char *CGameEngineWin32::GetTextStringForControllerOriginDigital( ECONTROLLERACTIONSET dwActionSet, ECONTROLLERDIGITALACTION dwDigitalAction ) +{ + EInputActionOrigin origins[STEAM_CONTROLLER_MAX_ORIGINS]; + int nNumOrigins = SteamInput( )->GetDigitalActionOrigins( m_ActiveControllerHandle, m_ControllerActionSetHandles[dwActionSet], m_ControllerDigitalActionHandles[dwDigitalAction], origins ); + if ( nNumOrigins ) + { + // We should handle the case where this action is bound to multiple buttons, but + // here we just grab the first. + return SteamInput()->GetStringForActionOrigin( origins[0] ); + } + return SteamInput()->GetStringForActionOrigin( k_EInputActionOrigin_None ); // Return "None" +} + +//-------------------------------------------------------------------------------------------------------------- +// Purpose: For a given in-game action in a given action set, return a human-reaadable string to use as a prompt. +//-------------------------------------------------------------------------------------------------------------- +const char *CGameEngineWin32::GetTextStringForControllerOriginAnalog( ECONTROLLERACTIONSET dwActionSet, ECONTROLLERANALOGACTION dwDigitalAction ) +{ + EInputActionOrigin origins[STEAM_CONTROLLER_MAX_ORIGINS]; + int nNumOrigins = SteamInput( )->GetAnalogActionOrigins( m_ActiveControllerHandle, m_ControllerActionSetHandles[dwActionSet], m_ControllerDigitalActionHandles[dwDigitalAction], origins ); + + if ( nNumOrigins ) + { + // We should handle the case where this action is bound to multiple buttons, but + // here we just grab the first. + return SteamInput()->GetStringForActionOrigin( origins[0] ); + } + + return SteamInput()->GetStringForActionOrigin( k_EInputActionOrigin_None ); // Return "None" +} + +//----------------------------------------------------------------------------- +// Purpose: Called each frame +//----------------------------------------------------------------------------- +void CGameEngineWin32::PollSteamInput() +{ + + // Each frame check our active controller handle + FindActiveSteamInputDevice(); + +} + + +//----------------------------------------------------------------------------- +// Purpose: Set the LED color on the controller, if supported by controller +//----------------------------------------------------------------------------- +void CGameEngineWin32::SetControllerColor( uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ) +{ + SteamInput()->SetLEDColor( m_ActiveControllerHandle, nColorR, nColorG, nColorB, nFlags ); +} + +//----------------------------------------------------------------------------- +// Purpose: Set the trigger effect on DualSense controllers +//----------------------------------------------------------------------------- +void CGameEngineWin32::SetTriggerEffect( bool bEnabled ) +{ + ScePadTriggerEffectParam param; + + memset( ¶m, 0, sizeof( param ) ); + param.triggerMask = SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2; + + // Clear any existing effect + param.command[ SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 ].mode = SCE_PAD_TRIGGER_EFFECT_MODE_OFF; + SteamInput()->SetDualSenseTriggerEffect( m_ActiveControllerHandle, ¶m ); + + if ( bEnabled ) + { + param.command[ SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 ].mode = SCE_PAD_TRIGGER_EFFECT_MODE_VIBRATION; + param.command[ SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 ].commandData.vibrationParam.position = 5; + param.command[ SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 ].commandData.vibrationParam.amplitude = 5; + param.command[ SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 ].commandData.vibrationParam.frequency = 8; + SteamInput()->SetDualSenseTriggerEffect( m_ActiveControllerHandle, ¶m ); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Trigger vibration on the controller, if supported by controller +//----------------------------------------------------------------------------- +void CGameEngineWin32::TriggerControllerVibration( unsigned short nLeftSpeed, unsigned short nRightSpeed ) +{ + SteamInput()->TriggerVibration( m_ActiveControllerHandle, nLeftSpeed, nRightSpeed ); +} + +//----------------------------------------------------------------------------- +// Purpose: Trigger haptics on the controller, if supported by controller +//----------------------------------------------------------------------------- +void CGameEngineWin32::TriggerControllerHaptics( ESteamControllerPad ePad, unsigned short usOnMicroSec, unsigned short usOffMicroSec, unsigned short usRepeat ) +{ + SteamInput()->Legacy_TriggerRepeatedHapticPulse( m_ActiveControllerHandle, ePad, usOnMicroSec, usOffMicroSec, usRepeat, 0 ); +} + +//----------------------------------------------------------------------------- +// Purpose: Find out if a controller event is currently active +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BIsControllerActionActive( ECONTROLLERDIGITALACTION dwAction ) +{ + ControllerDigitalActionData_t digitalData = SteamInput( )->GetDigitalActionData( m_ActiveControllerHandle, m_ControllerDigitalActionHandles[dwAction] ); + + // Actions are only 'active' when they're assigned to a control in an action set, and that action set is active. + if ( digitalData.bActive ) + return digitalData.bState; + + return false; +} + +//--------------------------------------------------------------------------------------------------------------------------------------------------- +// Purpose: Get the current x,y state of the analog action. Examples of an analog action are a virtual joystick on the trackpad or the real joystick. +//--------------------------------------------------------------------------------------------------------------------------------------------------- +void CGameEngineWin32::GetControllerAnalogAction( ECONTROLLERANALOGACTION dwAction, float *x, float *y ) +{ + ControllerAnalogActionData_t analogData = SteamInput( )->GetAnalogActionData( m_ActiveControllerHandle, m_ControllerAnalogActionHandles[dwAction] ); + + // Actions are only 'active' when they're assigned to a control in an action set, and that action set is active. + if ( analogData.bActive ) + { + *x = analogData.x; + *y = analogData.y; + } + else + { + *x = 0.0f; + *y = 0.0f; + } +} + +//----------------------------------------------------------------------------------------------------------------------------------------------------- +// Purpose: Put the controller into a specific action set. Action sets are collections of game-context actions ie "walking", "flying" or "menu" +//----------------------------------------------------------------------------------------------------------------------------------------------------- +void CGameEngineWin32::SetSteamControllerActionSet( ECONTROLLERACTIONSET dwActionSet ) +{ + if ( m_ActiveControllerHandle == 0 ) + return; + + // This call is low-overhead and can be called repeatedly from game code that is active in a specific mode. + SteamInput()->ActivateActionSet( m_ActiveControllerHandle, m_ControllerActionSetHandles[dwActionSet] ); +} + + +//----------------------------------------------------------------------------------------------------------------------------------------------------- +// Purpose: Put the controller into a specific action set layer. Action sets layers apply modifications to an existing action set. +//----------------------------------------------------------------------------------------------------------------------------------------------------- +void CGameEngineWin32::ActivateSteamControllerActionSetLayer( ECONTROLLERACTIONSET dwActionSetLayer ) +{ + if ( m_ActiveControllerHandle == 0 ) + return; + + // This call is low-overhead and can be called repeatedly from game code that is active in a specific mode. + SteamInput()->ActivateActionSetLayer( m_ActiveControllerHandle, m_ControllerActionSetHandles[ dwActionSetLayer ] ); +} + +//----------------------------------------------------------------------------------------------------------------------------------------------------- +// Purpose: Deactivate an existing action set layer +//----------------------------------------------------------------------------------------------------------------------------------------------------- +void CGameEngineWin32::DeactivateSteamControllerActionSetLayer( ECONTROLLERACTIONSET dwActionSetLayer ) +{ + if ( m_ActiveControllerHandle == 0 ) + return; + + // This call is low-overhead and can be called repeatedly from game code that is active in a specific mode. + SteamInput()->DeactivateActionSetLayer( m_ActiveControllerHandle, m_ControllerActionSetHandles[ dwActionSetLayer ] ); +} + + +//----------------------------------------------------------------------------------------------------------------------------------------------------- +// Purpose: Determine whether an action set layer is currently active +//----------------------------------------------------------------------------------------------------------------------------------------------------- +bool CGameEngineWin32::BIsActionSetLayerActive( ECONTROLLERACTIONSET dwActionSetLayer ) +{ + if ( m_ActiveControllerHandle == 0 ) + return false; + + ControllerActionSetHandle_t pActionSetLayerHandles[ 32 ]; + int nActiveLayerCount = SteamInput()->GetActiveActionSetLayers( m_ActiveControllerHandle, pActionSetLayerHandles ); + + for( int i = 0; i < nActiveLayerCount; i++ ) + { + if ( pActionSetLayerHandles[i] == m_ControllerActionSetHandles[ dwActionSetLayer ] ) + return true; + } + + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: Track keys which are down +//----------------------------------------------------------------------------- +void CGameEngineWin32::RecordKeyDown( DWORD dwVK ) +{ + m_SetKeysDown.insert( dwVK ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Track keys which are up +//----------------------------------------------------------------------------- +void CGameEngineWin32::RecordKeyUp( DWORD dwVK ) +{ + std::set::iterator iter; + iter = m_SetKeysDown.find( dwVK ); + if ( iter != m_SetKeysDown.end() ) + m_SetKeysDown.erase( iter ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Find out if a key is currently down +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BIsKeyDown( DWORD dwVK ) +{ + std::set::iterator iter; + iter = m_SetKeysDown.find( dwVK ); + if ( iter != m_SetKeysDown.end() ) + return true; + + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: Get a down key value +//----------------------------------------------------------------------------- +bool CGameEngineWin32::BGetFirstKeyDown( DWORD *pdwVK ) +{ + std::set::iterator iter; + iter = m_SetKeysDown.begin(); + if ( iter != m_SetKeysDown.end() ) + { + *pdwVK = *iter; + m_SetKeysDown.erase( iter ); + return true; + } + else + { + return false; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Find the engine instance tied to a given hwnd +//----------------------------------------------------------------------------- +CGameEngineWin32 * CGameEngineWin32::FindEngineInstanceForHWND( HWND hWnd ) +{ + std::map::iterator iter; + iter = m_MapEngineInstances.find( hWnd ); + if ( iter == m_MapEngineInstances.end() ) + return NULL; + else + return iter->second; +} + + +//----------------------------------------------------------------------------- +// Purpose: Add the engine instance tied to a given hwnd to our static map +//----------------------------------------------------------------------------- +void CGameEngineWin32::AddInstanceToHWNDMap( CGameEngineWin32* pInstance, HWND hWnd ) +{ + m_MapEngineInstances[hWnd] = pInstance; +} + + +//----------------------------------------------------------------------------- +// Purpose: Removes the instance associated with a given HWND from the map +//----------------------------------------------------------------------------- +void CGameEngineWin32::RemoveInstanceFromHWNDMap( HWND hWnd ) +{ + std::map::iterator iter; + iter = m_MapEngineInstances.find( hWnd ); + if ( iter != m_MapEngineInstances.end() ) + m_MapEngineInstances.erase( iter ); +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +HGAMEVOICECHANNEL CGameEngineWin32::HCreateVoiceChannel() +{ + if ( !m_pXAudio2 ) + return 0; + + m_unVoiceChannelCount++; + CVoiceContext* pVoiceContext = new CVoiceContext; + + // The format we sample voice in. + WAVEFORMATEX voicesampleformat = + { + WAVE_FORMAT_PCM, // wFormatTag + 1, // nChannels + VOICE_OUTPUT_SAMPLE_RATE,// nSamplesPerSec + VOICE_OUTPUT_SAMPLE_RATE*BYTES_PER_SAMPLE, // nAvgBytesPerSec + 2, // nBlockAlign + 8*BYTES_PER_SAMPLE, // wBitsPerSample + sizeof(WAVEFORMATEX) // cbSize + }; + + if( FAILED( m_pXAudio2->CreateSourceVoice( &pVoiceContext->m_pSourceVoice, &voicesampleformat , 0, 1.0f, pVoiceContext ) ) ) + { + delete pVoiceContext; + return 0; // failed + } + + pVoiceContext->m_pSourceVoice->Start( 0, 0 ); + + m_MapVoiceChannel[m_unVoiceChannelCount] = pVoiceContext; + + return m_unVoiceChannelCount; +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CGameEngineWin32::DestroyVoiceChannel( HGAMEVOICECHANNEL hChannel ) +{ + std::map::iterator iter; + iter = m_MapVoiceChannel.find( hChannel ); + if ( iter != m_MapVoiceChannel.end() ) + { + CVoiceContext* pVoiceContext = iter->second; + XAUDIO2_VOICE_STATE state; + + for(;;) + { + pVoiceContext->m_pSourceVoice->GetState( &state ); + if( !state.BuffersQueued ) + break; + + WaitForSingleObject( pVoiceContext->m_hBufferEndEvent, INFINITE ); + } + + pVoiceContext->m_pSourceVoice->Stop( 0 ); + pVoiceContext->m_pSourceVoice->DestroyVoice(); + + delete pVoiceContext; + + m_MapVoiceChannel.erase( iter ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +bool CGameEngineWin32::AddVoiceData( HGAMEVOICECHANNEL hChannel, const uint8 *pVoiceData, uint32 uLength ) +{ + std::map::iterator iter; + iter = m_MapVoiceChannel.find( hChannel ); + if ( iter == m_MapVoiceChannel.end() ) + return false; // channel not found + + CVoiceContext* pVoiceContext = iter->second; + + // + // At this point we have a buffer full of audio and enough room to submit it, so + // let's submit it and get another read request going. + + uint8 *pBuffer = (uint8 *) malloc( uLength ); + memcpy( pBuffer, pVoiceData, uLength ); + + XAUDIO2_BUFFER buf = {0}; + buf.AudioBytes = uLength; + buf.pAudioData = pBuffer; + buf.pContext = pBuffer; // the buffer is freed again in CVoiceContext::OnBufferEnd + + if ( FAILED( pVoiceContext->m_pSourceVoice->SubmitSourceBuffer( &buf ) ) ) + { + free ( pBuffer ); + return false; + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: update an existing texture +//----------------------------------------------------------------------------- +bool CGameEngineWin32::UpdateTexture( HGAMETEXTURE hTexture, byte *pRGBAData, uint32 uWidth, uint32 uHeight, ETEXTUREFORMAT eTextureFormat ) +{ + std::map::iterator iter; + iter = m_MapTextures.find( hTexture ); + if (iter == m_MapTextures.end()) + { + OutputDebugString( "BFlushQuadBuffer failed with invalid m_hLastTexture value\n" ); + return false; + } + + // Put the data into the texture + D3DLOCKED_RECT rect; + HRESULT hRes = iter->second.m_pTexture->LockRect( 0, &rect, NULL, 0 ); + if (FAILED( hRes )) + { + OutputDebugString( "LockRect call failed\n" ); + iter->second.m_pTexture->Release(); + iter->second.m_pTexture = NULL; + return false; + } + + if (iter->second.m_eFormat == D3DFMT_A8R8G8B8) + { + DWORD *pARGB = (DWORD *)rect.pBits; + byte *pRGBA = (byte *)pRGBAData; + + byte r, g, b, a; + for (uint32 y = 0; y < uHeight; ++y) + { + for (uint32 x = 0; x < uWidth; ++x) + { + // swap position of alpha value from back to front to be in correct format for d3d... + r = *pRGBA++; + g = *pRGBA++; + b = *pRGBA++; + a = *pRGBA++; + + if ( eTextureFormat == eTextureFormat_RGBA ) + *pARGB++ = D3DCOLOR_ARGB( a, r, g, b ); + else if ( eTextureFormat == eTextureFormat_BGRA) + *pARGB++ = D3DCOLOR_ARGB( a, b, g, r ); + } + } + } + else if (iter->second.m_eFormat == D3DFMT_A16B16G16R16) + { + uint16 *pDest = (uint16 *)rect.pBits; + uint16 *pSrc = (uint16 *)pRGBAData; + + if ( eTextureFormat != eTextureFormat_BGRA16 ) + OutputDebugString( "Unsupported texture format for BGRA16 texture \n" ); + + memcpy( pDest, pSrc, sizeof( uint16 )* uWidth * uHeight * 4 ); + } + + hRes = iter->second.m_pTexture->UnlockRect( 0 ); + if (FAILED( hRes )) + { + OutputDebugString( "UnlockRect call failed\n" ); + iter->second.m_pTexture->Release(); + iter->second.m_pTexture = NULL; + return false; + } + + return true; +} + + +bool CGameEngineWin32::BReadyTexture( HGAMETEXTURE hTexture ) +{ + std::map::iterator iter; + iter = m_MapTextures.find( hTexture ); + if ( iter == m_MapTextures.end() ) + { + OutputDebugString( "BFlushQuadBuffer failed with invalid m_hLastTexture value\n" ); + return false; + } + + // See if we need to actually create the d3d texture + if ( !iter->second.m_pTexture ) + { + // render targets get a special flag + DWORD dwUsage = 0; + D3DPOOL pool = D3DPOOL_MANAGED; + if ( !iter->second.m_pRGBAData ) + { + dwUsage = D3DUSAGE_RENDERTARGET; + pool = D3DPOOL_DEFAULT; + } + + HRESULT hRes = m_pD3D9Device->CreateTexture( + iter->second.m_uWidth, + iter->second.m_uHeight, + 1, // mip map levels (0 = generate all levels down to 1x1 if supported) + dwUsage, // have to set the right flag here if you want to autogen mipmaps... we don't + iter->second.m_eFormat, + pool, + &iter->second.m_pTexture, + NULL ); + if ( FAILED( hRes ) ) + { + OutputDebugString( "BFlushQuadBuffer failed because CreateTexture() call failed\n" ); + iter->second.m_pTexture = NULL; + return false; + } + + // if the texture has source data, copy that in. Render targets don't + // have source data. + if ( iter->second.m_pRGBAData ) + { + // Put the data into the texture + D3DLOCKED_RECT rect; + hRes = iter->second.m_pTexture->LockRect( 0, &rect, NULL, 0 ); + if ( FAILED( hRes ) ) + { + OutputDebugString( "LockRect call failed\n" ); + iter->second.m_pTexture->Release(); + iter->second.m_pTexture = NULL; + return false; + } + + if ( iter->second.m_eFormat == D3DFMT_A8R8G8B8 ) + { + DWORD *pARGB = (DWORD *)rect.pBits; + byte *pRGBA = (byte *)iter->second.m_pRGBAData; + + byte r, g, b, a; + for ( uint32 y = 0; y < iter->second.m_uHeight; ++y ) + { + for ( uint32 x = 0; x < iter->second.m_uWidth; ++x ) + { + // swap position of alpha value from back to front to be in correct format for d3d... + r = *pRGBA++; + g = *pRGBA++; + b = *pRGBA++; + a = *pRGBA++; + + if ( iter->second.m_eTextureFormat == eTextureFormat_RGBA ) + *pARGB++ = D3DCOLOR_ARGB( a, r, g, b ); + else + *pARGB++ = D3DCOLOR_ARGB( a, b, g, r ); + } + } + } + else if ( iter->second.m_eFormat == D3DFMT_A16B16G16R16 ) + { + uint16 *pDest = (uint16 *)rect.pBits; + uint16 *pSrc = (uint16 *)iter->second.m_pRGBAData; + + if ( iter->second.m_eTextureFormat != eTextureFormat_BGRA16 ) + OutputDebugString( "Unsupported texture format for BGRA16 texture \n" ); + + memcpy( pDest, pSrc, sizeof(uint16)* iter->second.m_uWidth * iter->second.m_uHeight * 4 ); + } + + hRes = iter->second.m_pTexture->UnlockRect( 0 ); + if ( FAILED( hRes ) ) + { + OutputDebugString( "UnlockRect call failed\n" ); + iter->second.m_pTexture->Release(); + iter->second.m_pTexture = NULL; + return false; + } + } + else + { + // for render targets we also need to create the depth buffer + hRes = m_pD3D9Device->CreateDepthStencilSurface( iter->second.m_uWidth, iter->second.m_uHeight, D3DFMT_D32F_LOCKABLE, D3DMULTISAMPLE_NONE, 0, FALSE, &iter->second.m_pDepthSurface, NULL ); + if ( FAILED( hRes ) ) + { + OutputDebugString( "BReadyTexture - CreateDepthStencilSurface failed\n" ); + iter->second.m_pTexture->Release(); + iter->second.m_pTexture = NULL; + return false; + } + } + } + + return true; +} + +bool CGameEngineWin32::BSetTexture( HGAMETEXTURE hTexture ) +{ + if ( !BReadyTexture( hTexture ) ) + return false; + + // Ok, texture should be created ok, do the drawing work + if ( FAILED( m_pD3D9Device->SetTexture( 0, m_MapTextures[ hTexture ].m_pTexture ) ) ) + { + OutputDebugString( "BFlushQuadBuffer failed setting texture\n" ); + return false; + } + + return true; +} + + +// sets the texture as a render target. +bool CGameEngineWin32::BSetRenderTarget( HGAMETEXTURE hTexture ) +{ + if ( !BReadyTexture( hTexture ) ) + { + OutputDebugString( "BSetRenderTarget couldn't ready the texture\n" ); + return false; + } + + TextureData_t & tex = m_MapTextures[hTexture]; + LPDIRECT3DTEXTURE9 pTex = tex.m_pTexture; + if ( !pTex ) + { + OutputDebugString( "BSetRenderTarget - no texture\n" ); + return false; + } + + IDirect3DSurface9 *pSurface; + if ( FAILED( pTex->GetSurfaceLevel( 0, &pSurface ) ) ) + { + OutputDebugString( "BSetRenderTarget - no surface\n" ); + return false; + } + + if ( FAILED( m_pD3D9Device->SetRenderTarget( 0, pSurface ) ) ) + { + OutputDebugString( "BSetRenderTarget failed\n" ); + return false; + } + + if ( FAILED( m_pD3D9Device->SetDepthStencilSurface( tex.m_pDepthSurface ) ) ) + { + OutputDebugString( "BSetRenderTarget Depth stencil surface\n" ); + return false; + } + + return true; +} + + +// sets the render target back to the frame buffer +bool CGameEngineWin32::BUnsetRenderTarget() +{ + IDirect3DSurface9 *pSurface; + if ( FAILED( m_pD3D9Device->GetBackBuffer( 0, 0, D3DBACKBUFFER_TYPE_MONO, &pSurface ) ) ) + { + OutputDebugString( "BClearRenderTarget - no surface\n" ); + return false; + } + + if ( FAILED( m_pD3D9Device->SetRenderTarget( 0, pSurface ) ) ) + { + OutputDebugString( "BClearRenderTarget - SetRenderTarget failed\n" ); + return false; + } + + if ( FAILED( m_pD3D9Device->SetDepthStencilSurface( m_pBackbufferDepth ) ) ) + { + OutputDebugString( "BClearRenderTarget Depth stencil surface\n" ); + return false; + } + return true; +} + + diff --git a/external/steamworks/steamworksexample/gameenginewin32.h b/external/steamworks/steamworksexample/gameenginewin32.h new file mode 100644 index 0000000..cea67b6 --- /dev/null +++ b/external/steamworks/steamworksexample/gameenginewin32.h @@ -0,0 +1,468 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Main class for the game engine -- win32 implementation +// +// $NoKeywords: $ +//============================================================================= + +#ifndef GAMEENGINEWIN32_H +#define GAMEENGINEWIN32_H + +#include "GameEngine.h" +#include +#include + +// How big is the vertex buffer for batching lines in total? +// NOTE: This must be a multiple of the batch size below!!! (crashes will occur if it isn't) +#define LINE_BUFFER_TOTAL_SIZE 1000 + +// How many lines do we put in the buffer in between flushes? +// +// This should be enough smaller than the total size so that draw calls +// can finish using the data before we wrap around and discard it. +#define LINE_BUFFER_BATCH_SIZE 250 + +// How big is the vertex buffer for batching points in total? +// NOTE: This must be a multiple of the batch size below!!! (crashes will occur if it isn't) +#define POINT_BUFFER_TOTAL_SIZE 1800 + +// How many points do we put in the buffer in between flushes? +// +// This should be enough smaller than the total size so that draw calls +// can finish using the data before we wrap around and discard it. +#define POINT_BUFFER_BATCH_SIZE 600 + +// How big is the vertex buffer for batching quads in total? +// NOTE: This must be a multiple of the batch size below!!! (crashes will occur if it isn't) +#define QUAD_BUFFER_TOTAL_SIZE 1000 + +// How many quads do we put in the buffer in between flushes? +// +// This should be enough smaller than the total size so that draw calls +// can finish using the data before we wrap around and discard it. +#define QUAD_BUFFER_BATCH_SIZE 250 + + + +// Vertex struct for line batches +struct LineVertex_t +{ + float x, y, z, rhw; + DWORD color; +}; + + +// Vertex struct for point batches +struct PointVertex_t +{ + float x, y, z, rhw; + DWORD color; +}; + +// Vertex struct for textured quads in pixel space +struct TexturedQuadVertex_t +{ + float x, y, z, rhw; + DWORD color; + float u, v; // texture coordinates +}; + +// Vertex struct for textured quads in 3D space +struct Textured3DQuadVertex_t +{ + float x, y, z; + DWORD color; + float u, v; // texture coordinates +}; + +class CVoiceContext; + +// WndProc declaration +LRESULT CALLBACK GameWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ); + +class CGameEngineWin32 : public IGameEngine +{ +public: + + // Static methods for tracing mapping of game engine class instances to hwnds + static CGameEngineWin32 * FindEngineInstanceForHWND( HWND hWnd ); + static void AddInstanceToHWNDMap( CGameEngineWin32* pInstance, HWND hWnd ); + static void RemoveInstanceFromHWNDMap( HWND hWnd ); + + // Constructor + CGameEngineWin32( HINSTANCE hInstance, int nShowCommand, int32 nWindowWidth, int32 nWindowHeight ); + + // Destructor + ~CGameEngineWin32() { Shutdown(); } + + // Check if the game engine is initialized ok and ready for use + bool BReadyForUse() { return m_bEngineReadyForUse; } + + // Check if the engine is shutting down + bool BShuttingDown() { return m_bShuttingDown; } + + // Set the background color + void SetBackgroundColor( short a, short r, short g, short b ); + + // Start a frame, clear(), beginscene(), etc + bool StartFrame(); + + // Finish a frame, endscene(), present(), etc. + void EndFrame(); + + // Shutdown the game engine + void Shutdown(); + + // Pump messages from the OS + void MessagePump(); + + // Accessors for game screen size + int32 GetViewportWidth() { return m_nViewportWidth; } + int32 GetViewportHeight() { return m_nViewportHeight; } + + // Function for drawing text to the screen, dwFormat is a combination of flags like DT_LEFT, DT_VCENTER etc... + bool BDrawString( HGAMEFONT hFont, RECT rect, DWORD dwColor, DWORD dwFormat, const char *pchText ); + + // Create a new font returning our internal handle value for it (0 means failure) + HGAMEFONT HCreateFont( int nHeight, int nFontWeight, bool bItalic, const char * pchFont ); + + // Create a new texture returning our internal handle value for it (0 means failure) + HGAMETEXTURE HCreateTexture( byte *pRGBAData, uint32 uWidth, uint32 uHeight, ETEXTUREFORMAT eTextureFormat = eTextureFormat_RGBA ); + + // update an existing texture + bool UpdateTexture( HGAMETEXTURE texture, byte *pRGBAData, uint32 uWidth, uint32 uHeight, ETEXTUREFORMAT eTextureFormat ); + + // Draw a line, the engine itself will manage batching these (although you can explicitly flush if you need to) + bool BDrawLine( float xPos0, float yPos0, DWORD dwColor0, float xPos1, float yPos1, DWORD dwColor1 ); + + // Flush the line buffer + bool BFlushLineBuffer(); + + // Draw a point, the engine itself will manage batching these (although you can explicitly flush if you need to) + bool BDrawPoint( float xPos, float yPos, DWORD dwColor ); + + // Flush the point buffer + bool BFlushPointBuffer(); + + // Draw a filled quad + bool BDrawFilledRect( float xPos0, float yPos0, float xPos1, float yPos1, DWORD dwColor ); + + // Draw a textured rectangle + bool BDrawTexturedRect( float xPos0, float yPos0, float xPos1, float yPos1, + float u0, float v0, float u1, float v1, DWORD dwColor, HGAMETEXTURE hTexture ); + + // Draw a textured arbitrary quad + bool BDrawTexturedQuad( float xPos0, float yPos0, float xPos1, float yPos1, float xPos2, float yPos2, float xPos3, float yPos3, + float u0, float v0, float u1, float v1, DWORD dwColor, HGAMETEXTURE hTexture ); + + // Flush any still cached quad buffers + bool BFlushQuadBuffer(); + + // Draw a textured rectangle with full 3D points + bool BDraw3DTexturedQuad( Textured3DQuadVertex_t vert[4], HGAMETEXTURE hTexture ); + + // Flush any still cached quad buffers + bool BFlush3DQuadBuffer(); + + // sets the texture as the 0th one to draw with + bool BSetTexture( HGAMETEXTURE hTexture ); + + // sets the texture as a render target. + bool BSetRenderTarget( HGAMETEXTURE hTexture ); + + // sets the render target back to the frame buffer + bool BUnsetRenderTarget(); + + // make sure the texture is created on the device and ready to use + bool BReadyTexture( HGAMETEXTURE hTexture ); + + // Get the current state of a key + bool BIsKeyDown( DWORD dwVK ); + + // Get the first (in some arbitrary order) key down, if any + bool BGetFirstKeyDown( DWORD *pdwVK ); + + // Return true if there is an active Steam Controller + bool BIsSteamInputDeviceActive( ); + + // Find an active Steam controller + void FindActiveSteamInputDevice( ); + + // Get the current state of a controller action + bool BIsControllerActionActive( ECONTROLLERDIGITALACTION dwAction ); + + // Get the current state of a controller action + void GetControllerAnalogAction( ECONTROLLERANALOGACTION dwAction, float *x, float *y ); + + // Set the current Steam Controller Action set + void SetSteamControllerActionSet( ECONTROLLERACTIONSET dwActionSet ); + + // Set an Action Set Layer for Steam Input + virtual void ActivateSteamControllerActionSetLayer( ECONTROLLERACTIONSET dwActionSet ); + virtual void DeactivateSteamControllerActionSetLayer( ECONTROLLERACTIONSET dwActionSet ); + + // Returns whether a given action set layer is active + virtual bool BIsActionSetLayerActive( ECONTROLLERACTIONSET dwActionSetLayer ); + + // These calls return a string describing which controller button the action is currently bound to + const char *GetTextStringForControllerOriginDigital( ECONTROLLERACTIONSET dwActionSet, ECONTROLLERDIGITALACTION dwDigitalAction ); + const char *GetTextStringForControllerOriginAnalog( ECONTROLLERACTIONSET dwActionSet, ECONTROLLERANALOGACTION dwDigitalAction ); + + // Set the controller LED Color, if available + void SetControllerColor( uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ); + + // Set the trigger effect on DualSense controllers + void SetTriggerEffect( bool bEnabled ); + + // Trigger a vibration on the controller, if available + void TriggerControllerVibration( unsigned short nLeftSpeed, unsigned short nRightSpeed ); + + // Trigger haptics on the specified pad of the controller, if available + void TriggerControllerHaptics( ESteamControllerPad ePad, unsigned short usOnMicroSec, unsigned short usOffMicroSec, unsigned short usRepeat ); + + // Initialize the Steam Controller interfaces + void InitSteamInput( ); + + // Called each frame to update the Steam Controller interface + void PollSteamInput(); + + // Get current tick count for the game engine + uint64 GetGameTickCount() { return m_ulGameTickCount; } + + // Get the tick count elapsed since the previous frame + // bugbug - We use this time to compute things like thrust and acceleration in the game, + // so it's important in doesn't jump ahead by large increments... Need a better + // way to handle that. + uint64 GetGameTicksFrameDelta() { return m_ulGameTickCount - m_ulPreviousGameTickCount; } + + // Tell the game engine to update current tick count + void UpdateGameTickCount(); + + // Tell the game engine to sleep for a bit if needed to limit frame rate + bool BSleepForFrameRateLimit( uint32 ulMaxFrameRate ); + + // Check if the game engine hwnd currently has focus (and a working d3d device) + bool BGameEngineHasFocus() { return ::GetForegroundWindow() == m_hWnd && !m_bDeviceLost; } + + // voice chat sound engine + virtual HGAMEVOICECHANNEL HCreateVoiceChannel(); + virtual void DestroyVoiceChannel( HGAMEVOICECHANNEL hChannel ); + virtual bool AddVoiceData( HGAMEVOICECHANNEL hChannel, const uint8 *pVoiceData, uint32 uLength ); + + // Track the state of keyboard input (these are public, but not part of the public interface) + void RecordKeyDown( DWORD dwVK ); + void RecordKeyUp( DWORD dwVK ); + +private: + + // Creates the hwnd for the game + bool BCreateGameWindow( int nShowCommand ); + + // Initializes D3D for the game + bool BInitializeD3D9(); + + // Resets all the render, texture, and sampler states to our defaults + void ResetRenderStates(); + + // Create a new vertex buffer returning our internal handle for it (0 means failure) + HGAMEVERTBUF HCreateVertexBuffer( uint32 nSizeInBytes, DWORD dwUsage, DWORD dwFVF ); + + // Lock an entire vertex buffer with the specified flags + bool BLockEntireVertexBuffer( HGAMEVERTBUF hVertBuf, void **ppVoid, DWORD dwFlags ); + + // Unlock a vertex buffer + bool BUnlockVertexBuffer( HGAMEVERTBUF hVertBuf ); + + // Release a vertex buffer and free its resources + bool BReleaseVertexBuffer( HGAMEVERTBUF hVertBuf ); + + // Set steam source + bool BSetStreamSource( HGAMEVERTBUF hVertBuf, uint32 uOffset, uint32 uStride ); + + // Render primitives out of the current stream source + bool BRenderPrimitive( D3DPRIMITIVETYPE primType, uint32 uStartVertex, uint32 uCount ); + + // Set vertex format + bool BSetFVF( DWORD dwFormat ); + + // Handle losing the d3d device (ie, release resources) + bool BHandleLostDevice(); + + // Handle reseting the d3d device (ie, acquire resources again) + bool BHandleResetDevice(); + +private: + // Tracks whether the engine is ready for use + bool m_bEngineReadyForUse; + + // Tracks if we are shutting down + bool m_bShuttingDown; + + // Color we clear the background of the window to each frame + DWORD m_dwBackgroundColor; + + // HInstance for the application running the engine + HINSTANCE m_hInstance; + + // HWND for the engine instance + HWND m_hWnd; + + // IDirect3D9 interface + IDirect3D9 *m_pD3D9Interface; + + // IDirect3DDevice9 interface + IDirect3DDevice9 *m_pD3D9Device; + + // Depth/stencil surface associated with the back buffer + IDirect3DSurface9 *m_pBackbufferDepth; + + // Size of the window to display the game in + int32 m_nWindowWidth; + int32 m_nWindowHeight; + + // Size of actual d3d viewport (window size minus borders, title, etc) + int32 m_nViewportWidth; + int32 m_nViewportHeight; + + // Next font handle value to give out + HGAMEFONT m_nNextFontHandle; + + // Map of font handles to font objects + std::map m_MapFontInstances; + + // Next vertex buffer handle value to give out + HGAMEVERTBUF m_nNextVertBufferHandle; + + // Map of handles to vertex buffer objects + struct VertBufData_t + { + bool m_bIsLocked; + IDirect3DVertexBuffer9 * m_pBuffer; + }; + std::map m_MapVertexBuffers; + + HGAMETEXTURE m_nNextTextureHandle; + + // Map of handles to texture objects + struct TextureData_t + { + byte *m_pRGBAData; // We keep a copy of the raw data so we can rebuild textures after a device is lost + uint32 m_uWidth; + uint32 m_uHeight; + LPDIRECT3DTEXTURE9 m_pTexture; + LPDIRECT3DSURFACE9 m_pDepthSurface; // render targets only + D3DFORMAT m_eFormat; // format for the texture on the card itself + ETEXTUREFORMAT m_eTextureFormat; // format of the data you provide + }; + std::map m_MapTextures; + + // Vertex buffer for textured quads + HGAMEVERTBUF m_hQuadBuffer; + + // Last texture used in drawing a batched quad + HGAMETEXTURE m_hLastTexture; + + // Pointer to quad vertex data + TexturedQuadVertex_t *m_pQuadVertexes; + + // How many quads are awaiting flushing + DWORD m_dwQuadsToFlush; + + // Where does the current batch begin + DWORD m_dwQuadBufferBatchPos; + + // Vertex buffer for textured quads + HGAMEVERTBUF m_h3DQuadBuffer; + + // Last texture used in drawing a batched quad + HGAMETEXTURE m_h3DLastTexture; + + // Pointer to quad 3D vertex data + Textured3DQuadVertex_t *m_p3DQuadVertexes; + + // How many 3D quads are awaiting flushing + DWORD m_dw3DQuadsToFlush; + + // Where does the current 3D batch begin + DWORD m_dw3DQuadBufferBatchPos; + + // White texture used when drawing filled quads + HGAMETEXTURE m_hTextureWhite; + + // Currently set FVF format + DWORD m_dwCurrentFVF; + + // Map of key state + std::set m_SetKeysDown; + + // Current game time in milliseconds + uint64 m_ulGameTickCount; + + // Game time at the start of the previous frame + uint64 m_ulPreviousGameTickCount; + + // Divisor for turning QPC values to milliseconds + uint64 m_ulPerfCounterToMillisecondsDivisor; + + // First value for QPC when we started the process + uint64 m_ulFirstQueryPerformanceCounterValue; + + // Map of engine instances by HWND, used in wndproc to find engine instance for messages + static std::map m_MapEngineInstances; + + // Internal vertex buffer for batching line drawing + HGAMEVERTBUF m_hLineBuffer; + + // Pointer to actual line buffer memory (valid only while locked) + LineVertex_t *m_pLineVertexes; + + // Track how many lines are awaiting flushing in our line buffer + DWORD m_dwLinesToFlush; + + // Track where the current batch starts in the vert buffer + DWORD m_dwLineBufferBatchPos; + + // Internal vertex buffer for batching point drawing + HGAMEVERTBUF m_hPointBuffer; + + // Pointer to actual point buffer memory (valid only while locked) + PointVertex_t *m_pPointVertexes; + + // Track how many points are awaiting flushing in our line buffer + DWORD m_dwPointsToFlush; + + // Track where the current batch starts in the vert buffer + DWORD m_dwPointBufferBatchPos; + + // Track if we have lost the d3d device + bool m_bDeviceLost; + + // Presentation parameters, saved in case of lost device needing reset + D3DPRESENT_PARAMETERS m_d3dpp; + + IXAudio2* m_pXAudio2; + IXAudio2MasteringVoice* m_pMasteringVoice; + + // Map of font handles to font objects + std::map m_MapVoiceChannel; + uint32 m_unVoiceChannelCount; + + // An array of handles to Steam Controller events that player can bind to controls + InputDigitalActionHandle_t m_ControllerDigitalActionHandles[eControllerDigitalAction_NumActions]; + + // An array of handles to Steam Controller events that player can bind to controls + InputAnalogActionHandle_t m_ControllerAnalogActionHandles[eControllerAnalogAction_NumActions]; + + // An array of handles to different Steam Controller action set configurations + InputActionSetHandle_t m_ControllerActionSetHandles[eControllerActionSet_NumSets]; + + // A handle to the currently active Steam Controller. + InputHandle_t m_ActiveControllerHandle; + + // Origins for all the Steam Input actions. The 'origin' is where the action is currently bound to, + // ie 'jump' is currently bound to the Steam Controller 'A' button. + EInputActionOrigin m_ControllerDigitalActionOrigins[eControllerDigitalAction_NumActions]; + EInputActionOrigin m_ControllerAnalogActionOrigins[eControllerDigitalAction_NumActions]; +}; + +#endif // GAMEENGINEWIN32_H diff --git a/external/steamworks/steamworksexample/glew.c b/external/steamworks/steamworksexample/glew.c new file mode 100644 index 0000000..8b06f29 --- /dev/null +++ b/external/steamworks/steamworksexample/glew.c @@ -0,0 +1,18123 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "GL/glew.h" + +#if defined(_WIN32) +# include "GL/wglew.h" +#elif !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) +# include "GL/glxew.h" +#endif + +/* + * Define glewGetContext and related helper macros. + */ +#ifdef GLEW_MX +# define glewGetContext() ctx +# ifdef _WIN32 +# define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx +# define GLEW_CONTEXT_ARG_VAR_INIT ctx +# define wglewGetContext() ctx +# define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx +# define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx +# else /* _WIN32 */ +# define GLEW_CONTEXT_ARG_DEF_INIT void +# define GLEW_CONTEXT_ARG_VAR_INIT +# define glxewGetContext() ctx +# define GLXEW_CONTEXT_ARG_DEF_INIT void +# define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx +# endif /* _WIN32 */ +# define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx +#else /* GLEW_MX */ +# define GLEW_CONTEXT_ARG_DEF_INIT void +# define GLEW_CONTEXT_ARG_VAR_INIT +# define GLEW_CONTEXT_ARG_DEF_LIST void +# define WGLEW_CONTEXT_ARG_DEF_INIT void +# define WGLEW_CONTEXT_ARG_DEF_LIST void +# define GLXEW_CONTEXT_ARG_DEF_INIT void +# define GLXEW_CONTEXT_ARG_DEF_LIST void +#endif /* GLEW_MX */ + +#if defined(__sgi) || defined (__sun) || defined(GLEW_APPLE_GLX) +#include +#include +#include + +void* dlGetProcAddress (const GLubyte* name) +{ + static void* h = NULL; + static void* gpa; + + if (h == NULL) + { + if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL; + gpa = dlsym(h, "glXGetProcAddress"); + } + + if (gpa != NULL) + return ((void*(*)(const GLubyte*))gpa)(name); + else + return dlsym(h, (const char*)name); +} +#endif /* __sgi || __sun || GLEW_APPLE_GLX */ + +#if defined(__APPLE__) +#include +#include +#include + +#ifdef MAC_OS_X_VERSION_10_3 + +#include + +void* NSGLGetProcAddress (const GLubyte *name) +{ + static void* image = NULL; + void* addr; + if (NULL == image) + { +#ifdef GLEW_REGAL + image = dlopen("libRegal.dylib", RTLD_LAZY); +#else + image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY); +#endif + } + if( !image ) return NULL; + addr = dlsym(image, (const char*)name); + if( addr ) return addr; +#ifdef GLEW_APPLE_GLX + return dlGetProcAddress( name ); // try next for glx symbols +#else + return NULL; +#endif +} +#else + +#include + +void* NSGLGetProcAddress (const GLubyte *name) +{ + static const struct mach_header* image = NULL; + NSSymbol symbol; + char* symbolName; + if (NULL == image) + { +#ifdef GLEW_REGAL + image = NSAddImage("libRegal.dylib", NSADDIMAGE_OPTION_RETURN_ON_ERROR); +#else + image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR); +#endif + } + /* prepend a '_' for the Unix C symbol mangling convention */ + symbolName = malloc(strlen((const char*)name) + 2); + strcpy(symbolName+1, (const char*)name); + symbolName[0] = '_'; + symbol = NULL; + /* if (NSIsSymbolNameDefined(symbolName)) + symbol = NSLookupAndBindSymbol(symbolName); */ + symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL; + free(symbolName); + if( symbol ) return NSAddressOfSymbol(symbol); +#ifdef GLEW_APPLE_GLX + return dlGetProcAddress( name ); // try next for glx symbols +#else + return NULL; +#endif +} +#endif /* MAC_OS_X_VERSION_10_3 */ +#endif /* __APPLE__ */ + +/* + * Define glewGetProcAddress. + */ +#if defined(_WIN32) +# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) +# define glewGetProcAddress(name) NSGLGetProcAddress(name) +#elif defined(__sgi) || defined(__sun) +# define glewGetProcAddress(name) dlGetProcAddress(name) +#elif defined(__ANDROID__) +# define glewGetProcAddress(name) NULL /* TODO */ +#elif defined(__native_client__) +# define glewGetProcAddress(name) NULL /* TODO */ +#else /* __linux */ +# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) +#endif + +/* + * Define GLboolean const cast. + */ +#define CONST_CAST(x) (*(GLboolean*)&x) + +/* + * GLEW, just like OpenGL or GLU, does not rely on the standard C library. + * These functions implement the functionality required in this file. + */ +static GLuint _glewStrLen (const GLubyte* s) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0') i++; + return i; +} + +static GLuint _glewStrCLen (const GLubyte* s, GLubyte c) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0' && s[i] != c) i++; + return (s[i] == '\0' || s[i] == c) ? i : 0; +} + +static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n) +{ + GLuint i=0; + if(a == NULL || b == NULL) + return (a == NULL && b == NULL && n == 0) ? GL_TRUE : GL_FALSE; + while (i < n && a[i] != '\0' && b[i] != '\0' && a[i] == b[i]) i++; + return i == n ? GL_TRUE : GL_FALSE; +} + +static GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + while (*na > 0 && (**a == ' ' || **a == '\n' || **a == '\r' || **a == '\t')) + { + (*a)++; + (*na)--; + } + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +static GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +static GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if (i == nb && (*na == nb || (*a)[i] == ' ' || (*a)[i] == '\n' || (*a)[i] == '\r' || (*a)[i] == '\t')) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +/* + * Search for name in the extensions string. Use of strstr() + * is not sufficient because extension names can be prefixes of + * other extension names. Could use strtok() but the constant + * string returned by glGetString might be in read-only memory. + */ +static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, const GLubyte *end) +{ + const GLubyte* p; + GLuint len = _glewStrLen((const GLubyte*)name); + p = start; + while (p < end) + { + GLuint n = _glewStrCLen(p, ' '); + if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; + p += n+1; + } + return GL_FALSE; +} + +#if !defined(_WIN32) || !defined(GLEW_MX) + +PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D = NULL; +PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements = NULL; +PFNGLTEXIMAGE3DPROC __glewTexImage3D = NULL; +PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D = NULL; + +PFNGLACTIVETEXTUREPROC __glewActiveTexture = NULL; +PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture = NULL; +PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D = NULL; +PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D = NULL; +PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D = NULL; +PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage = NULL; +PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd = NULL; +PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf = NULL; +PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd = NULL; +PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf = NULL; +PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d = NULL; +PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv = NULL; +PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f = NULL; +PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv = NULL; +PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i = NULL; +PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv = NULL; +PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s = NULL; +PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv = NULL; +PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d = NULL; +PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv = NULL; +PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f = NULL; +PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv = NULL; +PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i = NULL; +PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv = NULL; +PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s = NULL; +PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv = NULL; +PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d = NULL; +PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv = NULL; +PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f = NULL; +PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv = NULL; +PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i = NULL; +PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv = NULL; +PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s = NULL; +PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv = NULL; +PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d = NULL; +PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv = NULL; +PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f = NULL; +PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv = NULL; +PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i = NULL; +PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv = NULL; +PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s = NULL; +PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv = NULL; +PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage = NULL; + +PFNGLBLENDCOLORPROC __glewBlendColor = NULL; +PFNGLBLENDEQUATIONPROC __glewBlendEquation = NULL; +PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate = NULL; +PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer = NULL; +PFNGLFOGCOORDDPROC __glewFogCoordd = NULL; +PFNGLFOGCOORDDVPROC __glewFogCoorddv = NULL; +PFNGLFOGCOORDFPROC __glewFogCoordf = NULL; +PFNGLFOGCOORDFVPROC __glewFogCoordfv = NULL; +PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays = NULL; +PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements = NULL; +PFNGLPOINTPARAMETERFPROC __glewPointParameterf = NULL; +PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv = NULL; +PFNGLPOINTPARAMETERIPROC __glewPointParameteri = NULL; +PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv = NULL; +PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b = NULL; +PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv = NULL; +PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d = NULL; +PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv = NULL; +PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f = NULL; +PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv = NULL; +PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i = NULL; +PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv = NULL; +PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s = NULL; +PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv = NULL; +PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub = NULL; +PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv = NULL; +PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui = NULL; +PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv = NULL; +PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us = NULL; +PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv = NULL; +PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer = NULL; +PFNGLWINDOWPOS2DPROC __glewWindowPos2d = NULL; +PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv = NULL; +PFNGLWINDOWPOS2FPROC __glewWindowPos2f = NULL; +PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv = NULL; +PFNGLWINDOWPOS2IPROC __glewWindowPos2i = NULL; +PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv = NULL; +PFNGLWINDOWPOS2SPROC __glewWindowPos2s = NULL; +PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv = NULL; +PFNGLWINDOWPOS3DPROC __glewWindowPos3d = NULL; +PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv = NULL; +PFNGLWINDOWPOS3FPROC __glewWindowPos3f = NULL; +PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv = NULL; +PFNGLWINDOWPOS3IPROC __glewWindowPos3i = NULL; +PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv = NULL; +PFNGLWINDOWPOS3SPROC __glewWindowPos3s = NULL; +PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv = NULL; + +PFNGLBEGINQUERYPROC __glewBeginQuery = NULL; +PFNGLBINDBUFFERPROC __glewBindBuffer = NULL; +PFNGLBUFFERDATAPROC __glewBufferData = NULL; +PFNGLBUFFERSUBDATAPROC __glewBufferSubData = NULL; +PFNGLDELETEBUFFERSPROC __glewDeleteBuffers = NULL; +PFNGLDELETEQUERIESPROC __glewDeleteQueries = NULL; +PFNGLENDQUERYPROC __glewEndQuery = NULL; +PFNGLGENBUFFERSPROC __glewGenBuffers = NULL; +PFNGLGENQUERIESPROC __glewGenQueries = NULL; +PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv = NULL; +PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv = NULL; +PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData = NULL; +PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv = NULL; +PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv = NULL; +PFNGLGETQUERYIVPROC __glewGetQueryiv = NULL; +PFNGLISBUFFERPROC __glewIsBuffer = NULL; +PFNGLISQUERYPROC __glewIsQuery = NULL; +PFNGLMAPBUFFERPROC __glewMapBuffer = NULL; +PFNGLUNMAPBUFFERPROC __glewUnmapBuffer = NULL; + +PFNGLATTACHSHADERPROC __glewAttachShader = NULL; +PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation = NULL; +PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate = NULL; +PFNGLCOMPILESHADERPROC __glewCompileShader = NULL; +PFNGLCREATEPROGRAMPROC __glewCreateProgram = NULL; +PFNGLCREATESHADERPROC __glewCreateShader = NULL; +PFNGLDELETEPROGRAMPROC __glewDeleteProgram = NULL; +PFNGLDELETESHADERPROC __glewDeleteShader = NULL; +PFNGLDETACHSHADERPROC __glewDetachShader = NULL; +PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray = NULL; +PFNGLDRAWBUFFERSPROC __glewDrawBuffers = NULL; +PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray = NULL; +PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib = NULL; +PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform = NULL; +PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders = NULL; +PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation = NULL; +PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog = NULL; +PFNGLGETPROGRAMIVPROC __glewGetProgramiv = NULL; +PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog = NULL; +PFNGLGETSHADERSOURCEPROC __glewGetShaderSource = NULL; +PFNGLGETSHADERIVPROC __glewGetShaderiv = NULL; +PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation = NULL; +PFNGLGETUNIFORMFVPROC __glewGetUniformfv = NULL; +PFNGLGETUNIFORMIVPROC __glewGetUniformiv = NULL; +PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv = NULL; +PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv = NULL; +PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv = NULL; +PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv = NULL; +PFNGLISPROGRAMPROC __glewIsProgram = NULL; +PFNGLISSHADERPROC __glewIsShader = NULL; +PFNGLLINKPROGRAMPROC __glewLinkProgram = NULL; +PFNGLSHADERSOURCEPROC __glewShaderSource = NULL; +PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate = NULL; +PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate = NULL; +PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate = NULL; +PFNGLUNIFORM1FPROC __glewUniform1f = NULL; +PFNGLUNIFORM1FVPROC __glewUniform1fv = NULL; +PFNGLUNIFORM1IPROC __glewUniform1i = NULL; +PFNGLUNIFORM1IVPROC __glewUniform1iv = NULL; +PFNGLUNIFORM2FPROC __glewUniform2f = NULL; +PFNGLUNIFORM2FVPROC __glewUniform2fv = NULL; +PFNGLUNIFORM2IPROC __glewUniform2i = NULL; +PFNGLUNIFORM2IVPROC __glewUniform2iv = NULL; +PFNGLUNIFORM3FPROC __glewUniform3f = NULL; +PFNGLUNIFORM3FVPROC __glewUniform3fv = NULL; +PFNGLUNIFORM3IPROC __glewUniform3i = NULL; +PFNGLUNIFORM3IVPROC __glewUniform3iv = NULL; +PFNGLUNIFORM4FPROC __glewUniform4f = NULL; +PFNGLUNIFORM4FVPROC __glewUniform4fv = NULL; +PFNGLUNIFORM4IPROC __glewUniform4i = NULL; +PFNGLUNIFORM4IVPROC __glewUniform4iv = NULL; +PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv = NULL; +PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv = NULL; +PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv = NULL; +PFNGLUSEPROGRAMPROC __glewUseProgram = NULL; +PFNGLVALIDATEPROGRAMPROC __glewValidateProgram = NULL; +PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d = NULL; +PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv = NULL; +PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f = NULL; +PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv = NULL; +PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s = NULL; +PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv = NULL; +PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d = NULL; +PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv = NULL; +PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f = NULL; +PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv = NULL; +PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s = NULL; +PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv = NULL; +PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d = NULL; +PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv = NULL; +PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f = NULL; +PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv = NULL; +PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s = NULL; +PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv = NULL; +PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv = NULL; +PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv = NULL; +PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv = NULL; +PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub = NULL; +PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv = NULL; +PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv = NULL; +PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv = NULL; +PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv = NULL; +PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d = NULL; +PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv = NULL; +PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f = NULL; +PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv = NULL; +PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv = NULL; +PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s = NULL; +PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv = NULL; +PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv = NULL; +PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv = NULL; +PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv = NULL; +PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer = NULL; + +PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv = NULL; +PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv = NULL; +PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv = NULL; +PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv = NULL; +PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv = NULL; +PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv = NULL; + +PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender = NULL; +PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback = NULL; +PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation = NULL; +PFNGLCLAMPCOLORPROC __glewClampColor = NULL; +PFNGLCLEARBUFFERFIPROC __glewClearBufferfi = NULL; +PFNGLCLEARBUFFERFVPROC __glewClearBufferfv = NULL; +PFNGLCLEARBUFFERIVPROC __glewClearBufferiv = NULL; +PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv = NULL; +PFNGLCOLORMASKIPROC __glewColorMaski = NULL; +PFNGLDISABLEIPROC __glewDisablei = NULL; +PFNGLENABLEIPROC __glewEnablei = NULL; +PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender = NULL; +PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback = NULL; +PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v = NULL; +PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation = NULL; +PFNGLGETSTRINGIPROC __glewGetStringi = NULL; +PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv = NULL; +PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv = NULL; +PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying = NULL; +PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv = NULL; +PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv = NULL; +PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv = NULL; +PFNGLISENABLEDIPROC __glewIsEnabledi = NULL; +PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv = NULL; +PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv = NULL; +PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings = NULL; +PFNGLUNIFORM1UIPROC __glewUniform1ui = NULL; +PFNGLUNIFORM1UIVPROC __glewUniform1uiv = NULL; +PFNGLUNIFORM2UIPROC __glewUniform2ui = NULL; +PFNGLUNIFORM2UIVPROC __glewUniform2uiv = NULL; +PFNGLUNIFORM3UIPROC __glewUniform3ui = NULL; +PFNGLUNIFORM3UIVPROC __glewUniform3uiv = NULL; +PFNGLUNIFORM4UIPROC __glewUniform4ui = NULL; +PFNGLUNIFORM4UIVPROC __glewUniform4uiv = NULL; +PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i = NULL; +PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv = NULL; +PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui = NULL; +PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv = NULL; +PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i = NULL; +PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv = NULL; +PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui = NULL; +PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv = NULL; +PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i = NULL; +PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv = NULL; +PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui = NULL; +PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv = NULL; +PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv = NULL; +PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i = NULL; +PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv = NULL; +PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv = NULL; +PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv = NULL; +PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui = NULL; +PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv = NULL; +PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv = NULL; +PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer = NULL; + +PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced = NULL; +PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced = NULL; +PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex = NULL; +PFNGLTEXBUFFERPROC __glewTexBuffer = NULL; + +PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture = NULL; +PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v = NULL; +PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v = NULL; + +PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor = NULL; + +PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei = NULL; +PFNGLBLENDEQUATIONIPROC __glewBlendEquationi = NULL; +PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei = NULL; +PFNGLBLENDFUNCIPROC __glewBlendFunci = NULL; +PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading = NULL; + +PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX = NULL; + +PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD = NULL; +PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD = NULL; +PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD = NULL; +PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD = NULL; + +PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD = NULL; +PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD = NULL; +PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD = NULL; +PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD = NULL; + +PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD = NULL; + +PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD = NULL; +PFNGLGENNAMESAMDPROC __glewGenNamesAMD = NULL; +PFNGLISNAMEAMDPROC __glewIsNameAMD = NULL; + +PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD = NULL; +PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD = NULL; +PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD = NULL; +PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD = NULL; +PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD = NULL; +PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD = NULL; +PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD = NULL; +PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD = NULL; +PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD = NULL; +PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD = NULL; +PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD = NULL; + +PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD = NULL; + +PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD = NULL; +PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD = NULL; + +PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD = NULL; + +PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD = NULL; +PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD = NULL; + +PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE = NULL; + +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE = NULL; + +PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE = NULL; +PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE = NULL; +PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE = NULL; + +PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE = NULL; +PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE = NULL; +PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE = NULL; +PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE = NULL; +PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE = NULL; +PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE = NULL; +PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE = NULL; +PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE = NULL; +PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE = NULL; +PFNGLISQUERYANGLEPROC __glewIsQueryANGLE = NULL; +PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE = NULL; + +PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE = NULL; + +PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE = NULL; +PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE = NULL; +PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE = NULL; +PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE = NULL; +PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE = NULL; + +PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE = NULL; +PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE = NULL; +PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE = NULL; +PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE = NULL; +PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE = NULL; +PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE = NULL; +PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE = NULL; +PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE = NULL; + +PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE = NULL; +PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE = NULL; + +PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE = NULL; +PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE = NULL; +PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE = NULL; + +PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE = NULL; +PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE = NULL; + +PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE = NULL; +PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE = NULL; +PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE = NULL; +PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE = NULL; + +PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE = NULL; +PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE = NULL; +PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE = NULL; + +PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE = NULL; +PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE = NULL; +PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE = NULL; +PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE = NULL; +PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE = NULL; +PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE = NULL; +PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE = NULL; + +PFNGLCLEARDEPTHFPROC __glewClearDepthf = NULL; +PFNGLDEPTHRANGEFPROC __glewDepthRangef = NULL; +PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat = NULL; +PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler = NULL; +PFNGLSHADERBINARYPROC __glewShaderBinary = NULL; + +PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance = NULL; + +PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB = NULL; +PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB = NULL; +PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB = NULL; +PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB = NULL; +PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB = NULL; +PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB = NULL; +PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB = NULL; +PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB = NULL; +PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB = NULL; +PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB = NULL; +PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB = NULL; +PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB = NULL; +PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB = NULL; +PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB = NULL; +PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB = NULL; +PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB = NULL; + +PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed = NULL; +PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex = NULL; + +PFNGLBUFFERSTORAGEPROC __glewBufferStorage = NULL; +PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT = NULL; + +PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB = NULL; + +PFNGLCLEARBUFFERDATAPROC __glewClearBufferData = NULL; +PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData = NULL; +PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT = NULL; +PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT = NULL; + +PFNGLCLEARTEXIMAGEPROC __glewClearTexImage = NULL; +PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage = NULL; + +PFNGLCLAMPCOLORARBPROC __glewClampColorARB = NULL; + +PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute = NULL; +PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect = NULL; + +PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB = NULL; + +PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData = NULL; + +PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData = NULL; + +PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB = NULL; +PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB = NULL; +PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB = NULL; +PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB = NULL; + +PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB = NULL; + +PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB = NULL; +PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB = NULL; +PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB = NULL; +PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB = NULL; + +PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex = NULL; +PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex = NULL; +PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex = NULL; + +PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect = NULL; +PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect = NULL; + +PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri = NULL; +PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv = NULL; +PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT = NULL; +PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT = NULL; + +PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer = NULL; +PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer = NULL; +PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer = NULL; +PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus = NULL; +PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers = NULL; +PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers = NULL; +PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer = NULL; +PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D = NULL; +PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D = NULL; +PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D = NULL; +PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer = NULL; +PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers = NULL; +PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers = NULL; +PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap = NULL; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv = NULL; +PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv = NULL; +PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer = NULL; +PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer = NULL; +PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage = NULL; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample = NULL; + +PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB = NULL; +PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB = NULL; +PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB = NULL; +PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB = NULL; + +PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary = NULL; +PFNGLPROGRAMBINARYPROC __glewProgramBinary = NULL; +PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri = NULL; + +PFNGLGETUNIFORMDVPROC __glewGetUniformdv = NULL; +PFNGLUNIFORM1DPROC __glewUniform1d = NULL; +PFNGLUNIFORM1DVPROC __glewUniform1dv = NULL; +PFNGLUNIFORM2DPROC __glewUniform2d = NULL; +PFNGLUNIFORM2DVPROC __glewUniform2dv = NULL; +PFNGLUNIFORM3DPROC __glewUniform3d = NULL; +PFNGLUNIFORM3DVPROC __glewUniform3dv = NULL; +PFNGLUNIFORM4DPROC __glewUniform4d = NULL; +PFNGLUNIFORM4DVPROC __glewUniform4dv = NULL; +PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv = NULL; +PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv = NULL; +PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv = NULL; +PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv = NULL; +PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv = NULL; +PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv = NULL; +PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv = NULL; +PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv = NULL; +PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv = NULL; + +PFNGLCOLORSUBTABLEPROC __glewColorSubTable = NULL; +PFNGLCOLORTABLEPROC __glewColorTable = NULL; +PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv = NULL; +PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv = NULL; +PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D = NULL; +PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D = NULL; +PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf = NULL; +PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv = NULL; +PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri = NULL; +PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv = NULL; +PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable = NULL; +PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable = NULL; +PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D = NULL; +PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D = NULL; +PFNGLGETCOLORTABLEPROC __glewGetColorTable = NULL; +PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv = NULL; +PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv = NULL; +PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter = NULL; +PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv = NULL; +PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv = NULL; +PFNGLGETHISTOGRAMPROC __glewGetHistogram = NULL; +PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv = NULL; +PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv = NULL; +PFNGLGETMINMAXPROC __glewGetMinmax = NULL; +PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv = NULL; +PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv = NULL; +PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter = NULL; +PFNGLHISTOGRAMPROC __glewHistogram = NULL; +PFNGLMINMAXPROC __glewMinmax = NULL; +PFNGLRESETHISTOGRAMPROC __glewResetHistogram = NULL; +PFNGLRESETMINMAXPROC __glewResetMinmax = NULL; +PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB = NULL; + +PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB = NULL; +PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB = NULL; +PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB = NULL; + +PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ = NULL; + +PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v = NULL; + +PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData = NULL; +PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData = NULL; +PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer = NULL; +PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer = NULL; +PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage = NULL; +PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage = NULL; + +PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange = NULL; +PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange = NULL; + +PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB = NULL; +PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB = NULL; +PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB = NULL; +PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB = NULL; +PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB = NULL; + +PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase = NULL; +PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange = NULL; +PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures = NULL; +PFNGLBINDSAMPLERSPROC __glewBindSamplers = NULL; +PFNGLBINDTEXTURESPROC __glewBindTextures = NULL; +PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect = NULL; + +PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB = NULL; + +PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB = NULL; +PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB = NULL; +PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB = NULL; +PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB = NULL; +PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB = NULL; +PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB = NULL; +PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB = NULL; +PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB = NULL; +PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB = NULL; +PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB = NULL; +PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB = NULL; +PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB = NULL; +PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB = NULL; +PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB = NULL; +PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB = NULL; +PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB = NULL; +PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB = NULL; +PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB = NULL; +PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB = NULL; +PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB = NULL; +PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB = NULL; +PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB = NULL; +PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB = NULL; +PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB = NULL; +PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB = NULL; +PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB = NULL; +PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB = NULL; +PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB = NULL; +PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB = NULL; +PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB = NULL; +PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB = NULL; +PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB = NULL; +PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB = NULL; +PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB = NULL; + +PFNGLBEGINQUERYARBPROC __glewBeginQueryARB = NULL; +PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB = NULL; +PFNGLENDQUERYARBPROC __glewEndQueryARB = NULL; +PFNGLGENQUERIESARBPROC __glewGenQueriesARB = NULL; +PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB = NULL; +PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB = NULL; +PFNGLGETQUERYIVARBPROC __glewGetQueryivARB = NULL; +PFNGLISQUERYARBPROC __glewIsQueryARB = NULL; + +PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB = NULL; +PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB = NULL; + +PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv = NULL; +PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex = NULL; +PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation = NULL; +PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex = NULL; +PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName = NULL; +PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv = NULL; + +PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex = NULL; + +PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB = NULL; +PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB = NULL; +PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB = NULL; +PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB = NULL; +PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB = NULL; +PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB = NULL; +PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB = NULL; +PFNGLGETNMAPIVARBPROC __glewGetnMapivARB = NULL; +PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB = NULL; +PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB = NULL; +PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB = NULL; +PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB = NULL; +PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB = NULL; +PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB = NULL; +PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB = NULL; +PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB = NULL; +PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB = NULL; +PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB = NULL; +PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB = NULL; +PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB = NULL; + +PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB = NULL; + +PFNGLBINDSAMPLERPROC __glewBindSampler = NULL; +PFNGLDELETESAMPLERSPROC __glewDeleteSamplers = NULL; +PFNGLGENSAMPLERSPROC __glewGenSamplers = NULL; +PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv = NULL; +PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv = NULL; +PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv = NULL; +PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv = NULL; +PFNGLISSAMPLERPROC __glewIsSampler = NULL; +PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv = NULL; +PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv = NULL; +PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf = NULL; +PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv = NULL; +PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri = NULL; +PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv = NULL; + +PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram = NULL; +PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline = NULL; +PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv = NULL; +PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines = NULL; +PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines = NULL; +PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog = NULL; +PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv = NULL; +PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline = NULL; +PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d = NULL; +PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv = NULL; +PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f = NULL; +PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv = NULL; +PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i = NULL; +PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv = NULL; +PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui = NULL; +PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv = NULL; +PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d = NULL; +PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv = NULL; +PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f = NULL; +PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv = NULL; +PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i = NULL; +PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv = NULL; +PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui = NULL; +PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv = NULL; +PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d = NULL; +PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv = NULL; +PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f = NULL; +PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv = NULL; +PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i = NULL; +PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv = NULL; +PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui = NULL; +PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv = NULL; +PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d = NULL; +PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv = NULL; +PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f = NULL; +PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv = NULL; +PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i = NULL; +PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv = NULL; +PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui = NULL; +PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv = NULL; +PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages = NULL; +PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline = NULL; + +PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv = NULL; + +PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture = NULL; +PFNGLMEMORYBARRIERPROC __glewMemoryBarrier = NULL; + +PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB = NULL; +PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB = NULL; +PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB = NULL; +PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB = NULL; +PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB = NULL; +PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB = NULL; +PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB = NULL; +PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB = NULL; +PFNGLGETHANDLEARBPROC __glewGetHandleARB = NULL; +PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB = NULL; +PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB = NULL; +PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB = NULL; +PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB = NULL; +PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB = NULL; +PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB = NULL; +PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB = NULL; +PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB = NULL; +PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB = NULL; +PFNGLUNIFORM1FARBPROC __glewUniform1fARB = NULL; +PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB = NULL; +PFNGLUNIFORM1IARBPROC __glewUniform1iARB = NULL; +PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB = NULL; +PFNGLUNIFORM2FARBPROC __glewUniform2fARB = NULL; +PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB = NULL; +PFNGLUNIFORM2IARBPROC __glewUniform2iARB = NULL; +PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB = NULL; +PFNGLUNIFORM3FARBPROC __glewUniform3fARB = NULL; +PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB = NULL; +PFNGLUNIFORM3IARBPROC __glewUniform3iARB = NULL; +PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB = NULL; +PFNGLUNIFORM4FARBPROC __glewUniform4fARB = NULL; +PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB = NULL; +PFNGLUNIFORM4IARBPROC __glewUniform4iARB = NULL; +PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB = NULL; +PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB = NULL; +PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB = NULL; +PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB = NULL; +PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB = NULL; +PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB = NULL; + +PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding = NULL; + +PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName = NULL; +PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName = NULL; +PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv = NULL; +PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv = NULL; +PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex = NULL; +PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation = NULL; +PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv = NULL; +PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv = NULL; + +PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB = NULL; +PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB = NULL; +PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB = NULL; +PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB = NULL; +PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB = NULL; +PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB = NULL; + +PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB = NULL; +PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT = NULL; + +PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync = NULL; +PFNGLDELETESYNCPROC __glewDeleteSync = NULL; +PFNGLFENCESYNCPROC __glewFenceSync = NULL; +PFNGLGETINTEGER64VPROC __glewGetInteger64v = NULL; +PFNGLGETSYNCIVPROC __glewGetSynciv = NULL; +PFNGLISSYNCPROC __glewIsSync = NULL; +PFNGLWAITSYNCPROC __glewWaitSync = NULL; + +PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv = NULL; +PFNGLPATCHPARAMETERIPROC __glewPatchParameteri = NULL; + +PFNGLTEXBUFFERARBPROC __glewTexBufferARB = NULL; + +PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange = NULL; +PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT = NULL; + +PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB = NULL; +PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB = NULL; +PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB = NULL; +PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB = NULL; + +PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv = NULL; +PFNGLSAMPLEMASKIPROC __glewSampleMaski = NULL; +PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample = NULL; +PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample = NULL; + +PFNGLTEXSTORAGE1DPROC __glewTexStorage1D = NULL; +PFNGLTEXSTORAGE2DPROC __glewTexStorage2D = NULL; +PFNGLTEXSTORAGE3DPROC __glewTexStorage3D = NULL; +PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT = NULL; +PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT = NULL; +PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT = NULL; + +PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample = NULL; +PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample = NULL; +PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT = NULL; +PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT = NULL; + +PFNGLTEXTUREVIEWPROC __glewTextureView = NULL; + +PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v = NULL; +PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v = NULL; +PFNGLQUERYCOUNTERPROC __glewQueryCounter = NULL; + +PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback = NULL; +PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks = NULL; +PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback = NULL; +PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks = NULL; +PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback = NULL; +PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback = NULL; +PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback = NULL; + +PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed = NULL; +PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream = NULL; +PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed = NULL; +PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv = NULL; + +PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced = NULL; +PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced = NULL; + +PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB = NULL; +PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB = NULL; +PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB = NULL; +PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB = NULL; + +PFNGLBINDBUFFERBASEPROC __glewBindBufferBase = NULL; +PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange = NULL; +PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName = NULL; +PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv = NULL; +PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName = NULL; +PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv = NULL; +PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v = NULL; +PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex = NULL; +PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices = NULL; +PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding = NULL; + +PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray = NULL; +PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays = NULL; +PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays = NULL; +PFNGLISVERTEXARRAYPROC __glewIsVertexArray = NULL; + +PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv = NULL; +PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d = NULL; +PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv = NULL; +PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d = NULL; +PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv = NULL; +PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d = NULL; +PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv = NULL; +PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d = NULL; +PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv = NULL; +PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer = NULL; + +PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer = NULL; +PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding = NULL; +PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat = NULL; +PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat = NULL; +PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat = NULL; +PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor = NULL; + +PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB = NULL; +PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB = NULL; +PFNGLWEIGHTBVARBPROC __glewWeightbvARB = NULL; +PFNGLWEIGHTDVARBPROC __glewWeightdvARB = NULL; +PFNGLWEIGHTFVARBPROC __glewWeightfvARB = NULL; +PFNGLWEIGHTIVARBPROC __glewWeightivARB = NULL; +PFNGLWEIGHTSVARBPROC __glewWeightsvARB = NULL; +PFNGLWEIGHTUBVARBPROC __glewWeightubvARB = NULL; +PFNGLWEIGHTUIVARBPROC __glewWeightuivARB = NULL; +PFNGLWEIGHTUSVARBPROC __glewWeightusvARB = NULL; + +PFNGLBINDBUFFERARBPROC __glewBindBufferARB = NULL; +PFNGLBUFFERDATAARBPROC __glewBufferDataARB = NULL; +PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB = NULL; +PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB = NULL; +PFNGLGENBUFFERSARBPROC __glewGenBuffersARB = NULL; +PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB = NULL; +PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB = NULL; +PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB = NULL; +PFNGLISBUFFERARBPROC __glewIsBufferARB = NULL; +PFNGLMAPBUFFERARBPROC __glewMapBufferARB = NULL; +PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB = NULL; + +PFNGLBINDPROGRAMARBPROC __glewBindProgramARB = NULL; +PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB = NULL; +PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB = NULL; +PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB = NULL; +PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB = NULL; +PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB = NULL; +PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB = NULL; +PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB = NULL; +PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB = NULL; +PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB = NULL; +PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB = NULL; +PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB = NULL; +PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB = NULL; +PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB = NULL; +PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB = NULL; +PFNGLISPROGRAMARBPROC __glewIsProgramARB = NULL; +PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB = NULL; +PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB = NULL; +PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB = NULL; +PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB = NULL; +PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB = NULL; +PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB = NULL; +PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB = NULL; +PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB = NULL; +PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB = NULL; +PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB = NULL; +PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB = NULL; +PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB = NULL; +PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB = NULL; +PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB = NULL; +PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB = NULL; +PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB = NULL; +PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB = NULL; +PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB = NULL; +PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB = NULL; +PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB = NULL; +PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB = NULL; +PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB = NULL; +PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB = NULL; +PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB = NULL; +PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB = NULL; +PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB = NULL; +PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB = NULL; +PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB = NULL; +PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB = NULL; +PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB = NULL; +PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB = NULL; +PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB = NULL; +PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB = NULL; +PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB = NULL; +PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB = NULL; +PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB = NULL; +PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB = NULL; +PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB = NULL; +PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB = NULL; +PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB = NULL; +PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB = NULL; +PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB = NULL; + +PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB = NULL; +PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB = NULL; +PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB = NULL; + +PFNGLCOLORP3UIPROC __glewColorP3ui = NULL; +PFNGLCOLORP3UIVPROC __glewColorP3uiv = NULL; +PFNGLCOLORP4UIPROC __glewColorP4ui = NULL; +PFNGLCOLORP4UIVPROC __glewColorP4uiv = NULL; +PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui = NULL; +PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv = NULL; +PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui = NULL; +PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv = NULL; +PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui = NULL; +PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv = NULL; +PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui = NULL; +PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv = NULL; +PFNGLNORMALP3UIPROC __glewNormalP3ui = NULL; +PFNGLNORMALP3UIVPROC __glewNormalP3uiv = NULL; +PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui = NULL; +PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv = NULL; +PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui = NULL; +PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv = NULL; +PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui = NULL; +PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv = NULL; +PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui = NULL; +PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv = NULL; +PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui = NULL; +PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv = NULL; +PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui = NULL; +PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv = NULL; +PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui = NULL; +PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv = NULL; +PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui = NULL; +PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv = NULL; +PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui = NULL; +PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv = NULL; +PFNGLVERTEXP2UIPROC __glewVertexP2ui = NULL; +PFNGLVERTEXP2UIVPROC __glewVertexP2uiv = NULL; +PFNGLVERTEXP3UIPROC __glewVertexP3ui = NULL; +PFNGLVERTEXP3UIVPROC __glewVertexP3uiv = NULL; +PFNGLVERTEXP4UIPROC __glewVertexP4ui = NULL; +PFNGLVERTEXP4UIVPROC __glewVertexP4uiv = NULL; + +PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv = NULL; +PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed = NULL; +PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v = NULL; +PFNGLGETFLOATI_VPROC __glewGetFloati_v = NULL; +PFNGLSCISSORARRAYVPROC __glewScissorArrayv = NULL; +PFNGLSCISSORINDEXEDPROC __glewScissorIndexed = NULL; +PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv = NULL; +PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv = NULL; +PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf = NULL; +PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv = NULL; + +PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB = NULL; +PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB = NULL; +PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB = NULL; +PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB = NULL; +PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB = NULL; +PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB = NULL; +PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB = NULL; +PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB = NULL; +PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB = NULL; +PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB = NULL; +PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB = NULL; +PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB = NULL; +PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB = NULL; +PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB = NULL; +PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB = NULL; +PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB = NULL; + +PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI = NULL; + +PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI = NULL; +PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI = NULL; +PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI = NULL; + +PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI = NULL; +PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI = NULL; +PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI = NULL; +PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI = NULL; + +PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI = NULL; +PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI = NULL; +PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI = NULL; +PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI = NULL; +PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI = NULL; +PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI = NULL; +PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI = NULL; +PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI = NULL; +PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI = NULL; +PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI = NULL; +PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI = NULL; +PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI = NULL; +PFNGLSAMPLEMAPATIPROC __glewSampleMapATI = NULL; +PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI = NULL; + +PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI = NULL; +PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI = NULL; + +PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI = NULL; +PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI = NULL; + +PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI = NULL; +PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI = NULL; + +PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI = NULL; +PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI = NULL; +PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI = NULL; +PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI = NULL; +PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI = NULL; +PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI = NULL; +PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI = NULL; +PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI = NULL; +PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI = NULL; +PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI = NULL; +PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI = NULL; +PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI = NULL; + +PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI = NULL; +PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI = NULL; +PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI = NULL; + +PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI = NULL; +PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI = NULL; +PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI = NULL; +PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI = NULL; +PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI = NULL; +PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI = NULL; +PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI = NULL; +PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI = NULL; +PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI = NULL; +PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI = NULL; +PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI = NULL; +PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI = NULL; +PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI = NULL; +PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI = NULL; +PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI = NULL; +PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI = NULL; +PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI = NULL; +PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI = NULL; +PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI = NULL; +PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI = NULL; +PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI = NULL; +PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI = NULL; +PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI = NULL; +PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI = NULL; +PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI = NULL; +PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI = NULL; +PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI = NULL; +PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI = NULL; +PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI = NULL; +PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI = NULL; +PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI = NULL; +PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI = NULL; +PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI = NULL; +PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI = NULL; +PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI = NULL; +PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI = NULL; +PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI = NULL; +PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI = NULL; +PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI = NULL; +PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI = NULL; +PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI = NULL; +PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI = NULL; +PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI = NULL; +PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI = NULL; +PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI = NULL; + +PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT = NULL; +PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT = NULL; +PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT = NULL; + +PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT = NULL; + +PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT = NULL; + +PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT = NULL; + +PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT = NULL; + +PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT = NULL; +PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT = NULL; + +PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT = NULL; +PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT = NULL; + +PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT = NULL; +PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT = NULL; +PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT = NULL; +PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT = NULL; +PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT = NULL; +PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT = NULL; +PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT = NULL; +PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT = NULL; +PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT = NULL; +PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT = NULL; +PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT = NULL; +PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT = NULL; +PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT = NULL; + +PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT = NULL; +PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT = NULL; + +PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT = NULL; +PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT = NULL; + +PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT = NULL; +PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT = NULL; + +PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT = NULL; +PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT = NULL; +PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT = NULL; + +PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT = NULL; + +PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT = NULL; +PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT = NULL; +PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT = NULL; +PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT = NULL; +PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT = NULL; +PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT = NULL; +PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT = NULL; +PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT = NULL; +PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT = NULL; +PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT = NULL; +PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT = NULL; +PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT = NULL; +PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT = NULL; +PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT = NULL; +PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT = NULL; +PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT = NULL; +PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT = NULL; +PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT = NULL; +PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT = NULL; +PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT = NULL; +PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT = NULL; +PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT = NULL; +PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT = NULL; +PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT = NULL; +PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT = NULL; +PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT = NULL; +PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT = NULL; +PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT = NULL; +PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT = NULL; +PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT = NULL; +PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT = NULL; +PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT = NULL; +PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT = NULL; +PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT = NULL; +PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT = NULL; +PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT = NULL; +PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT = NULL; +PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT = NULL; +PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT = NULL; +PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT = NULL; +PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT = NULL; +PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT = NULL; +PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT = NULL; +PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT = NULL; +PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT = NULL; +PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT = NULL; +PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT = NULL; +PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT = NULL; +PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT = NULL; +PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT = NULL; +PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT = NULL; +PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT = NULL; +PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT = NULL; +PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT = NULL; +PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT = NULL; +PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT = NULL; +PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT = NULL; +PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT = NULL; +PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT = NULL; +PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT = NULL; +PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT = NULL; +PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT = NULL; +PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT = NULL; +PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT = NULL; +PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT = NULL; +PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT = NULL; +PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT = NULL; +PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT = NULL; +PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT = NULL; +PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT = NULL; +PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT = NULL; +PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT = NULL; +PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT = NULL; +PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT = NULL; +PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT = NULL; +PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT = NULL; +PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT = NULL; +PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT = NULL; +PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT = NULL; +PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT = NULL; +PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT = NULL; +PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT = NULL; +PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT = NULL; +PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT = NULL; +PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT = NULL; +PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT = NULL; +PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT = NULL; +PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT = NULL; +PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT = NULL; +PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT = NULL; +PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT = NULL; +PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT = NULL; +PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT = NULL; +PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT = NULL; +PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT = NULL; +PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT = NULL; +PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT = NULL; +PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT = NULL; +PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT = NULL; +PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT = NULL; +PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT = NULL; +PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT = NULL; +PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT = NULL; +PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT = NULL; +PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT = NULL; +PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT = NULL; +PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT = NULL; +PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT = NULL; +PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT = NULL; +PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT = NULL; +PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT = NULL; +PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT = NULL; +PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT = NULL; +PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT = NULL; +PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT = NULL; +PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT = NULL; +PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT = NULL; +PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT = NULL; +PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT = NULL; +PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT = NULL; +PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT = NULL; +PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT = NULL; +PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT = NULL; +PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT = NULL; +PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT = NULL; +PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT = NULL; +PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT = NULL; +PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT = NULL; +PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT = NULL; +PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT = NULL; +PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT = NULL; +PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT = NULL; +PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT = NULL; +PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT = NULL; +PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT = NULL; +PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT = NULL; +PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT = NULL; +PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT = NULL; +PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT = NULL; +PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT = NULL; +PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT = NULL; +PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT = NULL; +PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT = NULL; +PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT = NULL; +PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT = NULL; +PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT = NULL; +PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT = NULL; +PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT = NULL; +PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT = NULL; +PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT = NULL; +PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT = NULL; +PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT = NULL; +PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT = NULL; +PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT = NULL; +PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT = NULL; +PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT = NULL; +PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT = NULL; + +PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT = NULL; +PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT = NULL; +PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT = NULL; +PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT = NULL; +PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT = NULL; +PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT = NULL; + +PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT = NULL; +PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT = NULL; + +PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT = NULL; + +PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT = NULL; +PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT = NULL; +PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT = NULL; +PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT = NULL; +PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT = NULL; + +PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT = NULL; +PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT = NULL; +PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT = NULL; +PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT = NULL; +PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT = NULL; +PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT = NULL; +PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT = NULL; +PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT = NULL; +PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT = NULL; +PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT = NULL; +PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT = NULL; +PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT = NULL; +PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT = NULL; +PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT = NULL; +PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT = NULL; +PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT = NULL; +PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT = NULL; +PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT = NULL; + +PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT = NULL; + +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT = NULL; + +PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT = NULL; +PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT = NULL; +PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT = NULL; +PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT = NULL; +PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT = NULL; +PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT = NULL; +PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT = NULL; +PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT = NULL; +PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT = NULL; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT = NULL; +PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT = NULL; +PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT = NULL; +PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT = NULL; +PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT = NULL; + +PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT = NULL; +PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT = NULL; +PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT = NULL; + +PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT = NULL; +PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT = NULL; + +PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT = NULL; +PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT = NULL; +PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT = NULL; +PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT = NULL; +PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT = NULL; +PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT = NULL; +PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT = NULL; +PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT = NULL; +PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT = NULL; +PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT = NULL; +PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT = NULL; +PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT = NULL; +PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT = NULL; +PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT = NULL; +PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT = NULL; +PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT = NULL; +PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT = NULL; +PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT = NULL; +PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT = NULL; +PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT = NULL; +PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT = NULL; +PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT = NULL; +PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT = NULL; +PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT = NULL; +PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT = NULL; +PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT = NULL; +PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT = NULL; +PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT = NULL; +PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT = NULL; +PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT = NULL; +PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT = NULL; +PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT = NULL; +PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT = NULL; +PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT = NULL; + +PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT = NULL; +PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT = NULL; +PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT = NULL; +PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT = NULL; +PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT = NULL; +PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT = NULL; +PFNGLHISTOGRAMEXTPROC __glewHistogramEXT = NULL; +PFNGLMINMAXEXTPROC __glewMinmaxEXT = NULL; +PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT = NULL; +PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT = NULL; + +PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT = NULL; + +PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT = NULL; + +PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT = NULL; +PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT = NULL; +PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT = NULL; + +PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT = NULL; +PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT = NULL; + +PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT = NULL; +PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT = NULL; + +PFNGLCOLORTABLEEXTPROC __glewColorTableEXT = NULL; +PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT = NULL; +PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT = NULL; +PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT = NULL; + +PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT = NULL; +PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT = NULL; + +PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT = NULL; +PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT = NULL; + +PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT = NULL; + +PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT = NULL; + +PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT = NULL; +PFNGLENDSCENEEXTPROC __glewEndSceneEXT = NULL; + +PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT = NULL; +PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT = NULL; +PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT = NULL; +PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT = NULL; +PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT = NULL; +PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT = NULL; +PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT = NULL; +PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT = NULL; +PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT = NULL; +PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT = NULL; +PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT = NULL; +PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT = NULL; +PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT = NULL; +PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT = NULL; +PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT = NULL; +PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT = NULL; +PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT = NULL; + +PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT = NULL; +PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT = NULL; +PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT = NULL; + +PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT = NULL; +PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT = NULL; + +PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT = NULL; + +PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT = NULL; +PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT = NULL; +PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT = NULL; + +PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT = NULL; + +PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT = NULL; + +PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT = NULL; + +PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT = NULL; +PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT = NULL; +PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT = NULL; +PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT = NULL; +PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT = NULL; +PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT = NULL; + +PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT = NULL; +PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT = NULL; +PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT = NULL; +PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT = NULL; +PFNGLISTEXTUREEXTPROC __glewIsTextureEXT = NULL; +PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT = NULL; + +PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT = NULL; + +PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT = NULL; +PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT = NULL; + +PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT = NULL; +PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT = NULL; +PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT = NULL; +PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT = NULL; +PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT = NULL; +PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT = NULL; +PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT = NULL; + +PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT = NULL; +PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT = NULL; +PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT = NULL; +PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT = NULL; +PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT = NULL; +PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT = NULL; +PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT = NULL; +PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT = NULL; + +PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT = NULL; +PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT = NULL; +PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT = NULL; +PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT = NULL; +PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT = NULL; +PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT = NULL; +PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT = NULL; +PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT = NULL; +PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT = NULL; +PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT = NULL; + +PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT = NULL; +PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT = NULL; +PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT = NULL; +PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT = NULL; +PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT = NULL; +PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT = NULL; +PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT = NULL; +PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT = NULL; +PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT = NULL; +PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT = NULL; +PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT = NULL; +PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT = NULL; +PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT = NULL; +PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT = NULL; +PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT = NULL; +PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT = NULL; +PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT = NULL; +PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT = NULL; +PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT = NULL; +PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT = NULL; +PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT = NULL; +PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT = NULL; +PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT = NULL; +PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT = NULL; +PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT = NULL; +PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT = NULL; +PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT = NULL; +PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT = NULL; +PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT = NULL; +PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT = NULL; +PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT = NULL; +PFNGLSWIZZLEEXTPROC __glewSwizzleEXT = NULL; +PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT = NULL; +PFNGLVARIANTBVEXTPROC __glewVariantbvEXT = NULL; +PFNGLVARIANTDVEXTPROC __glewVariantdvEXT = NULL; +PFNGLVARIANTFVEXTPROC __glewVariantfvEXT = NULL; +PFNGLVARIANTIVEXTPROC __glewVariantivEXT = NULL; +PFNGLVARIANTSVEXTPROC __glewVariantsvEXT = NULL; +PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT = NULL; +PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT = NULL; +PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT = NULL; +PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT = NULL; + +PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT = NULL; +PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT = NULL; +PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT = NULL; + +PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT = NULL; + +PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY = NULL; + +PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY = NULL; + +PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP = NULL; +PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP = NULL; + +PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM = NULL; +PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM = NULL; + +PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM = NULL; +PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM = NULL; +PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM = NULL; +PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM = NULL; +PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM = NULL; +PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM = NULL; +PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM = NULL; +PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM = NULL; + +PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL = NULL; +PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL = NULL; +PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL = NULL; + +PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL = NULL; +PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL = NULL; +PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL = NULL; +PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL = NULL; + +PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL = NULL; +PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL = NULL; + +PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback = NULL; +PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl = NULL; +PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert = NULL; +PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog = NULL; +PFNGLGETOBJECTLABELPROC __glewGetObjectLabel = NULL; +PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel = NULL; +PFNGLOBJECTLABELPROC __glewObjectLabel = NULL; +PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel = NULL; +PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup = NULL; +PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup = NULL; + +PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled = NULL; +PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion = NULL; +PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion = NULL; +PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion = NULL; +PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion = NULL; + +PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA = NULL; + +PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA = NULL; +PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA = NULL; +PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA = NULL; +PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA = NULL; +PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA = NULL; +PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA = NULL; +PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA = NULL; +PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA = NULL; +PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA = NULL; +PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA = NULL; +PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA = NULL; +PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA = NULL; +PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA = NULL; +PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA = NULL; +PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA = NULL; +PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA = NULL; +PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA = NULL; +PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA = NULL; +PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA = NULL; +PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA = NULL; +PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA = NULL; +PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA = NULL; +PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA = NULL; +PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA = NULL; + +PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX = NULL; +PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV = NULL; + +PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV = NULL; +PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV = NULL; +PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV = NULL; +PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV = NULL; +PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV = NULL; +PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV = NULL; +PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV = NULL; +PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV = NULL; +PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV = NULL; +PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV = NULL; +PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV = NULL; +PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV = NULL; +PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV = NULL; + +PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV = NULL; +PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV = NULL; + +PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV = NULL; +PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV = NULL; + +PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV = NULL; + +PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV = NULL; +PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV = NULL; +PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV = NULL; + +PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV = NULL; + +PFNGLEVALMAPSNVPROC __glewEvalMapsNV = NULL; +PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV = NULL; +PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV = NULL; +PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV = NULL; +PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV = NULL; +PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV = NULL; +PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV = NULL; +PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV = NULL; +PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV = NULL; + +PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV = NULL; +PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV = NULL; +PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV = NULL; + +PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV = NULL; +PFNGLFINISHFENCENVPROC __glewFinishFenceNV = NULL; +PFNGLGENFENCESNVPROC __glewGenFencesNV = NULL; +PFNGLGETFENCEIVNVPROC __glewGetFenceivNV = NULL; +PFNGLISFENCENVPROC __glewIsFenceNV = NULL; +PFNGLSETFENCENVPROC __glewSetFenceNV = NULL; +PFNGLTESTFENCENVPROC __glewTestFenceNV = NULL; + +PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV = NULL; +PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV = NULL; + +PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV = NULL; + +PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV = NULL; + +PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV = NULL; +PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV = NULL; +PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV = NULL; +PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV = NULL; +PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV = NULL; +PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV = NULL; + +PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV = NULL; +PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV = NULL; +PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV = NULL; +PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV = NULL; +PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV = NULL; +PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV = NULL; +PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV = NULL; +PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV = NULL; +PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV = NULL; +PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV = NULL; +PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV = NULL; +PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV = NULL; +PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV = NULL; +PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV = NULL; +PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV = NULL; +PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV = NULL; +PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV = NULL; +PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV = NULL; +PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV = NULL; +PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV = NULL; +PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV = NULL; +PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV = NULL; +PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV = NULL; +PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV = NULL; +PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV = NULL; +PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV = NULL; +PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV = NULL; +PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV = NULL; +PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV = NULL; +PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV = NULL; +PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV = NULL; +PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV = NULL; +PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV = NULL; +PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV = NULL; + +PFNGLCOLOR3HNVPROC __glewColor3hNV = NULL; +PFNGLCOLOR3HVNVPROC __glewColor3hvNV = NULL; +PFNGLCOLOR4HNVPROC __glewColor4hNV = NULL; +PFNGLCOLOR4HVNVPROC __glewColor4hvNV = NULL; +PFNGLFOGCOORDHNVPROC __glewFogCoordhNV = NULL; +PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV = NULL; +PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV = NULL; +PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV = NULL; +PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV = NULL; +PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV = NULL; +PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV = NULL; +PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV = NULL; +PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV = NULL; +PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV = NULL; +PFNGLNORMAL3HNVPROC __glewNormal3hNV = NULL; +PFNGLNORMAL3HVNVPROC __glewNormal3hvNV = NULL; +PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV = NULL; +PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV = NULL; +PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV = NULL; +PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV = NULL; +PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV = NULL; +PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV = NULL; +PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV = NULL; +PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV = NULL; +PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV = NULL; +PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV = NULL; +PFNGLVERTEX2HNVPROC __glewVertex2hNV = NULL; +PFNGLVERTEX2HVNVPROC __glewVertex2hvNV = NULL; +PFNGLVERTEX3HNVPROC __glewVertex3hNV = NULL; +PFNGLVERTEX3HVNVPROC __glewVertex3hvNV = NULL; +PFNGLVERTEX4HNVPROC __glewVertex4hNV = NULL; +PFNGLVERTEX4HVNVPROC __glewVertex4hvNV = NULL; +PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV = NULL; +PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV = NULL; +PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV = NULL; +PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV = NULL; +PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV = NULL; +PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV = NULL; +PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV = NULL; +PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV = NULL; +PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV = NULL; +PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV = NULL; +PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV = NULL; +PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV = NULL; +PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV = NULL; +PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV = NULL; + +PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV = NULL; +PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV = NULL; +PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV = NULL; +PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV = NULL; +PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV = NULL; +PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV = NULL; +PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV = NULL; + +PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV = NULL; +PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV = NULL; +PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV = NULL; + +PFNGLCOPYPATHNVPROC __glewCopyPathNV = NULL; +PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV = NULL; +PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV = NULL; +PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV = NULL; +PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV = NULL; +PFNGLDELETEPATHSNVPROC __glewDeletePathsNV = NULL; +PFNGLGENPATHSNVPROC __glewGenPathsNV = NULL; +PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV = NULL; +PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV = NULL; +PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV = NULL; +PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV = NULL; +PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV = NULL; +PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV = NULL; +PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV = NULL; +PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV = NULL; +PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV = NULL; +PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV = NULL; +PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV = NULL; +PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV = NULL; +PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV = NULL; +PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV = NULL; +PFNGLISPATHNVPROC __glewIsPathNV = NULL; +PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV = NULL; +PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV = NULL; +PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV = NULL; +PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV = NULL; +PFNGLPATHCOORDSNVPROC __glewPathCoordsNV = NULL; +PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV = NULL; +PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV = NULL; +PFNGLPATHFOGGENNVPROC __glewPathFogGenNV = NULL; +PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV = NULL; +PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV = NULL; +PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV = NULL; +PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV = NULL; +PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV = NULL; +PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV = NULL; +PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV = NULL; +PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV = NULL; +PFNGLPATHSTRINGNVPROC __glewPathStringNV = NULL; +PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV = NULL; +PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV = NULL; +PFNGLPATHTEXGENNVPROC __glewPathTexGenNV = NULL; +PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV = NULL; +PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV = NULL; +PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV = NULL; +PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV = NULL; +PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV = NULL; +PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV = NULL; +PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV = NULL; + +PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV = NULL; +PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV = NULL; + +PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV = NULL; +PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV = NULL; + +PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV = NULL; +PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV = NULL; +PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV = NULL; +PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV = NULL; +PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV = NULL; +PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV = NULL; + +PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV = NULL; +PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV = NULL; + +PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV = NULL; +PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV = NULL; +PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV = NULL; +PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV = NULL; +PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV = NULL; +PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV = NULL; +PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV = NULL; +PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV = NULL; +PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV = NULL; +PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV = NULL; +PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV = NULL; +PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV = NULL; +PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV = NULL; + +PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV = NULL; +PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV = NULL; + +PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV = NULL; +PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV = NULL; +PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV = NULL; +PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV = NULL; +PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV = NULL; +PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV = NULL; +PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV = NULL; +PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV = NULL; +PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV = NULL; +PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV = NULL; +PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV = NULL; +PFNGLUNIFORMUI64NVPROC __glewUniformui64NV = NULL; +PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV = NULL; + +PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV = NULL; + +PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV = NULL; +PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV = NULL; +PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV = NULL; +PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV = NULL; +PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV = NULL; +PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV = NULL; + +PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV = NULL; +PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV = NULL; +PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV = NULL; +PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV = NULL; +PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV = NULL; +PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV = NULL; +PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV = NULL; +PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV = NULL; +PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV = NULL; +PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV = NULL; +PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV = NULL; + +PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV = NULL; +PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV = NULL; +PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV = NULL; +PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV = NULL; +PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV = NULL; +PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV = NULL; +PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV = NULL; + +PFNGLVDPAUFININVPROC __glewVDPAUFiniNV = NULL; +PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV = NULL; +PFNGLVDPAUINITNVPROC __glewVDPAUInitNV = NULL; +PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV = NULL; +PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV = NULL; +PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV = NULL; +PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV = NULL; +PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV = NULL; +PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV = NULL; +PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV = NULL; + +PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV = NULL; +PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV = NULL; + +PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV = NULL; +PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV = NULL; +PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV = NULL; +PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV = NULL; +PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV = NULL; +PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV = NULL; +PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV = NULL; +PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV = NULL; +PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV = NULL; +PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV = NULL; +PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV = NULL; +PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV = NULL; +PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV = NULL; +PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV = NULL; +PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV = NULL; +PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV = NULL; +PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV = NULL; +PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV = NULL; +PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV = NULL; + +PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV = NULL; +PFNGLCOLORFORMATNVPROC __glewColorFormatNV = NULL; +PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV = NULL; +PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV = NULL; +PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV = NULL; +PFNGLINDEXFORMATNVPROC __glewIndexFormatNV = NULL; +PFNGLNORMALFORMATNVPROC __glewNormalFormatNV = NULL; +PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV = NULL; +PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV = NULL; +PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV = NULL; +PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV = NULL; +PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV = NULL; + +PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV = NULL; +PFNGLBINDPROGRAMNVPROC __glewBindProgramNV = NULL; +PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV = NULL; +PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV = NULL; +PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV = NULL; +PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV = NULL; +PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV = NULL; +PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV = NULL; +PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV = NULL; +PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV = NULL; +PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV = NULL; +PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV = NULL; +PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV = NULL; +PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV = NULL; +PFNGLISPROGRAMNVPROC __glewIsProgramNV = NULL; +PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV = NULL; +PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV = NULL; +PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV = NULL; +PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV = NULL; +PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV = NULL; +PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV = NULL; +PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV = NULL; +PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV = NULL; +PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV = NULL; +PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV = NULL; +PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV = NULL; +PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV = NULL; +PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV = NULL; +PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV = NULL; +PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV = NULL; +PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV = NULL; +PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV = NULL; +PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV = NULL; +PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV = NULL; +PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV = NULL; +PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV = NULL; +PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV = NULL; +PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV = NULL; +PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV = NULL; +PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV = NULL; +PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV = NULL; +PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV = NULL; +PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV = NULL; +PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV = NULL; +PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV = NULL; +PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV = NULL; +PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV = NULL; +PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV = NULL; +PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV = NULL; +PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV = NULL; +PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV = NULL; +PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV = NULL; +PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV = NULL; +PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV = NULL; +PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV = NULL; +PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV = NULL; +PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV = NULL; +PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV = NULL; +PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV = NULL; +PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV = NULL; +PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV = NULL; +PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV = NULL; +PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV = NULL; +PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV = NULL; + +PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV = NULL; +PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV = NULL; +PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV = NULL; +PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV = NULL; +PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV = NULL; +PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV = NULL; +PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV = NULL; +PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV = NULL; +PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV = NULL; +PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV = NULL; +PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV = NULL; +PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV = NULL; + +PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES = NULL; +PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES = NULL; +PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES = NULL; +PFNGLFRUSTUMFOESPROC __glewFrustumfOES = NULL; +PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES = NULL; +PFNGLORTHOFOESPROC __glewOrthofOES = NULL; + +PFNGLALPHAFUNCXPROC __glewAlphaFuncx = NULL; +PFNGLCLEARCOLORXPROC __glewClearColorx = NULL; +PFNGLCLEARDEPTHXPROC __glewClearDepthx = NULL; +PFNGLCOLOR4XPROC __glewColor4x = NULL; +PFNGLDEPTHRANGEXPROC __glewDepthRangex = NULL; +PFNGLFOGXPROC __glewFogx = NULL; +PFNGLFOGXVPROC __glewFogxv = NULL; +PFNGLFRUSTUMFPROC __glewFrustumf = NULL; +PFNGLFRUSTUMXPROC __glewFrustumx = NULL; +PFNGLLIGHTMODELXPROC __glewLightModelx = NULL; +PFNGLLIGHTMODELXVPROC __glewLightModelxv = NULL; +PFNGLLIGHTXPROC __glewLightx = NULL; +PFNGLLIGHTXVPROC __glewLightxv = NULL; +PFNGLLINEWIDTHXPROC __glewLineWidthx = NULL; +PFNGLLOADMATRIXXPROC __glewLoadMatrixx = NULL; +PFNGLMATERIALXPROC __glewMaterialx = NULL; +PFNGLMATERIALXVPROC __glewMaterialxv = NULL; +PFNGLMULTMATRIXXPROC __glewMultMatrixx = NULL; +PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x = NULL; +PFNGLNORMAL3XPROC __glewNormal3x = NULL; +PFNGLORTHOFPROC __glewOrthof = NULL; +PFNGLORTHOXPROC __glewOrthox = NULL; +PFNGLPOINTSIZEXPROC __glewPointSizex = NULL; +PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx = NULL; +PFNGLROTATEXPROC __glewRotatex = NULL; +PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex = NULL; +PFNGLSCALEXPROC __glewScalex = NULL; +PFNGLTEXENVXPROC __glewTexEnvx = NULL; +PFNGLTEXENVXVPROC __glewTexEnvxv = NULL; +PFNGLTEXPARAMETERXPROC __glewTexParameterx = NULL; +PFNGLTRANSLATEXPROC __glewTranslatex = NULL; + +PFNGLCLIPPLANEFPROC __glewClipPlanef = NULL; +PFNGLCLIPPLANEXPROC __glewClipPlanex = NULL; +PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef = NULL; +PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex = NULL; +PFNGLGETFIXEDVPROC __glewGetFixedv = NULL; +PFNGLGETLIGHTXVPROC __glewGetLightxv = NULL; +PFNGLGETMATERIALXVPROC __glewGetMaterialxv = NULL; +PFNGLGETTEXENVXVPROC __glewGetTexEnvxv = NULL; +PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv = NULL; +PFNGLPOINTPARAMETERXPROC __glewPointParameterx = NULL; +PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv = NULL; +PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES = NULL; +PFNGLTEXPARAMETERXVPROC __glewTexParameterxv = NULL; + +PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL = NULL; + +PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL = NULL; +PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL = NULL; + +PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL = NULL; + +PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS = NULL; +PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS = NULL; + +PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS = NULL; +PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS = NULL; + +PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS = NULL; +PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS = NULL; + +PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS = NULL; +PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS = NULL; + +PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS = NULL; +PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS = NULL; + +PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS = NULL; +PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS = NULL; + +PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX = NULL; +PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX = NULL; +PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX = NULL; +PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX = NULL; +PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX = NULL; +PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX = NULL; + +PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX = NULL; + +PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX = NULL; + +PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX = NULL; +PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX = NULL; +PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX = NULL; +PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX = NULL; +PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX = NULL; +PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX = NULL; +PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX = NULL; +PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX = NULL; +PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX = NULL; +PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX = NULL; +PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX = NULL; +PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX = NULL; +PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX = NULL; + +PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX = NULL; + +PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX = NULL; + +PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX = NULL; + +PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX = NULL; +PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX = NULL; +PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX = NULL; +PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX = NULL; + +PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX = NULL; + +PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI = NULL; +PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI = NULL; +PFNGLCOLORTABLESGIPROC __glewColorTableSGI = NULL; +PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI = NULL; +PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI = NULL; +PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI = NULL; +PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI = NULL; + +PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX = NULL; + +PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN = NULL; +PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN = NULL; +PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN = NULL; +PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN = NULL; +PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN = NULL; +PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN = NULL; +PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN = NULL; +PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN = NULL; + +PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN = NULL; + +PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN = NULL; +PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN = NULL; +PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN = NULL; +PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN = NULL; +PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN = NULL; +PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN = NULL; +PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN = NULL; + +PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN = NULL; +PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN = NULL; +PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN = NULL; +PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN = NULL; +PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN = NULL; +PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN = NULL; +PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN = NULL; +PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN = NULL; +PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN = NULL; +PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN = NULL; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN = NULL; +PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN = NULL; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN = NULL; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN = NULL; +PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN = NULL; +PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN = NULL; + +PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN = NULL; + +#endif /* !WIN32 || !GLEW_MX */ + +#if !defined(GLEW_MX) + +GLboolean __GLEW_VERSION_1_1 = GL_FALSE; +GLboolean __GLEW_VERSION_1_2 = GL_FALSE; +GLboolean __GLEW_VERSION_1_2_1 = GL_FALSE; +GLboolean __GLEW_VERSION_1_3 = GL_FALSE; +GLboolean __GLEW_VERSION_1_4 = GL_FALSE; +GLboolean __GLEW_VERSION_1_5 = GL_FALSE; +GLboolean __GLEW_VERSION_2_0 = GL_FALSE; +GLboolean __GLEW_VERSION_2_1 = GL_FALSE; +GLboolean __GLEW_VERSION_3_0 = GL_FALSE; +GLboolean __GLEW_VERSION_3_1 = GL_FALSE; +GLboolean __GLEW_VERSION_3_2 = GL_FALSE; +GLboolean __GLEW_VERSION_3_3 = GL_FALSE; +GLboolean __GLEW_VERSION_4_0 = GL_FALSE; +GLboolean __GLEW_VERSION_4_1 = GL_FALSE; +GLboolean __GLEW_VERSION_4_2 = GL_FALSE; +GLboolean __GLEW_VERSION_4_3 = GL_FALSE; +GLboolean __GLEW_VERSION_4_4 = GL_FALSE; +GLboolean __GLEW_3DFX_multisample = GL_FALSE; +GLboolean __GLEW_3DFX_tbuffer = GL_FALSE; +GLboolean __GLEW_3DFX_texture_compression_FXT1 = GL_FALSE; +GLboolean __GLEW_AMD_blend_minmax_factor = GL_FALSE; +GLboolean __GLEW_AMD_conservative_depth = GL_FALSE; +GLboolean __GLEW_AMD_debug_output = GL_FALSE; +GLboolean __GLEW_AMD_depth_clamp_separate = GL_FALSE; +GLboolean __GLEW_AMD_draw_buffers_blend = GL_FALSE; +GLboolean __GLEW_AMD_interleaved_elements = GL_FALSE; +GLboolean __GLEW_AMD_multi_draw_indirect = GL_FALSE; +GLboolean __GLEW_AMD_name_gen_delete = GL_FALSE; +GLboolean __GLEW_AMD_performance_monitor = GL_FALSE; +GLboolean __GLEW_AMD_pinned_memory = GL_FALSE; +GLboolean __GLEW_AMD_query_buffer_object = GL_FALSE; +GLboolean __GLEW_AMD_sample_positions = GL_FALSE; +GLboolean __GLEW_AMD_seamless_cubemap_per_texture = GL_FALSE; +GLboolean __GLEW_AMD_shader_stencil_export = GL_FALSE; +GLboolean __GLEW_AMD_shader_trinary_minmax = GL_FALSE; +GLboolean __GLEW_AMD_sparse_texture = GL_FALSE; +GLboolean __GLEW_AMD_stencil_operation_extended = GL_FALSE; +GLboolean __GLEW_AMD_texture_texture4 = GL_FALSE; +GLboolean __GLEW_AMD_transform_feedback3_lines_triangles = GL_FALSE; +GLboolean __GLEW_AMD_vertex_shader_layer = GL_FALSE; +GLboolean __GLEW_AMD_vertex_shader_tessellator = GL_FALSE; +GLboolean __GLEW_AMD_vertex_shader_viewport_index = GL_FALSE; +GLboolean __GLEW_ANGLE_depth_texture = GL_FALSE; +GLboolean __GLEW_ANGLE_framebuffer_blit = GL_FALSE; +GLboolean __GLEW_ANGLE_framebuffer_multisample = GL_FALSE; +GLboolean __GLEW_ANGLE_instanced_arrays = GL_FALSE; +GLboolean __GLEW_ANGLE_pack_reverse_row_order = GL_FALSE; +GLboolean __GLEW_ANGLE_program_binary = GL_FALSE; +GLboolean __GLEW_ANGLE_texture_compression_dxt1 = GL_FALSE; +GLboolean __GLEW_ANGLE_texture_compression_dxt3 = GL_FALSE; +GLboolean __GLEW_ANGLE_texture_compression_dxt5 = GL_FALSE; +GLboolean __GLEW_ANGLE_texture_usage = GL_FALSE; +GLboolean __GLEW_ANGLE_timer_query = GL_FALSE; +GLboolean __GLEW_ANGLE_translated_shader_source = GL_FALSE; +GLboolean __GLEW_APPLE_aux_depth_stencil = GL_FALSE; +GLboolean __GLEW_APPLE_client_storage = GL_FALSE; +GLboolean __GLEW_APPLE_element_array = GL_FALSE; +GLboolean __GLEW_APPLE_fence = GL_FALSE; +GLboolean __GLEW_APPLE_float_pixels = GL_FALSE; +GLboolean __GLEW_APPLE_flush_buffer_range = GL_FALSE; +GLboolean __GLEW_APPLE_object_purgeable = GL_FALSE; +GLboolean __GLEW_APPLE_pixel_buffer = GL_FALSE; +GLboolean __GLEW_APPLE_rgb_422 = GL_FALSE; +GLboolean __GLEW_APPLE_row_bytes = GL_FALSE; +GLboolean __GLEW_APPLE_specular_vector = GL_FALSE; +GLboolean __GLEW_APPLE_texture_range = GL_FALSE; +GLboolean __GLEW_APPLE_transform_hint = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_array_object = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_array_range = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_program_evaluators = GL_FALSE; +GLboolean __GLEW_APPLE_ycbcr_422 = GL_FALSE; +GLboolean __GLEW_ARB_ES2_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_ES3_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_arrays_of_arrays = GL_FALSE; +GLboolean __GLEW_ARB_base_instance = GL_FALSE; +GLboolean __GLEW_ARB_bindless_texture = GL_FALSE; +GLboolean __GLEW_ARB_blend_func_extended = GL_FALSE; +GLboolean __GLEW_ARB_buffer_storage = GL_FALSE; +GLboolean __GLEW_ARB_cl_event = GL_FALSE; +GLboolean __GLEW_ARB_clear_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_clear_texture = GL_FALSE; +GLboolean __GLEW_ARB_color_buffer_float = GL_FALSE; +GLboolean __GLEW_ARB_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_compressed_texture_pixel_storage = GL_FALSE; +GLboolean __GLEW_ARB_compute_shader = GL_FALSE; +GLboolean __GLEW_ARB_compute_variable_group_size = GL_FALSE; +GLboolean __GLEW_ARB_conservative_depth = GL_FALSE; +GLboolean __GLEW_ARB_copy_buffer = GL_FALSE; +GLboolean __GLEW_ARB_copy_image = GL_FALSE; +GLboolean __GLEW_ARB_debug_output = GL_FALSE; +GLboolean __GLEW_ARB_depth_buffer_float = GL_FALSE; +GLboolean __GLEW_ARB_depth_clamp = GL_FALSE; +GLboolean __GLEW_ARB_depth_texture = GL_FALSE; +GLboolean __GLEW_ARB_draw_buffers = GL_FALSE; +GLboolean __GLEW_ARB_draw_buffers_blend = GL_FALSE; +GLboolean __GLEW_ARB_draw_elements_base_vertex = GL_FALSE; +GLboolean __GLEW_ARB_draw_indirect = GL_FALSE; +GLboolean __GLEW_ARB_draw_instanced = GL_FALSE; +GLboolean __GLEW_ARB_enhanced_layouts = GL_FALSE; +GLboolean __GLEW_ARB_explicit_attrib_location = GL_FALSE; +GLboolean __GLEW_ARB_explicit_uniform_location = GL_FALSE; +GLboolean __GLEW_ARB_fragment_coord_conventions = GL_FALSE; +GLboolean __GLEW_ARB_fragment_layer_viewport = GL_FALSE; +GLboolean __GLEW_ARB_fragment_program = GL_FALSE; +GLboolean __GLEW_ARB_fragment_program_shadow = GL_FALSE; +GLboolean __GLEW_ARB_fragment_shader = GL_FALSE; +GLboolean __GLEW_ARB_framebuffer_no_attachments = GL_FALSE; +GLboolean __GLEW_ARB_framebuffer_object = GL_FALSE; +GLboolean __GLEW_ARB_framebuffer_sRGB = GL_FALSE; +GLboolean __GLEW_ARB_geometry_shader4 = GL_FALSE; +GLboolean __GLEW_ARB_get_program_binary = GL_FALSE; +GLboolean __GLEW_ARB_gpu_shader5 = GL_FALSE; +GLboolean __GLEW_ARB_gpu_shader_fp64 = GL_FALSE; +GLboolean __GLEW_ARB_half_float_pixel = GL_FALSE; +GLboolean __GLEW_ARB_half_float_vertex = GL_FALSE; +GLboolean __GLEW_ARB_imaging = GL_FALSE; +GLboolean __GLEW_ARB_indirect_parameters = GL_FALSE; +GLboolean __GLEW_ARB_instanced_arrays = GL_FALSE; +GLboolean __GLEW_ARB_internalformat_query = GL_FALSE; +GLboolean __GLEW_ARB_internalformat_query2 = GL_FALSE; +GLboolean __GLEW_ARB_invalidate_subdata = GL_FALSE; +GLboolean __GLEW_ARB_map_buffer_alignment = GL_FALSE; +GLboolean __GLEW_ARB_map_buffer_range = GL_FALSE; +GLboolean __GLEW_ARB_matrix_palette = GL_FALSE; +GLboolean __GLEW_ARB_multi_bind = GL_FALSE; +GLboolean __GLEW_ARB_multi_draw_indirect = GL_FALSE; +GLboolean __GLEW_ARB_multisample = GL_FALSE; +GLboolean __GLEW_ARB_multitexture = GL_FALSE; +GLboolean __GLEW_ARB_occlusion_query = GL_FALSE; +GLboolean __GLEW_ARB_occlusion_query2 = GL_FALSE; +GLboolean __GLEW_ARB_pixel_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_point_parameters = GL_FALSE; +GLboolean __GLEW_ARB_point_sprite = GL_FALSE; +GLboolean __GLEW_ARB_program_interface_query = GL_FALSE; +GLboolean __GLEW_ARB_provoking_vertex = GL_FALSE; +GLboolean __GLEW_ARB_query_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_robust_buffer_access_behavior = GL_FALSE; +GLboolean __GLEW_ARB_robustness = GL_FALSE; +GLboolean __GLEW_ARB_robustness_application_isolation = GL_FALSE; +GLboolean __GLEW_ARB_robustness_share_group_isolation = GL_FALSE; +GLboolean __GLEW_ARB_sample_shading = GL_FALSE; +GLboolean __GLEW_ARB_sampler_objects = GL_FALSE; +GLboolean __GLEW_ARB_seamless_cube_map = GL_FALSE; +GLboolean __GLEW_ARB_seamless_cubemap_per_texture = GL_FALSE; +GLboolean __GLEW_ARB_separate_shader_objects = GL_FALSE; +GLboolean __GLEW_ARB_shader_atomic_counters = GL_FALSE; +GLboolean __GLEW_ARB_shader_bit_encoding = GL_FALSE; +GLboolean __GLEW_ARB_shader_draw_parameters = GL_FALSE; +GLboolean __GLEW_ARB_shader_group_vote = GL_FALSE; +GLboolean __GLEW_ARB_shader_image_load_store = GL_FALSE; +GLboolean __GLEW_ARB_shader_image_size = GL_FALSE; +GLboolean __GLEW_ARB_shader_objects = GL_FALSE; +GLboolean __GLEW_ARB_shader_precision = GL_FALSE; +GLboolean __GLEW_ARB_shader_stencil_export = GL_FALSE; +GLboolean __GLEW_ARB_shader_storage_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_shader_subroutine = GL_FALSE; +GLboolean __GLEW_ARB_shader_texture_lod = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_100 = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_420pack = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_include = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_packing = GL_FALSE; +GLboolean __GLEW_ARB_shadow = GL_FALSE; +GLboolean __GLEW_ARB_shadow_ambient = GL_FALSE; +GLboolean __GLEW_ARB_sparse_texture = GL_FALSE; +GLboolean __GLEW_ARB_stencil_texturing = GL_FALSE; +GLboolean __GLEW_ARB_sync = GL_FALSE; +GLboolean __GLEW_ARB_tessellation_shader = GL_FALSE; +GLboolean __GLEW_ARB_texture_border_clamp = GL_FALSE; +GLboolean __GLEW_ARB_texture_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_texture_buffer_object_rgb32 = GL_FALSE; +GLboolean __GLEW_ARB_texture_buffer_range = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression_bptc = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression_rgtc = GL_FALSE; +GLboolean __GLEW_ARB_texture_cube_map = GL_FALSE; +GLboolean __GLEW_ARB_texture_cube_map_array = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_add = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_combine = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_crossbar = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_dot3 = GL_FALSE; +GLboolean __GLEW_ARB_texture_float = GL_FALSE; +GLboolean __GLEW_ARB_texture_gather = GL_FALSE; +GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge = GL_FALSE; +GLboolean __GLEW_ARB_texture_mirrored_repeat = GL_FALSE; +GLboolean __GLEW_ARB_texture_multisample = GL_FALSE; +GLboolean __GLEW_ARB_texture_non_power_of_two = GL_FALSE; +GLboolean __GLEW_ARB_texture_query_levels = GL_FALSE; +GLboolean __GLEW_ARB_texture_query_lod = GL_FALSE; +GLboolean __GLEW_ARB_texture_rectangle = GL_FALSE; +GLboolean __GLEW_ARB_texture_rg = GL_FALSE; +GLboolean __GLEW_ARB_texture_rgb10_a2ui = GL_FALSE; +GLboolean __GLEW_ARB_texture_stencil8 = GL_FALSE; +GLboolean __GLEW_ARB_texture_storage = GL_FALSE; +GLboolean __GLEW_ARB_texture_storage_multisample = GL_FALSE; +GLboolean __GLEW_ARB_texture_swizzle = GL_FALSE; +GLboolean __GLEW_ARB_texture_view = GL_FALSE; +GLboolean __GLEW_ARB_timer_query = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback2 = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback3 = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback_instanced = GL_FALSE; +GLboolean __GLEW_ARB_transpose_matrix = GL_FALSE; +GLboolean __GLEW_ARB_uniform_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_array_bgra = GL_FALSE; +GLboolean __GLEW_ARB_vertex_array_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_attrib_64bit = GL_FALSE; +GLboolean __GLEW_ARB_vertex_attrib_binding = GL_FALSE; +GLboolean __GLEW_ARB_vertex_blend = GL_FALSE; +GLboolean __GLEW_ARB_vertex_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_program = GL_FALSE; +GLboolean __GLEW_ARB_vertex_shader = GL_FALSE; +GLboolean __GLEW_ARB_vertex_type_10f_11f_11f_rev = GL_FALSE; +GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev = GL_FALSE; +GLboolean __GLEW_ARB_viewport_array = GL_FALSE; +GLboolean __GLEW_ARB_window_pos = GL_FALSE; +GLboolean __GLEW_ATIX_point_sprites = GL_FALSE; +GLboolean __GLEW_ATIX_texture_env_combine3 = GL_FALSE; +GLboolean __GLEW_ATIX_texture_env_route = GL_FALSE; +GLboolean __GLEW_ATIX_vertex_shader_output_point_size = GL_FALSE; +GLboolean __GLEW_ATI_draw_buffers = GL_FALSE; +GLboolean __GLEW_ATI_element_array = GL_FALSE; +GLboolean __GLEW_ATI_envmap_bumpmap = GL_FALSE; +GLboolean __GLEW_ATI_fragment_shader = GL_FALSE; +GLboolean __GLEW_ATI_map_object_buffer = GL_FALSE; +GLboolean __GLEW_ATI_meminfo = GL_FALSE; +GLboolean __GLEW_ATI_pn_triangles = GL_FALSE; +GLboolean __GLEW_ATI_separate_stencil = GL_FALSE; +GLboolean __GLEW_ATI_shader_texture_lod = GL_FALSE; +GLboolean __GLEW_ATI_text_fragment_shader = GL_FALSE; +GLboolean __GLEW_ATI_texture_compression_3dc = GL_FALSE; +GLboolean __GLEW_ATI_texture_env_combine3 = GL_FALSE; +GLboolean __GLEW_ATI_texture_float = GL_FALSE; +GLboolean __GLEW_ATI_texture_mirror_once = GL_FALSE; +GLboolean __GLEW_ATI_vertex_array_object = GL_FALSE; +GLboolean __GLEW_ATI_vertex_attrib_array_object = GL_FALSE; +GLboolean __GLEW_ATI_vertex_streams = GL_FALSE; +GLboolean __GLEW_EXT_422_pixels = GL_FALSE; +GLboolean __GLEW_EXT_Cg_shader = GL_FALSE; +GLboolean __GLEW_EXT_abgr = GL_FALSE; +GLboolean __GLEW_EXT_bgra = GL_FALSE; +GLboolean __GLEW_EXT_bindable_uniform = GL_FALSE; +GLboolean __GLEW_EXT_blend_color = GL_FALSE; +GLboolean __GLEW_EXT_blend_equation_separate = GL_FALSE; +GLboolean __GLEW_EXT_blend_func_separate = GL_FALSE; +GLboolean __GLEW_EXT_blend_logic_op = GL_FALSE; +GLboolean __GLEW_EXT_blend_minmax = GL_FALSE; +GLboolean __GLEW_EXT_blend_subtract = GL_FALSE; +GLboolean __GLEW_EXT_clip_volume_hint = GL_FALSE; +GLboolean __GLEW_EXT_cmyka = GL_FALSE; +GLboolean __GLEW_EXT_color_subtable = GL_FALSE; +GLboolean __GLEW_EXT_compiled_vertex_array = GL_FALSE; +GLboolean __GLEW_EXT_convolution = GL_FALSE; +GLboolean __GLEW_EXT_coordinate_frame = GL_FALSE; +GLboolean __GLEW_EXT_copy_texture = GL_FALSE; +GLboolean __GLEW_EXT_cull_vertex = GL_FALSE; +GLboolean __GLEW_EXT_debug_marker = GL_FALSE; +GLboolean __GLEW_EXT_depth_bounds_test = GL_FALSE; +GLboolean __GLEW_EXT_direct_state_access = GL_FALSE; +GLboolean __GLEW_EXT_draw_buffers2 = GL_FALSE; +GLboolean __GLEW_EXT_draw_instanced = GL_FALSE; +GLboolean __GLEW_EXT_draw_range_elements = GL_FALSE; +GLboolean __GLEW_EXT_fog_coord = GL_FALSE; +GLboolean __GLEW_EXT_fragment_lighting = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_blit = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_multisample = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_object = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean __GLEW_EXT_geometry_shader4 = GL_FALSE; +GLboolean __GLEW_EXT_gpu_program_parameters = GL_FALSE; +GLboolean __GLEW_EXT_gpu_shader4 = GL_FALSE; +GLboolean __GLEW_EXT_histogram = GL_FALSE; +GLboolean __GLEW_EXT_index_array_formats = GL_FALSE; +GLboolean __GLEW_EXT_index_func = GL_FALSE; +GLboolean __GLEW_EXT_index_material = GL_FALSE; +GLboolean __GLEW_EXT_index_texture = GL_FALSE; +GLboolean __GLEW_EXT_light_texture = GL_FALSE; +GLboolean __GLEW_EXT_misc_attribute = GL_FALSE; +GLboolean __GLEW_EXT_multi_draw_arrays = GL_FALSE; +GLboolean __GLEW_EXT_multisample = GL_FALSE; +GLboolean __GLEW_EXT_packed_depth_stencil = GL_FALSE; +GLboolean __GLEW_EXT_packed_float = GL_FALSE; +GLboolean __GLEW_EXT_packed_pixels = GL_FALSE; +GLboolean __GLEW_EXT_paletted_texture = GL_FALSE; +GLboolean __GLEW_EXT_pixel_buffer_object = GL_FALSE; +GLboolean __GLEW_EXT_pixel_transform = GL_FALSE; +GLboolean __GLEW_EXT_pixel_transform_color_table = GL_FALSE; +GLboolean __GLEW_EXT_point_parameters = GL_FALSE; +GLboolean __GLEW_EXT_polygon_offset = GL_FALSE; +GLboolean __GLEW_EXT_provoking_vertex = GL_FALSE; +GLboolean __GLEW_EXT_rescale_normal = GL_FALSE; +GLboolean __GLEW_EXT_scene_marker = GL_FALSE; +GLboolean __GLEW_EXT_secondary_color = GL_FALSE; +GLboolean __GLEW_EXT_separate_shader_objects = GL_FALSE; +GLboolean __GLEW_EXT_separate_specular_color = GL_FALSE; +GLboolean __GLEW_EXT_shader_image_load_store = GL_FALSE; +GLboolean __GLEW_EXT_shadow_funcs = GL_FALSE; +GLboolean __GLEW_EXT_shared_texture_palette = GL_FALSE; +GLboolean __GLEW_EXT_stencil_clear_tag = GL_FALSE; +GLboolean __GLEW_EXT_stencil_two_side = GL_FALSE; +GLboolean __GLEW_EXT_stencil_wrap = GL_FALSE; +GLboolean __GLEW_EXT_subtexture = GL_FALSE; +GLboolean __GLEW_EXT_texture = GL_FALSE; +GLboolean __GLEW_EXT_texture3D = GL_FALSE; +GLboolean __GLEW_EXT_texture_array = GL_FALSE; +GLboolean __GLEW_EXT_texture_buffer_object = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_dxt1 = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_latc = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_rgtc = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_s3tc = GL_FALSE; +GLboolean __GLEW_EXT_texture_cube_map = GL_FALSE; +GLboolean __GLEW_EXT_texture_edge_clamp = GL_FALSE; +GLboolean __GLEW_EXT_texture_env = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_add = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_combine = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_dot3 = GL_FALSE; +GLboolean __GLEW_EXT_texture_filter_anisotropic = GL_FALSE; +GLboolean __GLEW_EXT_texture_integer = GL_FALSE; +GLboolean __GLEW_EXT_texture_lod_bias = GL_FALSE; +GLboolean __GLEW_EXT_texture_mirror_clamp = GL_FALSE; +GLboolean __GLEW_EXT_texture_object = GL_FALSE; +GLboolean __GLEW_EXT_texture_perturb_normal = GL_FALSE; +GLboolean __GLEW_EXT_texture_rectangle = GL_FALSE; +GLboolean __GLEW_EXT_texture_sRGB = GL_FALSE; +GLboolean __GLEW_EXT_texture_sRGB_decode = GL_FALSE; +GLboolean __GLEW_EXT_texture_shared_exponent = GL_FALSE; +GLboolean __GLEW_EXT_texture_snorm = GL_FALSE; +GLboolean __GLEW_EXT_texture_swizzle = GL_FALSE; +GLboolean __GLEW_EXT_timer_query = GL_FALSE; +GLboolean __GLEW_EXT_transform_feedback = GL_FALSE; +GLboolean __GLEW_EXT_vertex_array = GL_FALSE; +GLboolean __GLEW_EXT_vertex_array_bgra = GL_FALSE; +GLboolean __GLEW_EXT_vertex_attrib_64bit = GL_FALSE; +GLboolean __GLEW_EXT_vertex_shader = GL_FALSE; +GLboolean __GLEW_EXT_vertex_weighting = GL_FALSE; +GLboolean __GLEW_EXT_x11_sync_object = GL_FALSE; +GLboolean __GLEW_GREMEDY_frame_terminator = GL_FALSE; +GLboolean __GLEW_GREMEDY_string_marker = GL_FALSE; +GLboolean __GLEW_HP_convolution_border_modes = GL_FALSE; +GLboolean __GLEW_HP_image_transform = GL_FALSE; +GLboolean __GLEW_HP_occlusion_test = GL_FALSE; +GLboolean __GLEW_HP_texture_lighting = GL_FALSE; +GLboolean __GLEW_IBM_cull_vertex = GL_FALSE; +GLboolean __GLEW_IBM_multimode_draw_arrays = GL_FALSE; +GLboolean __GLEW_IBM_rasterpos_clip = GL_FALSE; +GLboolean __GLEW_IBM_static_data = GL_FALSE; +GLboolean __GLEW_IBM_texture_mirrored_repeat = GL_FALSE; +GLboolean __GLEW_IBM_vertex_array_lists = GL_FALSE; +GLboolean __GLEW_INGR_color_clamp = GL_FALSE; +GLboolean __GLEW_INGR_interlace_read = GL_FALSE; +GLboolean __GLEW_INTEL_map_texture = GL_FALSE; +GLboolean __GLEW_INTEL_parallel_arrays = GL_FALSE; +GLboolean __GLEW_INTEL_texture_scissor = GL_FALSE; +GLboolean __GLEW_KHR_debug = GL_FALSE; +GLboolean __GLEW_KHR_texture_compression_astc_ldr = GL_FALSE; +GLboolean __GLEW_KTX_buffer_region = GL_FALSE; +GLboolean __GLEW_MESAX_texture_stack = GL_FALSE; +GLboolean __GLEW_MESA_pack_invert = GL_FALSE; +GLboolean __GLEW_MESA_resize_buffers = GL_FALSE; +GLboolean __GLEW_MESA_window_pos = GL_FALSE; +GLboolean __GLEW_MESA_ycbcr_texture = GL_FALSE; +GLboolean __GLEW_NVX_conditional_render = GL_FALSE; +GLboolean __GLEW_NVX_gpu_memory_info = GL_FALSE; +GLboolean __GLEW_NV_bindless_multi_draw_indirect = GL_FALSE; +GLboolean __GLEW_NV_bindless_texture = GL_FALSE; +GLboolean __GLEW_NV_blend_equation_advanced = GL_FALSE; +GLboolean __GLEW_NV_blend_equation_advanced_coherent = GL_FALSE; +GLboolean __GLEW_NV_blend_square = GL_FALSE; +GLboolean __GLEW_NV_compute_program5 = GL_FALSE; +GLboolean __GLEW_NV_conditional_render = GL_FALSE; +GLboolean __GLEW_NV_copy_depth_to_color = GL_FALSE; +GLboolean __GLEW_NV_copy_image = GL_FALSE; +GLboolean __GLEW_NV_deep_texture3D = GL_FALSE; +GLboolean __GLEW_NV_depth_buffer_float = GL_FALSE; +GLboolean __GLEW_NV_depth_clamp = GL_FALSE; +GLboolean __GLEW_NV_depth_range_unclamped = GL_FALSE; +GLboolean __GLEW_NV_draw_texture = GL_FALSE; +GLboolean __GLEW_NV_evaluators = GL_FALSE; +GLboolean __GLEW_NV_explicit_multisample = GL_FALSE; +GLboolean __GLEW_NV_fence = GL_FALSE; +GLboolean __GLEW_NV_float_buffer = GL_FALSE; +GLboolean __GLEW_NV_fog_distance = GL_FALSE; +GLboolean __GLEW_NV_fragment_program = GL_FALSE; +GLboolean __GLEW_NV_fragment_program2 = GL_FALSE; +GLboolean __GLEW_NV_fragment_program4 = GL_FALSE; +GLboolean __GLEW_NV_fragment_program_option = GL_FALSE; +GLboolean __GLEW_NV_framebuffer_multisample_coverage = GL_FALSE; +GLboolean __GLEW_NV_geometry_program4 = GL_FALSE; +GLboolean __GLEW_NV_geometry_shader4 = GL_FALSE; +GLboolean __GLEW_NV_gpu_program4 = GL_FALSE; +GLboolean __GLEW_NV_gpu_program5 = GL_FALSE; +GLboolean __GLEW_NV_gpu_program5_mem_extended = GL_FALSE; +GLboolean __GLEW_NV_gpu_program_fp64 = GL_FALSE; +GLboolean __GLEW_NV_gpu_shader5 = GL_FALSE; +GLboolean __GLEW_NV_half_float = GL_FALSE; +GLboolean __GLEW_NV_light_max_exponent = GL_FALSE; +GLboolean __GLEW_NV_multisample_coverage = GL_FALSE; +GLboolean __GLEW_NV_multisample_filter_hint = GL_FALSE; +GLboolean __GLEW_NV_occlusion_query = GL_FALSE; +GLboolean __GLEW_NV_packed_depth_stencil = GL_FALSE; +GLboolean __GLEW_NV_parameter_buffer_object = GL_FALSE; +GLboolean __GLEW_NV_parameter_buffer_object2 = GL_FALSE; +GLboolean __GLEW_NV_path_rendering = GL_FALSE; +GLboolean __GLEW_NV_pixel_data_range = GL_FALSE; +GLboolean __GLEW_NV_point_sprite = GL_FALSE; +GLboolean __GLEW_NV_present_video = GL_FALSE; +GLboolean __GLEW_NV_primitive_restart = GL_FALSE; +GLboolean __GLEW_NV_register_combiners = GL_FALSE; +GLboolean __GLEW_NV_register_combiners2 = GL_FALSE; +GLboolean __GLEW_NV_shader_atomic_counters = GL_FALSE; +GLboolean __GLEW_NV_shader_atomic_float = GL_FALSE; +GLboolean __GLEW_NV_shader_buffer_load = GL_FALSE; +GLboolean __GLEW_NV_shader_storage_buffer_object = GL_FALSE; +GLboolean __GLEW_NV_tessellation_program5 = GL_FALSE; +GLboolean __GLEW_NV_texgen_emboss = GL_FALSE; +GLboolean __GLEW_NV_texgen_reflection = GL_FALSE; +GLboolean __GLEW_NV_texture_barrier = GL_FALSE; +GLboolean __GLEW_NV_texture_compression_vtc = GL_FALSE; +GLboolean __GLEW_NV_texture_env_combine4 = GL_FALSE; +GLboolean __GLEW_NV_texture_expand_normal = GL_FALSE; +GLboolean __GLEW_NV_texture_multisample = GL_FALSE; +GLboolean __GLEW_NV_texture_rectangle = GL_FALSE; +GLboolean __GLEW_NV_texture_shader = GL_FALSE; +GLboolean __GLEW_NV_texture_shader2 = GL_FALSE; +GLboolean __GLEW_NV_texture_shader3 = GL_FALSE; +GLboolean __GLEW_NV_transform_feedback = GL_FALSE; +GLboolean __GLEW_NV_transform_feedback2 = GL_FALSE; +GLboolean __GLEW_NV_vdpau_interop = GL_FALSE; +GLboolean __GLEW_NV_vertex_array_range = GL_FALSE; +GLboolean __GLEW_NV_vertex_array_range2 = GL_FALSE; +GLboolean __GLEW_NV_vertex_attrib_integer_64bit = GL_FALSE; +GLboolean __GLEW_NV_vertex_buffer_unified_memory = GL_FALSE; +GLboolean __GLEW_NV_vertex_program = GL_FALSE; +GLboolean __GLEW_NV_vertex_program1_1 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program2 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program2_option = GL_FALSE; +GLboolean __GLEW_NV_vertex_program3 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program4 = GL_FALSE; +GLboolean __GLEW_NV_video_capture = GL_FALSE; +GLboolean __GLEW_OES_byte_coordinates = GL_FALSE; +GLboolean __GLEW_OES_compressed_paletted_texture = GL_FALSE; +GLboolean __GLEW_OES_read_format = GL_FALSE; +GLboolean __GLEW_OES_single_precision = GL_FALSE; +GLboolean __GLEW_OML_interlace = GL_FALSE; +GLboolean __GLEW_OML_resample = GL_FALSE; +GLboolean __GLEW_OML_subsample = GL_FALSE; +GLboolean __GLEW_PGI_misc_hints = GL_FALSE; +GLboolean __GLEW_PGI_vertex_hints = GL_FALSE; +GLboolean __GLEW_REGAL_ES1_0_compatibility = GL_FALSE; +GLboolean __GLEW_REGAL_ES1_1_compatibility = GL_FALSE; +GLboolean __GLEW_REGAL_enable = GL_FALSE; +GLboolean __GLEW_REGAL_error_string = GL_FALSE; +GLboolean __GLEW_REGAL_extension_query = GL_FALSE; +GLboolean __GLEW_REGAL_log = GL_FALSE; +GLboolean __GLEW_REND_screen_coordinates = GL_FALSE; +GLboolean __GLEW_S3_s3tc = GL_FALSE; +GLboolean __GLEW_SGIS_color_range = GL_FALSE; +GLboolean __GLEW_SGIS_detail_texture = GL_FALSE; +GLboolean __GLEW_SGIS_fog_function = GL_FALSE; +GLboolean __GLEW_SGIS_generate_mipmap = GL_FALSE; +GLboolean __GLEW_SGIS_multisample = GL_FALSE; +GLboolean __GLEW_SGIS_pixel_texture = GL_FALSE; +GLboolean __GLEW_SGIS_point_line_texgen = GL_FALSE; +GLboolean __GLEW_SGIS_sharpen_texture = GL_FALSE; +GLboolean __GLEW_SGIS_texture4D = GL_FALSE; +GLboolean __GLEW_SGIS_texture_border_clamp = GL_FALSE; +GLboolean __GLEW_SGIS_texture_edge_clamp = GL_FALSE; +GLboolean __GLEW_SGIS_texture_filter4 = GL_FALSE; +GLboolean __GLEW_SGIS_texture_lod = GL_FALSE; +GLboolean __GLEW_SGIS_texture_select = GL_FALSE; +GLboolean __GLEW_SGIX_async = GL_FALSE; +GLboolean __GLEW_SGIX_async_histogram = GL_FALSE; +GLboolean __GLEW_SGIX_async_pixel = GL_FALSE; +GLboolean __GLEW_SGIX_blend_alpha_minmax = GL_FALSE; +GLboolean __GLEW_SGIX_clipmap = GL_FALSE; +GLboolean __GLEW_SGIX_convolution_accuracy = GL_FALSE; +GLboolean __GLEW_SGIX_depth_texture = GL_FALSE; +GLboolean __GLEW_SGIX_flush_raster = GL_FALSE; +GLboolean __GLEW_SGIX_fog_offset = GL_FALSE; +GLboolean __GLEW_SGIX_fog_texture = GL_FALSE; +GLboolean __GLEW_SGIX_fragment_specular_lighting = GL_FALSE; +GLboolean __GLEW_SGIX_framezoom = GL_FALSE; +GLboolean __GLEW_SGIX_interlace = GL_FALSE; +GLboolean __GLEW_SGIX_ir_instrument1 = GL_FALSE; +GLboolean __GLEW_SGIX_list_priority = GL_FALSE; +GLboolean __GLEW_SGIX_pixel_texture = GL_FALSE; +GLboolean __GLEW_SGIX_pixel_texture_bits = GL_FALSE; +GLboolean __GLEW_SGIX_reference_plane = GL_FALSE; +GLboolean __GLEW_SGIX_resample = GL_FALSE; +GLboolean __GLEW_SGIX_shadow = GL_FALSE; +GLboolean __GLEW_SGIX_shadow_ambient = GL_FALSE; +GLboolean __GLEW_SGIX_sprite = GL_FALSE; +GLboolean __GLEW_SGIX_tag_sample_buffer = GL_FALSE; +GLboolean __GLEW_SGIX_texture_add_env = GL_FALSE; +GLboolean __GLEW_SGIX_texture_coordinate_clamp = GL_FALSE; +GLboolean __GLEW_SGIX_texture_lod_bias = GL_FALSE; +GLboolean __GLEW_SGIX_texture_multi_buffer = GL_FALSE; +GLboolean __GLEW_SGIX_texture_range = GL_FALSE; +GLboolean __GLEW_SGIX_texture_scale_bias = GL_FALSE; +GLboolean __GLEW_SGIX_vertex_preclip = GL_FALSE; +GLboolean __GLEW_SGIX_vertex_preclip_hint = GL_FALSE; +GLboolean __GLEW_SGIX_ycrcb = GL_FALSE; +GLboolean __GLEW_SGI_color_matrix = GL_FALSE; +GLboolean __GLEW_SGI_color_table = GL_FALSE; +GLboolean __GLEW_SGI_texture_color_table = GL_FALSE; +GLboolean __GLEW_SUNX_constant_data = GL_FALSE; +GLboolean __GLEW_SUN_convolution_border_modes = GL_FALSE; +GLboolean __GLEW_SUN_global_alpha = GL_FALSE; +GLboolean __GLEW_SUN_mesh_array = GL_FALSE; +GLboolean __GLEW_SUN_read_video_pixels = GL_FALSE; +GLboolean __GLEW_SUN_slice_accum = GL_FALSE; +GLboolean __GLEW_SUN_triangle_list = GL_FALSE; +GLboolean __GLEW_SUN_vertex = GL_FALSE; +GLboolean __GLEW_WIN_phong_shading = GL_FALSE; +GLboolean __GLEW_WIN_specular_fog = GL_FALSE; +GLboolean __GLEW_WIN_swap_hint = GL_FALSE; + +#endif /* !GLEW_MX */ + +#ifdef GL_VERSION_1_2 + +static GLboolean _glewInit_GL_VERSION_1_2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3D")) == NULL) || r; + r = ((glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElements")) == NULL) || r; + r = ((glTexImage3D = (PFNGLTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexImage3D")) == NULL) || r; + r = ((glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3D")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_2 */ + +#ifdef GL_VERSION_1_2_1 + +#endif /* GL_VERSION_1_2_1 */ + +#ifdef GL_VERSION_1_3 + +static GLboolean _glewInit_GL_VERSION_1_3 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveTexture = (PFNGLACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glActiveTexture")) == NULL) || r; + r = ((glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTexture")) == NULL) || r; + r = ((glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1D")) == NULL) || r; + r = ((glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2D")) == NULL) || r; + r = ((glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3D")) == NULL) || r; + r = ((glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1D")) == NULL) || r; + r = ((glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2D")) == NULL) || r; + r = ((glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3D")) == NULL) || r; + r = ((glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImage")) == NULL) || r; + r = ((glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixd")) == NULL) || r; + r = ((glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixf")) == NULL) || r; + r = ((glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixd")) == NULL) || r; + r = ((glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixf")) == NULL) || r; + r = ((glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1d")) == NULL) || r; + r = ((glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dv")) == NULL) || r; + r = ((glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1f")) == NULL) || r; + r = ((glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fv")) == NULL) || r; + r = ((glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1i")) == NULL) || r; + r = ((glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iv")) == NULL) || r; + r = ((glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1s")) == NULL) || r; + r = ((glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sv")) == NULL) || r; + r = ((glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2d")) == NULL) || r; + r = ((glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dv")) == NULL) || r; + r = ((glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2f")) == NULL) || r; + r = ((glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fv")) == NULL) || r; + r = ((glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2i")) == NULL) || r; + r = ((glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iv")) == NULL) || r; + r = ((glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2s")) == NULL) || r; + r = ((glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sv")) == NULL) || r; + r = ((glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3d")) == NULL) || r; + r = ((glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dv")) == NULL) || r; + r = ((glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3f")) == NULL) || r; + r = ((glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fv")) == NULL) || r; + r = ((glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3i")) == NULL) || r; + r = ((glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iv")) == NULL) || r; + r = ((glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3s")) == NULL) || r; + r = ((glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sv")) == NULL) || r; + r = ((glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4d")) == NULL) || r; + r = ((glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dv")) == NULL) || r; + r = ((glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4f")) == NULL) || r; + r = ((glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fv")) == NULL) || r; + r = ((glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4i")) == NULL) || r; + r = ((glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iv")) == NULL) || r; + r = ((glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4s")) == NULL) || r; + r = ((glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sv")) == NULL) || r; + r = ((glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverage")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_3 */ + +#ifdef GL_VERSION_1_4 + +static GLboolean _glewInit_GL_VERSION_1_4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendColor = (PFNGLBLENDCOLORPROC)glewGetProcAddress((const GLubyte*)"glBlendColor")) == NULL) || r; + r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; + r = ((glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparate")) == NULL) || r; + r = ((glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointer")) == NULL) || r; + r = ((glFogCoordd = (PFNGLFOGCOORDDPROC)glewGetProcAddress((const GLubyte*)"glFogCoordd")) == NULL) || r; + r = ((glFogCoorddv = (PFNGLFOGCOORDDVPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddv")) == NULL) || r; + r = ((glFogCoordf = (PFNGLFOGCOORDFPROC)glewGetProcAddress((const GLubyte*)"glFogCoordf")) == NULL) || r; + r = ((glFogCoordfv = (PFNGLFOGCOORDFVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfv")) == NULL) || r; + r = ((glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArrays")) == NULL) || r; + r = ((glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElements")) == NULL) || r; + r = ((glPointParameterf = (PFNGLPOINTPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glPointParameterf")) == NULL) || r; + r = ((glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfv")) == NULL) || r; + r = ((glPointParameteri = (PFNGLPOINTPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPointParameteri")) == NULL) || r; + r = ((glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriv")) == NULL) || r; + r = ((glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3b")) == NULL) || r; + r = ((glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bv")) == NULL) || r; + r = ((glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3d")) == NULL) || r; + r = ((glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dv")) == NULL) || r; + r = ((glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3f")) == NULL) || r; + r = ((glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fv")) == NULL) || r; + r = ((glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3i")) == NULL) || r; + r = ((glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iv")) == NULL) || r; + r = ((glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3s")) == NULL) || r; + r = ((glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sv")) == NULL) || r; + r = ((glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ub")) == NULL) || r; + r = ((glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubv")) == NULL) || r; + r = ((glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ui")) == NULL) || r; + r = ((glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiv")) == NULL) || r; + r = ((glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3us")) == NULL) || r; + r = ((glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usv")) == NULL) || r; + r = ((glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointer")) == NULL) || r; + r = ((glWindowPos2d = (PFNGLWINDOWPOS2DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2d")) == NULL) || r; + r = ((glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dv")) == NULL) || r; + r = ((glWindowPos2f = (PFNGLWINDOWPOS2FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2f")) == NULL) || r; + r = ((glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fv")) == NULL) || r; + r = ((glWindowPos2i = (PFNGLWINDOWPOS2IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2i")) == NULL) || r; + r = ((glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iv")) == NULL) || r; + r = ((glWindowPos2s = (PFNGLWINDOWPOS2SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2s")) == NULL) || r; + r = ((glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sv")) == NULL) || r; + r = ((glWindowPos3d = (PFNGLWINDOWPOS3DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3d")) == NULL) || r; + r = ((glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dv")) == NULL) || r; + r = ((glWindowPos3f = (PFNGLWINDOWPOS3FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3f")) == NULL) || r; + r = ((glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fv")) == NULL) || r; + r = ((glWindowPos3i = (PFNGLWINDOWPOS3IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3i")) == NULL) || r; + r = ((glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iv")) == NULL) || r; + r = ((glWindowPos3s = (PFNGLWINDOWPOS3SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3s")) == NULL) || r; + r = ((glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sv")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_4 */ + +#ifdef GL_VERSION_1_5 + +static GLboolean _glewInit_GL_VERSION_1_5 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQuery = (PFNGLBEGINQUERYPROC)glewGetProcAddress((const GLubyte*)"glBeginQuery")) == NULL) || r; + r = ((glBindBuffer = (PFNGLBINDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindBuffer")) == NULL) || r; + r = ((glBufferData = (PFNGLBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferData")) == NULL) || r; + r = ((glBufferSubData = (PFNGLBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferSubData")) == NULL) || r; + r = ((glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffers")) == NULL) || r; + r = ((glDeleteQueries = (PFNGLDELETEQUERIESPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueries")) == NULL) || r; + r = ((glEndQuery = (PFNGLENDQUERYPROC)glewGetProcAddress((const GLubyte*)"glEndQuery")) == NULL) || r; + r = ((glGenBuffers = (PFNGLGENBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenBuffers")) == NULL) || r; + r = ((glGenQueries = (PFNGLGENQUERIESPROC)glewGetProcAddress((const GLubyte*)"glGenQueries")) == NULL) || r; + r = ((glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteriv")) == NULL) || r; + r = ((glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointerv")) == NULL) || r; + r = ((glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubData")) == NULL) || r; + r = ((glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectiv")) == NULL) || r; + r = ((glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuiv")) == NULL) || r; + r = ((glGetQueryiv = (PFNGLGETQUERYIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryiv")) == NULL) || r; + r = ((glIsBuffer = (PFNGLISBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsBuffer")) == NULL) || r; + r = ((glIsQuery = (PFNGLISQUERYPROC)glewGetProcAddress((const GLubyte*)"glIsQuery")) == NULL) || r; + r = ((glMapBuffer = (PFNGLMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glMapBuffer")) == NULL) || r; + r = ((glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glUnmapBuffer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_5 */ + +#ifdef GL_VERSION_2_0 + +static GLboolean _glewInit_GL_VERSION_2_0 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAttachShader = (PFNGLATTACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glAttachShader")) == NULL) || r; + r = ((glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocation")) == NULL) || r; + r = ((glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparate")) == NULL) || r; + r = ((glCompileShader = (PFNGLCOMPILESHADERPROC)glewGetProcAddress((const GLubyte*)"glCompileShader")) == NULL) || r; + r = ((glCreateProgram = (PFNGLCREATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glCreateProgram")) == NULL) || r; + r = ((glCreateShader = (PFNGLCREATESHADERPROC)glewGetProcAddress((const GLubyte*)"glCreateShader")) == NULL) || r; + r = ((glDeleteProgram = (PFNGLDELETEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgram")) == NULL) || r; + r = ((glDeleteShader = (PFNGLDELETESHADERPROC)glewGetProcAddress((const GLubyte*)"glDeleteShader")) == NULL) || r; + r = ((glDetachShader = (PFNGLDETACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glDetachShader")) == NULL) || r; + r = ((glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArray")) == NULL) || r; + r = ((glDrawBuffers = (PFNGLDRAWBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffers")) == NULL) || r; + r = ((glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArray")) == NULL) || r; + r = ((glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttrib")) == NULL) || r; + r = ((glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniform")) == NULL) || r; + r = ((glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedShaders")) == NULL) || r; + r = ((glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocation")) == NULL) || r; + r = ((glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInfoLog")) == NULL) || r; + r = ((glGetProgramiv = (PFNGLGETPROGRAMIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramiv")) == NULL) || r; + r = ((glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetShaderInfoLog")) == NULL) || r; + r = ((glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSource")) == NULL) || r; + r = ((glGetShaderiv = (PFNGLGETSHADERIVPROC)glewGetProcAddress((const GLubyte*)"glGetShaderiv")) == NULL) || r; + r = ((glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocation")) == NULL) || r; + r = ((glGetUniformfv = (PFNGLGETUNIFORMFVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfv")) == NULL) || r; + r = ((glGetUniformiv = (PFNGLGETUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformiv")) == NULL) || r; + r = ((glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointerv")) == NULL) || r; + r = ((glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdv")) == NULL) || r; + r = ((glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfv")) == NULL) || r; + r = ((glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribiv")) == NULL) || r; + r = ((glIsProgram = (PFNGLISPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glIsProgram")) == NULL) || r; + r = ((glIsShader = (PFNGLISSHADERPROC)glewGetProcAddress((const GLubyte*)"glIsShader")) == NULL) || r; + r = ((glLinkProgram = (PFNGLLINKPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glLinkProgram")) == NULL) || r; + r = ((glShaderSource = (PFNGLSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glShaderSource")) == NULL) || r; + r = ((glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparate")) == NULL) || r; + r = ((glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilMaskSeparate")) == NULL) || r; + r = ((glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparate")) == NULL) || r; + r = ((glUniform1f = (PFNGLUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glUniform1f")) == NULL) || r; + r = ((glUniform1fv = (PFNGLUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glUniform1fv")) == NULL) || r; + r = ((glUniform1i = (PFNGLUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glUniform1i")) == NULL) || r; + r = ((glUniform1iv = (PFNGLUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glUniform1iv")) == NULL) || r; + r = ((glUniform2f = (PFNGLUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glUniform2f")) == NULL) || r; + r = ((glUniform2fv = (PFNGLUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glUniform2fv")) == NULL) || r; + r = ((glUniform2i = (PFNGLUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glUniform2i")) == NULL) || r; + r = ((glUniform2iv = (PFNGLUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glUniform2iv")) == NULL) || r; + r = ((glUniform3f = (PFNGLUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glUniform3f")) == NULL) || r; + r = ((glUniform3fv = (PFNGLUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glUniform3fv")) == NULL) || r; + r = ((glUniform3i = (PFNGLUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glUniform3i")) == NULL) || r; + r = ((glUniform3iv = (PFNGLUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glUniform3iv")) == NULL) || r; + r = ((glUniform4f = (PFNGLUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glUniform4f")) == NULL) || r; + r = ((glUniform4fv = (PFNGLUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glUniform4fv")) == NULL) || r; + r = ((glUniform4i = (PFNGLUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glUniform4i")) == NULL) || r; + r = ((glUniform4iv = (PFNGLUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glUniform4iv")) == NULL) || r; + r = ((glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fv")) == NULL) || r; + r = ((glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fv")) == NULL) || r; + r = ((glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fv")) == NULL) || r; + r = ((glUseProgram = (PFNGLUSEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glUseProgram")) == NULL) || r; + r = ((glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glValidateProgram")) == NULL) || r; + r = ((glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1d")) == NULL) || r; + r = ((glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dv")) == NULL) || r; + r = ((glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1f")) == NULL) || r; + r = ((glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fv")) == NULL) || r; + r = ((glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1s")) == NULL) || r; + r = ((glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sv")) == NULL) || r; + r = ((glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2d")) == NULL) || r; + r = ((glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dv")) == NULL) || r; + r = ((glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2f")) == NULL) || r; + r = ((glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fv")) == NULL) || r; + r = ((glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2s")) == NULL) || r; + r = ((glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sv")) == NULL) || r; + r = ((glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3d")) == NULL) || r; + r = ((glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dv")) == NULL) || r; + r = ((glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3f")) == NULL) || r; + r = ((glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fv")) == NULL) || r; + r = ((glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3s")) == NULL) || r; + r = ((glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sv")) == NULL) || r; + r = ((glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nbv")) == NULL) || r; + r = ((glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Niv")) == NULL) || r; + r = ((glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nsv")) == NULL) || r; + r = ((glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nub")) == NULL) || r; + r = ((glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nubv")) == NULL) || r; + r = ((glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nuiv")) == NULL) || r; + r = ((glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nusv")) == NULL) || r; + r = ((glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bv")) == NULL) || r; + r = ((glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4d")) == NULL) || r; + r = ((glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dv")) == NULL) || r; + r = ((glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4f")) == NULL) || r; + r = ((glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fv")) == NULL) || r; + r = ((glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4iv")) == NULL) || r; + r = ((glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4s")) == NULL) || r; + r = ((glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sv")) == NULL) || r; + r = ((glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubv")) == NULL) || r; + r = ((glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uiv")) == NULL) || r; + r = ((glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usv")) == NULL) || r; + r = ((glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_2_0 */ + +#ifdef GL_VERSION_2_1 + +static GLboolean _glewInit_GL_VERSION_2_1 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3fv")) == NULL) || r; + r = ((glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4fv")) == NULL) || r; + r = ((glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2fv")) == NULL) || r; + r = ((glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4fv")) == NULL) || r; + r = ((glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2fv")) == NULL) || r; + r = ((glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3fv")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_2_1 */ + +#ifdef GL_VERSION_3_0 + +static GLboolean _glewInit_GL_VERSION_3_0 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRender")) == NULL) || r; + r = ((glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedback")) == NULL) || r; + r = ((glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocation")) == NULL) || r; + r = ((glClampColor = (PFNGLCLAMPCOLORPROC)glewGetProcAddress((const GLubyte*)"glClampColor")) == NULL) || r; + r = ((glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfi")) == NULL) || r; + r = ((glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfv")) == NULL) || r; + r = ((glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferiv")) == NULL) || r; + r = ((glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferuiv")) == NULL) || r; + r = ((glColorMaski = (PFNGLCOLORMASKIPROC)glewGetProcAddress((const GLubyte*)"glColorMaski")) == NULL) || r; + r = ((glDisablei = (PFNGLDISABLEIPROC)glewGetProcAddress((const GLubyte*)"glDisablei")) == NULL) || r; + r = ((glEnablei = (PFNGLENABLEIPROC)glewGetProcAddress((const GLubyte*)"glEnablei")) == NULL) || r; + r = ((glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRender")) == NULL) || r; + r = ((glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedback")) == NULL) || r; + r = ((glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)glewGetProcAddress((const GLubyte*)"glGetBooleani_v")) == NULL) || r; + r = ((glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocation")) == NULL) || r; + r = ((glGetStringi = (PFNGLGETSTRINGIPROC)glewGetProcAddress((const GLubyte*)"glGetStringi")) == NULL) || r; + r = ((glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIiv")) == NULL) || r; + r = ((glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuiv")) == NULL) || r; + r = ((glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVarying")) == NULL) || r; + r = ((glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuiv")) == NULL) || r; + r = ((glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIiv")) == NULL) || r; + r = ((glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuiv")) == NULL) || r; + r = ((glIsEnabledi = (PFNGLISENABLEDIPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledi")) == NULL) || r; + r = ((glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIiv")) == NULL) || r; + r = ((glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuiv")) == NULL) || r; + r = ((glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryings")) == NULL) || r; + r = ((glUniform1ui = (PFNGLUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui")) == NULL) || r; + r = ((glUniform1uiv = (PFNGLUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiv")) == NULL) || r; + r = ((glUniform2ui = (PFNGLUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui")) == NULL) || r; + r = ((glUniform2uiv = (PFNGLUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiv")) == NULL) || r; + r = ((glUniform3ui = (PFNGLUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui")) == NULL) || r; + r = ((glUniform3uiv = (PFNGLUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiv")) == NULL) || r; + r = ((glUniform4ui = (PFNGLUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui")) == NULL) || r; + r = ((glUniform4uiv = (PFNGLUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiv")) == NULL) || r; + r = ((glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1i")) == NULL) || r; + r = ((glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iv")) == NULL) || r; + r = ((glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ui")) == NULL) || r; + r = ((glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiv")) == NULL) || r; + r = ((glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2i")) == NULL) || r; + r = ((glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iv")) == NULL) || r; + r = ((glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ui")) == NULL) || r; + r = ((glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiv")) == NULL) || r; + r = ((glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3i")) == NULL) || r; + r = ((glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iv")) == NULL) || r; + r = ((glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ui")) == NULL) || r; + r = ((glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiv")) == NULL) || r; + r = ((glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bv")) == NULL) || r; + r = ((glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4i")) == NULL) || r; + r = ((glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iv")) == NULL) || r; + r = ((glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4sv")) == NULL) || r; + r = ((glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubv")) == NULL) || r; + r = ((glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ui")) == NULL) || r; + r = ((glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiv")) == NULL) || r; + r = ((glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usv")) == NULL) || r; + r = ((glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_0 */ + +#ifdef GL_VERSION_3_1 + +static GLboolean _glewInit_GL_VERSION_3_1 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstanced")) == NULL) || r; + r = ((glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstanced")) == NULL) || r; + r = ((glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndex")) == NULL) || r; + r = ((glTexBuffer = (PFNGLTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glTexBuffer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_1 */ + +#ifdef GL_VERSION_3_2 + +static GLboolean _glewInit_GL_VERSION_3_2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture")) == NULL) || r; + r = ((glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteri64v")) == NULL) || r; + r = ((glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64i_v")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_2 */ + +#ifdef GL_VERSION_3_3 + +static GLboolean _glewInit_GL_VERSION_3_3 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisor")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_3 */ + +#ifdef GL_VERSION_4_0 + +static GLboolean _glewInit_GL_VERSION_4_0 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparatei = (PFNGLBLENDEQUATIONSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparatei")) == NULL) || r; + r = ((glBlendEquationi = (PFNGLBLENDEQUATIONIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationi")) == NULL) || r; + r = ((glBlendFuncSeparatei = (PFNGLBLENDFUNCSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparatei")) == NULL) || r; + r = ((glBlendFunci = (PFNGLBLENDFUNCIPROC)glewGetProcAddress((const GLubyte*)"glBlendFunci")) == NULL) || r; + r = ((glMinSampleShading = (PFNGLMINSAMPLESHADINGPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShading")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_4_0 */ + +#ifdef GL_VERSION_4_1 + +#endif /* GL_VERSION_4_1 */ + +#ifdef GL_VERSION_4_2 + +#endif /* GL_VERSION_4_2 */ + +#ifdef GL_VERSION_4_3 + +#endif /* GL_VERSION_4_3 */ + +#ifdef GL_VERSION_4_4 + +#endif /* GL_VERSION_4_4 */ + +#ifdef GL_3DFX_multisample + +#endif /* GL_3DFX_multisample */ + +#ifdef GL_3DFX_tbuffer + +static GLboolean _glewInit_GL_3DFX_tbuffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTbufferMask3DFX = (PFNGLTBUFFERMASK3DFXPROC)glewGetProcAddress((const GLubyte*)"glTbufferMask3DFX")) == NULL) || r; + + return r; +} + +#endif /* GL_3DFX_tbuffer */ + +#ifdef GL_3DFX_texture_compression_FXT1 + +#endif /* GL_3DFX_texture_compression_FXT1 */ + +#ifdef GL_AMD_blend_minmax_factor + +#endif /* GL_AMD_blend_minmax_factor */ + +#ifdef GL_AMD_conservative_depth + +#endif /* GL_AMD_conservative_depth */ + +#ifdef GL_AMD_debug_output + +static GLboolean _glewInit_GL_AMD_debug_output (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackAMD")) == NULL) || r; + r = ((glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageEnableAMD")) == NULL) || r; + r = ((glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertAMD")) == NULL) || r; + r = ((glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_debug_output */ + +#ifdef GL_AMD_depth_clamp_separate + +#endif /* GL_AMD_depth_clamp_separate */ + +#ifdef GL_AMD_draw_buffers_blend + +static GLboolean _glewInit_GL_AMD_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationIndexedAMD = (PFNGLBLENDEQUATIONINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationIndexedAMD")) == NULL) || r; + r = ((glBlendEquationSeparateIndexedAMD = (PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateIndexedAMD")) == NULL) || r; + r = ((glBlendFuncIndexedAMD = (PFNGLBLENDFUNCINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncIndexedAMD")) == NULL) || r; + r = ((glBlendFuncSeparateIndexedAMD = (PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateIndexedAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_draw_buffers_blend */ + +#ifdef GL_AMD_interleaved_elements + +static GLboolean _glewInit_GL_AMD_interleaved_elements (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVertexAttribParameteriAMD = (PFNGLVERTEXATTRIBPARAMETERIAMDPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribParameteriAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_interleaved_elements */ + +#ifdef GL_AMD_multi_draw_indirect + +static GLboolean _glewInit_GL_AMD_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectAMD = (PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectAMD")) == NULL) || r; + r = ((glMultiDrawElementsIndirectAMD = (PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_multi_draw_indirect */ + +#ifdef GL_AMD_name_gen_delete + +static GLboolean _glewInit_GL_AMD_name_gen_delete (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteNamesAMD = (PFNGLDELETENAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamesAMD")) == NULL) || r; + r = ((glGenNamesAMD = (PFNGLGENNAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glGenNamesAMD")) == NULL) || r; + r = ((glIsNameAMD = (PFNGLISNAMEAMDPROC)glewGetProcAddress((const GLubyte*)"glIsNameAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_name_gen_delete */ + +#ifdef GL_AMD_performance_monitor + +static GLboolean _glewInit_GL_AMD_performance_monitor (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginPerfMonitorAMD = (PFNGLBEGINPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glBeginPerfMonitorAMD")) == NULL) || r; + r = ((glDeletePerfMonitorsAMD = (PFNGLDELETEPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glDeletePerfMonitorsAMD")) == NULL) || r; + r = ((glEndPerfMonitorAMD = (PFNGLENDPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glEndPerfMonitorAMD")) == NULL) || r; + r = ((glGenPerfMonitorsAMD = (PFNGLGENPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glGenPerfMonitorsAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterDataAMD = (PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterDataAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterInfoAMD = (PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterInfoAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterStringAMD = (PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterStringAMD")) == NULL) || r; + r = ((glGetPerfMonitorCountersAMD = (PFNGLGETPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCountersAMD")) == NULL) || r; + r = ((glGetPerfMonitorGroupStringAMD = (PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupStringAMD")) == NULL) || r; + r = ((glGetPerfMonitorGroupsAMD = (PFNGLGETPERFMONITORGROUPSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupsAMD")) == NULL) || r; + r = ((glSelectPerfMonitorCountersAMD = (PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glSelectPerfMonitorCountersAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_performance_monitor */ + +#ifdef GL_AMD_pinned_memory + +#endif /* GL_AMD_pinned_memory */ + +#ifdef GL_AMD_query_buffer_object + +#endif /* GL_AMD_query_buffer_object */ + +#ifdef GL_AMD_sample_positions + +static GLboolean _glewInit_GL_AMD_sample_positions (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSetMultisamplefvAMD = (PFNGLSETMULTISAMPLEFVAMDPROC)glewGetProcAddress((const GLubyte*)"glSetMultisamplefvAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_sample_positions */ + +#ifdef GL_AMD_seamless_cubemap_per_texture + +#endif /* GL_AMD_seamless_cubemap_per_texture */ + +#ifdef GL_AMD_shader_stencil_export + +#endif /* GL_AMD_shader_stencil_export */ + +#ifdef GL_AMD_shader_trinary_minmax + +#endif /* GL_AMD_shader_trinary_minmax */ + +#ifdef GL_AMD_sparse_texture + +static GLboolean _glewInit_GL_AMD_sparse_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexStorageSparseAMD = (PFNGLTEXSTORAGESPARSEAMDPROC)glewGetProcAddress((const GLubyte*)"glTexStorageSparseAMD")) == NULL) || r; + r = ((glTextureStorageSparseAMD = (PFNGLTEXTURESTORAGESPARSEAMDPROC)glewGetProcAddress((const GLubyte*)"glTextureStorageSparseAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_sparse_texture */ + +#ifdef GL_AMD_stencil_operation_extended + +static GLboolean _glewInit_GL_AMD_stencil_operation_extended (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glStencilOpValueAMD = (PFNGLSTENCILOPVALUEAMDPROC)glewGetProcAddress((const GLubyte*)"glStencilOpValueAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_stencil_operation_extended */ + +#ifdef GL_AMD_texture_texture4 + +#endif /* GL_AMD_texture_texture4 */ + +#ifdef GL_AMD_transform_feedback3_lines_triangles + +#endif /* GL_AMD_transform_feedback3_lines_triangles */ + +#ifdef GL_AMD_vertex_shader_layer + +#endif /* GL_AMD_vertex_shader_layer */ + +#ifdef GL_AMD_vertex_shader_tessellator + +static GLboolean _glewInit_GL_AMD_vertex_shader_tessellator (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTessellationFactorAMD = (PFNGLTESSELLATIONFACTORAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationFactorAMD")) == NULL) || r; + r = ((glTessellationModeAMD = (PFNGLTESSELLATIONMODEAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationModeAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_vertex_shader_tessellator */ + +#ifdef GL_AMD_vertex_shader_viewport_index + +#endif /* GL_AMD_vertex_shader_viewport_index */ + +#ifdef GL_ANGLE_depth_texture + +#endif /* GL_ANGLE_depth_texture */ + +#ifdef GL_ANGLE_framebuffer_blit + +static GLboolean _glewInit_GL_ANGLE_framebuffer_blit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlitFramebufferANGLE = (PFNGLBLITFRAMEBUFFERANGLEPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferANGLE")) == NULL) || r; + + return r; +} + +#endif /* GL_ANGLE_framebuffer_blit */ + +#ifdef GL_ANGLE_framebuffer_multisample + +static GLboolean _glewInit_GL_ANGLE_framebuffer_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glRenderbufferStorageMultisampleANGLE = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleANGLE")) == NULL) || r; + + return r; +} + +#endif /* GL_ANGLE_framebuffer_multisample */ + +#ifdef GL_ANGLE_instanced_arrays + +static GLboolean _glewInit_GL_ANGLE_instanced_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedANGLE = (PFNGLDRAWARRAYSINSTANCEDANGLEPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedANGLE")) == NULL) || r; + r = ((glDrawElementsInstancedANGLE = (PFNGLDRAWELEMENTSINSTANCEDANGLEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedANGLE")) == NULL) || r; + r = ((glVertexAttribDivisorANGLE = (PFNGLVERTEXATTRIBDIVISORANGLEPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorANGLE")) == NULL) || r; + + return r; +} + +#endif /* GL_ANGLE_instanced_arrays */ + +#ifdef GL_ANGLE_pack_reverse_row_order + +#endif /* GL_ANGLE_pack_reverse_row_order */ + +#ifdef GL_ANGLE_program_binary + +#endif /* GL_ANGLE_program_binary */ + +#ifdef GL_ANGLE_texture_compression_dxt1 + +#endif /* GL_ANGLE_texture_compression_dxt1 */ + +#ifdef GL_ANGLE_texture_compression_dxt3 + +#endif /* GL_ANGLE_texture_compression_dxt3 */ + +#ifdef GL_ANGLE_texture_compression_dxt5 + +#endif /* GL_ANGLE_texture_compression_dxt5 */ + +#ifdef GL_ANGLE_texture_usage + +#endif /* GL_ANGLE_texture_usage */ + +#ifdef GL_ANGLE_timer_query + +static GLboolean _glewInit_GL_ANGLE_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQueryANGLE = (PFNGLBEGINQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryANGLE")) == NULL) || r; + r = ((glDeleteQueriesANGLE = (PFNGLDELETEQUERIESANGLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueriesANGLE")) == NULL) || r; + r = ((glEndQueryANGLE = (PFNGLENDQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glEndQueryANGLE")) == NULL) || r; + r = ((glGenQueriesANGLE = (PFNGLGENQUERIESANGLEPROC)glewGetProcAddress((const GLubyte*)"glGenQueriesANGLE")) == NULL) || r; + r = ((glGetQueryObjecti64vANGLE = (PFNGLGETQUERYOBJECTI64VANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64vANGLE")) == NULL) || r; + r = ((glGetQueryObjectivANGLE = (PFNGLGETQUERYOBJECTIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectivANGLE")) == NULL) || r; + r = ((glGetQueryObjectui64vANGLE = (PFNGLGETQUERYOBJECTUI64VANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64vANGLE")) == NULL) || r; + r = ((glGetQueryObjectuivANGLE = (PFNGLGETQUERYOBJECTUIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuivANGLE")) == NULL) || r; + r = ((glGetQueryivANGLE = (PFNGLGETQUERYIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryivANGLE")) == NULL) || r; + r = ((glIsQueryANGLE = (PFNGLISQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glIsQueryANGLE")) == NULL) || r; + r = ((glQueryCounterANGLE = (PFNGLQUERYCOUNTERANGLEPROC)glewGetProcAddress((const GLubyte*)"glQueryCounterANGLE")) == NULL) || r; + + return r; +} + +#endif /* GL_ANGLE_timer_query */ + +#ifdef GL_ANGLE_translated_shader_source + +static GLboolean _glewInit_GL_ANGLE_translated_shader_source (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetTranslatedShaderSourceANGLE = (PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetTranslatedShaderSourceANGLE")) == NULL) || r; + + return r; +} + +#endif /* GL_ANGLE_translated_shader_source */ + +#ifdef GL_APPLE_aux_depth_stencil + +#endif /* GL_APPLE_aux_depth_stencil */ + +#ifdef GL_APPLE_client_storage + +#endif /* GL_APPLE_client_storage */ + +#ifdef GL_APPLE_element_array + +static GLboolean _glewInit_GL_APPLE_element_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementArrayAPPLE = (PFNGLDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayAPPLE")) == NULL) || r; + r = ((glDrawRangeElementArrayAPPLE = (PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayAPPLE")) == NULL) || r; + r = ((glElementPointerAPPLE = (PFNGLELEMENTPOINTERAPPLEPROC)glewGetProcAddress((const GLubyte*)"glElementPointerAPPLE")) == NULL) || r; + r = ((glMultiDrawElementArrayAPPLE = (PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementArrayAPPLE")) == NULL) || r; + r = ((glMultiDrawRangeElementArrayAPPLE = (PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawRangeElementArrayAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_element_array */ + +#ifdef GL_APPLE_fence + +static GLboolean _glewInit_GL_APPLE_fence (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteFencesAPPLE = (PFNGLDELETEFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesAPPLE")) == NULL) || r; + r = ((glFinishFenceAPPLE = (PFNGLFINISHFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceAPPLE")) == NULL) || r; + r = ((glFinishObjectAPPLE = (PFNGLFINISHOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishObjectAPPLE")) == NULL) || r; + r = ((glGenFencesAPPLE = (PFNGLGENFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenFencesAPPLE")) == NULL) || r; + r = ((glIsFenceAPPLE = (PFNGLISFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsFenceAPPLE")) == NULL) || r; + r = ((glSetFenceAPPLE = (PFNGLSETFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glSetFenceAPPLE")) == NULL) || r; + r = ((glTestFenceAPPLE = (PFNGLTESTFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestFenceAPPLE")) == NULL) || r; + r = ((glTestObjectAPPLE = (PFNGLTESTOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestObjectAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_fence */ + +#ifdef GL_APPLE_float_pixels + +#endif /* GL_APPLE_float_pixels */ + +#ifdef GL_APPLE_flush_buffer_range + +static GLboolean _glewInit_GL_APPLE_flush_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBufferParameteriAPPLE = (PFNGLBUFFERPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBufferParameteriAPPLE")) == NULL) || r; + r = ((glFlushMappedBufferRangeAPPLE = (PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRangeAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_flush_buffer_range */ + +#ifdef GL_APPLE_object_purgeable + +static GLboolean _glewInit_GL_APPLE_object_purgeable (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetObjectParameterivAPPLE = (PFNGLGETOBJECTPARAMETERIVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivAPPLE")) == NULL) || r; + r = ((glObjectPurgeableAPPLE = (PFNGLOBJECTPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectPurgeableAPPLE")) == NULL) || r; + r = ((glObjectUnpurgeableAPPLE = (PFNGLOBJECTUNPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectUnpurgeableAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_object_purgeable */ + +#ifdef GL_APPLE_pixel_buffer + +#endif /* GL_APPLE_pixel_buffer */ + +#ifdef GL_APPLE_rgb_422 + +#endif /* GL_APPLE_rgb_422 */ + +#ifdef GL_APPLE_row_bytes + +#endif /* GL_APPLE_row_bytes */ + +#ifdef GL_APPLE_specular_vector + +#endif /* GL_APPLE_specular_vector */ + +#ifdef GL_APPLE_texture_range + +static GLboolean _glewInit_GL_APPLE_texture_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexParameterPointervAPPLE = (PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterPointervAPPLE")) == NULL) || r; + r = ((glTextureRangeAPPLE = (PFNGLTEXTURERANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureRangeAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_texture_range */ + +#ifdef GL_APPLE_transform_hint + +#endif /* GL_APPLE_transform_hint */ + +#ifdef GL_APPLE_vertex_array_object + +static GLboolean _glewInit_GL_APPLE_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindVertexArrayAPPLE = (PFNGLBINDVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArrayAPPLE")) == NULL) || r; + r = ((glDeleteVertexArraysAPPLE = (PFNGLDELETEVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArraysAPPLE")) == NULL) || r; + r = ((glGenVertexArraysAPPLE = (PFNGLGENVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArraysAPPLE")) == NULL) || r; + r = ((glIsVertexArrayAPPLE = (PFNGLISVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArrayAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_array_object */ + +#ifdef GL_APPLE_vertex_array_range + +static GLboolean _glewInit_GL_APPLE_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushVertexArrayRangeAPPLE = (PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeAPPLE")) == NULL) || r; + r = ((glVertexArrayParameteriAPPLE = (PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayParameteriAPPLE")) == NULL) || r; + r = ((glVertexArrayRangeAPPLE = (PFNGLVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_array_range */ + +#ifdef GL_APPLE_vertex_program_evaluators + +static GLboolean _glewInit_GL_APPLE_vertex_program_evaluators (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDisableVertexAttribAPPLE = (PFNGLDISABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribAPPLE")) == NULL) || r; + r = ((glEnableVertexAttribAPPLE = (PFNGLENABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribAPPLE")) == NULL) || r; + r = ((glIsVertexAttribEnabledAPPLE = (PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexAttribEnabledAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib1dAPPLE = (PFNGLMAPVERTEXATTRIB1DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1dAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib1fAPPLE = (PFNGLMAPVERTEXATTRIB1FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1fAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib2dAPPLE = (PFNGLMAPVERTEXATTRIB2DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2dAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib2fAPPLE = (PFNGLMAPVERTEXATTRIB2FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2fAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_program_evaluators */ + +#ifdef GL_APPLE_ycbcr_422 + +#endif /* GL_APPLE_ycbcr_422 */ + +#ifdef GL_ARB_ES2_compatibility + +static GLboolean _glewInit_GL_ARB_ES2_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearDepthf = (PFNGLCLEARDEPTHFPROC)glewGetProcAddress((const GLubyte*)"glClearDepthf")) == NULL) || r; + r = ((glDepthRangef = (PFNGLDEPTHRANGEFPROC)glewGetProcAddress((const GLubyte*)"glDepthRangef")) == NULL) || r; + r = ((glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)glewGetProcAddress((const GLubyte*)"glGetShaderPrecisionFormat")) == NULL) || r; + r = ((glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)glewGetProcAddress((const GLubyte*)"glReleaseShaderCompiler")) == NULL) || r; + r = ((glShaderBinary = (PFNGLSHADERBINARYPROC)glewGetProcAddress((const GLubyte*)"glShaderBinary")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_ES2_compatibility */ + +#ifdef GL_ARB_ES3_compatibility + +#endif /* GL_ARB_ES3_compatibility */ + +#ifdef GL_ARB_arrays_of_arrays + +#endif /* GL_ARB_arrays_of_arrays */ + +#ifdef GL_ARB_base_instance + +static GLboolean _glewInit_GL_ARB_base_instance (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedBaseInstance")) == NULL) || r; + r = ((glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseInstance")) == NULL) || r; + r = ((glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertexBaseInstance")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_base_instance */ + +#ifdef GL_ARB_bindless_texture + +static GLboolean _glewInit_GL_ARB_bindless_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetImageHandleARB = (PFNGLGETIMAGEHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetImageHandleARB")) == NULL) || r; + r = ((glGetTextureHandleARB = (PFNGLGETTEXTUREHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetTextureHandleARB")) == NULL) || r; + r = ((glGetTextureSamplerHandleARB = (PFNGLGETTEXTURESAMPLERHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSamplerHandleARB")) == NULL) || r; + r = ((glGetVertexAttribLui64vARB = (PFNGLGETVERTEXATTRIBLUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLui64vARB")) == NULL) || r; + r = ((glIsImageHandleResidentARB = (PFNGLISIMAGEHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glIsImageHandleResidentARB")) == NULL) || r; + r = ((glIsTextureHandleResidentARB = (PFNGLISTEXTUREHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glIsTextureHandleResidentARB")) == NULL) || r; + r = ((glMakeImageHandleNonResidentARB = (PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleNonResidentARB")) == NULL) || r; + r = ((glMakeImageHandleResidentARB = (PFNGLMAKEIMAGEHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleResidentARB")) == NULL) || r; + r = ((glMakeTextureHandleNonResidentARB = (PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleNonResidentARB")) == NULL) || r; + r = ((glMakeTextureHandleResidentARB = (PFNGLMAKETEXTUREHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleResidentARB")) == NULL) || r; + r = ((glProgramUniformHandleui64ARB = (PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64ARB")) == NULL) || r; + r = ((glProgramUniformHandleui64vARB = (PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64vARB")) == NULL) || r; + r = ((glUniformHandleui64ARB = (PFNGLUNIFORMHANDLEUI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64ARB")) == NULL) || r; + r = ((glUniformHandleui64vARB = (PFNGLUNIFORMHANDLEUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64vARB")) == NULL) || r; + r = ((glVertexAttribL1ui64ARB = (PFNGLVERTEXATTRIBL1UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64ARB")) == NULL) || r; + r = ((glVertexAttribL1ui64vARB = (PFNGLVERTEXATTRIBL1UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64vARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_bindless_texture */ + +#ifdef GL_ARB_blend_func_extended + +static GLboolean _glewInit_GL_ARB_blend_func_extended (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationIndexed")) == NULL) || r; + r = ((glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataIndex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_blend_func_extended */ + +#ifdef GL_ARB_buffer_storage + +static GLboolean _glewInit_GL_ARB_buffer_storage (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBufferStorage = (PFNGLBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glBufferStorage")) == NULL) || r; + r = ((glNamedBufferStorageEXT = (PFNGLNAMEDBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferStorageEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_buffer_storage */ + +#ifdef GL_ARB_cl_event + +static GLboolean _glewInit_GL_ARB_cl_event (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCreateSyncFromCLeventARB = (PFNGLCREATESYNCFROMCLEVENTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateSyncFromCLeventARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_cl_event */ + +#ifdef GL_ARB_clear_buffer_object + +static GLboolean _glewInit_GL_ARB_clear_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferData")) == NULL) || r; + r = ((glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferSubData")) == NULL) || r; + r = ((glClearNamedBufferDataEXT = (PFNGLCLEARNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferDataEXT")) == NULL) || r; + r = ((glClearNamedBufferSubDataEXT = (PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferSubDataEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_clear_buffer_object */ + +#ifdef GL_ARB_clear_texture + +static GLboolean _glewInit_GL_ARB_clear_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearTexImage = (PFNGLCLEARTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glClearTexImage")) == NULL) || r; + r = ((glClearTexSubImage = (PFNGLCLEARTEXSUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glClearTexSubImage")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_clear_texture */ + +#ifdef GL_ARB_color_buffer_float + +static GLboolean _glewInit_GL_ARB_color_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClampColorARB = (PFNGLCLAMPCOLORARBPROC)glewGetProcAddress((const GLubyte*)"glClampColorARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_color_buffer_float */ + +#ifdef GL_ARB_compatibility + +#endif /* GL_ARB_compatibility */ + +#ifdef GL_ARB_compressed_texture_pixel_storage + +#endif /* GL_ARB_compressed_texture_pixel_storage */ + +#ifdef GL_ARB_compute_shader + +static GLboolean _glewInit_GL_ARB_compute_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)glewGetProcAddress((const GLubyte*)"glDispatchCompute")) == NULL) || r; + r = ((glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDispatchComputeIndirect")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_compute_shader */ + +#ifdef GL_ARB_compute_variable_group_size + +static GLboolean _glewInit_GL_ARB_compute_variable_group_size (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDispatchComputeGroupSizeARB = (PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC)glewGetProcAddress((const GLubyte*)"glDispatchComputeGroupSizeARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_compute_variable_group_size */ + +#ifdef GL_ARB_conservative_depth + +#endif /* GL_ARB_conservative_depth */ + +#ifdef GL_ARB_copy_buffer + +static GLboolean _glewInit_GL_ARB_copy_buffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyBufferSubData")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_copy_buffer */ + +#ifdef GL_ARB_copy_image + +static GLboolean _glewInit_GL_ARB_copy_image (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubData")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_copy_image */ + +#ifdef GL_ARB_debug_output + +static GLboolean _glewInit_GL_ARB_debug_output (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackARB")) == NULL) || r; + r = ((glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControlARB")) == NULL) || r; + r = ((glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertARB")) == NULL) || r; + r = ((glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_debug_output */ + +#ifdef GL_ARB_depth_buffer_float + +#endif /* GL_ARB_depth_buffer_float */ + +#ifdef GL_ARB_depth_clamp + +#endif /* GL_ARB_depth_clamp */ + +#ifdef GL_ARB_depth_texture + +#endif /* GL_ARB_depth_texture */ + +#ifdef GL_ARB_draw_buffers + +static GLboolean _glewInit_GL_ARB_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_buffers */ + +#ifdef GL_ARB_draw_buffers_blend + +static GLboolean _glewInit_GL_ARB_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparateiARB = (PFNGLBLENDEQUATIONSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateiARB")) == NULL) || r; + r = ((glBlendEquationiARB = (PFNGLBLENDEQUATIONIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationiARB")) == NULL) || r; + r = ((glBlendFuncSeparateiARB = (PFNGLBLENDFUNCSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateiARB")) == NULL) || r; + r = ((glBlendFunciARB = (PFNGLBLENDFUNCIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFunciARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_buffers_blend */ + +#ifdef GL_ARB_draw_elements_base_vertex + +static GLboolean _glewInit_GL_ARB_draw_elements_base_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsBaseVertex")) == NULL) || r; + r = ((glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertex")) == NULL) || r; + r = ((glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsBaseVertex")) == NULL) || r; + r = ((glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsBaseVertex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_elements_base_vertex */ + +#ifdef GL_ARB_draw_indirect + +static GLboolean _glewInit_GL_ARB_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysIndirect")) == NULL) || r; + r = ((glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsIndirect")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_indirect */ + +#ifdef GL_ARB_draw_instanced + +#endif /* GL_ARB_draw_instanced */ + +#ifdef GL_ARB_enhanced_layouts + +#endif /* GL_ARB_enhanced_layouts */ + +#ifdef GL_ARB_explicit_attrib_location + +#endif /* GL_ARB_explicit_attrib_location */ + +#ifdef GL_ARB_explicit_uniform_location + +#endif /* GL_ARB_explicit_uniform_location */ + +#ifdef GL_ARB_fragment_coord_conventions + +#endif /* GL_ARB_fragment_coord_conventions */ + +#ifdef GL_ARB_fragment_layer_viewport + +#endif /* GL_ARB_fragment_layer_viewport */ + +#ifdef GL_ARB_fragment_program + +#endif /* GL_ARB_fragment_program */ + +#ifdef GL_ARB_fragment_program_shadow + +#endif /* GL_ARB_fragment_program_shadow */ + +#ifdef GL_ARB_fragment_shader + +#endif /* GL_ARB_fragment_shader */ + +#ifdef GL_ARB_framebuffer_no_attachments + +static GLboolean _glewInit_GL_ARB_framebuffer_no_attachments (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glFramebufferParameteri")) == NULL) || r; + r = ((glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameteriv")) == NULL) || r; + r = ((glGetNamedFramebufferParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferParameterivEXT")) == NULL) || r; + r = ((glNamedFramebufferParameteriEXT = (PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferParameteriEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_framebuffer_no_attachments */ + +#ifdef GL_ARB_framebuffer_object + +static GLboolean _glewInit_GL_ARB_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindFramebuffer")) == NULL) || r; + r = ((glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbuffer")) == NULL) || r; + r = ((glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebuffer")) == NULL) || r; + r = ((glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatus")) == NULL) || r; + r = ((glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffers")) == NULL) || r; + r = ((glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffers")) == NULL) || r; + r = ((glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbuffer")) == NULL) || r; + r = ((glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1D")) == NULL) || r; + r = ((glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2D")) == NULL) || r; + r = ((glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3D")) == NULL) || r; + r = ((glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayer")) == NULL) || r; + r = ((glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffers")) == NULL) || r; + r = ((glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffers")) == NULL) || r; + r = ((glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmap")) == NULL) || r; + r = ((glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameteriv")) == NULL) || r; + r = ((glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameteriv")) == NULL) || r; + r = ((glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsFramebuffer")) == NULL) || r; + r = ((glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbuffer")) == NULL) || r; + r = ((glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorage")) == NULL) || r; + r = ((glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisample")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_framebuffer_object */ + +#ifdef GL_ARB_framebuffer_sRGB + +#endif /* GL_ARB_framebuffer_sRGB */ + +#ifdef GL_ARB_geometry_shader4 + +static GLboolean _glewInit_GL_ARB_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureARB")) == NULL) || r; + r = ((glFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceARB")) == NULL) || r; + r = ((glFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerARB")) == NULL) || r; + r = ((glProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_geometry_shader4 */ + +#ifdef GL_ARB_get_program_binary + +static GLboolean _glewInit_GL_ARB_get_program_binary (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glGetProgramBinary")) == NULL) || r; + r = ((glProgramBinary = (PFNGLPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glProgramBinary")) == NULL) || r; + r = ((glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteri")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_get_program_binary */ + +#ifdef GL_ARB_gpu_shader5 + +#endif /* GL_ARB_gpu_shader5 */ + +#ifdef GL_ARB_gpu_shader_fp64 + +static GLboolean _glewInit_GL_ARB_gpu_shader_fp64 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformdv = (PFNGLGETUNIFORMDVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformdv")) == NULL) || r; + r = ((glUniform1d = (PFNGLUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glUniform1d")) == NULL) || r; + r = ((glUniform1dv = (PFNGLUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glUniform1dv")) == NULL) || r; + r = ((glUniform2d = (PFNGLUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glUniform2d")) == NULL) || r; + r = ((glUniform2dv = (PFNGLUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glUniform2dv")) == NULL) || r; + r = ((glUniform3d = (PFNGLUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glUniform3d")) == NULL) || r; + r = ((glUniform3dv = (PFNGLUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glUniform3dv")) == NULL) || r; + r = ((glUniform4d = (PFNGLUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glUniform4d")) == NULL) || r; + r = ((glUniform4dv = (PFNGLUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glUniform4dv")) == NULL) || r; + r = ((glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2dv")) == NULL) || r; + r = ((glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3dv")) == NULL) || r; + r = ((glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4dv")) == NULL) || r; + r = ((glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3dv")) == NULL) || r; + r = ((glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2dv")) == NULL) || r; + r = ((glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4dv")) == NULL) || r; + r = ((glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4dv")) == NULL) || r; + r = ((glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2dv")) == NULL) || r; + r = ((glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3dv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_gpu_shader_fp64 */ + +#ifdef GL_ARB_half_float_pixel + +#endif /* GL_ARB_half_float_pixel */ + +#ifdef GL_ARB_half_float_vertex + +#endif /* GL_ARB_half_float_vertex */ + +#ifdef GL_ARB_imaging + +static GLboolean _glewInit_GL_ARB_imaging (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; + r = ((glColorSubTable = (PFNGLCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorSubTable")) == NULL) || r; + r = ((glColorTable = (PFNGLCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorTable")) == NULL) || r; + r = ((glColorTableParameterfv = (PFNGLCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfv")) == NULL) || r; + r = ((glColorTableParameteriv = (PFNGLCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameteriv")) == NULL) || r; + r = ((glConvolutionFilter1D = (PFNGLCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1D")) == NULL) || r; + r = ((glConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2D")) == NULL) || r; + r = ((glConvolutionParameterf = (PFNGLCONVOLUTIONPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterf")) == NULL) || r; + r = ((glConvolutionParameterfv = (PFNGLCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfv")) == NULL) || r; + r = ((glConvolutionParameteri = (PFNGLCONVOLUTIONPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteri")) == NULL) || r; + r = ((glConvolutionParameteriv = (PFNGLCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriv")) == NULL) || r; + r = ((glCopyColorSubTable = (PFNGLCOPYCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTable")) == NULL) || r; + r = ((glCopyColorTable = (PFNGLCOPYCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTable")) == NULL) || r; + r = ((glCopyConvolutionFilter1D = (PFNGLCOPYCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1D")) == NULL) || r; + r = ((glCopyConvolutionFilter2D = (PFNGLCOPYCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2D")) == NULL) || r; + r = ((glGetColorTable = (PFNGLGETCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glGetColorTable")) == NULL) || r; + r = ((glGetColorTableParameterfv = (PFNGLGETCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfv")) == NULL) || r; + r = ((glGetColorTableParameteriv = (PFNGLGETCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameteriv")) == NULL) || r; + r = ((glGetConvolutionFilter = (PFNGLGETCONVOLUTIONFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilter")) == NULL) || r; + r = ((glGetConvolutionParameterfv = (PFNGLGETCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfv")) == NULL) || r; + r = ((glGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameteriv")) == NULL) || r; + r = ((glGetHistogram = (PFNGLGETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glGetHistogram")) == NULL) || r; + r = ((glGetHistogramParameterfv = (PFNGLGETHISTOGRAMPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfv")) == NULL) || r; + r = ((glGetHistogramParameteriv = (PFNGLGETHISTOGRAMPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameteriv")) == NULL) || r; + r = ((glGetMinmax = (PFNGLGETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glGetMinmax")) == NULL) || r; + r = ((glGetMinmaxParameterfv = (PFNGLGETMINMAXPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfv")) == NULL) || r; + r = ((glGetMinmaxParameteriv = (PFNGLGETMINMAXPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameteriv")) == NULL) || r; + r = ((glGetSeparableFilter = (PFNGLGETSEPARABLEFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilter")) == NULL) || r; + r = ((glHistogram = (PFNGLHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glHistogram")) == NULL) || r; + r = ((glMinmax = (PFNGLMINMAXPROC)glewGetProcAddress((const GLubyte*)"glMinmax")) == NULL) || r; + r = ((glResetHistogram = (PFNGLRESETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glResetHistogram")) == NULL) || r; + r = ((glResetMinmax = (PFNGLRESETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glResetMinmax")) == NULL) || r; + r = ((glSeparableFilter2D = (PFNGLSEPARABLEFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2D")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_imaging */ + +#ifdef GL_ARB_indirect_parameters + +static GLboolean _glewInit_GL_ARB_indirect_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectCountARB = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectCountARB")) == NULL) || r; + r = ((glMultiDrawElementsIndirectCountARB = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectCountARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_indirect_parameters */ + +#ifdef GL_ARB_instanced_arrays + +static GLboolean _glewInit_GL_ARB_instanced_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedARB")) == NULL) || r; + r = ((glDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedARB")) == NULL) || r; + r = ((glVertexAttribDivisorARB = (PFNGLVERTEXATTRIBDIVISORARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_instanced_arrays */ + +#ifdef GL_ARB_internalformat_query + +static GLboolean _glewInit_GL_ARB_internalformat_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformativ")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_internalformat_query */ + +#ifdef GL_ARB_internalformat_query2 + +static GLboolean _glewInit_GL_ARB_internalformat_query2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformati64v")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_internalformat_query2 */ + +#ifdef GL_ARB_invalidate_subdata + +static GLboolean _glewInit_GL_ARB_invalidate_subdata (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferData")) == NULL) || r; + r = ((glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferSubData")) == NULL) || r; + r = ((glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateFramebuffer")) == NULL) || r; + r = ((glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateSubFramebuffer")) == NULL) || r; + r = ((glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexImage")) == NULL) || r; + r = ((glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexSubImage")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_invalidate_subdata */ + +#ifdef GL_ARB_map_buffer_alignment + +#endif /* GL_ARB_map_buffer_alignment */ + +#ifdef GL_ARB_map_buffer_range + +static GLboolean _glewInit_GL_ARB_map_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRange")) == NULL) || r; + r = ((glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glMapBufferRange")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_map_buffer_range */ + +#ifdef GL_ARB_matrix_palette + +static GLboolean _glewInit_GL_ARB_matrix_palette (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCurrentPaletteMatrixARB = (PFNGLCURRENTPALETTEMATRIXARBPROC)glewGetProcAddress((const GLubyte*)"glCurrentPaletteMatrixARB")) == NULL) || r; + r = ((glMatrixIndexPointerARB = (PFNGLMATRIXINDEXPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexPointerARB")) == NULL) || r; + r = ((glMatrixIndexubvARB = (PFNGLMATRIXINDEXUBVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexubvARB")) == NULL) || r; + r = ((glMatrixIndexuivARB = (PFNGLMATRIXINDEXUIVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexuivARB")) == NULL) || r; + r = ((glMatrixIndexusvARB = (PFNGLMATRIXINDEXUSVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexusvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_matrix_palette */ + +#ifdef GL_ARB_multi_bind + +static GLboolean _glewInit_GL_ARB_multi_bind (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindBuffersBase = (PFNGLBINDBUFFERSBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBuffersBase")) == NULL) || r; + r = ((glBindBuffersRange = (PFNGLBINDBUFFERSRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBuffersRange")) == NULL) || r; + r = ((glBindImageTextures = (PFNGLBINDIMAGETEXTURESPROC)glewGetProcAddress((const GLubyte*)"glBindImageTextures")) == NULL) || r; + r = ((glBindSamplers = (PFNGLBINDSAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glBindSamplers")) == NULL) || r; + r = ((glBindTextures = (PFNGLBINDTEXTURESPROC)glewGetProcAddress((const GLubyte*)"glBindTextures")) == NULL) || r; + r = ((glBindVertexBuffers = (PFNGLBINDVERTEXBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glBindVertexBuffers")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multi_bind */ + +#ifdef GL_ARB_multi_draw_indirect + +static GLboolean _glewInit_GL_ARB_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirect")) == NULL) || r; + r = ((glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirect")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multi_draw_indirect */ + +#ifdef GL_ARB_multisample + +static GLboolean _glewInit_GL_ARB_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverageARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multisample */ + +#ifdef GL_ARB_multitexture + +static GLboolean _glewInit_GL_ARB_multitexture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glActiveTextureARB")) == NULL) || r; + r = ((glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTextureARB")) == NULL) || r; + r = ((glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dARB")) == NULL) || r; + r = ((glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dvARB")) == NULL) || r; + r = ((glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fARB")) == NULL) || r; + r = ((glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fvARB")) == NULL) || r; + r = ((glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iARB")) == NULL) || r; + r = ((glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1ivARB")) == NULL) || r; + r = ((glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sARB")) == NULL) || r; + r = ((glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1svARB")) == NULL) || r; + r = ((glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dARB")) == NULL) || r; + r = ((glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dvARB")) == NULL) || r; + r = ((glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fARB")) == NULL) || r; + r = ((glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fvARB")) == NULL) || r; + r = ((glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iARB")) == NULL) || r; + r = ((glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2ivARB")) == NULL) || r; + r = ((glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sARB")) == NULL) || r; + r = ((glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2svARB")) == NULL) || r; + r = ((glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dARB")) == NULL) || r; + r = ((glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dvARB")) == NULL) || r; + r = ((glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fARB")) == NULL) || r; + r = ((glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fvARB")) == NULL) || r; + r = ((glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iARB")) == NULL) || r; + r = ((glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3ivARB")) == NULL) || r; + r = ((glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sARB")) == NULL) || r; + r = ((glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3svARB")) == NULL) || r; + r = ((glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dARB")) == NULL) || r; + r = ((glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dvARB")) == NULL) || r; + r = ((glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fARB")) == NULL) || r; + r = ((glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fvARB")) == NULL) || r; + r = ((glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iARB")) == NULL) || r; + r = ((glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4ivARB")) == NULL) || r; + r = ((glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sARB")) == NULL) || r; + r = ((glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4svARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multitexture */ + +#ifdef GL_ARB_occlusion_query + +static GLboolean _glewInit_GL_ARB_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryARB")) == NULL) || r; + r = ((glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueriesARB")) == NULL) || r; + r = ((glEndQueryARB = (PFNGLENDQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glEndQueryARB")) == NULL) || r; + r = ((glGenQueriesARB = (PFNGLGENQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glGenQueriesARB")) == NULL) || r; + r = ((glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectivARB")) == NULL) || r; + r = ((glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuivARB")) == NULL) || r; + r = ((glGetQueryivARB = (PFNGLGETQUERYIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryivARB")) == NULL) || r; + r = ((glIsQueryARB = (PFNGLISQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glIsQueryARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_occlusion_query */ + +#ifdef GL_ARB_occlusion_query2 + +#endif /* GL_ARB_occlusion_query2 */ + +#ifdef GL_ARB_pixel_buffer_object + +#endif /* GL_ARB_pixel_buffer_object */ + +#ifdef GL_ARB_point_parameters + +static GLboolean _glewInit_GL_ARB_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfARB")) == NULL) || r; + r = ((glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_point_parameters */ + +#ifdef GL_ARB_point_sprite + +#endif /* GL_ARB_point_sprite */ + +#ifdef GL_ARB_program_interface_query + +static GLboolean _glewInit_GL_ARB_program_interface_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInterfaceiv")) == NULL) || r; + r = ((glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceIndex")) == NULL) || r; + r = ((glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocation")) == NULL) || r; + r = ((glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocationIndex")) == NULL) || r; + r = ((glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceName")) == NULL) || r; + r = ((glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_program_interface_query */ + +#ifdef GL_ARB_provoking_vertex + +static GLboolean _glewInit_GL_ARB_provoking_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_provoking_vertex */ + +#ifdef GL_ARB_query_buffer_object + +#endif /* GL_ARB_query_buffer_object */ + +#ifdef GL_ARB_robust_buffer_access_behavior + +#endif /* GL_ARB_robust_buffer_access_behavior */ + +#ifdef GL_ARB_robustness + +static GLboolean _glewInit_GL_ARB_robustness (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetGraphicsResetStatusARB = (PFNGLGETGRAPHICSRESETSTATUSARBPROC)glewGetProcAddress((const GLubyte*)"glGetGraphicsResetStatusARB")) == NULL) || r; + r = ((glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnColorTableARB")) == NULL) || r; + r = ((glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnCompressedTexImageARB")) == NULL) || r; + r = ((glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnConvolutionFilterARB")) == NULL) || r; + r = ((glGetnHistogramARB = (PFNGLGETNHISTOGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glGetnHistogramARB")) == NULL) || r; + r = ((glGetnMapdvARB = (PFNGLGETNMAPDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapdvARB")) == NULL) || r; + r = ((glGetnMapfvARB = (PFNGLGETNMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapfvARB")) == NULL) || r; + r = ((glGetnMapivARB = (PFNGLGETNMAPIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapivARB")) == NULL) || r; + r = ((glGetnMinmaxARB = (PFNGLGETNMINMAXARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMinmaxARB")) == NULL) || r; + r = ((glGetnPixelMapfvARB = (PFNGLGETNPIXELMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapfvARB")) == NULL) || r; + r = ((glGetnPixelMapuivARB = (PFNGLGETNPIXELMAPUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapuivARB")) == NULL) || r; + r = ((glGetnPixelMapusvARB = (PFNGLGETNPIXELMAPUSVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapusvARB")) == NULL) || r; + r = ((glGetnPolygonStippleARB = (PFNGLGETNPOLYGONSTIPPLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPolygonStippleARB")) == NULL) || r; + r = ((glGetnSeparableFilterARB = (PFNGLGETNSEPARABLEFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnSeparableFilterARB")) == NULL) || r; + r = ((glGetnTexImageARB = (PFNGLGETNTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnTexImageARB")) == NULL) || r; + r = ((glGetnUniformdvARB = (PFNGLGETNUNIFORMDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformdvARB")) == NULL) || r; + r = ((glGetnUniformfvARB = (PFNGLGETNUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformfvARB")) == NULL) || r; + r = ((glGetnUniformivARB = (PFNGLGETNUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformivARB")) == NULL) || r; + r = ((glGetnUniformuivARB = (PFNGLGETNUNIFORMUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformuivARB")) == NULL) || r; + r = ((glReadnPixelsARB = (PFNGLREADNPIXELSARBPROC)glewGetProcAddress((const GLubyte*)"glReadnPixelsARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_robustness */ + +#ifdef GL_ARB_robustness_application_isolation + +#endif /* GL_ARB_robustness_application_isolation */ + +#ifdef GL_ARB_robustness_share_group_isolation + +#endif /* GL_ARB_robustness_share_group_isolation */ + +#ifdef GL_ARB_sample_shading + +static GLboolean _glewInit_GL_ARB_sample_shading (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMinSampleShadingARB = (PFNGLMINSAMPLESHADINGARBPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShadingARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sample_shading */ + +#ifdef GL_ARB_sampler_objects + +static GLboolean _glewInit_GL_ARB_sampler_objects (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindSampler = (PFNGLBINDSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glBindSampler")) == NULL) || r; + r = ((glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteSamplers")) == NULL) || r; + r = ((glGenSamplers = (PFNGLGENSAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glGenSamplers")) == NULL) || r; + r = ((glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIiv")) == NULL) || r; + r = ((glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIuiv")) == NULL) || r; + r = ((glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterfv")) == NULL) || r; + r = ((glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameteriv")) == NULL) || r; + r = ((glIsSampler = (PFNGLISSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glIsSampler")) == NULL) || r; + r = ((glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIiv")) == NULL) || r; + r = ((glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIuiv")) == NULL) || r; + r = ((glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterf")) == NULL) || r; + r = ((glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterfv")) == NULL) || r; + r = ((glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteri")) == NULL) || r; + r = ((glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteriv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sampler_objects */ + +#ifdef GL_ARB_seamless_cube_map + +#endif /* GL_ARB_seamless_cube_map */ + +#ifdef GL_ARB_seamless_cubemap_per_texture + +#endif /* GL_ARB_seamless_cubemap_per_texture */ + +#ifdef GL_ARB_separate_shader_objects + +static GLboolean _glewInit_GL_ARB_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glActiveShaderProgram")) == NULL) || r; + r = ((glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glBindProgramPipeline")) == NULL) || r; + r = ((glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramv")) == NULL) || r; + r = ((glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramPipelines")) == NULL) || r; + r = ((glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glGenProgramPipelines")) == NULL) || r; + r = ((glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineInfoLog")) == NULL) || r; + r = ((glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineiv")) == NULL) || r; + r = ((glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glIsProgramPipeline")) == NULL) || r; + r = ((glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1d")) == NULL) || r; + r = ((glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dv")) == NULL) || r; + r = ((glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1f")) == NULL) || r; + r = ((glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fv")) == NULL) || r; + r = ((glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i")) == NULL) || r; + r = ((glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iv")) == NULL) || r; + r = ((glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui")) == NULL) || r; + r = ((glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiv")) == NULL) || r; + r = ((glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2d")) == NULL) || r; + r = ((glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dv")) == NULL) || r; + r = ((glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2f")) == NULL) || r; + r = ((glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fv")) == NULL) || r; + r = ((glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i")) == NULL) || r; + r = ((glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iv")) == NULL) || r; + r = ((glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui")) == NULL) || r; + r = ((glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiv")) == NULL) || r; + r = ((glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3d")) == NULL) || r; + r = ((glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dv")) == NULL) || r; + r = ((glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3f")) == NULL) || r; + r = ((glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fv")) == NULL) || r; + r = ((glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i")) == NULL) || r; + r = ((glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iv")) == NULL) || r; + r = ((glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui")) == NULL) || r; + r = ((glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiv")) == NULL) || r; + r = ((glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4d")) == NULL) || r; + r = ((glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dv")) == NULL) || r; + r = ((glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4f")) == NULL) || r; + r = ((glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fv")) == NULL) || r; + r = ((glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i")) == NULL) || r; + r = ((glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iv")) == NULL) || r; + r = ((glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui")) == NULL) || r; + r = ((glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiv")) == NULL) || r; + r = ((glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2dv")) == NULL) || r; + r = ((glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fv")) == NULL) || r; + r = ((glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3dv")) == NULL) || r; + r = ((glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fv")) == NULL) || r; + r = ((glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4dv")) == NULL) || r; + r = ((glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fv")) == NULL) || r; + r = ((glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3dv")) == NULL) || r; + r = ((glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fv")) == NULL) || r; + r = ((glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2dv")) == NULL) || r; + r = ((glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fv")) == NULL) || r; + r = ((glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4dv")) == NULL) || r; + r = ((glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fv")) == NULL) || r; + r = ((glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4dv")) == NULL) || r; + r = ((glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fv")) == NULL) || r; + r = ((glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2dv")) == NULL) || r; + r = ((glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fv")) == NULL) || r; + r = ((glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3dv")) == NULL) || r; + r = ((glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fv")) == NULL) || r; + r = ((glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)glewGetProcAddress((const GLubyte*)"glUseProgramStages")) == NULL) || r; + r = ((glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramPipeline")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_separate_shader_objects */ + +#ifdef GL_ARB_shader_atomic_counters + +static GLboolean _glewInit_GL_ARB_shader_atomic_counters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAtomicCounterBufferiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_atomic_counters */ + +#ifdef GL_ARB_shader_bit_encoding + +#endif /* GL_ARB_shader_bit_encoding */ + +#ifdef GL_ARB_shader_draw_parameters + +#endif /* GL_ARB_shader_draw_parameters */ + +#ifdef GL_ARB_shader_group_vote + +#endif /* GL_ARB_shader_group_vote */ + +#ifdef GL_ARB_shader_image_load_store + +static GLboolean _glewInit_GL_ARB_shader_image_load_store (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glBindImageTexture")) == NULL) || r; + r = ((glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrier")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_image_load_store */ + +#ifdef GL_ARB_shader_image_size + +#endif /* GL_ARB_shader_image_size */ + +#ifdef GL_ARB_shader_objects + +static GLboolean _glewInit_GL_ARB_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glAttachObjectARB")) == NULL) || r; + r = ((glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderARB")) == NULL) || r; + r = ((glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateProgramObjectARB")) == NULL) || r; + r = ((glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderObjectARB")) == NULL) || r; + r = ((glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteObjectARB")) == NULL) || r; + r = ((glDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDetachObjectARB")) == NULL) || r; + r = ((glGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformARB")) == NULL) || r; + r = ((glGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedObjectsARB")) == NULL) || r; + r = ((glGetHandleARB = (PFNGLGETHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetHandleARB")) == NULL) || r; + r = ((glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetInfoLogARB")) == NULL) || r; + r = ((glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterfvARB")) == NULL) || r; + r = ((glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivARB")) == NULL) || r; + r = ((glGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSourceARB")) == NULL) || r; + r = ((glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocationARB")) == NULL) || r; + r = ((glGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfvARB")) == NULL) || r; + r = ((glGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformivARB")) == NULL) || r; + r = ((glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glLinkProgramARB")) == NULL) || r; + r = ((glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glShaderSourceARB")) == NULL) || r; + r = ((glUniform1fARB = (PFNGLUNIFORM1FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fARB")) == NULL) || r; + r = ((glUniform1fvARB = (PFNGLUNIFORM1FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fvARB")) == NULL) || r; + r = ((glUniform1iARB = (PFNGLUNIFORM1IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1iARB")) == NULL) || r; + r = ((glUniform1ivARB = (PFNGLUNIFORM1IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ivARB")) == NULL) || r; + r = ((glUniform2fARB = (PFNGLUNIFORM2FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fARB")) == NULL) || r; + r = ((glUniform2fvARB = (PFNGLUNIFORM2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fvARB")) == NULL) || r; + r = ((glUniform2iARB = (PFNGLUNIFORM2IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2iARB")) == NULL) || r; + r = ((glUniform2ivARB = (PFNGLUNIFORM2IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ivARB")) == NULL) || r; + r = ((glUniform3fARB = (PFNGLUNIFORM3FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fARB")) == NULL) || r; + r = ((glUniform3fvARB = (PFNGLUNIFORM3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fvARB")) == NULL) || r; + r = ((glUniform3iARB = (PFNGLUNIFORM3IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3iARB")) == NULL) || r; + r = ((glUniform3ivARB = (PFNGLUNIFORM3IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ivARB")) == NULL) || r; + r = ((glUniform4fARB = (PFNGLUNIFORM4FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fARB")) == NULL) || r; + r = ((glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fvARB")) == NULL) || r; + r = ((glUniform4iARB = (PFNGLUNIFORM4IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4iARB")) == NULL) || r; + r = ((glUniform4ivARB = (PFNGLUNIFORM4IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ivARB")) == NULL) || r; + r = ((glUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fvARB")) == NULL) || r; + r = ((glUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fvARB")) == NULL) || r; + r = ((glUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fvARB")) == NULL) || r; + r = ((glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glUseProgramObjectARB")) == NULL) || r; + r = ((glValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_objects */ + +#ifdef GL_ARB_shader_precision + +#endif /* GL_ARB_shader_precision */ + +#ifdef GL_ARB_shader_stencil_export + +#endif /* GL_ARB_shader_stencil_export */ + +#ifdef GL_ARB_shader_storage_buffer_object + +static GLboolean _glewInit_GL_ARB_shader_storage_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glShaderStorageBlockBinding")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_storage_buffer_object */ + +#ifdef GL_ARB_shader_subroutine + +static GLboolean _glewInit_GL_ARB_shader_subroutine (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineName")) == NULL) || r; + r = ((glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformName")) == NULL) || r; + r = ((glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformiv")) == NULL) || r; + r = ((glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStageiv")) == NULL) || r; + r = ((glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineIndex")) == NULL) || r; + r = ((glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineUniformLocation")) == NULL) || r; + r = ((glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformSubroutineuiv")) == NULL) || r; + r = ((glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)glewGetProcAddress((const GLubyte*)"glUniformSubroutinesuiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_subroutine */ + +#ifdef GL_ARB_shader_texture_lod + +#endif /* GL_ARB_shader_texture_lod */ + +#ifdef GL_ARB_shading_language_100 + +#endif /* GL_ARB_shading_language_100 */ + +#ifdef GL_ARB_shading_language_420pack + +#endif /* GL_ARB_shading_language_420pack */ + +#ifdef GL_ARB_shading_language_include + +static GLboolean _glewInit_GL_ARB_shading_language_include (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCompileShaderIncludeARB = (PFNGLCOMPILESHADERINCLUDEARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderIncludeARB")) == NULL) || r; + r = ((glDeleteNamedStringARB = (PFNGLDELETENAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamedStringARB")) == NULL) || r; + r = ((glGetNamedStringARB = (PFNGLGETNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringARB")) == NULL) || r; + r = ((glGetNamedStringivARB = (PFNGLGETNAMEDSTRINGIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringivARB")) == NULL) || r; + r = ((glIsNamedStringARB = (PFNGLISNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glIsNamedStringARB")) == NULL) || r; + r = ((glNamedStringARB = (PFNGLNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glNamedStringARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shading_language_include */ + +#ifdef GL_ARB_shading_language_packing + +#endif /* GL_ARB_shading_language_packing */ + +#ifdef GL_ARB_shadow + +#endif /* GL_ARB_shadow */ + +#ifdef GL_ARB_shadow_ambient + +#endif /* GL_ARB_shadow_ambient */ + +#ifdef GL_ARB_sparse_texture + +static GLboolean _glewInit_GL_ARB_sparse_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexPageCommitmentARB = (PFNGLTEXPAGECOMMITMENTARBPROC)glewGetProcAddress((const GLubyte*)"glTexPageCommitmentARB")) == NULL) || r; + r = ((glTexturePageCommitmentEXT = (PFNGLTEXTUREPAGECOMMITMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glTexturePageCommitmentEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sparse_texture */ + +#ifdef GL_ARB_stencil_texturing + +#endif /* GL_ARB_stencil_texturing */ + +#ifdef GL_ARB_sync + +static GLboolean _glewInit_GL_ARB_sync (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glClientWaitSync")) == NULL) || r; + r = ((glDeleteSync = (PFNGLDELETESYNCPROC)glewGetProcAddress((const GLubyte*)"glDeleteSync")) == NULL) || r; + r = ((glFenceSync = (PFNGLFENCESYNCPROC)glewGetProcAddress((const GLubyte*)"glFenceSync")) == NULL) || r; + r = ((glGetInteger64v = (PFNGLGETINTEGER64VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64v")) == NULL) || r; + r = ((glGetSynciv = (PFNGLGETSYNCIVPROC)glewGetProcAddress((const GLubyte*)"glGetSynciv")) == NULL) || r; + r = ((glIsSync = (PFNGLISSYNCPROC)glewGetProcAddress((const GLubyte*)"glIsSync")) == NULL) || r; + r = ((glWaitSync = (PFNGLWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glWaitSync")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sync */ + +#ifdef GL_ARB_tessellation_shader + +static GLboolean _glewInit_GL_ARB_tessellation_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPatchParameterfv")) == NULL) || r; + r = ((glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPatchParameteri")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_tessellation_shader */ + +#ifdef GL_ARB_texture_border_clamp + +#endif /* GL_ARB_texture_border_clamp */ + +#ifdef GL_ARB_texture_buffer_object + +static GLboolean _glewInit_GL_ARB_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexBufferARB = (PFNGLTEXBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glTexBufferARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_buffer_object */ + +#ifdef GL_ARB_texture_buffer_object_rgb32 + +#endif /* GL_ARB_texture_buffer_object_rgb32 */ + +#ifdef GL_ARB_texture_buffer_range + +static GLboolean _glewInit_GL_ARB_texture_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glTexBufferRange")) == NULL) || r; + r = ((glTextureBufferRangeEXT = (PFNGLTEXTUREBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferRangeEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_buffer_range */ + +#ifdef GL_ARB_texture_compression + +static GLboolean _glewInit_GL_ARB_texture_compression (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1DARB")) == NULL) || r; + r = ((glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2DARB")) == NULL) || r; + r = ((glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3DARB")) == NULL) || r; + r = ((glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1DARB")) == NULL) || r; + r = ((glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2DARB")) == NULL) || r; + r = ((glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3DARB")) == NULL) || r; + r = ((glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImageARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_compression */ + +#ifdef GL_ARB_texture_compression_bptc + +#endif /* GL_ARB_texture_compression_bptc */ + +#ifdef GL_ARB_texture_compression_rgtc + +#endif /* GL_ARB_texture_compression_rgtc */ + +#ifdef GL_ARB_texture_cube_map + +#endif /* GL_ARB_texture_cube_map */ + +#ifdef GL_ARB_texture_cube_map_array + +#endif /* GL_ARB_texture_cube_map_array */ + +#ifdef GL_ARB_texture_env_add + +#endif /* GL_ARB_texture_env_add */ + +#ifdef GL_ARB_texture_env_combine + +#endif /* GL_ARB_texture_env_combine */ + +#ifdef GL_ARB_texture_env_crossbar + +#endif /* GL_ARB_texture_env_crossbar */ + +#ifdef GL_ARB_texture_env_dot3 + +#endif /* GL_ARB_texture_env_dot3 */ + +#ifdef GL_ARB_texture_float + +#endif /* GL_ARB_texture_float */ + +#ifdef GL_ARB_texture_gather + +#endif /* GL_ARB_texture_gather */ + +#ifdef GL_ARB_texture_mirror_clamp_to_edge + +#endif /* GL_ARB_texture_mirror_clamp_to_edge */ + +#ifdef GL_ARB_texture_mirrored_repeat + +#endif /* GL_ARB_texture_mirrored_repeat */ + +#ifdef GL_ARB_texture_multisample + +static GLboolean _glewInit_GL_ARB_texture_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefv")) == NULL) || r; + r = ((glSampleMaski = (PFNGLSAMPLEMASKIPROC)glewGetProcAddress((const GLubyte*)"glSampleMaski")) == NULL) || r; + r = ((glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisample")) == NULL) || r; + r = ((glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisample")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_multisample */ + +#ifdef GL_ARB_texture_non_power_of_two + +#endif /* GL_ARB_texture_non_power_of_two */ + +#ifdef GL_ARB_texture_query_levels + +#endif /* GL_ARB_texture_query_levels */ + +#ifdef GL_ARB_texture_query_lod + +#endif /* GL_ARB_texture_query_lod */ + +#ifdef GL_ARB_texture_rectangle + +#endif /* GL_ARB_texture_rectangle */ + +#ifdef GL_ARB_texture_rg + +#endif /* GL_ARB_texture_rg */ + +#ifdef GL_ARB_texture_rgb10_a2ui + +#endif /* GL_ARB_texture_rgb10_a2ui */ + +#ifdef GL_ARB_texture_stencil8 + +#endif /* GL_ARB_texture_stencil8 */ + +#ifdef GL_ARB_texture_storage + +static GLboolean _glewInit_GL_ARB_texture_storage (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage1D")) == NULL) || r; + r = ((glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2D")) == NULL) || r; + r = ((glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3D")) == NULL) || r; + r = ((glTextureStorage1DEXT = (PFNGLTEXTURESTORAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage1DEXT")) == NULL) || r; + r = ((glTextureStorage2DEXT = (PFNGLTEXTURESTORAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DEXT")) == NULL) || r; + r = ((glTextureStorage3DEXT = (PFNGLTEXTURESTORAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_storage */ + +#ifdef GL_ARB_texture_storage_multisample + +static GLboolean _glewInit_GL_ARB_texture_storage_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2DMultisample")) == NULL) || r; + r = ((glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3DMultisample")) == NULL) || r; + r = ((glTextureStorage2DMultisampleEXT = (PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DMultisampleEXT")) == NULL) || r; + r = ((glTextureStorage3DMultisampleEXT = (PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DMultisampleEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_storage_multisample */ + +#ifdef GL_ARB_texture_swizzle + +#endif /* GL_ARB_texture_swizzle */ + +#ifdef GL_ARB_texture_view + +static GLboolean _glewInit_GL_ARB_texture_view (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTextureView = (PFNGLTEXTUREVIEWPROC)glewGetProcAddress((const GLubyte*)"glTextureView")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_view */ + +#ifdef GL_ARB_timer_query + +static GLboolean _glewInit_GL_ARB_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64v")) == NULL) || r; + r = ((glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64v")) == NULL) || r; + r = ((glQueryCounter = (PFNGLQUERYCOUNTERPROC)glewGetProcAddress((const GLubyte*)"glQueryCounter")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_timer_query */ + +#ifdef GL_ARB_transform_feedback2 + +static GLboolean _glewInit_GL_ARB_transform_feedback2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedback")) == NULL) || r; + r = ((glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacks")) == NULL) || r; + r = ((glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedback")) == NULL) || r; + r = ((glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacks")) == NULL) || r; + r = ((glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedback")) == NULL) || r; + r = ((glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedback")) == NULL) || r; + r = ((glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedback")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback2 */ + +#ifdef GL_ARB_transform_feedback3 + +static GLboolean _glewInit_GL_ARB_transform_feedback3 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryIndexed")) == NULL) || r; + r = ((glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStream")) == NULL) || r; + r = ((glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glEndQueryIndexed")) == NULL) || r; + r = ((glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryIndexediv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback3 */ + +#ifdef GL_ARB_transform_feedback_instanced + +static GLboolean _glewInit_GL_ARB_transform_feedback_instanced (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackInstanced")) == NULL) || r; + r = ((glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStreamInstanced")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback_instanced */ + +#ifdef GL_ARB_transpose_matrix + +static GLboolean _glewInit_GL_ARB_transpose_matrix (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glLoadTransposeMatrixdARB = (PFNGLLOADTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixdARB")) == NULL) || r; + r = ((glLoadTransposeMatrixfARB = (PFNGLLOADTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixfARB")) == NULL) || r; + r = ((glMultTransposeMatrixdARB = (PFNGLMULTTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixdARB")) == NULL) || r; + r = ((glMultTransposeMatrixfARB = (PFNGLMULTTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixfARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transpose_matrix */ + +#ifdef GL_ARB_uniform_buffer_object + +static GLboolean _glewInit_GL_ARB_uniform_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBase")) == NULL) || r; + r = ((glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRange")) == NULL) || r; + r = ((glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockName")) == NULL) || r; + r = ((glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockiv")) == NULL) || r; + r = ((glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformName")) == NULL) || r; + r = ((glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformsiv")) == NULL) || r; + r = ((glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)glewGetProcAddress((const GLubyte*)"glGetIntegeri_v")) == NULL) || r; + r = ((glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBlockIndex")) == NULL) || r; + r = ((glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)glewGetProcAddress((const GLubyte*)"glGetUniformIndices")) == NULL) || r; + r = ((glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glUniformBlockBinding")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_uniform_buffer_object */ + +#ifdef GL_ARB_vertex_array_bgra + +#endif /* GL_ARB_vertex_array_bgra */ + +#ifdef GL_ARB_vertex_array_object + +static GLboolean _glewInit_GL_ARB_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArray")) == NULL) || r; + r = ((glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArrays")) == NULL) || r; + r = ((glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArrays")) == NULL) || r; + r = ((glIsVertexArray = (PFNGLISVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArray")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_array_object */ + +#ifdef GL_ARB_vertex_attrib_64bit + +static GLboolean _glewInit_GL_ARB_vertex_attrib_64bit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdv")) == NULL) || r; + r = ((glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1d")) == NULL) || r; + r = ((glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dv")) == NULL) || r; + r = ((glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2d")) == NULL) || r; + r = ((glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dv")) == NULL) || r; + r = ((glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3d")) == NULL) || r; + r = ((glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dv")) == NULL) || r; + r = ((glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4d")) == NULL) || r; + r = ((glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dv")) == NULL) || r; + r = ((glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_attrib_64bit */ + +#ifdef GL_ARB_vertex_attrib_binding + +static GLboolean _glewInit_GL_ARB_vertex_attrib_binding (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindVertexBuffer")) == NULL) || r; + r = ((glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribBinding")) == NULL) || r; + r = ((glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormat")) == NULL) || r; + r = ((glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormat")) == NULL) || r; + r = ((glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormat")) == NULL) || r; + r = ((glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexBindingDivisor")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_attrib_binding */ + +#ifdef GL_ARB_vertex_blend + +static GLboolean _glewInit_GL_ARB_vertex_blend (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVertexBlendARB = (PFNGLVERTEXBLENDARBPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendARB")) == NULL) || r; + r = ((glWeightPointerARB = (PFNGLWEIGHTPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glWeightPointerARB")) == NULL) || r; + r = ((glWeightbvARB = (PFNGLWEIGHTBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightbvARB")) == NULL) || r; + r = ((glWeightdvARB = (PFNGLWEIGHTDVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightdvARB")) == NULL) || r; + r = ((glWeightfvARB = (PFNGLWEIGHTFVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightfvARB")) == NULL) || r; + r = ((glWeightivARB = (PFNGLWEIGHTIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightivARB")) == NULL) || r; + r = ((glWeightsvARB = (PFNGLWEIGHTSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightsvARB")) == NULL) || r; + r = ((glWeightubvARB = (PFNGLWEIGHTUBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightubvARB")) == NULL) || r; + r = ((glWeightuivARB = (PFNGLWEIGHTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightuivARB")) == NULL) || r; + r = ((glWeightusvARB = (PFNGLWEIGHTUSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightusvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_blend */ + +#ifdef GL_ARB_vertex_buffer_object + +static GLboolean _glewInit_GL_ARB_vertex_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindBufferARB = (PFNGLBINDBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glBindBufferARB")) == NULL) || r; + r = ((glBufferDataARB = (PFNGLBUFFERDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferDataARB")) == NULL) || r; + r = ((glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferSubDataARB")) == NULL) || r; + r = ((glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffersARB")) == NULL) || r; + r = ((glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glGenBuffersARB")) == NULL) || r; + r = ((glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterivARB")) == NULL) || r; + r = ((glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointervARB")) == NULL) || r; + r = ((glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubDataARB")) == NULL) || r; + r = ((glIsBufferARB = (PFNGLISBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glIsBufferARB")) == NULL) || r; + r = ((glMapBufferARB = (PFNGLMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glMapBufferARB")) == NULL) || r; + r = ((glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glUnmapBufferARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_buffer_object */ + +#ifdef GL_ARB_vertex_program + +static GLboolean _glewInit_GL_ARB_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glBindProgramARB")) == NULL) || r; + r = ((glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsARB")) == NULL) || r; + r = ((glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArrayARB")) == NULL) || r; + r = ((glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArrayARB")) == NULL) || r; + r = ((glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsARB")) == NULL) || r; + r = ((glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterdvARB")) == NULL) || r; + r = ((glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterfvARB")) == NULL) || r; + r = ((glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterdvARB")) == NULL) || r; + r = ((glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterfvARB")) == NULL) || r; + r = ((glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringARB")) == NULL) || r; + r = ((glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivARB")) == NULL) || r; + r = ((glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervARB")) == NULL) || r; + r = ((glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvARB")) == NULL) || r; + r = ((glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvARB")) == NULL) || r; + r = ((glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivARB")) == NULL) || r; + r = ((glIsProgramARB = (PFNGLISPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glIsProgramARB")) == NULL) || r; + r = ((glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dARB")) == NULL) || r; + r = ((glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dvARB")) == NULL) || r; + r = ((glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fARB")) == NULL) || r; + r = ((glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fvARB")) == NULL) || r; + r = ((glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dARB")) == NULL) || r; + r = ((glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dvARB")) == NULL) || r; + r = ((glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fARB")) == NULL) || r; + r = ((glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fvARB")) == NULL) || r; + r = ((glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glProgramStringARB")) == NULL) || r; + r = ((glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dARB")) == NULL) || r; + r = ((glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvARB")) == NULL) || r; + r = ((glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fARB")) == NULL) || r; + r = ((glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvARB")) == NULL) || r; + r = ((glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sARB")) == NULL) || r; + r = ((glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svARB")) == NULL) || r; + r = ((glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dARB")) == NULL) || r; + r = ((glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvARB")) == NULL) || r; + r = ((glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fARB")) == NULL) || r; + r = ((glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvARB")) == NULL) || r; + r = ((glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sARB")) == NULL) || r; + r = ((glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svARB")) == NULL) || r; + r = ((glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dARB")) == NULL) || r; + r = ((glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvARB")) == NULL) || r; + r = ((glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fARB")) == NULL) || r; + r = ((glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvARB")) == NULL) || r; + r = ((glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sARB")) == NULL) || r; + r = ((glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svARB")) == NULL) || r; + r = ((glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NbvARB")) == NULL) || r; + r = ((glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NivARB")) == NULL) || r; + r = ((glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NsvARB")) == NULL) || r; + r = ((glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubARB")) == NULL) || r; + r = ((glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubvARB")) == NULL) || r; + r = ((glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NuivARB")) == NULL) || r; + r = ((glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NusvARB")) == NULL) || r; + r = ((glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bvARB")) == NULL) || r; + r = ((glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dARB")) == NULL) || r; + r = ((glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvARB")) == NULL) || r; + r = ((glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fARB")) == NULL) || r; + r = ((glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvARB")) == NULL) || r; + r = ((glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ivARB")) == NULL) || r; + r = ((glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sARB")) == NULL) || r; + r = ((glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svARB")) == NULL) || r; + r = ((glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvARB")) == NULL) || r; + r = ((glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uivARB")) == NULL) || r; + r = ((glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usvARB")) == NULL) || r; + r = ((glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_program */ + +#ifdef GL_ARB_vertex_shader + +static GLboolean _glewInit_GL_ARB_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocationARB")) == NULL) || r; + r = ((glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttribARB")) == NULL) || r; + r = ((glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocationARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_shader */ + +#ifdef GL_ARB_vertex_type_10f_11f_11f_rev + +#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ + +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + +static GLboolean _glewInit_GL_ARB_vertex_type_2_10_10_10_rev (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorP3ui = (PFNGLCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glColorP3ui")) == NULL) || r; + r = ((glColorP3uiv = (PFNGLCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP3uiv")) == NULL) || r; + r = ((glColorP4ui = (PFNGLCOLORP4UIPROC)glewGetProcAddress((const GLubyte*)"glColorP4ui")) == NULL) || r; + r = ((glColorP4uiv = (PFNGLCOLORP4UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP4uiv")) == NULL) || r; + r = ((glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1ui")) == NULL) || r; + r = ((glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1uiv")) == NULL) || r; + r = ((glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2ui")) == NULL) || r; + r = ((glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2uiv")) == NULL) || r; + r = ((glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3ui")) == NULL) || r; + r = ((glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3uiv")) == NULL) || r; + r = ((glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4ui")) == NULL) || r; + r = ((glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4uiv")) == NULL) || r; + r = ((glNormalP3ui = (PFNGLNORMALP3UIPROC)glewGetProcAddress((const GLubyte*)"glNormalP3ui")) == NULL) || r; + r = ((glNormalP3uiv = (PFNGLNORMALP3UIVPROC)glewGetProcAddress((const GLubyte*)"glNormalP3uiv")) == NULL) || r; + r = ((glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3ui")) == NULL) || r; + r = ((glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3uiv")) == NULL) || r; + r = ((glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1ui")) == NULL) || r; + r = ((glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1uiv")) == NULL) || r; + r = ((glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2ui")) == NULL) || r; + r = ((glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2uiv")) == NULL) || r; + r = ((glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3ui")) == NULL) || r; + r = ((glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3uiv")) == NULL) || r; + r = ((glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4ui")) == NULL) || r; + r = ((glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4uiv")) == NULL) || r; + r = ((glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1ui")) == NULL) || r; + r = ((glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1uiv")) == NULL) || r; + r = ((glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2ui")) == NULL) || r; + r = ((glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2uiv")) == NULL) || r; + r = ((glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3ui")) == NULL) || r; + r = ((glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3uiv")) == NULL) || r; + r = ((glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4ui")) == NULL) || r; + r = ((glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4uiv")) == NULL) || r; + r = ((glVertexP2ui = (PFNGLVERTEXP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP2ui")) == NULL) || r; + r = ((glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP2uiv")) == NULL) || r; + r = ((glVertexP3ui = (PFNGLVERTEXP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP3ui")) == NULL) || r; + r = ((glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP3uiv")) == NULL) || r; + r = ((glVertexP4ui = (PFNGLVERTEXP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP4ui")) == NULL) || r; + r = ((glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP4uiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +#ifdef GL_ARB_viewport_array + +static GLboolean _glewInit_GL_ARB_viewport_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeArrayv")) == NULL) || r; + r = ((glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeIndexed")) == NULL) || r; + r = ((glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_v")) == NULL) || r; + r = ((glGetFloati_v = (PFNGLGETFLOATI_VPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_v")) == NULL) || r; + r = ((glScissorArrayv = (PFNGLSCISSORARRAYVPROC)glewGetProcAddress((const GLubyte*)"glScissorArrayv")) == NULL) || r; + r = ((glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexed")) == NULL) || r; + r = ((glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexedv")) == NULL) || r; + r = ((glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)glewGetProcAddress((const GLubyte*)"glViewportArrayv")) == NULL) || r; + r = ((glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedf")) == NULL) || r; + r = ((glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedfv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_viewport_array */ + +#ifdef GL_ARB_window_pos + +static GLboolean _glewInit_GL_ARB_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glWindowPos2dARB = (PFNGLWINDOWPOS2DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dARB")) == NULL) || r; + r = ((glWindowPos2dvARB = (PFNGLWINDOWPOS2DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvARB")) == NULL) || r; + r = ((glWindowPos2fARB = (PFNGLWINDOWPOS2FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fARB")) == NULL) || r; + r = ((glWindowPos2fvARB = (PFNGLWINDOWPOS2FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvARB")) == NULL) || r; + r = ((glWindowPos2iARB = (PFNGLWINDOWPOS2IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iARB")) == NULL) || r; + r = ((glWindowPos2ivARB = (PFNGLWINDOWPOS2IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivARB")) == NULL) || r; + r = ((glWindowPos2sARB = (PFNGLWINDOWPOS2SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sARB")) == NULL) || r; + r = ((glWindowPos2svARB = (PFNGLWINDOWPOS2SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svARB")) == NULL) || r; + r = ((glWindowPos3dARB = (PFNGLWINDOWPOS3DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dARB")) == NULL) || r; + r = ((glWindowPos3dvARB = (PFNGLWINDOWPOS3DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvARB")) == NULL) || r; + r = ((glWindowPos3fARB = (PFNGLWINDOWPOS3FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fARB")) == NULL) || r; + r = ((glWindowPos3fvARB = (PFNGLWINDOWPOS3FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvARB")) == NULL) || r; + r = ((glWindowPos3iARB = (PFNGLWINDOWPOS3IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iARB")) == NULL) || r; + r = ((glWindowPos3ivARB = (PFNGLWINDOWPOS3IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivARB")) == NULL) || r; + r = ((glWindowPos3sARB = (PFNGLWINDOWPOS3SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sARB")) == NULL) || r; + r = ((glWindowPos3svARB = (PFNGLWINDOWPOS3SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_window_pos */ + +#ifdef GL_ATIX_point_sprites + +#endif /* GL_ATIX_point_sprites */ + +#ifdef GL_ATIX_texture_env_combine3 + +#endif /* GL_ATIX_texture_env_combine3 */ + +#ifdef GL_ATIX_texture_env_route + +#endif /* GL_ATIX_texture_env_route */ + +#ifdef GL_ATIX_vertex_shader_output_point_size + +#endif /* GL_ATIX_vertex_shader_output_point_size */ + +#ifdef GL_ATI_draw_buffers + +static GLboolean _glewInit_GL_ATI_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_draw_buffers */ + +#ifdef GL_ATI_element_array + +static GLboolean _glewInit_GL_ATI_element_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayATI")) == NULL) || r; + r = ((glDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayATI")) == NULL) || r; + r = ((glElementPointerATI = (PFNGLELEMENTPOINTERATIPROC)glewGetProcAddress((const GLubyte*)"glElementPointerATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_element_array */ + +#ifdef GL_ATI_envmap_bumpmap + +static GLboolean _glewInit_GL_ATI_envmap_bumpmap (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexBumpParameterfvATI = (PFNGLGETTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterfvATI")) == NULL) || r; + r = ((glGetTexBumpParameterivATI = (PFNGLGETTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterivATI")) == NULL) || r; + r = ((glTexBumpParameterfvATI = (PFNGLTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterfvATI")) == NULL) || r; + r = ((glTexBumpParameterivATI = (PFNGLTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterivATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_envmap_bumpmap */ + +#ifdef GL_ATI_fragment_shader + +static GLboolean _glewInit_GL_ATI_fragment_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp1ATI")) == NULL) || r; + r = ((glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp2ATI")) == NULL) || r; + r = ((glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp3ATI")) == NULL) || r; + r = ((glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBeginFragmentShaderATI")) == NULL) || r; + r = ((glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBindFragmentShaderATI")) == NULL) || r; + r = ((glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp1ATI")) == NULL) || r; + r = ((glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp2ATI")) == NULL) || r; + r = ((glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp3ATI")) == NULL) || r; + r = ((glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glDeleteFragmentShaderATI")) == NULL) || r; + r = ((glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glEndFragmentShaderATI")) == NULL) || r; + r = ((glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)glewGetProcAddress((const GLubyte*)"glGenFragmentShadersATI")) == NULL) || r; + r = ((glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)glewGetProcAddress((const GLubyte*)"glPassTexCoordATI")) == NULL) || r; + r = ((glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)glewGetProcAddress((const GLubyte*)"glSampleMapATI")) == NULL) || r; + r = ((glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)glewGetProcAddress((const GLubyte*)"glSetFragmentShaderConstantATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_fragment_shader */ + +#ifdef GL_ATI_map_object_buffer + +static GLboolean _glewInit_GL_ATI_map_object_buffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMapObjectBufferATI = (PFNGLMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glMapObjectBufferATI")) == NULL) || r; + r = ((glUnmapObjectBufferATI = (PFNGLUNMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUnmapObjectBufferATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_map_object_buffer */ + +#ifdef GL_ATI_meminfo + +#endif /* GL_ATI_meminfo */ + +#ifdef GL_ATI_pn_triangles + +static GLboolean _glewInit_GL_ATI_pn_triangles (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPNTrianglesfATI = (PFNGLPNTRIANGLESFATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesfATI")) == NULL) || r; + r = ((glPNTrianglesiATI = (PFNGLPNTRIANGLESIATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesiATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_pn_triangles */ + +#ifdef GL_ATI_separate_stencil + +static GLboolean _glewInit_GL_ATI_separate_stencil (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glStencilFuncSeparateATI = (PFNGLSTENCILFUNCSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparateATI")) == NULL) || r; + r = ((glStencilOpSeparateATI = (PFNGLSTENCILOPSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparateATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_separate_stencil */ + +#ifdef GL_ATI_shader_texture_lod + +#endif /* GL_ATI_shader_texture_lod */ + +#ifdef GL_ATI_text_fragment_shader + +#endif /* GL_ATI_text_fragment_shader */ + +#ifdef GL_ATI_texture_compression_3dc + +#endif /* GL_ATI_texture_compression_3dc */ + +#ifdef GL_ATI_texture_env_combine3 + +#endif /* GL_ATI_texture_env_combine3 */ + +#ifdef GL_ATI_texture_float + +#endif /* GL_ATI_texture_float */ + +#ifdef GL_ATI_texture_mirror_once + +#endif /* GL_ATI_texture_mirror_once */ + +#ifdef GL_ATI_vertex_array_object + +static GLboolean _glewInit_GL_ATI_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glArrayObjectATI = (PFNGLARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glArrayObjectATI")) == NULL) || r; + r = ((glFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glFreeObjectBufferATI")) == NULL) || r; + r = ((glGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectfvATI")) == NULL) || r; + r = ((glGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectivATI")) == NULL) || r; + r = ((glGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferfvATI")) == NULL) || r; + r = ((glGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferivATI")) == NULL) || r; + r = ((glGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectfvATI")) == NULL) || r; + r = ((glGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectivATI")) == NULL) || r; + r = ((glIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glIsObjectBufferATI")) == NULL) || r; + r = ((glNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glNewObjectBufferATI")) == NULL) || r; + r = ((glUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUpdateObjectBufferATI")) == NULL) || r; + r = ((glVariantArrayObjectATI = (PFNGLVARIANTARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVariantArrayObjectATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_array_object */ + +#ifdef GL_ATI_vertex_attrib_array_object + +static GLboolean _glewInit_GL_ATI_vertex_attrib_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribArrayObjectfvATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectfvATI")) == NULL) || r; + r = ((glGetVertexAttribArrayObjectivATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectivATI")) == NULL) || r; + r = ((glVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribArrayObjectATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_attrib_array_object */ + +#ifdef GL_ATI_vertex_streams + +static GLboolean _glewInit_GL_ATI_vertex_streams (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClientActiveVertexStreamATI = (PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)glewGetProcAddress((const GLubyte*)"glClientActiveVertexStreamATI")) == NULL) || r; + r = ((glNormalStream3bATI = (PFNGLNORMALSTREAM3BATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bATI")) == NULL) || r; + r = ((glNormalStream3bvATI = (PFNGLNORMALSTREAM3BVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bvATI")) == NULL) || r; + r = ((glNormalStream3dATI = (PFNGLNORMALSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dATI")) == NULL) || r; + r = ((glNormalStream3dvATI = (PFNGLNORMALSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dvATI")) == NULL) || r; + r = ((glNormalStream3fATI = (PFNGLNORMALSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fATI")) == NULL) || r; + r = ((glNormalStream3fvATI = (PFNGLNORMALSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fvATI")) == NULL) || r; + r = ((glNormalStream3iATI = (PFNGLNORMALSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3iATI")) == NULL) || r; + r = ((glNormalStream3ivATI = (PFNGLNORMALSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3ivATI")) == NULL) || r; + r = ((glNormalStream3sATI = (PFNGLNORMALSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3sATI")) == NULL) || r; + r = ((glNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3svATI")) == NULL) || r; + r = ((glVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnvfATI")) == NULL) || r; + r = ((glVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnviATI")) == NULL) || r; + r = ((glVertexStream1dATI = (PFNGLVERTEXSTREAM1DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dATI")) == NULL) || r; + r = ((glVertexStream1dvATI = (PFNGLVERTEXSTREAM1DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dvATI")) == NULL) || r; + r = ((glVertexStream1fATI = (PFNGLVERTEXSTREAM1FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fATI")) == NULL) || r; + r = ((glVertexStream1fvATI = (PFNGLVERTEXSTREAM1FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fvATI")) == NULL) || r; + r = ((glVertexStream1iATI = (PFNGLVERTEXSTREAM1IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1iATI")) == NULL) || r; + r = ((glVertexStream1ivATI = (PFNGLVERTEXSTREAM1IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1ivATI")) == NULL) || r; + r = ((glVertexStream1sATI = (PFNGLVERTEXSTREAM1SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1sATI")) == NULL) || r; + r = ((glVertexStream1svATI = (PFNGLVERTEXSTREAM1SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1svATI")) == NULL) || r; + r = ((glVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dATI")) == NULL) || r; + r = ((glVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dvATI")) == NULL) || r; + r = ((glVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fATI")) == NULL) || r; + r = ((glVertexStream2fvATI = (PFNGLVERTEXSTREAM2FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fvATI")) == NULL) || r; + r = ((glVertexStream2iATI = (PFNGLVERTEXSTREAM2IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2iATI")) == NULL) || r; + r = ((glVertexStream2ivATI = (PFNGLVERTEXSTREAM2IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2ivATI")) == NULL) || r; + r = ((glVertexStream2sATI = (PFNGLVERTEXSTREAM2SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2sATI")) == NULL) || r; + r = ((glVertexStream2svATI = (PFNGLVERTEXSTREAM2SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2svATI")) == NULL) || r; + r = ((glVertexStream3dATI = (PFNGLVERTEXSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dATI")) == NULL) || r; + r = ((glVertexStream3dvATI = (PFNGLVERTEXSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dvATI")) == NULL) || r; + r = ((glVertexStream3fATI = (PFNGLVERTEXSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fATI")) == NULL) || r; + r = ((glVertexStream3fvATI = (PFNGLVERTEXSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fvATI")) == NULL) || r; + r = ((glVertexStream3iATI = (PFNGLVERTEXSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3iATI")) == NULL) || r; + r = ((glVertexStream3ivATI = (PFNGLVERTEXSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3ivATI")) == NULL) || r; + r = ((glVertexStream3sATI = (PFNGLVERTEXSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3sATI")) == NULL) || r; + r = ((glVertexStream3svATI = (PFNGLVERTEXSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3svATI")) == NULL) || r; + r = ((glVertexStream4dATI = (PFNGLVERTEXSTREAM4DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dATI")) == NULL) || r; + r = ((glVertexStream4dvATI = (PFNGLVERTEXSTREAM4DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dvATI")) == NULL) || r; + r = ((glVertexStream4fATI = (PFNGLVERTEXSTREAM4FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fATI")) == NULL) || r; + r = ((glVertexStream4fvATI = (PFNGLVERTEXSTREAM4FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fvATI")) == NULL) || r; + r = ((glVertexStream4iATI = (PFNGLVERTEXSTREAM4IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4iATI")) == NULL) || r; + r = ((glVertexStream4ivATI = (PFNGLVERTEXSTREAM4IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4ivATI")) == NULL) || r; + r = ((glVertexStream4sATI = (PFNGLVERTEXSTREAM4SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4sATI")) == NULL) || r; + r = ((glVertexStream4svATI = (PFNGLVERTEXSTREAM4SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4svATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_streams */ + +#ifdef GL_EXT_422_pixels + +#endif /* GL_EXT_422_pixels */ + +#ifdef GL_EXT_Cg_shader + +#endif /* GL_EXT_Cg_shader */ + +#ifdef GL_EXT_abgr + +#endif /* GL_EXT_abgr */ + +#ifdef GL_EXT_bgra + +#endif /* GL_EXT_bgra */ + +#ifdef GL_EXT_bindable_uniform + +static GLboolean _glewInit_GL_EXT_bindable_uniform (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformBufferSizeEXT = (PFNGLGETUNIFORMBUFFERSIZEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBufferSizeEXT")) == NULL) || r; + r = ((glGetUniformOffsetEXT = (PFNGLGETUNIFORMOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformOffsetEXT")) == NULL) || r; + r = ((glUniformBufferEXT = (PFNGLUNIFORMBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUniformBufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_bindable_uniform */ + +#ifdef GL_EXT_blend_color + +static GLboolean _glewInit_GL_EXT_blend_color (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendColorEXT = (PFNGLBLENDCOLOREXTPROC)glewGetProcAddress((const GLubyte*)"glBlendColorEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_color */ + +#ifdef GL_EXT_blend_equation_separate + +static GLboolean _glewInit_GL_EXT_blend_equation_separate (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_equation_separate */ + +#ifdef GL_EXT_blend_func_separate + +static GLboolean _glewInit_GL_EXT_blend_func_separate (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_func_separate */ + +#ifdef GL_EXT_blend_logic_op + +#endif /* GL_EXT_blend_logic_op */ + +#ifdef GL_EXT_blend_minmax + +static GLboolean _glewInit_GL_EXT_blend_minmax (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationEXT = (PFNGLBLENDEQUATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_minmax */ + +#ifdef GL_EXT_blend_subtract + +#endif /* GL_EXT_blend_subtract */ + +#ifdef GL_EXT_clip_volume_hint + +#endif /* GL_EXT_clip_volume_hint */ + +#ifdef GL_EXT_cmyka + +#endif /* GL_EXT_cmyka */ + +#ifdef GL_EXT_color_subtable + +static GLboolean _glewInit_GL_EXT_color_subtable (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorSubTableEXT")) == NULL) || r; + r = ((glCopyColorSubTableEXT = (PFNGLCOPYCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTableEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_color_subtable */ + +#ifdef GL_EXT_compiled_vertex_array + +static GLboolean _glewInit_GL_EXT_compiled_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glLockArraysEXT")) == NULL) || r; + r = ((glUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glUnlockArraysEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_compiled_vertex_array */ + +#ifdef GL_EXT_convolution + +static GLboolean _glewInit_GL_EXT_convolution (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glConvolutionFilter1DEXT = (PFNGLCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1DEXT")) == NULL) || r; + r = ((glConvolutionFilter2DEXT = (PFNGLCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2DEXT")) == NULL) || r; + r = ((glConvolutionParameterfEXT = (PFNGLCONVOLUTIONPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfEXT")) == NULL) || r; + r = ((glConvolutionParameterfvEXT = (PFNGLCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfvEXT")) == NULL) || r; + r = ((glConvolutionParameteriEXT = (PFNGLCONVOLUTIONPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriEXT")) == NULL) || r; + r = ((glConvolutionParameterivEXT = (PFNGLCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterivEXT")) == NULL) || r; + r = ((glCopyConvolutionFilter1DEXT = (PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1DEXT")) == NULL) || r; + r = ((glCopyConvolutionFilter2DEXT = (PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2DEXT")) == NULL) || r; + r = ((glGetConvolutionFilterEXT = (PFNGLGETCONVOLUTIONFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilterEXT")) == NULL) || r; + r = ((glGetConvolutionParameterfvEXT = (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfvEXT")) == NULL) || r; + r = ((glGetConvolutionParameterivEXT = (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterivEXT")) == NULL) || r; + r = ((glGetSeparableFilterEXT = (PFNGLGETSEPARABLEFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilterEXT")) == NULL) || r; + r = ((glSeparableFilter2DEXT = (PFNGLSEPARABLEFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_convolution */ + +#ifdef GL_EXT_coordinate_frame + +static GLboolean _glewInit_GL_EXT_coordinate_frame (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBinormalPointerEXT = (PFNGLBINORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glBinormalPointerEXT")) == NULL) || r; + r = ((glTangentPointerEXT = (PFNGLTANGENTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTangentPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_coordinate_frame */ + +#ifdef GL_EXT_copy_texture + +static GLboolean _glewInit_GL_EXT_copy_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyTexImage1DEXT = (PFNGLCOPYTEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage1DEXT")) == NULL) || r; + r = ((glCopyTexImage2DEXT = (PFNGLCOPYTEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage2DEXT")) == NULL) || r; + r = ((glCopyTexSubImage1DEXT = (PFNGLCOPYTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage1DEXT")) == NULL) || r; + r = ((glCopyTexSubImage2DEXT = (PFNGLCOPYTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage2DEXT")) == NULL) || r; + r = ((glCopyTexSubImage3DEXT = (PFNGLCOPYTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_copy_texture */ + +#ifdef GL_EXT_cull_vertex + +static GLboolean _glewInit_GL_EXT_cull_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCullParameterdvEXT = (PFNGLCULLPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterdvEXT")) == NULL) || r; + r = ((glCullParameterfvEXT = (PFNGLCULLPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_cull_vertex */ + +#ifdef GL_EXT_debug_marker + +static GLboolean _glewInit_GL_EXT_debug_marker (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glInsertEventMarkerEXT")) == NULL) || r; + r = ((glPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPopGroupMarkerEXT")) == NULL) || r; + r = ((glPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPushGroupMarkerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_debug_marker */ + +#ifdef GL_EXT_depth_bounds_test + +static GLboolean _glewInit_GL_EXT_depth_bounds_test (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDepthBoundsEXT = (PFNGLDEPTHBOUNDSEXTPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_depth_bounds_test */ + +#ifdef GL_EXT_direct_state_access + +static GLboolean _glewInit_GL_EXT_direct_state_access (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindMultiTextureEXT")) == NULL) || r; + r = ((glCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckNamedFramebufferStatusEXT")) == NULL) || r; + r = ((glClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glClientAttribDefaultEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage1DEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage2DEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage3DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage1DEXT")) == NULL) || r; + r = ((glCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage2DEXT")) == NULL) || r; + r = ((glCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage3DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage1DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage2DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage3DEXT")) == NULL) || r; + r = ((glCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage1DEXT")) == NULL) || r; + r = ((glCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage2DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage1DEXT")) == NULL) || r; + r = ((glCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage2DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage1DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage2DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage3DEXT")) == NULL) || r; + r = ((glDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateIndexedEXT")) == NULL) || r; + r = ((glDisableClientStateiEXT = (PFNGLDISABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateiEXT")) == NULL) || r; + r = ((glDisableVertexArrayAttribEXT = (PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayAttribEXT")) == NULL) || r; + r = ((glDisableVertexArrayEXT = (PFNGLDISABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayEXT")) == NULL) || r; + r = ((glEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateIndexedEXT")) == NULL) || r; + r = ((glEnableClientStateiEXT = (PFNGLENABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateiEXT")) == NULL) || r; + r = ((glEnableVertexArrayAttribEXT = (PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayAttribEXT")) == NULL) || r; + r = ((glEnableVertexArrayEXT = (PFNGLENABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayEXT")) == NULL) || r; + r = ((glFlushMappedNamedBufferRangeEXT = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedNamedBufferRangeEXT")) == NULL) || r; + r = ((glFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBufferEXT")) == NULL) || r; + r = ((glFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBuffersEXT")) == NULL) || r; + r = ((glFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferReadBufferEXT")) == NULL) || r; + r = ((glGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMultiTexMipmapEXT")) == NULL) || r; + r = ((glGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateTextureMipmapEXT")) == NULL) || r; + r = ((glGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedMultiTexImageEXT")) == NULL) || r; + r = ((glGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureImageEXT")) == NULL) || r; + r = ((glGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoubleIndexedvEXT")) == NULL) || r; + r = ((glGetDoublei_vEXT = (PFNGLGETDOUBLEI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_vEXT")) == NULL) || r; + r = ((glGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloatIndexedvEXT")) == NULL) || r; + r = ((glGetFloati_vEXT = (PFNGLGETFLOATI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_vEXT")) == NULL) || r; + r = ((glGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameterivEXT")) == NULL) || r; + r = ((glGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvfvEXT")) == NULL) || r; + r = ((glGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvivEXT")) == NULL) || r; + r = ((glGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGendvEXT")) == NULL) || r; + r = ((glGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenfvEXT")) == NULL) || r; + r = ((glGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenivEXT")) == NULL) || r; + r = ((glGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexImageEXT")) == NULL) || r; + r = ((glGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterfvEXT")) == NULL) || r; + r = ((glGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIuivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterfvEXT")) == NULL) || r; + r = ((glGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterivEXT")) == NULL) || r; + r = ((glGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterivEXT")) == NULL) || r; + r = ((glGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferPointervEXT")) == NULL) || r; + r = ((glGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferSubDataEXT")) == NULL) || r; + r = ((glGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferAttachmentParameterivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIuivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterdvEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterfvEXT")) == NULL) || r; + r = ((glGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramStringEXT")) == NULL) || r; + r = ((glGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramivEXT")) == NULL) || r; + r = ((glGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedRenderbufferParameterivEXT")) == NULL) || r; + r = ((glGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointerIndexedvEXT")) == NULL) || r; + r = ((glGetPointeri_vEXT = (PFNGLGETPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointeri_vEXT")) == NULL) || r; + r = ((glGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureImageEXT")) == NULL) || r; + r = ((glGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterfvEXT")) == NULL) || r; + r = ((glGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterivEXT")) == NULL) || r; + r = ((glGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIivEXT")) == NULL) || r; + r = ((glGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIuivEXT")) == NULL) || r; + r = ((glGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterfvEXT")) == NULL) || r; + r = ((glGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterivEXT")) == NULL) || r; + r = ((glGetVertexArrayIntegeri_vEXT = (PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegeri_vEXT")) == NULL) || r; + r = ((glGetVertexArrayIntegervEXT = (PFNGLGETVERTEXARRAYINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegervEXT")) == NULL) || r; + r = ((glGetVertexArrayPointeri_vEXT = (PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointeri_vEXT")) == NULL) || r; + r = ((glGetVertexArrayPointervEXT = (PFNGLGETVERTEXARRAYPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointervEXT")) == NULL) || r; + r = ((glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferEXT")) == NULL) || r; + r = ((glMapNamedBufferRangeEXT = (PFNGLMAPNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferRangeEXT")) == NULL) || r; + r = ((glMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixFrustumEXT")) == NULL) || r; + r = ((glMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadIdentityEXT")) == NULL) || r; + r = ((glMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposedEXT")) == NULL) || r; + r = ((glMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposefEXT")) == NULL) || r; + r = ((glMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoaddEXT")) == NULL) || r; + r = ((glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadfEXT")) == NULL) || r; + r = ((glMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposedEXT")) == NULL) || r; + r = ((glMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposefEXT")) == NULL) || r; + r = ((glMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultdEXT")) == NULL) || r; + r = ((glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultfEXT")) == NULL) || r; + r = ((glMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixOrthoEXT")) == NULL) || r; + r = ((glMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPopEXT")) == NULL) || r; + r = ((glMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPushEXT")) == NULL) || r; + r = ((glMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatedEXT")) == NULL) || r; + r = ((glMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatefEXT")) == NULL) || r; + r = ((glMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScaledEXT")) == NULL) || r; + r = ((glMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScalefEXT")) == NULL) || r; + r = ((glMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatedEXT")) == NULL) || r; + r = ((glMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatefEXT")) == NULL) || r; + r = ((glMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexBufferEXT")) == NULL) || r; + r = ((glMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordPointerEXT")) == NULL) || r; + r = ((glMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfEXT")) == NULL) || r; + r = ((glMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfvEXT")) == NULL) || r; + r = ((glMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnviEXT")) == NULL) || r; + r = ((glMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvivEXT")) == NULL) || r; + r = ((glMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendEXT")) == NULL) || r; + r = ((glMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendvEXT")) == NULL) || r; + r = ((glMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfEXT")) == NULL) || r; + r = ((glMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfvEXT")) == NULL) || r; + r = ((glMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGeniEXT")) == NULL) || r; + r = ((glMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenivEXT")) == NULL) || r; + r = ((glMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage1DEXT")) == NULL) || r; + r = ((glMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage2DEXT")) == NULL) || r; + r = ((glMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage3DEXT")) == NULL) || r; + r = ((glMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIivEXT")) == NULL) || r; + r = ((glMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIuivEXT")) == NULL) || r; + r = ((glMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfEXT")) == NULL) || r; + r = ((glMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfvEXT")) == NULL) || r; + r = ((glMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameteriEXT")) == NULL) || r; + r = ((glMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterivEXT")) == NULL) || r; + r = ((glMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexRenderbufferEXT")) == NULL) || r; + r = ((glMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferDataEXT")) == NULL) || r; + r = ((glNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferSubDataEXT")) == NULL) || r; + r = ((glNamedCopyBufferSubDataEXT = (PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedCopyBufferSubDataEXT")) == NULL) || r; + r = ((glNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferRenderbufferEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture1DEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture2DEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture3DEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureFaceEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureLayerEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4iEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4ivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uiEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameters4fvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4ivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4uivEXT")) == NULL) || r; + r = ((glNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramStringEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleCoverageEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleEXT")) == NULL) || r; + r = ((glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fEXT")) == NULL) || r; + r = ((glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fvEXT")) == NULL) || r; + r = ((glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iEXT")) == NULL) || r; + r = ((glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ivEXT")) == NULL) || r; + r = ((glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiEXT")) == NULL) || r; + r = ((glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uivEXT")) == NULL) || r; + r = ((glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fEXT")) == NULL) || r; + r = ((glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fvEXT")) == NULL) || r; + r = ((glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iEXT")) == NULL) || r; + r = ((glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ivEXT")) == NULL) || r; + r = ((glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiEXT")) == NULL) || r; + r = ((glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uivEXT")) == NULL) || r; + r = ((glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fEXT")) == NULL) || r; + r = ((glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fvEXT")) == NULL) || r; + r = ((glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iEXT")) == NULL) || r; + r = ((glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ivEXT")) == NULL) || r; + r = ((glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiEXT")) == NULL) || r; + r = ((glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uivEXT")) == NULL) || r; + r = ((glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fEXT")) == NULL) || r; + r = ((glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fvEXT")) == NULL) || r; + r = ((glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iEXT")) == NULL) || r; + r = ((glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ivEXT")) == NULL) || r; + r = ((glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiEXT")) == NULL) || r; + r = ((glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uivEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fvEXT")) == NULL) || r; + r = ((glPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glPushClientAttribDefaultEXT")) == NULL) || r; + r = ((glTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferEXT")) == NULL) || r; + r = ((glTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage1DEXT")) == NULL) || r; + r = ((glTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DEXT")) == NULL) || r; + r = ((glTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DEXT")) == NULL) || r; + r = ((glTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIivEXT")) == NULL) || r; + r = ((glTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIuivEXT")) == NULL) || r; + r = ((glTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfEXT")) == NULL) || r; + r = ((glTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfvEXT")) == NULL) || r; + r = ((glTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteriEXT")) == NULL) || r; + r = ((glTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterivEXT")) == NULL) || r; + r = ((glTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureRenderbufferEXT")) == NULL) || r; + r = ((glTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage1DEXT")) == NULL) || r; + r = ((glTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage2DEXT")) == NULL) || r; + r = ((glTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage3DEXT")) == NULL) || r; + r = ((glUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUnmapNamedBufferEXT")) == NULL) || r; + r = ((glVertexArrayColorOffsetEXT = (PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayColorOffsetEXT")) == NULL) || r; + r = ((glVertexArrayEdgeFlagOffsetEXT = (PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayEdgeFlagOffsetEXT")) == NULL) || r; + r = ((glVertexArrayFogCoordOffsetEXT = (PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayFogCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayIndexOffsetEXT = (PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayIndexOffsetEXT")) == NULL) || r; + r = ((glVertexArrayMultiTexCoordOffsetEXT = (PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayMultiTexCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayNormalOffsetEXT = (PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayNormalOffsetEXT")) == NULL) || r; + r = ((glVertexArraySecondaryColorOffsetEXT = (PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArraySecondaryColorOffsetEXT")) == NULL) || r; + r = ((glVertexArrayTexCoordOffsetEXT = (PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayTexCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribIOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribIOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexOffsetEXT = (PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexOffsetEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_direct_state_access */ + +#ifdef GL_EXT_draw_buffers2 + +static GLboolean _glewInit_GL_EXT_draw_buffers2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorMaskIndexedEXT = (PFNGLCOLORMASKINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glColorMaskIndexedEXT")) == NULL) || r; + r = ((glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableIndexedEXT")) == NULL) || r; + r = ((glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableIndexedEXT")) == NULL) || r; + r = ((glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetBooleanIndexedvEXT")) == NULL) || r; + r = ((glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerIndexedvEXT")) == NULL) || r; + r = ((glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledIndexedEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_buffers2 */ + +#ifdef GL_EXT_draw_instanced + +static GLboolean _glewInit_GL_EXT_draw_instanced (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedEXT")) == NULL) || r; + r = ((glDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_instanced */ + +#ifdef GL_EXT_draw_range_elements + +static GLboolean _glewInit_GL_EXT_draw_range_elements (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawRangeElementsEXT = (PFNGLDRAWRANGEELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_range_elements */ + +#ifdef GL_EXT_fog_coord + +static GLboolean _glewInit_GL_EXT_fog_coord (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerEXT")) == NULL) || r; + r = ((glFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddEXT")) == NULL) || r; + r = ((glFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddvEXT")) == NULL) || r; + r = ((glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfEXT")) == NULL) || r; + r = ((glFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_fog_coord */ + +#ifdef GL_EXT_fragment_lighting + +static GLboolean _glewInit_GL_EXT_fragment_lighting (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFragmentColorMaterialEXT = (PFNGLFRAGMENTCOLORMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialEXT")) == NULL) || r; + r = ((glFragmentLightModelfEXT = (PFNGLFRAGMENTLIGHTMODELFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfEXT")) == NULL) || r; + r = ((glFragmentLightModelfvEXT = (PFNGLFRAGMENTLIGHTMODELFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvEXT")) == NULL) || r; + r = ((glFragmentLightModeliEXT = (PFNGLFRAGMENTLIGHTMODELIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliEXT")) == NULL) || r; + r = ((glFragmentLightModelivEXT = (PFNGLFRAGMENTLIGHTMODELIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivEXT")) == NULL) || r; + r = ((glFragmentLightfEXT = (PFNGLFRAGMENTLIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfEXT")) == NULL) || r; + r = ((glFragmentLightfvEXT = (PFNGLFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvEXT")) == NULL) || r; + r = ((glFragmentLightiEXT = (PFNGLFRAGMENTLIGHTIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiEXT")) == NULL) || r; + r = ((glFragmentLightivEXT = (PFNGLFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivEXT")) == NULL) || r; + r = ((glFragmentMaterialfEXT = (PFNGLFRAGMENTMATERIALFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfEXT")) == NULL) || r; + r = ((glFragmentMaterialfvEXT = (PFNGLFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvEXT")) == NULL) || r; + r = ((glFragmentMaterialiEXT = (PFNGLFRAGMENTMATERIALIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiEXT")) == NULL) || r; + r = ((glFragmentMaterialivEXT = (PFNGLFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivEXT")) == NULL) || r; + r = ((glGetFragmentLightfvEXT = (PFNGLGETFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvEXT")) == NULL) || r; + r = ((glGetFragmentLightivEXT = (PFNGLGETFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivEXT")) == NULL) || r; + r = ((glGetFragmentMaterialfvEXT = (PFNGLGETFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvEXT")) == NULL) || r; + r = ((glGetFragmentMaterialivEXT = (PFNGLGETFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivEXT")) == NULL) || r; + r = ((glLightEnviEXT = (PFNGLLIGHTENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glLightEnviEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_fragment_lighting */ + +#ifdef GL_EXT_framebuffer_blit + +static GLboolean _glewInit_GL_EXT_framebuffer_blit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_blit */ + +#ifdef GL_EXT_framebuffer_multisample + +static GLboolean _glewInit_GL_EXT_framebuffer_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_multisample */ + +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + +#ifdef GL_EXT_framebuffer_object + +static GLboolean _glewInit_GL_EXT_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindFramebufferEXT")) == NULL) || r; + r = ((glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbufferEXT")) == NULL) || r; + r = ((glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatusEXT")) == NULL) || r; + r = ((glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffersEXT")) == NULL) || r; + r = ((glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffersEXT")) == NULL) || r; + r = ((glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbufferEXT")) == NULL) || r; + r = ((glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1DEXT")) == NULL) || r; + r = ((glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2DEXT")) == NULL) || r; + r = ((glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3DEXT")) == NULL) || r; + r = ((glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffersEXT")) == NULL) || r; + r = ((glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffersEXT")) == NULL) || r; + r = ((glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmapEXT")) == NULL) || r; + r = ((glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameterivEXT")) == NULL) || r; + r = ((glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameterivEXT")) == NULL) || r; + r = ((glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsFramebufferEXT")) == NULL) || r; + r = ((glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbufferEXT")) == NULL) || r; + r = ((glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_object */ + +#ifdef GL_EXT_framebuffer_sRGB + +#endif /* GL_EXT_framebuffer_sRGB */ + +#ifdef GL_EXT_geometry_shader4 + +static GLboolean _glewInit_GL_EXT_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureEXT")) == NULL) || r; + r = ((glFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceEXT")) == NULL) || r; + r = ((glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_geometry_shader4 */ + +#ifdef GL_EXT_gpu_program_parameters + +static GLboolean _glewInit_GL_EXT_gpu_program_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProgramEnvParameters4fvEXT = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameters4fvEXT")) == NULL) || r; + r = ((glProgramLocalParameters4fvEXT = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameters4fvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_gpu_program_parameters */ + +#ifdef GL_EXT_gpu_shader4 + +static GLboolean _glewInit_GL_EXT_gpu_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindFragDataLocationEXT = (PFNGLBINDFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationEXT")) == NULL) || r; + r = ((glGetFragDataLocationEXT = (PFNGLGETFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocationEXT")) == NULL) || r; + r = ((glGetUniformuivEXT = (PFNGLGETUNIFORMUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuivEXT")) == NULL) || r; + r = ((glGetVertexAttribIivEXT = (PFNGLGETVERTEXATTRIBIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIivEXT")) == NULL) || r; + r = ((glGetVertexAttribIuivEXT = (PFNGLGETVERTEXATTRIBIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuivEXT")) == NULL) || r; + r = ((glUniform1uiEXT = (PFNGLUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiEXT")) == NULL) || r; + r = ((glUniform1uivEXT = (PFNGLUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uivEXT")) == NULL) || r; + r = ((glUniform2uiEXT = (PFNGLUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiEXT")) == NULL) || r; + r = ((glUniform2uivEXT = (PFNGLUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uivEXT")) == NULL) || r; + r = ((glUniform3uiEXT = (PFNGLUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiEXT")) == NULL) || r; + r = ((glUniform3uivEXT = (PFNGLUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uivEXT")) == NULL) || r; + r = ((glUniform4uiEXT = (PFNGLUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiEXT")) == NULL) || r; + r = ((glUniform4uivEXT = (PFNGLUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uivEXT")) == NULL) || r; + r = ((glVertexAttribI1iEXT = (PFNGLVERTEXATTRIBI1IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iEXT")) == NULL) || r; + r = ((glVertexAttribI1ivEXT = (PFNGLVERTEXATTRIBI1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ivEXT")) == NULL) || r; + r = ((glVertexAttribI1uiEXT = (PFNGLVERTEXATTRIBI1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiEXT")) == NULL) || r; + r = ((glVertexAttribI1uivEXT = (PFNGLVERTEXATTRIBI1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uivEXT")) == NULL) || r; + r = ((glVertexAttribI2iEXT = (PFNGLVERTEXATTRIBI2IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iEXT")) == NULL) || r; + r = ((glVertexAttribI2ivEXT = (PFNGLVERTEXATTRIBI2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ivEXT")) == NULL) || r; + r = ((glVertexAttribI2uiEXT = (PFNGLVERTEXATTRIBI2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiEXT")) == NULL) || r; + r = ((glVertexAttribI2uivEXT = (PFNGLVERTEXATTRIBI2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uivEXT")) == NULL) || r; + r = ((glVertexAttribI3iEXT = (PFNGLVERTEXATTRIBI3IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iEXT")) == NULL) || r; + r = ((glVertexAttribI3ivEXT = (PFNGLVERTEXATTRIBI3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ivEXT")) == NULL) || r; + r = ((glVertexAttribI3uiEXT = (PFNGLVERTEXATTRIBI3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiEXT")) == NULL) || r; + r = ((glVertexAttribI3uivEXT = (PFNGLVERTEXATTRIBI3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uivEXT")) == NULL) || r; + r = ((glVertexAttribI4bvEXT = (PFNGLVERTEXATTRIBI4BVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bvEXT")) == NULL) || r; + r = ((glVertexAttribI4iEXT = (PFNGLVERTEXATTRIBI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iEXT")) == NULL) || r; + r = ((glVertexAttribI4ivEXT = (PFNGLVERTEXATTRIBI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ivEXT")) == NULL) || r; + r = ((glVertexAttribI4svEXT = (PFNGLVERTEXATTRIBI4SVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4svEXT")) == NULL) || r; + r = ((glVertexAttribI4ubvEXT = (PFNGLVERTEXATTRIBI4UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubvEXT")) == NULL) || r; + r = ((glVertexAttribI4uiEXT = (PFNGLVERTEXATTRIBI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiEXT")) == NULL) || r; + r = ((glVertexAttribI4uivEXT = (PFNGLVERTEXATTRIBI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uivEXT")) == NULL) || r; + r = ((glVertexAttribI4usvEXT = (PFNGLVERTEXATTRIBI4USVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usvEXT")) == NULL) || r; + r = ((glVertexAttribIPointerEXT = (PFNGLVERTEXATTRIBIPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_gpu_shader4 */ + +#ifdef GL_EXT_histogram + +static GLboolean _glewInit_GL_EXT_histogram (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetHistogramEXT = (PFNGLGETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramEXT")) == NULL) || r; + r = ((glGetHistogramParameterfvEXT = (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfvEXT")) == NULL) || r; + r = ((glGetHistogramParameterivEXT = (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterivEXT")) == NULL) || r; + r = ((glGetMinmaxEXT = (PFNGLGETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxEXT")) == NULL) || r; + r = ((glGetMinmaxParameterfvEXT = (PFNGLGETMINMAXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfvEXT")) == NULL) || r; + r = ((glGetMinmaxParameterivEXT = (PFNGLGETMINMAXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterivEXT")) == NULL) || r; + r = ((glHistogramEXT = (PFNGLHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glHistogramEXT")) == NULL) || r; + r = ((glMinmaxEXT = (PFNGLMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glMinmaxEXT")) == NULL) || r; + r = ((glResetHistogramEXT = (PFNGLRESETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glResetHistogramEXT")) == NULL) || r; + r = ((glResetMinmaxEXT = (PFNGLRESETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glResetMinmaxEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_histogram */ + +#ifdef GL_EXT_index_array_formats + +#endif /* GL_EXT_index_array_formats */ + +#ifdef GL_EXT_index_func + +static GLboolean _glewInit_GL_EXT_index_func (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glIndexFuncEXT = (PFNGLINDEXFUNCEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexFuncEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_index_func */ + +#ifdef GL_EXT_index_material + +static GLboolean _glewInit_GL_EXT_index_material (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glIndexMaterialEXT = (PFNGLINDEXMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexMaterialEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_index_material */ + +#ifdef GL_EXT_index_texture + +#endif /* GL_EXT_index_texture */ + +#ifdef GL_EXT_light_texture + +static GLboolean _glewInit_GL_EXT_light_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glApplyTextureEXT = (PFNGLAPPLYTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glApplyTextureEXT")) == NULL) || r; + r = ((glTextureLightEXT = (PFNGLTEXTURELIGHTEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureLightEXT")) == NULL) || r; + r = ((glTextureMaterialEXT = (PFNGLTEXTUREMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureMaterialEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_light_texture */ + +#ifdef GL_EXT_misc_attribute + +#endif /* GL_EXT_misc_attribute */ + +#ifdef GL_EXT_multi_draw_arrays + +static GLboolean _glewInit_GL_EXT_multi_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysEXT")) == NULL) || r; + r = ((glMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_multi_draw_arrays */ + +#ifdef GL_EXT_multisample + +static GLboolean _glewInit_GL_EXT_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSampleMaskEXT = (PFNGLSAMPLEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskEXT")) == NULL) || r; + r = ((glSamplePatternEXT = (PFNGLSAMPLEPATTERNEXTPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_multisample */ + +#ifdef GL_EXT_packed_depth_stencil + +#endif /* GL_EXT_packed_depth_stencil */ + +#ifdef GL_EXT_packed_float + +#endif /* GL_EXT_packed_float */ + +#ifdef GL_EXT_packed_pixels + +#endif /* GL_EXT_packed_pixels */ + +#ifdef GL_EXT_paletted_texture + +static GLboolean _glewInit_GL_EXT_paletted_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorTableEXT = (PFNGLCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorTableEXT")) == NULL) || r; + r = ((glGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableEXT")) == NULL) || r; + r = ((glGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvEXT")) == NULL) || r; + r = ((glGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_paletted_texture */ + +#ifdef GL_EXT_pixel_buffer_object + +#endif /* GL_EXT_pixel_buffer_object */ + +#ifdef GL_EXT_pixel_transform + +static GLboolean _glewInit_GL_EXT_pixel_transform (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetPixelTransformParameterfvEXT = (PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterfvEXT")) == NULL) || r; + r = ((glGetPixelTransformParameterivEXT = (PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterivEXT")) == NULL) || r; + r = ((glPixelTransformParameterfEXT = (PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfEXT")) == NULL) || r; + r = ((glPixelTransformParameterfvEXT = (PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfvEXT")) == NULL) || r; + r = ((glPixelTransformParameteriEXT = (PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameteriEXT")) == NULL) || r; + r = ((glPixelTransformParameterivEXT = (PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterivEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_pixel_transform */ + +#ifdef GL_EXT_pixel_transform_color_table + +#endif /* GL_EXT_pixel_transform_color_table */ + +#ifdef GL_EXT_point_parameters + +static GLboolean _glewInit_GL_EXT_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameterfEXT = (PFNGLPOINTPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfEXT")) == NULL) || r; + r = ((glPointParameterfvEXT = (PFNGLPOINTPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_point_parameters */ + +#ifdef GL_EXT_polygon_offset + +static GLboolean _glewInit_GL_EXT_polygon_offset (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPolygonOffsetEXT = (PFNGLPOLYGONOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_polygon_offset */ + +#ifdef GL_EXT_provoking_vertex + +static GLboolean _glewInit_GL_EXT_provoking_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProvokingVertexEXT = (PFNGLPROVOKINGVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertexEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_provoking_vertex */ + +#ifdef GL_EXT_rescale_normal + +#endif /* GL_EXT_rescale_normal */ + +#ifdef GL_EXT_scene_marker + +static GLboolean _glewInit_GL_EXT_scene_marker (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginSceneEXT = (PFNGLBEGINSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginSceneEXT")) == NULL) || r; + r = ((glEndSceneEXT = (PFNGLENDSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glEndSceneEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_scene_marker */ + +#ifdef GL_EXT_secondary_color + +static GLboolean _glewInit_GL_EXT_secondary_color (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bEXT")) == NULL) || r; + r = ((glSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bvEXT")) == NULL) || r; + r = ((glSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dEXT")) == NULL) || r; + r = ((glSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dvEXT")) == NULL) || r; + r = ((glSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fEXT")) == NULL) || r; + r = ((glSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fvEXT")) == NULL) || r; + r = ((glSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iEXT")) == NULL) || r; + r = ((glSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ivEXT")) == NULL) || r; + r = ((glSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sEXT")) == NULL) || r; + r = ((glSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3svEXT")) == NULL) || r; + r = ((glSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubEXT")) == NULL) || r; + r = ((glSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubvEXT")) == NULL) || r; + r = ((glSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiEXT")) == NULL) || r; + r = ((glSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uivEXT")) == NULL) || r; + r = ((glSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usEXT")) == NULL) || r; + r = ((glSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usvEXT")) == NULL) || r; + r = ((glSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_secondary_color */ + +#ifdef GL_EXT_separate_shader_objects + +static GLboolean _glewInit_GL_EXT_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveProgramEXT = (PFNGLACTIVEPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveProgramEXT")) == NULL) || r; + r = ((glCreateShaderProgramEXT = (PFNGLCREATESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramEXT")) == NULL) || r; + r = ((glUseShaderProgramEXT = (PFNGLUSESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glUseShaderProgramEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_separate_shader_objects */ + +#ifdef GL_EXT_separate_specular_color + +#endif /* GL_EXT_separate_specular_color */ + +#ifdef GL_EXT_shader_image_load_store + +static GLboolean _glewInit_GL_EXT_shader_image_load_store (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindImageTextureEXT = (PFNGLBINDIMAGETEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindImageTextureEXT")) == NULL) || r; + r = ((glMemoryBarrierEXT = (PFNGLMEMORYBARRIEREXTPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrierEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_shader_image_load_store */ + +#ifdef GL_EXT_shadow_funcs + +#endif /* GL_EXT_shadow_funcs */ + +#ifdef GL_EXT_shared_texture_palette + +#endif /* GL_EXT_shared_texture_palette */ + +#ifdef GL_EXT_stencil_clear_tag + +#endif /* GL_EXT_stencil_clear_tag */ + +#ifdef GL_EXT_stencil_two_side + +static GLboolean _glewInit_GL_EXT_stencil_two_side (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveStencilFaceEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_stencil_two_side */ + +#ifdef GL_EXT_stencil_wrap + +#endif /* GL_EXT_stencil_wrap */ + +#ifdef GL_EXT_subtexture + +static GLboolean _glewInit_GL_EXT_subtexture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexSubImage1DEXT = (PFNGLTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage1DEXT")) == NULL) || r; + r = ((glTexSubImage2DEXT = (PFNGLTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage2DEXT")) == NULL) || r; + r = ((glTexSubImage3DEXT = (PFNGLTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_subtexture */ + +#ifdef GL_EXT_texture + +#endif /* GL_EXT_texture */ + +#ifdef GL_EXT_texture3D + +static GLboolean _glewInit_GL_EXT_texture3D (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexImage3DEXT = (PFNGLTEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture3D */ + +#ifdef GL_EXT_texture_array + +static GLboolean _glewInit_GL_EXT_texture_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_array */ + +#ifdef GL_EXT_texture_buffer_object + +static GLboolean _glewInit_GL_EXT_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexBufferEXT = (PFNGLTEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexBufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_buffer_object */ + +#ifdef GL_EXT_texture_compression_dxt1 + +#endif /* GL_EXT_texture_compression_dxt1 */ + +#ifdef GL_EXT_texture_compression_latc + +#endif /* GL_EXT_texture_compression_latc */ + +#ifdef GL_EXT_texture_compression_rgtc + +#endif /* GL_EXT_texture_compression_rgtc */ + +#ifdef GL_EXT_texture_compression_s3tc + +#endif /* GL_EXT_texture_compression_s3tc */ + +#ifdef GL_EXT_texture_cube_map + +#endif /* GL_EXT_texture_cube_map */ + +#ifdef GL_EXT_texture_edge_clamp + +#endif /* GL_EXT_texture_edge_clamp */ + +#ifdef GL_EXT_texture_env + +#endif /* GL_EXT_texture_env */ + +#ifdef GL_EXT_texture_env_add + +#endif /* GL_EXT_texture_env_add */ + +#ifdef GL_EXT_texture_env_combine + +#endif /* GL_EXT_texture_env_combine */ + +#ifdef GL_EXT_texture_env_dot3 + +#endif /* GL_EXT_texture_env_dot3 */ + +#ifdef GL_EXT_texture_filter_anisotropic + +#endif /* GL_EXT_texture_filter_anisotropic */ + +#ifdef GL_EXT_texture_integer + +static GLboolean _glewInit_GL_EXT_texture_integer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearColorIiEXT = (PFNGLCLEARCOLORIIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIiEXT")) == NULL) || r; + r = ((glClearColorIuiEXT = (PFNGLCLEARCOLORIUIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIuiEXT")) == NULL) || r; + r = ((glGetTexParameterIivEXT = (PFNGLGETTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIivEXT")) == NULL) || r; + r = ((glGetTexParameterIuivEXT = (PFNGLGETTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuivEXT")) == NULL) || r; + r = ((glTexParameterIivEXT = (PFNGLTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIivEXT")) == NULL) || r; + r = ((glTexParameterIuivEXT = (PFNGLTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuivEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_integer */ + +#ifdef GL_EXT_texture_lod_bias + +#endif /* GL_EXT_texture_lod_bias */ + +#ifdef GL_EXT_texture_mirror_clamp + +#endif /* GL_EXT_texture_mirror_clamp */ + +#ifdef GL_EXT_texture_object + +static GLboolean _glewInit_GL_EXT_texture_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAreTexturesResidentEXT = (PFNGLARETEXTURESRESIDENTEXTPROC)glewGetProcAddress((const GLubyte*)"glAreTexturesResidentEXT")) == NULL) || r; + r = ((glBindTextureEXT = (PFNGLBINDTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureEXT")) == NULL) || r; + r = ((glDeleteTexturesEXT = (PFNGLDELETETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteTexturesEXT")) == NULL) || r; + r = ((glGenTexturesEXT = (PFNGLGENTEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glGenTexturesEXT")) == NULL) || r; + r = ((glIsTextureEXT = (PFNGLISTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glIsTextureEXT")) == NULL) || r; + r = ((glPrioritizeTexturesEXT = (PFNGLPRIORITIZETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glPrioritizeTexturesEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_object */ + +#ifdef GL_EXT_texture_perturb_normal + +static GLboolean _glewInit_GL_EXT_texture_perturb_normal (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTextureNormalEXT = (PFNGLTEXTURENORMALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureNormalEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_perturb_normal */ + +#ifdef GL_EXT_texture_rectangle + +#endif /* GL_EXT_texture_rectangle */ + +#ifdef GL_EXT_texture_sRGB + +#endif /* GL_EXT_texture_sRGB */ + +#ifdef GL_EXT_texture_sRGB_decode + +#endif /* GL_EXT_texture_sRGB_decode */ + +#ifdef GL_EXT_texture_shared_exponent + +#endif /* GL_EXT_texture_shared_exponent */ + +#ifdef GL_EXT_texture_snorm + +#endif /* GL_EXT_texture_snorm */ + +#ifdef GL_EXT_texture_swizzle + +#endif /* GL_EXT_texture_swizzle */ + +#ifdef GL_EXT_timer_query + +static GLboolean _glewInit_GL_EXT_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64vEXT")) == NULL) || r; + r = ((glGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64vEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_timer_query */ + +#ifdef GL_EXT_transform_feedback + +static GLboolean _glewInit_GL_EXT_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackEXT")) == NULL) || r; + r = ((glBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseEXT")) == NULL) || r; + r = ((glBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetEXT")) == NULL) || r; + r = ((glBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeEXT")) == NULL) || r; + r = ((glEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackEXT")) == NULL) || r; + r = ((glGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingEXT")) == NULL) || r; + r = ((glTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_transform_feedback */ + +#ifdef GL_EXT_vertex_array + +static GLboolean _glewInit_GL_EXT_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glArrayElementEXT")) == NULL) || r; + r = ((glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glColorPointerEXT")) == NULL) || r; + r = ((glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysEXT")) == NULL) || r; + r = ((glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerEXT")) == NULL) || r; + r = ((glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerEXT")) == NULL) || r; + r = ((glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerEXT")) == NULL) || r; + r = ((glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerEXT")) == NULL) || r; + r = ((glVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_array */ + +#ifdef GL_EXT_vertex_array_bgra + +#endif /* GL_EXT_vertex_array_bgra */ + +#ifdef GL_EXT_vertex_attrib_64bit + +static GLboolean _glewInit_GL_EXT_vertex_attrib_64bit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLdvEXT = (PFNGLGETVERTEXATTRIBLDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdvEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribLOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribLOffsetEXT")) == NULL) || r; + r = ((glVertexAttribL1dEXT = (PFNGLVERTEXATTRIBL1DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dEXT")) == NULL) || r; + r = ((glVertexAttribL1dvEXT = (PFNGLVERTEXATTRIBL1DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dvEXT")) == NULL) || r; + r = ((glVertexAttribL2dEXT = (PFNGLVERTEXATTRIBL2DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dEXT")) == NULL) || r; + r = ((glVertexAttribL2dvEXT = (PFNGLVERTEXATTRIBL2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dvEXT")) == NULL) || r; + r = ((glVertexAttribL3dEXT = (PFNGLVERTEXATTRIBL3DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dEXT")) == NULL) || r; + r = ((glVertexAttribL3dvEXT = (PFNGLVERTEXATTRIBL3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dvEXT")) == NULL) || r; + r = ((glVertexAttribL4dEXT = (PFNGLVERTEXATTRIBL4DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dEXT")) == NULL) || r; + r = ((glVertexAttribL4dvEXT = (PFNGLVERTEXATTRIBL4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dvEXT")) == NULL) || r; + r = ((glVertexAttribLPointerEXT = (PFNGLVERTEXATTRIBLPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_attrib_64bit */ + +#ifdef GL_EXT_vertex_shader + +static GLboolean _glewInit_GL_EXT_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBeginVertexShaderEXT")) == NULL) || r; + r = ((glBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindLightParameterEXT")) == NULL) || r; + r = ((glBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindMaterialParameterEXT")) == NULL) || r; + r = ((glBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindParameterEXT")) == NULL) || r; + r = ((glBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTexGenParameterEXT")) == NULL) || r; + r = ((glBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureUnitParameterEXT")) == NULL) || r; + r = ((glBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindVertexShaderEXT")) == NULL) || r; + r = ((glDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexShaderEXT")) == NULL) || r; + r = ((glDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVariantClientStateEXT")) == NULL) || r; + r = ((glEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVariantClientStateEXT")) == NULL) || r; + r = ((glEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glEndVertexShaderEXT")) == NULL) || r; + r = ((glExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glExtractComponentEXT")) == NULL) || r; + r = ((glGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenSymbolsEXT")) == NULL) || r; + r = ((glGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenVertexShadersEXT")) == NULL) || r; + r = ((glGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantBooleanvEXT")) == NULL) || r; + r = ((glGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantFloatvEXT")) == NULL) || r; + r = ((glGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantIntegervEXT")) == NULL) || r; + r = ((glGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantBooleanvEXT")) == NULL) || r; + r = ((glGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantFloatvEXT")) == NULL) || r; + r = ((glGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantIntegervEXT")) == NULL) || r; + r = ((glGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantBooleanvEXT")) == NULL) || r; + r = ((glGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantFloatvEXT")) == NULL) || r; + r = ((glGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantIntegervEXT")) == NULL) || r; + r = ((glGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantPointervEXT")) == NULL) || r; + r = ((glInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glInsertComponentEXT")) == NULL) || r; + r = ((glIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsVariantEnabledEXT")) == NULL) || r; + r = ((glSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetInvariantEXT")) == NULL) || r; + r = ((glSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetLocalConstantEXT")) == NULL) || r; + r = ((glShaderOp1EXT = (PFNGLSHADEROP1EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp1EXT")) == NULL) || r; + r = ((glShaderOp2EXT = (PFNGLSHADEROP2EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp2EXT")) == NULL) || r; + r = ((glShaderOp3EXT = (PFNGLSHADEROP3EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp3EXT")) == NULL) || r; + r = ((glSwizzleEXT = (PFNGLSWIZZLEEXTPROC)glewGetProcAddress((const GLubyte*)"glSwizzleEXT")) == NULL) || r; + r = ((glVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVariantPointerEXT")) == NULL) || r; + r = ((glVariantbvEXT = (PFNGLVARIANTBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantbvEXT")) == NULL) || r; + r = ((glVariantdvEXT = (PFNGLVARIANTDVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantdvEXT")) == NULL) || r; + r = ((glVariantfvEXT = (PFNGLVARIANTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantfvEXT")) == NULL) || r; + r = ((glVariantivEXT = (PFNGLVARIANTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantivEXT")) == NULL) || r; + r = ((glVariantsvEXT = (PFNGLVARIANTSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantsvEXT")) == NULL) || r; + r = ((glVariantubvEXT = (PFNGLVARIANTUBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantubvEXT")) == NULL) || r; + r = ((glVariantuivEXT = (PFNGLVARIANTUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantuivEXT")) == NULL) || r; + r = ((glVariantusvEXT = (PFNGLVARIANTUSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantusvEXT")) == NULL) || r; + r = ((glWriteMaskEXT = (PFNGLWRITEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glWriteMaskEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_shader */ + +#ifdef GL_EXT_vertex_weighting + +static GLboolean _glewInit_GL_EXT_vertex_weighting (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVertexWeightPointerEXT = (PFNGLVERTEXWEIGHTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightPointerEXT")) == NULL) || r; + r = ((glVertexWeightfEXT = (PFNGLVERTEXWEIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfEXT")) == NULL) || r; + r = ((glVertexWeightfvEXT = (PFNGLVERTEXWEIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_weighting */ + +#ifdef GL_EXT_x11_sync_object + +static GLboolean _glewInit_GL_EXT_x11_sync_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glImportSyncEXT = (PFNGLIMPORTSYNCEXTPROC)glewGetProcAddress((const GLubyte*)"glImportSyncEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_x11_sync_object */ + +#ifdef GL_GREMEDY_frame_terminator + +static GLboolean _glewInit_GL_GREMEDY_frame_terminator (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFrameTerminatorGREMEDY = (PFNGLFRAMETERMINATORGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glFrameTerminatorGREMEDY")) == NULL) || r; + + return r; +} + +#endif /* GL_GREMEDY_frame_terminator */ + +#ifdef GL_GREMEDY_string_marker + +static GLboolean _glewInit_GL_GREMEDY_string_marker (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glStringMarkerGREMEDY = (PFNGLSTRINGMARKERGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glStringMarkerGREMEDY")) == NULL) || r; + + return r; +} + +#endif /* GL_GREMEDY_string_marker */ + +#ifdef GL_HP_convolution_border_modes + +#endif /* GL_HP_convolution_border_modes */ + +#ifdef GL_HP_image_transform + +static GLboolean _glewInit_GL_HP_image_transform (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetImageTransformParameterfvHP = (PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterfvHP")) == NULL) || r; + r = ((glGetImageTransformParameterivHP = (PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterivHP")) == NULL) || r; + r = ((glImageTransformParameterfHP = (PFNGLIMAGETRANSFORMPARAMETERFHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfHP")) == NULL) || r; + r = ((glImageTransformParameterfvHP = (PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfvHP")) == NULL) || r; + r = ((glImageTransformParameteriHP = (PFNGLIMAGETRANSFORMPARAMETERIHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameteriHP")) == NULL) || r; + r = ((glImageTransformParameterivHP = (PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterivHP")) == NULL) || r; + + return r; +} + +#endif /* GL_HP_image_transform */ + +#ifdef GL_HP_occlusion_test + +#endif /* GL_HP_occlusion_test */ + +#ifdef GL_HP_texture_lighting + +#endif /* GL_HP_texture_lighting */ + +#ifdef GL_IBM_cull_vertex + +#endif /* GL_IBM_cull_vertex */ + +#ifdef GL_IBM_multimode_draw_arrays + +static GLboolean _glewInit_GL_IBM_multimode_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiModeDrawArraysIBM = (PFNGLMULTIMODEDRAWARRAYSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawArraysIBM")) == NULL) || r; + r = ((glMultiModeDrawElementsIBM = (PFNGLMULTIMODEDRAWELEMENTSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawElementsIBM")) == NULL) || r; + + return r; +} + +#endif /* GL_IBM_multimode_draw_arrays */ + +#ifdef GL_IBM_rasterpos_clip + +#endif /* GL_IBM_rasterpos_clip */ + +#ifdef GL_IBM_static_data + +#endif /* GL_IBM_static_data */ + +#ifdef GL_IBM_texture_mirrored_repeat + +#endif /* GL_IBM_texture_mirrored_repeat */ + +#ifdef GL_IBM_vertex_array_lists + +static GLboolean _glewInit_GL_IBM_vertex_array_lists (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorPointerListIBM = (PFNGLCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glColorPointerListIBM")) == NULL) || r; + r = ((glEdgeFlagPointerListIBM = (PFNGLEDGEFLAGPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerListIBM")) == NULL) || r; + r = ((glFogCoordPointerListIBM = (PFNGLFOGCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerListIBM")) == NULL) || r; + r = ((glIndexPointerListIBM = (PFNGLINDEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerListIBM")) == NULL) || r; + r = ((glNormalPointerListIBM = (PFNGLNORMALPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerListIBM")) == NULL) || r; + r = ((glSecondaryColorPointerListIBM = (PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerListIBM")) == NULL) || r; + r = ((glTexCoordPointerListIBM = (PFNGLTEXCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerListIBM")) == NULL) || r; + r = ((glVertexPointerListIBM = (PFNGLVERTEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerListIBM")) == NULL) || r; + + return r; +} + +#endif /* GL_IBM_vertex_array_lists */ + +#ifdef GL_INGR_color_clamp + +#endif /* GL_INGR_color_clamp */ + +#ifdef GL_INGR_interlace_read + +#endif /* GL_INGR_interlace_read */ + +#ifdef GL_INTEL_map_texture + +static GLboolean _glewInit_GL_INTEL_map_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMapTexture2DINTEL = (PFNGLMAPTEXTURE2DINTELPROC)glewGetProcAddress((const GLubyte*)"glMapTexture2DINTEL")) == NULL) || r; + r = ((glSyncTextureINTEL = (PFNGLSYNCTEXTUREINTELPROC)glewGetProcAddress((const GLubyte*)"glSyncTextureINTEL")) == NULL) || r; + r = ((glUnmapTexture2DINTEL = (PFNGLUNMAPTEXTURE2DINTELPROC)glewGetProcAddress((const GLubyte*)"glUnmapTexture2DINTEL")) == NULL) || r; + + return r; +} + +#endif /* GL_INTEL_map_texture */ + +#ifdef GL_INTEL_parallel_arrays + +static GLboolean _glewInit_GL_INTEL_parallel_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorPointervINTEL = (PFNGLCOLORPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glColorPointervINTEL")) == NULL) || r; + r = ((glNormalPointervINTEL = (PFNGLNORMALPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glNormalPointervINTEL")) == NULL) || r; + r = ((glTexCoordPointervINTEL = (PFNGLTEXCOORDPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointervINTEL")) == NULL) || r; + r = ((glVertexPointervINTEL = (PFNGLVERTEXPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glVertexPointervINTEL")) == NULL) || r; + + return r; +} + +#endif /* GL_INTEL_parallel_arrays */ + +#ifdef GL_INTEL_texture_scissor + +static GLboolean _glewInit_GL_INTEL_texture_scissor (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexScissorFuncINTEL = (PFNGLTEXSCISSORFUNCINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorFuncINTEL")) == NULL) || r; + r = ((glTexScissorINTEL = (PFNGLTEXSCISSORINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorINTEL")) == NULL) || r; + + return r; +} + +#endif /* GL_INTEL_texture_scissor */ + +#ifdef GL_KHR_debug + +static GLboolean _glewInit_GL_KHR_debug (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallback")) == NULL) || r; + r = ((glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControl")) == NULL) || r; + r = ((glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsert")) == NULL) || r; + r = ((glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLog")) == NULL) || r; + r = ((glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectLabel")) == NULL) || r; + r = ((glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectPtrLabel")) == NULL) || r; + r = ((glObjectLabel = (PFNGLOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectLabel")) == NULL) || r; + r = ((glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectPtrLabel")) == NULL) || r; + r = ((glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)glewGetProcAddress((const GLubyte*)"glPopDebugGroup")) == NULL) || r; + r = ((glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)glewGetProcAddress((const GLubyte*)"glPushDebugGroup")) == NULL) || r; + + return r; +} + +#endif /* GL_KHR_debug */ + +#ifdef GL_KHR_texture_compression_astc_ldr + +#endif /* GL_KHR_texture_compression_astc_ldr */ + +#ifdef GL_KTX_buffer_region + +static GLboolean _glewInit_GL_KTX_buffer_region (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBufferRegionEnabled = (PFNGLBUFFERREGIONENABLEDPROC)glewGetProcAddress((const GLubyte*)"glBufferRegionEnabled")) == NULL) || r; + r = ((glDeleteBufferRegion = (PFNGLDELETEBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDeleteBufferRegion")) == NULL) || r; + r = ((glDrawBufferRegion = (PFNGLDRAWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDrawBufferRegion")) == NULL) || r; + r = ((glNewBufferRegion = (PFNGLNEWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glNewBufferRegion")) == NULL) || r; + r = ((glReadBufferRegion = (PFNGLREADBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glReadBufferRegion")) == NULL) || r; + + return r; +} + +#endif /* GL_KTX_buffer_region */ + +#ifdef GL_MESAX_texture_stack + +#endif /* GL_MESAX_texture_stack */ + +#ifdef GL_MESA_pack_invert + +#endif /* GL_MESA_pack_invert */ + +#ifdef GL_MESA_resize_buffers + +static GLboolean _glewInit_GL_MESA_resize_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glResizeBuffersMESA = (PFNGLRESIZEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glResizeBuffersMESA")) == NULL) || r; + + return r; +} + +#endif /* GL_MESA_resize_buffers */ + +#ifdef GL_MESA_window_pos + +static GLboolean _glewInit_GL_MESA_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glWindowPos2dMESA = (PFNGLWINDOWPOS2DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dMESA")) == NULL) || r; + r = ((glWindowPos2dvMESA = (PFNGLWINDOWPOS2DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvMESA")) == NULL) || r; + r = ((glWindowPos2fMESA = (PFNGLWINDOWPOS2FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fMESA")) == NULL) || r; + r = ((glWindowPos2fvMESA = (PFNGLWINDOWPOS2FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvMESA")) == NULL) || r; + r = ((glWindowPos2iMESA = (PFNGLWINDOWPOS2IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iMESA")) == NULL) || r; + r = ((glWindowPos2ivMESA = (PFNGLWINDOWPOS2IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivMESA")) == NULL) || r; + r = ((glWindowPos2sMESA = (PFNGLWINDOWPOS2SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sMESA")) == NULL) || r; + r = ((glWindowPos2svMESA = (PFNGLWINDOWPOS2SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svMESA")) == NULL) || r; + r = ((glWindowPos3dMESA = (PFNGLWINDOWPOS3DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dMESA")) == NULL) || r; + r = ((glWindowPos3dvMESA = (PFNGLWINDOWPOS3DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvMESA")) == NULL) || r; + r = ((glWindowPos3fMESA = (PFNGLWINDOWPOS3FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fMESA")) == NULL) || r; + r = ((glWindowPos3fvMESA = (PFNGLWINDOWPOS3FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvMESA")) == NULL) || r; + r = ((glWindowPos3iMESA = (PFNGLWINDOWPOS3IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iMESA")) == NULL) || r; + r = ((glWindowPos3ivMESA = (PFNGLWINDOWPOS3IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivMESA")) == NULL) || r; + r = ((glWindowPos3sMESA = (PFNGLWINDOWPOS3SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sMESA")) == NULL) || r; + r = ((glWindowPos3svMESA = (PFNGLWINDOWPOS3SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svMESA")) == NULL) || r; + r = ((glWindowPos4dMESA = (PFNGLWINDOWPOS4DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dMESA")) == NULL) || r; + r = ((glWindowPos4dvMESA = (PFNGLWINDOWPOS4DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dvMESA")) == NULL) || r; + r = ((glWindowPos4fMESA = (PFNGLWINDOWPOS4FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fMESA")) == NULL) || r; + r = ((glWindowPos4fvMESA = (PFNGLWINDOWPOS4FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fvMESA")) == NULL) || r; + r = ((glWindowPos4iMESA = (PFNGLWINDOWPOS4IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4iMESA")) == NULL) || r; + r = ((glWindowPos4ivMESA = (PFNGLWINDOWPOS4IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4ivMESA")) == NULL) || r; + r = ((glWindowPos4sMESA = (PFNGLWINDOWPOS4SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4sMESA")) == NULL) || r; + r = ((glWindowPos4svMESA = (PFNGLWINDOWPOS4SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4svMESA")) == NULL) || r; + + return r; +} + +#endif /* GL_MESA_window_pos */ + +#ifdef GL_MESA_ycbcr_texture + +#endif /* GL_MESA_ycbcr_texture */ + +#ifdef GL_NVX_conditional_render + +static GLboolean _glewInit_GL_NVX_conditional_render (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginConditionalRenderNVX = (PFNGLBEGINCONDITIONALRENDERNVXPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNVX")) == NULL) || r; + r = ((glEndConditionalRenderNVX = (PFNGLENDCONDITIONALRENDERNVXPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRenderNVX")) == NULL) || r; + + return r; +} + +#endif /* GL_NVX_conditional_render */ + +#ifdef GL_NVX_gpu_memory_info + +#endif /* GL_NVX_gpu_memory_info */ + +#ifdef GL_NV_bindless_multi_draw_indirect + +static GLboolean _glewInit_GL_NV_bindless_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectBindlessNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectBindlessNV")) == NULL) || r; + r = ((glMultiDrawElementsIndirectBindlessNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectBindlessNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_bindless_multi_draw_indirect */ + +#ifdef GL_NV_bindless_texture + +static GLboolean _glewInit_GL_NV_bindless_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetImageHandleNV = (PFNGLGETIMAGEHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetImageHandleNV")) == NULL) || r; + r = ((glGetTextureHandleNV = (PFNGLGETTEXTUREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureHandleNV")) == NULL) || r; + r = ((glGetTextureSamplerHandleNV = (PFNGLGETTEXTURESAMPLERHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSamplerHandleNV")) == NULL) || r; + r = ((glIsImageHandleResidentNV = (PFNGLISIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsImageHandleResidentNV")) == NULL) || r; + r = ((glIsTextureHandleResidentNV = (PFNGLISTEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsTextureHandleResidentNV")) == NULL) || r; + r = ((glMakeImageHandleNonResidentNV = (PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleNonResidentNV")) == NULL) || r; + r = ((glMakeImageHandleResidentNV = (PFNGLMAKEIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleResidentNV")) == NULL) || r; + r = ((glMakeTextureHandleNonResidentNV = (PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleNonResidentNV")) == NULL) || r; + r = ((glMakeTextureHandleResidentNV = (PFNGLMAKETEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleResidentNV")) == NULL) || r; + r = ((glProgramUniformHandleui64NV = (PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64NV")) == NULL) || r; + r = ((glProgramUniformHandleui64vNV = (PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64vNV")) == NULL) || r; + r = ((glUniformHandleui64NV = (PFNGLUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64NV")) == NULL) || r; + r = ((glUniformHandleui64vNV = (PFNGLUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64vNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_bindless_texture */ + +#ifdef GL_NV_blend_equation_advanced + +static GLboolean _glewInit_GL_NV_blend_equation_advanced (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendBarrierNV = (PFNGLBLENDBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glBlendBarrierNV")) == NULL) || r; + r = ((glBlendParameteriNV = (PFNGLBLENDPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glBlendParameteriNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_blend_equation_advanced */ + +#ifdef GL_NV_blend_equation_advanced_coherent + +#endif /* GL_NV_blend_equation_advanced_coherent */ + +#ifdef GL_NV_blend_square + +#endif /* GL_NV_blend_square */ + +#ifdef GL_NV_compute_program5 + +#endif /* GL_NV_compute_program5 */ + +#ifdef GL_NV_conditional_render + +static GLboolean _glewInit_GL_NV_conditional_render (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNV")) == NULL) || r; + r = ((glEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRenderNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_conditional_render */ + +#ifdef GL_NV_copy_depth_to_color + +#endif /* GL_NV_copy_depth_to_color */ + +#ifdef GL_NV_copy_image + +static GLboolean _glewInit_GL_NV_copy_image (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyImageSubDataNV = (PFNGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_copy_image */ + +#ifdef GL_NV_deep_texture3D + +#endif /* GL_NV_deep_texture3D */ + +#ifdef GL_NV_depth_buffer_float + +static GLboolean _glewInit_GL_NV_depth_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC)glewGetProcAddress((const GLubyte*)"glClearDepthdNV")) == NULL) || r; + r = ((glDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsdNV")) == NULL) || r; + r = ((glDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangedNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_depth_buffer_float */ + +#ifdef GL_NV_depth_clamp + +#endif /* GL_NV_depth_clamp */ + +#ifdef GL_NV_depth_range_unclamped + +#endif /* GL_NV_depth_range_unclamped */ + +#ifdef GL_NV_draw_texture + +static GLboolean _glewInit_GL_NV_draw_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawTextureNV = (PFNGLDRAWTEXTURENVPROC)glewGetProcAddress((const GLubyte*)"glDrawTextureNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_draw_texture */ + +#ifdef GL_NV_evaluators + +static GLboolean _glewInit_GL_NV_evaluators (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glEvalMapsNV = (PFNGLEVALMAPSNVPROC)glewGetProcAddress((const GLubyte*)"glEvalMapsNV")) == NULL) || r; + r = ((glGetMapAttribParameterfvNV = (PFNGLGETMAPATTRIBPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterfvNV")) == NULL) || r; + r = ((glGetMapAttribParameterivNV = (PFNGLGETMAPATTRIBPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterivNV")) == NULL) || r; + r = ((glGetMapControlPointsNV = (PFNGLGETMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapControlPointsNV")) == NULL) || r; + r = ((glGetMapParameterfvNV = (PFNGLGETMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterfvNV")) == NULL) || r; + r = ((glGetMapParameterivNV = (PFNGLGETMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterivNV")) == NULL) || r; + r = ((glMapControlPointsNV = (PFNGLMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glMapControlPointsNV")) == NULL) || r; + r = ((glMapParameterfvNV = (PFNGLMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterfvNV")) == NULL) || r; + r = ((glMapParameterivNV = (PFNGLMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_evaluators */ + +#ifdef GL_NV_explicit_multisample + +static GLboolean _glewInit_GL_NV_explicit_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetMultisamplefvNV = (PFNGLGETMULTISAMPLEFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefvNV")) == NULL) || r; + r = ((glSampleMaskIndexedNV = (PFNGLSAMPLEMASKINDEXEDNVPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskIndexedNV")) == NULL) || r; + r = ((glTexRenderbufferNV = (PFNGLTEXRENDERBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glTexRenderbufferNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_explicit_multisample */ + +#ifdef GL_NV_fence + +static GLboolean _glewInit_GL_NV_fence (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteFencesNV = (PFNGLDELETEFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesNV")) == NULL) || r; + r = ((glFinishFenceNV = (PFNGLFINISHFENCENVPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceNV")) == NULL) || r; + r = ((glGenFencesNV = (PFNGLGENFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glGenFencesNV")) == NULL) || r; + r = ((glGetFenceivNV = (PFNGLGETFENCEIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFenceivNV")) == NULL) || r; + r = ((glIsFenceNV = (PFNGLISFENCENVPROC)glewGetProcAddress((const GLubyte*)"glIsFenceNV")) == NULL) || r; + r = ((glSetFenceNV = (PFNGLSETFENCENVPROC)glewGetProcAddress((const GLubyte*)"glSetFenceNV")) == NULL) || r; + r = ((glTestFenceNV = (PFNGLTESTFENCENVPROC)glewGetProcAddress((const GLubyte*)"glTestFenceNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_fence */ + +#ifdef GL_NV_float_buffer + +#endif /* GL_NV_float_buffer */ + +#ifdef GL_NV_fog_distance + +#endif /* GL_NV_fog_distance */ + +#ifdef GL_NV_fragment_program + +static GLboolean _glewInit_GL_NV_fragment_program (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterdvNV")) == NULL) || r; + r = ((glGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterfvNV")) == NULL) || r; + r = ((glProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dNV")) == NULL) || r; + r = ((glProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dvNV")) == NULL) || r; + r = ((glProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fNV")) == NULL) || r; + r = ((glProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_fragment_program */ + +#ifdef GL_NV_fragment_program2 + +#endif /* GL_NV_fragment_program2 */ + +#ifdef GL_NV_fragment_program4 + +#endif /* GL_NV_fragment_program4 */ + +#ifdef GL_NV_fragment_program_option + +#endif /* GL_NV_fragment_program_option */ + +#ifdef GL_NV_framebuffer_multisample_coverage + +static GLboolean _glewInit_GL_NV_framebuffer_multisample_coverage (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glRenderbufferStorageMultisampleCoverageNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleCoverageNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_framebuffer_multisample_coverage */ + +#ifdef GL_NV_geometry_program4 + +static GLboolean _glewInit_GL_NV_geometry_program4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProgramVertexLimitNV = (PFNGLPROGRAMVERTEXLIMITNVPROC)glewGetProcAddress((const GLubyte*)"glProgramVertexLimitNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_geometry_program4 */ + +#ifdef GL_NV_geometry_shader4 + +#endif /* GL_NV_geometry_shader4 */ + +#ifdef GL_NV_gpu_program4 + +static GLboolean _glewInit_GL_NV_gpu_program4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProgramEnvParameterI4iNV = (PFNGLPROGRAMENVPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4iNV")) == NULL) || r; + r = ((glProgramEnvParameterI4ivNV = (PFNGLPROGRAMENVPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4ivNV")) == NULL) || r; + r = ((glProgramEnvParameterI4uiNV = (PFNGLPROGRAMENVPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uiNV")) == NULL) || r; + r = ((glProgramEnvParameterI4uivNV = (PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uivNV")) == NULL) || r; + r = ((glProgramEnvParametersI4ivNV = (PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4ivNV")) == NULL) || r; + r = ((glProgramEnvParametersI4uivNV = (PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4uivNV")) == NULL) || r; + r = ((glProgramLocalParameterI4iNV = (PFNGLPROGRAMLOCALPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4iNV")) == NULL) || r; + r = ((glProgramLocalParameterI4ivNV = (PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4ivNV")) == NULL) || r; + r = ((glProgramLocalParameterI4uiNV = (PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uiNV")) == NULL) || r; + r = ((glProgramLocalParameterI4uivNV = (PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uivNV")) == NULL) || r; + r = ((glProgramLocalParametersI4ivNV = (PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4ivNV")) == NULL) || r; + r = ((glProgramLocalParametersI4uivNV = (PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4uivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_gpu_program4 */ + +#ifdef GL_NV_gpu_program5 + +#endif /* GL_NV_gpu_program5 */ + +#ifdef GL_NV_gpu_program5_mem_extended + +#endif /* GL_NV_gpu_program5_mem_extended */ + +#ifdef GL_NV_gpu_program_fp64 + +#endif /* GL_NV_gpu_program_fp64 */ + +#ifdef GL_NV_gpu_shader5 + +static GLboolean _glewInit_GL_NV_gpu_shader5 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformi64vNV")) == NULL) || r; + r = ((glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformui64vNV")) == NULL) || r; + r = ((glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64NV")) == NULL) || r; + r = ((glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64vNV")) == NULL) || r; + r = ((glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64NV")) == NULL) || r; + r = ((glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64vNV")) == NULL) || r; + r = ((glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64NV")) == NULL) || r; + r = ((glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64vNV")) == NULL) || r; + r = ((glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64NV")) == NULL) || r; + r = ((glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64vNV")) == NULL) || r; + r = ((glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64NV")) == NULL) || r; + r = ((glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64vNV")) == NULL) || r; + r = ((glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64NV")) == NULL) || r; + r = ((glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64vNV")) == NULL) || r; + r = ((glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64NV")) == NULL) || r; + r = ((glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64vNV")) == NULL) || r; + r = ((glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64NV")) == NULL) || r; + r = ((glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64vNV")) == NULL) || r; + r = ((glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64NV")) == NULL) || r; + r = ((glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64vNV")) == NULL) || r; + r = ((glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64NV")) == NULL) || r; + r = ((glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64vNV")) == NULL) || r; + r = ((glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64NV")) == NULL) || r; + r = ((glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64vNV")) == NULL) || r; + r = ((glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64NV")) == NULL) || r; + r = ((glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64vNV")) == NULL) || r; + r = ((glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64NV")) == NULL) || r; + r = ((glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64vNV")) == NULL) || r; + r = ((glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64NV")) == NULL) || r; + r = ((glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64vNV")) == NULL) || r; + r = ((glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64NV")) == NULL) || r; + r = ((glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64vNV")) == NULL) || r; + r = ((glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64NV")) == NULL) || r; + r = ((glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64vNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_gpu_shader5 */ + +#ifdef GL_NV_half_float + +static GLboolean _glewInit_GL_NV_half_float (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColor3hNV = (PFNGLCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hNV")) == NULL) || r; + r = ((glColor3hvNV = (PFNGLCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hvNV")) == NULL) || r; + r = ((glColor4hNV = (PFNGLCOLOR4HNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hNV")) == NULL) || r; + r = ((glColor4hvNV = (PFNGLCOLOR4HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hvNV")) == NULL) || r; + r = ((glFogCoordhNV = (PFNGLFOGCOORDHNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhNV")) == NULL) || r; + r = ((glFogCoordhvNV = (PFNGLFOGCOORDHVNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhvNV")) == NULL) || r; + r = ((glMultiTexCoord1hNV = (PFNGLMULTITEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hNV")) == NULL) || r; + r = ((glMultiTexCoord1hvNV = (PFNGLMULTITEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hvNV")) == NULL) || r; + r = ((glMultiTexCoord2hNV = (PFNGLMULTITEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hNV")) == NULL) || r; + r = ((glMultiTexCoord2hvNV = (PFNGLMULTITEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hvNV")) == NULL) || r; + r = ((glMultiTexCoord3hNV = (PFNGLMULTITEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hNV")) == NULL) || r; + r = ((glMultiTexCoord3hvNV = (PFNGLMULTITEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hvNV")) == NULL) || r; + r = ((glMultiTexCoord4hNV = (PFNGLMULTITEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hNV")) == NULL) || r; + r = ((glMultiTexCoord4hvNV = (PFNGLMULTITEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hvNV")) == NULL) || r; + r = ((glNormal3hNV = (PFNGLNORMAL3HNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hNV")) == NULL) || r; + r = ((glNormal3hvNV = (PFNGLNORMAL3HVNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hvNV")) == NULL) || r; + r = ((glSecondaryColor3hNV = (PFNGLSECONDARYCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hNV")) == NULL) || r; + r = ((glSecondaryColor3hvNV = (PFNGLSECONDARYCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hvNV")) == NULL) || r; + r = ((glTexCoord1hNV = (PFNGLTEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hNV")) == NULL) || r; + r = ((glTexCoord1hvNV = (PFNGLTEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hvNV")) == NULL) || r; + r = ((glTexCoord2hNV = (PFNGLTEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hNV")) == NULL) || r; + r = ((glTexCoord2hvNV = (PFNGLTEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hvNV")) == NULL) || r; + r = ((glTexCoord3hNV = (PFNGLTEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hNV")) == NULL) || r; + r = ((glTexCoord3hvNV = (PFNGLTEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hvNV")) == NULL) || r; + r = ((glTexCoord4hNV = (PFNGLTEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hNV")) == NULL) || r; + r = ((glTexCoord4hvNV = (PFNGLTEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hvNV")) == NULL) || r; + r = ((glVertex2hNV = (PFNGLVERTEX2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hNV")) == NULL) || r; + r = ((glVertex2hvNV = (PFNGLVERTEX2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hvNV")) == NULL) || r; + r = ((glVertex3hNV = (PFNGLVERTEX3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hNV")) == NULL) || r; + r = ((glVertex3hvNV = (PFNGLVERTEX3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hvNV")) == NULL) || r; + r = ((glVertex4hNV = (PFNGLVERTEX4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hNV")) == NULL) || r; + r = ((glVertex4hvNV = (PFNGLVERTEX4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hvNV")) == NULL) || r; + r = ((glVertexAttrib1hNV = (PFNGLVERTEXATTRIB1HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hNV")) == NULL) || r; + r = ((glVertexAttrib1hvNV = (PFNGLVERTEXATTRIB1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hvNV")) == NULL) || r; + r = ((glVertexAttrib2hNV = (PFNGLVERTEXATTRIB2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hNV")) == NULL) || r; + r = ((glVertexAttrib2hvNV = (PFNGLVERTEXATTRIB2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hvNV")) == NULL) || r; + r = ((glVertexAttrib3hNV = (PFNGLVERTEXATTRIB3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hNV")) == NULL) || r; + r = ((glVertexAttrib3hvNV = (PFNGLVERTEXATTRIB3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hvNV")) == NULL) || r; + r = ((glVertexAttrib4hNV = (PFNGLVERTEXATTRIB4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hNV")) == NULL) || r; + r = ((glVertexAttrib4hvNV = (PFNGLVERTEXATTRIB4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hvNV")) == NULL) || r; + r = ((glVertexAttribs1hvNV = (PFNGLVERTEXATTRIBS1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1hvNV")) == NULL) || r; + r = ((glVertexAttribs2hvNV = (PFNGLVERTEXATTRIBS2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2hvNV")) == NULL) || r; + r = ((glVertexAttribs3hvNV = (PFNGLVERTEXATTRIBS3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3hvNV")) == NULL) || r; + r = ((glVertexAttribs4hvNV = (PFNGLVERTEXATTRIBS4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4hvNV")) == NULL) || r; + r = ((glVertexWeighthNV = (PFNGLVERTEXWEIGHTHNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthNV")) == NULL) || r; + r = ((glVertexWeighthvNV = (PFNGLVERTEXWEIGHTHVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_half_float */ + +#ifdef GL_NV_light_max_exponent + +#endif /* GL_NV_light_max_exponent */ + +#ifdef GL_NV_multisample_coverage + +#endif /* GL_NV_multisample_coverage */ + +#ifdef GL_NV_multisample_filter_hint + +#endif /* GL_NV_multisample_filter_hint */ + +#ifdef GL_NV_occlusion_query + +static GLboolean _glewInit_GL_NV_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glBeginOcclusionQueryNV")) == NULL) || r; + r = ((glDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteOcclusionQueriesNV")) == NULL) || r; + r = ((glEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glEndOcclusionQueryNV")) == NULL) || r; + r = ((glGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glGenOcclusionQueriesNV")) == NULL) || r; + r = ((glGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryivNV")) == NULL) || r; + r = ((glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryuivNV")) == NULL) || r; + r = ((glIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glIsOcclusionQueryNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_occlusion_query */ + +#ifdef GL_NV_packed_depth_stencil + +#endif /* GL_NV_packed_depth_stencil */ + +#ifdef GL_NV_parameter_buffer_object + +static GLboolean _glewInit_GL_NV_parameter_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProgramBufferParametersIivNV = (PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIivNV")) == NULL) || r; + r = ((glProgramBufferParametersIuivNV = (PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIuivNV")) == NULL) || r; + r = ((glProgramBufferParametersfvNV = (PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersfvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_parameter_buffer_object */ + +#ifdef GL_NV_parameter_buffer_object2 + +#endif /* GL_NV_parameter_buffer_object2 */ + +#ifdef GL_NV_path_rendering + +static GLboolean _glewInit_GL_NV_path_rendering (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyPathNV = (PFNGLCOPYPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCopyPathNV")) == NULL) || r; + r = ((glCoverFillPathInstancedNV = (PFNGLCOVERFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathInstancedNV")) == NULL) || r; + r = ((glCoverFillPathNV = (PFNGLCOVERFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathNV")) == NULL) || r; + r = ((glCoverStrokePathInstancedNV = (PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathInstancedNV")) == NULL) || r; + r = ((glCoverStrokePathNV = (PFNGLCOVERSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathNV")) == NULL) || r; + r = ((glDeletePathsNV = (PFNGLDELETEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glDeletePathsNV")) == NULL) || r; + r = ((glGenPathsNV = (PFNGLGENPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glGenPathsNV")) == NULL) || r; + r = ((glGetPathColorGenfvNV = (PFNGLGETPATHCOLORGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenfvNV")) == NULL) || r; + r = ((glGetPathColorGenivNV = (PFNGLGETPATHCOLORGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenivNV")) == NULL) || r; + r = ((glGetPathCommandsNV = (PFNGLGETPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCommandsNV")) == NULL) || r; + r = ((glGetPathCoordsNV = (PFNGLGETPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCoordsNV")) == NULL) || r; + r = ((glGetPathDashArrayNV = (PFNGLGETPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathDashArrayNV")) == NULL) || r; + r = ((glGetPathLengthNV = (PFNGLGETPATHLENGTHNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathLengthNV")) == NULL) || r; + r = ((glGetPathMetricRangeNV = (PFNGLGETPATHMETRICRANGENVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricRangeNV")) == NULL) || r; + r = ((glGetPathMetricsNV = (PFNGLGETPATHMETRICSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricsNV")) == NULL) || r; + r = ((glGetPathParameterfvNV = (PFNGLGETPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterfvNV")) == NULL) || r; + r = ((glGetPathParameterivNV = (PFNGLGETPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterivNV")) == NULL) || r; + r = ((glGetPathSpacingNV = (PFNGLGETPATHSPACINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathSpacingNV")) == NULL) || r; + r = ((glGetPathTexGenfvNV = (PFNGLGETPATHTEXGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenfvNV")) == NULL) || r; + r = ((glGetPathTexGenivNV = (PFNGLGETPATHTEXGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenivNV")) == NULL) || r; + r = ((glInterpolatePathsNV = (PFNGLINTERPOLATEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glInterpolatePathsNV")) == NULL) || r; + r = ((glIsPathNV = (PFNGLISPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPathNV")) == NULL) || r; + r = ((glIsPointInFillPathNV = (PFNGLISPOINTINFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInFillPathNV")) == NULL) || r; + r = ((glIsPointInStrokePathNV = (PFNGLISPOINTINSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInStrokePathNV")) == NULL) || r; + r = ((glPathColorGenNV = (PFNGLPATHCOLORGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathColorGenNV")) == NULL) || r; + r = ((glPathCommandsNV = (PFNGLPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCommandsNV")) == NULL) || r; + r = ((glPathCoordsNV = (PFNGLPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoordsNV")) == NULL) || r; + r = ((glPathCoverDepthFuncNV = (PFNGLPATHCOVERDEPTHFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoverDepthFuncNV")) == NULL) || r; + r = ((glPathDashArrayNV = (PFNGLPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathDashArrayNV")) == NULL) || r; + r = ((glPathFogGenNV = (PFNGLPATHFOGGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathFogGenNV")) == NULL) || r; + r = ((glPathGlyphRangeNV = (PFNGLPATHGLYPHRANGENVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphRangeNV")) == NULL) || r; + r = ((glPathGlyphsNV = (PFNGLPATHGLYPHSNVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphsNV")) == NULL) || r; + r = ((glPathParameterfNV = (PFNGLPATHPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfNV")) == NULL) || r; + r = ((glPathParameterfvNV = (PFNGLPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfvNV")) == NULL) || r; + r = ((glPathParameteriNV = (PFNGLPATHPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPathParameteriNV")) == NULL) || r; + r = ((glPathParameterivNV = (PFNGLPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterivNV")) == NULL) || r; + r = ((glPathStencilDepthOffsetNV = (PFNGLPATHSTENCILDEPTHOFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilDepthOffsetNV")) == NULL) || r; + r = ((glPathStencilFuncNV = (PFNGLPATHSTENCILFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilFuncNV")) == NULL) || r; + r = ((glPathStringNV = (PFNGLPATHSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glPathStringNV")) == NULL) || r; + r = ((glPathSubCommandsNV = (PFNGLPATHSUBCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCommandsNV")) == NULL) || r; + r = ((glPathSubCoordsNV = (PFNGLPATHSUBCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCoordsNV")) == NULL) || r; + r = ((glPathTexGenNV = (PFNGLPATHTEXGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathTexGenNV")) == NULL) || r; + r = ((glPointAlongPathNV = (PFNGLPOINTALONGPATHNVPROC)glewGetProcAddress((const GLubyte*)"glPointAlongPathNV")) == NULL) || r; + r = ((glStencilFillPathInstancedNV = (PFNGLSTENCILFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathInstancedNV")) == NULL) || r; + r = ((glStencilFillPathNV = (PFNGLSTENCILFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathNV")) == NULL) || r; + r = ((glStencilStrokePathInstancedNV = (PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathInstancedNV")) == NULL) || r; + r = ((glStencilStrokePathNV = (PFNGLSTENCILSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathNV")) == NULL) || r; + r = ((glTransformPathNV = (PFNGLTRANSFORMPATHNVPROC)glewGetProcAddress((const GLubyte*)"glTransformPathNV")) == NULL) || r; + r = ((glWeightPathsNV = (PFNGLWEIGHTPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glWeightPathsNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_path_rendering */ + +#ifdef GL_NV_pixel_data_range + +static GLboolean _glewInit_GL_NV_pixel_data_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushPixelDataRangeNV = (PFNGLFLUSHPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushPixelDataRangeNV")) == NULL) || r; + r = ((glPixelDataRangeNV = (PFNGLPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glPixelDataRangeNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_pixel_data_range */ + +#ifdef GL_NV_point_sprite + +static GLboolean _glewInit_GL_NV_point_sprite (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameteriNV = (PFNGLPOINTPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriNV")) == NULL) || r; + r = ((glPointParameterivNV = (PFNGLPOINTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_point_sprite */ + +#ifdef GL_NV_present_video + +static GLboolean _glewInit_GL_NV_present_video (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVideoi64vNV = (PFNGLGETVIDEOI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoi64vNV")) == NULL) || r; + r = ((glGetVideoivNV = (PFNGLGETVIDEOIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoivNV")) == NULL) || r; + r = ((glGetVideoui64vNV = (PFNGLGETVIDEOUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoui64vNV")) == NULL) || r; + r = ((glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideouivNV")) == NULL) || r; + r = ((glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameDualFillNV")) == NULL) || r; + r = ((glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameKeyedNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_present_video */ + +#ifdef GL_NV_primitive_restart + +static GLboolean _glewInit_GL_NV_primitive_restart (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPrimitiveRestartIndexNV = (PFNGLPRIMITIVERESTARTINDEXNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndexNV")) == NULL) || r; + r = ((glPrimitiveRestartNV = (PFNGLPRIMITIVERESTARTNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_primitive_restart */ + +#ifdef GL_NV_register_combiners + +static GLboolean _glewInit_GL_NV_register_combiners (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerInputNV")) == NULL) || r; + r = ((glCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerOutputNV")) == NULL) || r; + r = ((glCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfNV")) == NULL) || r; + r = ((glCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfvNV")) == NULL) || r; + r = ((glCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameteriNV")) == NULL) || r; + r = ((glCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterivNV")) == NULL) || r; + r = ((glFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glFinalCombinerInputNV")) == NULL) || r; + r = ((glGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterfvNV")) == NULL) || r; + r = ((glGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterivNV")) == NULL) || r; + r = ((glGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterfvNV")) == NULL) || r; + r = ((glGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterivNV")) == NULL) || r; + r = ((glGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterfvNV")) == NULL) || r; + r = ((glGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_register_combiners */ + +#ifdef GL_NV_register_combiners2 + +static GLboolean _glewInit_GL_NV_register_combiners2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerStageParameterfvNV")) == NULL) || r; + r = ((glGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerStageParameterfvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_register_combiners2 */ + +#ifdef GL_NV_shader_atomic_counters + +#endif /* GL_NV_shader_atomic_counters */ + +#ifdef GL_NV_shader_atomic_float + +#endif /* GL_NV_shader_atomic_float */ + +#ifdef GL_NV_shader_buffer_load + +static GLboolean _glewInit_GL_NV_shader_buffer_load (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetBufferParameterui64vNV = (PFNGLGETBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterui64vNV")) == NULL) || r; + r = ((glGetIntegerui64vNV = (PFNGLGETINTEGERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64vNV")) == NULL) || r; + r = ((glGetNamedBufferParameterui64vNV = (PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterui64vNV")) == NULL) || r; + r = ((glIsBufferResidentNV = (PFNGLISBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsBufferResidentNV")) == NULL) || r; + r = ((glIsNamedBufferResidentNV = (PFNGLISNAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsNamedBufferResidentNV")) == NULL) || r; + r = ((glMakeBufferNonResidentNV = (PFNGLMAKEBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferNonResidentNV")) == NULL) || r; + r = ((glMakeBufferResidentNV = (PFNGLMAKEBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferResidentNV")) == NULL) || r; + r = ((glMakeNamedBufferNonResidentNV = (PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferNonResidentNV")) == NULL) || r; + r = ((glMakeNamedBufferResidentNV = (PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferResidentNV")) == NULL) || r; + r = ((glProgramUniformui64NV = (PFNGLPROGRAMUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64NV")) == NULL) || r; + r = ((glProgramUniformui64vNV = (PFNGLPROGRAMUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64vNV")) == NULL) || r; + r = ((glUniformui64NV = (PFNGLUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64NV")) == NULL) || r; + r = ((glUniformui64vNV = (PFNGLUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64vNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_shader_buffer_load */ + +#ifdef GL_NV_shader_storage_buffer_object + +#endif /* GL_NV_shader_storage_buffer_object */ + +#ifdef GL_NV_tessellation_program5 + +#endif /* GL_NV_tessellation_program5 */ + +#ifdef GL_NV_texgen_emboss + +#endif /* GL_NV_texgen_emboss */ + +#ifdef GL_NV_texgen_reflection + +#endif /* GL_NV_texgen_reflection */ + +#ifdef GL_NV_texture_barrier + +static GLboolean _glewInit_GL_NV_texture_barrier (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTextureBarrierNV = (PFNGLTEXTUREBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glTextureBarrierNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_texture_barrier */ + +#ifdef GL_NV_texture_compression_vtc + +#endif /* GL_NV_texture_compression_vtc */ + +#ifdef GL_NV_texture_env_combine4 + +#endif /* GL_NV_texture_env_combine4 */ + +#ifdef GL_NV_texture_expand_normal + +#endif /* GL_NV_texture_expand_normal */ + +#ifdef GL_NV_texture_multisample + +static GLboolean _glewInit_GL_NV_texture_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexImage2DMultisampleCoverageNV = (PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisampleCoverageNV")) == NULL) || r; + r = ((glTexImage3DMultisampleCoverageNV = (PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisampleCoverageNV")) == NULL) || r; + r = ((glTextureImage2DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleCoverageNV")) == NULL) || r; + r = ((glTextureImage2DMultisampleNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleNV")) == NULL) || r; + r = ((glTextureImage3DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleCoverageNV")) == NULL) || r; + r = ((glTextureImage3DMultisampleNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_texture_multisample */ + +#ifdef GL_NV_texture_rectangle + +#endif /* GL_NV_texture_rectangle */ + +#ifdef GL_NV_texture_shader + +#endif /* GL_NV_texture_shader */ + +#ifdef GL_NV_texture_shader2 + +#endif /* GL_NV_texture_shader2 */ + +#ifdef GL_NV_texture_shader3 + +#endif /* GL_NV_texture_shader3 */ + +#ifdef GL_NV_transform_feedback + +static GLboolean _glewInit_GL_NV_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveVaryingNV = (PFNGLACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glActiveVaryingNV")) == NULL) || r; + r = ((glBeginTransformFeedbackNV = (PFNGLBEGINTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackNV")) == NULL) || r; + r = ((glBindBufferBaseNV = (PFNGLBINDBUFFERBASENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseNV")) == NULL) || r; + r = ((glBindBufferOffsetNV = (PFNGLBINDBUFFEROFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetNV")) == NULL) || r; + r = ((glBindBufferRangeNV = (PFNGLBINDBUFFERRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeNV")) == NULL) || r; + r = ((glEndTransformFeedbackNV = (PFNGLENDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackNV")) == NULL) || r; + r = ((glGetActiveVaryingNV = (PFNGLGETACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveVaryingNV")) == NULL) || r; + r = ((glGetTransformFeedbackVaryingNV = (PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingNV")) == NULL) || r; + r = ((glGetVaryingLocationNV = (PFNGLGETVARYINGLOCATIONNVPROC)glewGetProcAddress((const GLubyte*)"glGetVaryingLocationNV")) == NULL) || r; + r = ((glTransformFeedbackAttribsNV = (PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackAttribsNV")) == NULL) || r; + r = ((glTransformFeedbackVaryingsNV = (PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_transform_feedback */ + +#ifdef GL_NV_transform_feedback2 + +static GLboolean _glewInit_GL_NV_transform_feedback2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindTransformFeedbackNV = (PFNGLBINDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedbackNV")) == NULL) || r; + r = ((glDeleteTransformFeedbacksNV = (PFNGLDELETETRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacksNV")) == NULL) || r; + r = ((glDrawTransformFeedbackNV = (PFNGLDRAWTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackNV")) == NULL) || r; + r = ((glGenTransformFeedbacksNV = (PFNGLGENTRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacksNV")) == NULL) || r; + r = ((glIsTransformFeedbackNV = (PFNGLISTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedbackNV")) == NULL) || r; + r = ((glPauseTransformFeedbackNV = (PFNGLPAUSETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedbackNV")) == NULL) || r; + r = ((glResumeTransformFeedbackNV = (PFNGLRESUMETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedbackNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_transform_feedback2 */ + +#ifdef GL_NV_vdpau_interop + +static GLboolean _glewInit_GL_NV_vdpau_interop (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVDPAUFiniNV = (PFNGLVDPAUFININVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUFiniNV")) == NULL) || r; + r = ((glVDPAUGetSurfaceivNV = (PFNGLVDPAUGETSURFACEIVNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUGetSurfaceivNV")) == NULL) || r; + r = ((glVDPAUInitNV = (PFNGLVDPAUINITNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUInitNV")) == NULL) || r; + r = ((glVDPAUIsSurfaceNV = (PFNGLVDPAUISSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUIsSurfaceNV")) == NULL) || r; + r = ((glVDPAUMapSurfacesNV = (PFNGLVDPAUMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUMapSurfacesNV")) == NULL) || r; + r = ((glVDPAURegisterOutputSurfaceNV = (PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterOutputSurfaceNV")) == NULL) || r; + r = ((glVDPAURegisterVideoSurfaceNV = (PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterVideoSurfaceNV")) == NULL) || r; + r = ((glVDPAUSurfaceAccessNV = (PFNGLVDPAUSURFACEACCESSNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUSurfaceAccessNV")) == NULL) || r; + r = ((glVDPAUUnmapSurfacesNV = (PFNGLVDPAUUNMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnmapSurfacesNV")) == NULL) || r; + r = ((glVDPAUUnregisterSurfaceNV = (PFNGLVDPAUUNREGISTERSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnregisterSurfaceNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vdpau_interop */ + +#ifdef GL_NV_vertex_array_range + +static GLboolean _glewInit_GL_NV_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushVertexArrayRangeNV = (PFNGLFLUSHVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeNV")) == NULL) || r; + r = ((glVertexArrayRangeNV = (PFNGLVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_array_range */ + +#ifdef GL_NV_vertex_array_range2 + +#endif /* GL_NV_vertex_array_range2 */ + +#ifdef GL_NV_vertex_attrib_integer_64bit + +static GLboolean _glewInit_GL_NV_vertex_attrib_integer_64bit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLi64vNV = (PFNGLGETVERTEXATTRIBLI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLi64vNV")) == NULL) || r; + r = ((glGetVertexAttribLui64vNV = (PFNGLGETVERTEXATTRIBLUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLui64vNV")) == NULL) || r; + r = ((glVertexAttribL1i64NV = (PFNGLVERTEXATTRIBL1I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64NV")) == NULL) || r; + r = ((glVertexAttribL1i64vNV = (PFNGLVERTEXATTRIBL1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64vNV")) == NULL) || r; + r = ((glVertexAttribL1ui64NV = (PFNGLVERTEXATTRIBL1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64NV")) == NULL) || r; + r = ((glVertexAttribL1ui64vNV = (PFNGLVERTEXATTRIBL1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64vNV")) == NULL) || r; + r = ((glVertexAttribL2i64NV = (PFNGLVERTEXATTRIBL2I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64NV")) == NULL) || r; + r = ((glVertexAttribL2i64vNV = (PFNGLVERTEXATTRIBL2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64vNV")) == NULL) || r; + r = ((glVertexAttribL2ui64NV = (PFNGLVERTEXATTRIBL2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64NV")) == NULL) || r; + r = ((glVertexAttribL2ui64vNV = (PFNGLVERTEXATTRIBL2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64vNV")) == NULL) || r; + r = ((glVertexAttribL3i64NV = (PFNGLVERTEXATTRIBL3I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64NV")) == NULL) || r; + r = ((glVertexAttribL3i64vNV = (PFNGLVERTEXATTRIBL3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64vNV")) == NULL) || r; + r = ((glVertexAttribL3ui64NV = (PFNGLVERTEXATTRIBL3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64NV")) == NULL) || r; + r = ((glVertexAttribL3ui64vNV = (PFNGLVERTEXATTRIBL3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64vNV")) == NULL) || r; + r = ((glVertexAttribL4i64NV = (PFNGLVERTEXATTRIBL4I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64NV")) == NULL) || r; + r = ((glVertexAttribL4i64vNV = (PFNGLVERTEXATTRIBL4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64vNV")) == NULL) || r; + r = ((glVertexAttribL4ui64NV = (PFNGLVERTEXATTRIBL4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64NV")) == NULL) || r; + r = ((glVertexAttribL4ui64vNV = (PFNGLVERTEXATTRIBL4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64vNV")) == NULL) || r; + r = ((glVertexAttribLFormatNV = (PFNGLVERTEXATTRIBLFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormatNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +#ifdef GL_NV_vertex_buffer_unified_memory + +static GLboolean _glewInit_GL_NV_vertex_buffer_unified_memory (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBufferAddressRangeNV = (PFNGLBUFFERADDRESSRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBufferAddressRangeNV")) == NULL) || r; + r = ((glColorFormatNV = (PFNGLCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glColorFormatNV")) == NULL) || r; + r = ((glEdgeFlagFormatNV = (PFNGLEDGEFLAGFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagFormatNV")) == NULL) || r; + r = ((glFogCoordFormatNV = (PFNGLFOGCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordFormatNV")) == NULL) || r; + r = ((glGetIntegerui64i_vNV = (PFNGLGETINTEGERUI64I_VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64i_vNV")) == NULL) || r; + r = ((glIndexFormatNV = (PFNGLINDEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glIndexFormatNV")) == NULL) || r; + r = ((glNormalFormatNV = (PFNGLNORMALFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glNormalFormatNV")) == NULL) || r; + r = ((glSecondaryColorFormatNV = (PFNGLSECONDARYCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorFormatNV")) == NULL) || r; + r = ((glTexCoordFormatNV = (PFNGLTEXCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordFormatNV")) == NULL) || r; + r = ((glVertexAttribFormatNV = (PFNGLVERTEXATTRIBFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormatNV")) == NULL) || r; + r = ((glVertexAttribIFormatNV = (PFNGLVERTEXATTRIBIFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormatNV")) == NULL) || r; + r = ((glVertexFormatNV = (PFNGLVERTEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexFormatNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_buffer_unified_memory */ + +#ifdef GL_NV_vertex_program + +static GLboolean _glewInit_GL_NV_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glAreProgramsResidentNV")) == NULL) || r; + r = ((glBindProgramNV = (PFNGLBINDPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glBindProgramNV")) == NULL) || r; + r = ((glDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsNV")) == NULL) || r; + r = ((glExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glExecuteProgramNV")) == NULL) || r; + r = ((glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsNV")) == NULL) || r; + r = ((glGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterdvNV")) == NULL) || r; + r = ((glGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterfvNV")) == NULL) || r; + r = ((glGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringNV")) == NULL) || r; + r = ((glGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivNV")) == NULL) || r; + r = ((glGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetTrackMatrixivNV")) == NULL) || r; + r = ((glGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervNV")) == NULL) || r; + r = ((glGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvNV")) == NULL) || r; + r = ((glGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvNV")) == NULL) || r; + r = ((glGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivNV")) == NULL) || r; + r = ((glIsProgramNV = (PFNGLISPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glIsProgramNV")) == NULL) || r; + r = ((glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glLoadProgramNV")) == NULL) || r; + r = ((glProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dNV")) == NULL) || r; + r = ((glProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dvNV")) == NULL) || r; + r = ((glProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fNV")) == NULL) || r; + r = ((glProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fvNV")) == NULL) || r; + r = ((glProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4dvNV")) == NULL) || r; + r = ((glProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4fvNV")) == NULL) || r; + r = ((glRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glRequestResidentProgramsNV")) == NULL) || r; + r = ((glTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC)glewGetProcAddress((const GLubyte*)"glTrackMatrixNV")) == NULL) || r; + r = ((glVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dNV")) == NULL) || r; + r = ((glVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvNV")) == NULL) || r; + r = ((glVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fNV")) == NULL) || r; + r = ((glVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvNV")) == NULL) || r; + r = ((glVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sNV")) == NULL) || r; + r = ((glVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svNV")) == NULL) || r; + r = ((glVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dNV")) == NULL) || r; + r = ((glVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvNV")) == NULL) || r; + r = ((glVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fNV")) == NULL) || r; + r = ((glVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvNV")) == NULL) || r; + r = ((glVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sNV")) == NULL) || r; + r = ((glVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svNV")) == NULL) || r; + r = ((glVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dNV")) == NULL) || r; + r = ((glVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvNV")) == NULL) || r; + r = ((glVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fNV")) == NULL) || r; + r = ((glVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvNV")) == NULL) || r; + r = ((glVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sNV")) == NULL) || r; + r = ((glVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svNV")) == NULL) || r; + r = ((glVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dNV")) == NULL) || r; + r = ((glVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvNV")) == NULL) || r; + r = ((glVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fNV")) == NULL) || r; + r = ((glVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvNV")) == NULL) || r; + r = ((glVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sNV")) == NULL) || r; + r = ((glVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svNV")) == NULL) || r; + r = ((glVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubNV")) == NULL) || r; + r = ((glVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvNV")) == NULL) || r; + r = ((glVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerNV")) == NULL) || r; + r = ((glVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1dvNV")) == NULL) || r; + r = ((glVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1fvNV")) == NULL) || r; + r = ((glVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1svNV")) == NULL) || r; + r = ((glVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2dvNV")) == NULL) || r; + r = ((glVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2fvNV")) == NULL) || r; + r = ((glVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2svNV")) == NULL) || r; + r = ((glVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3dvNV")) == NULL) || r; + r = ((glVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3fvNV")) == NULL) || r; + r = ((glVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3svNV")) == NULL) || r; + r = ((glVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4dvNV")) == NULL) || r; + r = ((glVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4fvNV")) == NULL) || r; + r = ((glVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4svNV")) == NULL) || r; + r = ((glVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4ubvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_program */ + +#ifdef GL_NV_vertex_program1_1 + +#endif /* GL_NV_vertex_program1_1 */ + +#ifdef GL_NV_vertex_program2 + +#endif /* GL_NV_vertex_program2 */ + +#ifdef GL_NV_vertex_program2_option + +#endif /* GL_NV_vertex_program2_option */ + +#ifdef GL_NV_vertex_program3 + +#endif /* GL_NV_vertex_program3 */ + +#ifdef GL_NV_vertex_program4 + +#endif /* GL_NV_vertex_program4 */ + +#ifdef GL_NV_video_capture + +static GLboolean _glewInit_GL_NV_video_capture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginVideoCaptureNV = (PFNGLBEGINVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glBeginVideoCaptureNV")) == NULL) || r; + r = ((glBindVideoCaptureStreamBufferNV = (PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamBufferNV")) == NULL) || r; + r = ((glBindVideoCaptureStreamTextureNV = (PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamTextureNV")) == NULL) || r; + r = ((glEndVideoCaptureNV = (PFNGLENDVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glEndVideoCaptureNV")) == NULL) || r; + r = ((glGetVideoCaptureStreamdvNV = (PFNGLGETVIDEOCAPTURESTREAMDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamdvNV")) == NULL) || r; + r = ((glGetVideoCaptureStreamfvNV = (PFNGLGETVIDEOCAPTURESTREAMFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamfvNV")) == NULL) || r; + r = ((glGetVideoCaptureStreamivNV = (PFNGLGETVIDEOCAPTURESTREAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamivNV")) == NULL) || r; + r = ((glGetVideoCaptureivNV = (PFNGLGETVIDEOCAPTUREIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureivNV")) == NULL) || r; + r = ((glVideoCaptureNV = (PFNGLVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureNV")) == NULL) || r; + r = ((glVideoCaptureStreamParameterdvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterdvNV")) == NULL) || r; + r = ((glVideoCaptureStreamParameterfvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterfvNV")) == NULL) || r; + r = ((glVideoCaptureStreamParameterivNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_video_capture */ + +#ifdef GL_OES_byte_coordinates + +#endif /* GL_OES_byte_coordinates */ + +#ifdef GL_OES_compressed_paletted_texture + +#endif /* GL_OES_compressed_paletted_texture */ + +#ifdef GL_OES_read_format + +#endif /* GL_OES_read_format */ + +#ifdef GL_OES_single_precision + +static GLboolean _glewInit_GL_OES_single_precision (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearDepthfOES = (PFNGLCLEARDEPTHFOESPROC)glewGetProcAddress((const GLubyte*)"glClearDepthfOES")) == NULL) || r; + r = ((glClipPlanefOES = (PFNGLCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glClipPlanefOES")) == NULL) || r; + r = ((glDepthRangefOES = (PFNGLDEPTHRANGEFOESPROC)glewGetProcAddress((const GLubyte*)"glDepthRangefOES")) == NULL) || r; + r = ((glFrustumfOES = (PFNGLFRUSTUMFOESPROC)glewGetProcAddress((const GLubyte*)"glFrustumfOES")) == NULL) || r; + r = ((glGetClipPlanefOES = (PFNGLGETCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanefOES")) == NULL) || r; + r = ((glOrthofOES = (PFNGLORTHOFOESPROC)glewGetProcAddress((const GLubyte*)"glOrthofOES")) == NULL) || r; + + return r; +} + +#endif /* GL_OES_single_precision */ + +#ifdef GL_OML_interlace + +#endif /* GL_OML_interlace */ + +#ifdef GL_OML_resample + +#endif /* GL_OML_resample */ + +#ifdef GL_OML_subsample + +#endif /* GL_OML_subsample */ + +#ifdef GL_PGI_misc_hints + +#endif /* GL_PGI_misc_hints */ + +#ifdef GL_PGI_vertex_hints + +#endif /* GL_PGI_vertex_hints */ + +#ifdef GL_REGAL_ES1_0_compatibility + +static GLboolean _glewInit_GL_REGAL_ES1_0_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAlphaFuncx = (PFNGLALPHAFUNCXPROC)glewGetProcAddress((const GLubyte*)"glAlphaFuncx")) == NULL) || r; + r = ((glClearColorx = (PFNGLCLEARCOLORXPROC)glewGetProcAddress((const GLubyte*)"glClearColorx")) == NULL) || r; + r = ((glClearDepthx = (PFNGLCLEARDEPTHXPROC)glewGetProcAddress((const GLubyte*)"glClearDepthx")) == NULL) || r; + r = ((glColor4x = (PFNGLCOLOR4XPROC)glewGetProcAddress((const GLubyte*)"glColor4x")) == NULL) || r; + r = ((glDepthRangex = (PFNGLDEPTHRANGEXPROC)glewGetProcAddress((const GLubyte*)"glDepthRangex")) == NULL) || r; + r = ((glFogx = (PFNGLFOGXPROC)glewGetProcAddress((const GLubyte*)"glFogx")) == NULL) || r; + r = ((glFogxv = (PFNGLFOGXVPROC)glewGetProcAddress((const GLubyte*)"glFogxv")) == NULL) || r; + r = ((glFrustumf = (PFNGLFRUSTUMFPROC)glewGetProcAddress((const GLubyte*)"glFrustumf")) == NULL) || r; + r = ((glFrustumx = (PFNGLFRUSTUMXPROC)glewGetProcAddress((const GLubyte*)"glFrustumx")) == NULL) || r; + r = ((glLightModelx = (PFNGLLIGHTMODELXPROC)glewGetProcAddress((const GLubyte*)"glLightModelx")) == NULL) || r; + r = ((glLightModelxv = (PFNGLLIGHTMODELXVPROC)glewGetProcAddress((const GLubyte*)"glLightModelxv")) == NULL) || r; + r = ((glLightx = (PFNGLLIGHTXPROC)glewGetProcAddress((const GLubyte*)"glLightx")) == NULL) || r; + r = ((glLightxv = (PFNGLLIGHTXVPROC)glewGetProcAddress((const GLubyte*)"glLightxv")) == NULL) || r; + r = ((glLineWidthx = (PFNGLLINEWIDTHXPROC)glewGetProcAddress((const GLubyte*)"glLineWidthx")) == NULL) || r; + r = ((glLoadMatrixx = (PFNGLLOADMATRIXXPROC)glewGetProcAddress((const GLubyte*)"glLoadMatrixx")) == NULL) || r; + r = ((glMaterialx = (PFNGLMATERIALXPROC)glewGetProcAddress((const GLubyte*)"glMaterialx")) == NULL) || r; + r = ((glMaterialxv = (PFNGLMATERIALXVPROC)glewGetProcAddress((const GLubyte*)"glMaterialxv")) == NULL) || r; + r = ((glMultMatrixx = (PFNGLMULTMATRIXXPROC)glewGetProcAddress((const GLubyte*)"glMultMatrixx")) == NULL) || r; + r = ((glMultiTexCoord4x = (PFNGLMULTITEXCOORD4XPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4x")) == NULL) || r; + r = ((glNormal3x = (PFNGLNORMAL3XPROC)glewGetProcAddress((const GLubyte*)"glNormal3x")) == NULL) || r; + r = ((glOrthof = (PFNGLORTHOFPROC)glewGetProcAddress((const GLubyte*)"glOrthof")) == NULL) || r; + r = ((glOrthox = (PFNGLORTHOXPROC)glewGetProcAddress((const GLubyte*)"glOrthox")) == NULL) || r; + r = ((glPointSizex = (PFNGLPOINTSIZEXPROC)glewGetProcAddress((const GLubyte*)"glPointSizex")) == NULL) || r; + r = ((glPolygonOffsetx = (PFNGLPOLYGONOFFSETXPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetx")) == NULL) || r; + r = ((glRotatex = (PFNGLROTATEXPROC)glewGetProcAddress((const GLubyte*)"glRotatex")) == NULL) || r; + r = ((glSampleCoveragex = (PFNGLSAMPLECOVERAGEXPROC)glewGetProcAddress((const GLubyte*)"glSampleCoveragex")) == NULL) || r; + r = ((glScalex = (PFNGLSCALEXPROC)glewGetProcAddress((const GLubyte*)"glScalex")) == NULL) || r; + r = ((glTexEnvx = (PFNGLTEXENVXPROC)glewGetProcAddress((const GLubyte*)"glTexEnvx")) == NULL) || r; + r = ((glTexEnvxv = (PFNGLTEXENVXVPROC)glewGetProcAddress((const GLubyte*)"glTexEnvxv")) == NULL) || r; + r = ((glTexParameterx = (PFNGLTEXPARAMETERXPROC)glewGetProcAddress((const GLubyte*)"glTexParameterx")) == NULL) || r; + r = ((glTranslatex = (PFNGLTRANSLATEXPROC)glewGetProcAddress((const GLubyte*)"glTranslatex")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_ES1_0_compatibility */ + +#ifdef GL_REGAL_ES1_1_compatibility + +static GLboolean _glewInit_GL_REGAL_ES1_1_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClipPlanef = (PFNGLCLIPPLANEFPROC)glewGetProcAddress((const GLubyte*)"glClipPlanef")) == NULL) || r; + r = ((glClipPlanex = (PFNGLCLIPPLANEXPROC)glewGetProcAddress((const GLubyte*)"glClipPlanex")) == NULL) || r; + r = ((glGetClipPlanef = (PFNGLGETCLIPPLANEFPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanef")) == NULL) || r; + r = ((glGetClipPlanex = (PFNGLGETCLIPPLANEXPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanex")) == NULL) || r; + r = ((glGetFixedv = (PFNGLGETFIXEDVPROC)glewGetProcAddress((const GLubyte*)"glGetFixedv")) == NULL) || r; + r = ((glGetLightxv = (PFNGLGETLIGHTXVPROC)glewGetProcAddress((const GLubyte*)"glGetLightxv")) == NULL) || r; + r = ((glGetMaterialxv = (PFNGLGETMATERIALXVPROC)glewGetProcAddress((const GLubyte*)"glGetMaterialxv")) == NULL) || r; + r = ((glGetTexEnvxv = (PFNGLGETTEXENVXVPROC)glewGetProcAddress((const GLubyte*)"glGetTexEnvxv")) == NULL) || r; + r = ((glGetTexParameterxv = (PFNGLGETTEXPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterxv")) == NULL) || r; + r = ((glPointParameterx = (PFNGLPOINTPARAMETERXPROC)glewGetProcAddress((const GLubyte*)"glPointParameterx")) == NULL) || r; + r = ((glPointParameterxv = (PFNGLPOINTPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterxv")) == NULL) || r; + r = ((glPointSizePointerOES = (PFNGLPOINTSIZEPOINTEROESPROC)glewGetProcAddress((const GLubyte*)"glPointSizePointerOES")) == NULL) || r; + r = ((glTexParameterxv = (PFNGLTEXPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterxv")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_ES1_1_compatibility */ + +#ifdef GL_REGAL_enable + +#endif /* GL_REGAL_enable */ + +#ifdef GL_REGAL_error_string + +static GLboolean _glewInit_GL_REGAL_error_string (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glErrorStringREGAL = (PFNGLERRORSTRINGREGALPROC)glewGetProcAddress((const GLubyte*)"glErrorStringREGAL")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_error_string */ + +#ifdef GL_REGAL_extension_query + +static GLboolean _glewInit_GL_REGAL_extension_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetExtensionREGAL = (PFNGLGETEXTENSIONREGALPROC)glewGetProcAddress((const GLubyte*)"glGetExtensionREGAL")) == NULL) || r; + r = ((glIsSupportedREGAL = (PFNGLISSUPPORTEDREGALPROC)glewGetProcAddress((const GLubyte*)"glIsSupportedREGAL")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_extension_query */ + +#ifdef GL_REGAL_log + +static GLboolean _glewInit_GL_REGAL_log (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glLogMessageCallbackREGAL = (PFNGLLOGMESSAGECALLBACKREGALPROC)glewGetProcAddress((const GLubyte*)"glLogMessageCallbackREGAL")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_log */ + +#ifdef GL_REND_screen_coordinates + +#endif /* GL_REND_screen_coordinates */ + +#ifdef GL_S3_s3tc + +#endif /* GL_S3_s3tc */ + +#ifdef GL_SGIS_color_range + +#endif /* GL_SGIS_color_range */ + +#ifdef GL_SGIS_detail_texture + +static GLboolean _glewInit_GL_SGIS_detail_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDetailTexFuncSGIS = (PFNGLDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glDetailTexFuncSGIS")) == NULL) || r; + r = ((glGetDetailTexFuncSGIS = (PFNGLGETDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetDetailTexFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_detail_texture */ + +#ifdef GL_SGIS_fog_function + +static GLboolean _glewInit_GL_SGIS_fog_function (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFogFuncSGIS = (PFNGLFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glFogFuncSGIS")) == NULL) || r; + r = ((glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetFogFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_fog_function */ + +#ifdef GL_SGIS_generate_mipmap + +#endif /* GL_SGIS_generate_mipmap */ + +#ifdef GL_SGIS_multisample + +static GLboolean _glewInit_GL_SGIS_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSampleMaskSGIS = (PFNGLSAMPLEMASKSGISPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskSGIS")) == NULL) || r; + r = ((glSamplePatternSGIS = (PFNGLSAMPLEPATTERNSGISPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_multisample */ + +#ifdef GL_SGIS_pixel_texture + +#endif /* GL_SGIS_pixel_texture */ + +#ifdef GL_SGIS_point_line_texgen + +#endif /* GL_SGIS_point_line_texgen */ + +#ifdef GL_SGIS_sharpen_texture + +static GLboolean _glewInit_GL_SGIS_sharpen_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetSharpenTexFuncSGIS = (PFNGLGETSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetSharpenTexFuncSGIS")) == NULL) || r; + r = ((glSharpenTexFuncSGIS = (PFNGLSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glSharpenTexFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_sharpen_texture */ + +#ifdef GL_SGIS_texture4D + +static GLboolean _glewInit_GL_SGIS_texture4D (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexImage4DSGIS = (PFNGLTEXIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexImage4DSGIS")) == NULL) || r; + r = ((glTexSubImage4DSGIS = (PFNGLTEXSUBIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage4DSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_texture4D */ + +#ifdef GL_SGIS_texture_border_clamp + +#endif /* GL_SGIS_texture_border_clamp */ + +#ifdef GL_SGIS_texture_edge_clamp + +#endif /* GL_SGIS_texture_edge_clamp */ + +#ifdef GL_SGIS_texture_filter4 + +static GLboolean _glewInit_GL_SGIS_texture_filter4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexFilterFuncSGIS = (PFNGLGETTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetTexFilterFuncSGIS")) == NULL) || r; + r = ((glTexFilterFuncSGIS = (PFNGLTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glTexFilterFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_texture_filter4 */ + +#ifdef GL_SGIS_texture_lod + +#endif /* GL_SGIS_texture_lod */ + +#ifdef GL_SGIS_texture_select + +#endif /* GL_SGIS_texture_select */ + +#ifdef GL_SGIX_async + +static GLboolean _glewInit_GL_SGIX_async (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAsyncMarkerSGIX = (PFNGLASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glAsyncMarkerSGIX")) == NULL) || r; + r = ((glDeleteAsyncMarkersSGIX = (PFNGLDELETEASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glDeleteAsyncMarkersSGIX")) == NULL) || r; + r = ((glFinishAsyncSGIX = (PFNGLFINISHASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glFinishAsyncSGIX")) == NULL) || r; + r = ((glGenAsyncMarkersSGIX = (PFNGLGENASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glGenAsyncMarkersSGIX")) == NULL) || r; + r = ((glIsAsyncMarkerSGIX = (PFNGLISASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glIsAsyncMarkerSGIX")) == NULL) || r; + r = ((glPollAsyncSGIX = (PFNGLPOLLASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glPollAsyncSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_async */ + +#ifdef GL_SGIX_async_histogram + +#endif /* GL_SGIX_async_histogram */ + +#ifdef GL_SGIX_async_pixel + +#endif /* GL_SGIX_async_pixel */ + +#ifdef GL_SGIX_blend_alpha_minmax + +#endif /* GL_SGIX_blend_alpha_minmax */ + +#ifdef GL_SGIX_clipmap + +#endif /* GL_SGIX_clipmap */ + +#ifdef GL_SGIX_convolution_accuracy + +#endif /* GL_SGIX_convolution_accuracy */ + +#ifdef GL_SGIX_depth_texture + +#endif /* GL_SGIX_depth_texture */ + +#ifdef GL_SGIX_flush_raster + +static GLboolean _glewInit_GL_SGIX_flush_raster (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushRasterSGIX = (PFNGLFLUSHRASTERSGIXPROC)glewGetProcAddress((const GLubyte*)"glFlushRasterSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_flush_raster */ + +#ifdef GL_SGIX_fog_offset + +#endif /* GL_SGIX_fog_offset */ + +#ifdef GL_SGIX_fog_texture + +static GLboolean _glewInit_GL_SGIX_fog_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTextureFogSGIX = (PFNGLTEXTUREFOGSGIXPROC)glewGetProcAddress((const GLubyte*)"glTextureFogSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_fog_texture */ + +#ifdef GL_SGIX_fragment_specular_lighting + +static GLboolean _glewInit_GL_SGIX_fragment_specular_lighting (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialSGIX")) == NULL) || r; + r = ((glFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfSGIX")) == NULL) || r; + r = ((glFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvSGIX")) == NULL) || r; + r = ((glFragmentLightModeliSGIX = (PFNGLFRAGMENTLIGHTMODELISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliSGIX")) == NULL) || r; + r = ((glFragmentLightModelivSGIX = (PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivSGIX")) == NULL) || r; + r = ((glFragmentLightfSGIX = (PFNGLFRAGMENTLIGHTFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfSGIX")) == NULL) || r; + r = ((glFragmentLightfvSGIX = (PFNGLFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvSGIX")) == NULL) || r; + r = ((glFragmentLightiSGIX = (PFNGLFRAGMENTLIGHTISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiSGIX")) == NULL) || r; + r = ((glFragmentLightivSGIX = (PFNGLFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivSGIX")) == NULL) || r; + r = ((glFragmentMaterialfSGIX = (PFNGLFRAGMENTMATERIALFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfSGIX")) == NULL) || r; + r = ((glFragmentMaterialfvSGIX = (PFNGLFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvSGIX")) == NULL) || r; + r = ((glFragmentMaterialiSGIX = (PFNGLFRAGMENTMATERIALISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiSGIX")) == NULL) || r; + r = ((glFragmentMaterialivSGIX = (PFNGLFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivSGIX")) == NULL) || r; + r = ((glGetFragmentLightfvSGIX = (PFNGLGETFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvSGIX")) == NULL) || r; + r = ((glGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivSGIX")) == NULL) || r; + r = ((glGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvSGIX")) == NULL) || r; + r = ((glGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_fragment_specular_lighting */ + +#ifdef GL_SGIX_framezoom + +static GLboolean _glewInit_GL_SGIX_framezoom (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFrameZoomSGIX = (PFNGLFRAMEZOOMSGIXPROC)glewGetProcAddress((const GLubyte*)"glFrameZoomSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_framezoom */ + +#ifdef GL_SGIX_interlace + +#endif /* GL_SGIX_interlace */ + +#ifdef GL_SGIX_ir_instrument1 + +#endif /* GL_SGIX_ir_instrument1 */ + +#ifdef GL_SGIX_list_priority + +#endif /* GL_SGIX_list_priority */ + +#ifdef GL_SGIX_pixel_texture + +static GLboolean _glewInit_GL_SGIX_pixel_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPixelTexGenSGIX = (PFNGLPIXELTEXGENSGIXPROC)glewGetProcAddress((const GLubyte*)"glPixelTexGenSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_pixel_texture */ + +#ifdef GL_SGIX_pixel_texture_bits + +#endif /* GL_SGIX_pixel_texture_bits */ + +#ifdef GL_SGIX_reference_plane + +static GLboolean _glewInit_GL_SGIX_reference_plane (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glReferencePlaneSGIX = (PFNGLREFERENCEPLANESGIXPROC)glewGetProcAddress((const GLubyte*)"glReferencePlaneSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_reference_plane */ + +#ifdef GL_SGIX_resample + +#endif /* GL_SGIX_resample */ + +#ifdef GL_SGIX_shadow + +#endif /* GL_SGIX_shadow */ + +#ifdef GL_SGIX_shadow_ambient + +#endif /* GL_SGIX_shadow_ambient */ + +#ifdef GL_SGIX_sprite + +static GLboolean _glewInit_GL_SGIX_sprite (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSpriteParameterfSGIX = (PFNGLSPRITEPARAMETERFSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfSGIX")) == NULL) || r; + r = ((glSpriteParameterfvSGIX = (PFNGLSPRITEPARAMETERFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfvSGIX")) == NULL) || r; + r = ((glSpriteParameteriSGIX = (PFNGLSPRITEPARAMETERISGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameteriSGIX")) == NULL) || r; + r = ((glSpriteParameterivSGIX = (PFNGLSPRITEPARAMETERIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterivSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_sprite */ + +#ifdef GL_SGIX_tag_sample_buffer + +static GLboolean _glewInit_GL_SGIX_tag_sample_buffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTagSampleBufferSGIX = (PFNGLTAGSAMPLEBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glTagSampleBufferSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_tag_sample_buffer */ + +#ifdef GL_SGIX_texture_add_env + +#endif /* GL_SGIX_texture_add_env */ + +#ifdef GL_SGIX_texture_coordinate_clamp + +#endif /* GL_SGIX_texture_coordinate_clamp */ + +#ifdef GL_SGIX_texture_lod_bias + +#endif /* GL_SGIX_texture_lod_bias */ + +#ifdef GL_SGIX_texture_multi_buffer + +#endif /* GL_SGIX_texture_multi_buffer */ + +#ifdef GL_SGIX_texture_range + +#endif /* GL_SGIX_texture_range */ + +#ifdef GL_SGIX_texture_scale_bias + +#endif /* GL_SGIX_texture_scale_bias */ + +#ifdef GL_SGIX_vertex_preclip + +#endif /* GL_SGIX_vertex_preclip */ + +#ifdef GL_SGIX_vertex_preclip_hint + +#endif /* GL_SGIX_vertex_preclip_hint */ + +#ifdef GL_SGIX_ycrcb + +#endif /* GL_SGIX_ycrcb */ + +#ifdef GL_SGI_color_matrix + +#endif /* GL_SGI_color_matrix */ + +#ifdef GL_SGI_color_table + +static GLboolean _glewInit_GL_SGI_color_table (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorTableParameterfvSGI = (PFNGLCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfvSGI")) == NULL) || r; + r = ((glColorTableParameterivSGI = (PFNGLCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterivSGI")) == NULL) || r; + r = ((glColorTableSGI = (PFNGLCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableSGI")) == NULL) || r; + r = ((glCopyColorTableSGI = (PFNGLCOPYCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTableSGI")) == NULL) || r; + r = ((glGetColorTableParameterfvSGI = (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvSGI")) == NULL) || r; + r = ((glGetColorTableParameterivSGI = (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivSGI")) == NULL) || r; + r = ((glGetColorTableSGI = (PFNGLGETCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableSGI")) == NULL) || r; + + return r; +} + +#endif /* GL_SGI_color_table */ + +#ifdef GL_SGI_texture_color_table + +#endif /* GL_SGI_texture_color_table */ + +#ifdef GL_SUNX_constant_data + +static GLboolean _glewInit_GL_SUNX_constant_data (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFinishTextureSUNX = (PFNGLFINISHTEXTURESUNXPROC)glewGetProcAddress((const GLubyte*)"glFinishTextureSUNX")) == NULL) || r; + + return r; +} + +#endif /* GL_SUNX_constant_data */ + +#ifdef GL_SUN_convolution_border_modes + +#endif /* GL_SUN_convolution_border_modes */ + +#ifdef GL_SUN_global_alpha + +static GLboolean _glewInit_GL_SUN_global_alpha (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGlobalAlphaFactorbSUN = (PFNGLGLOBALALPHAFACTORBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorbSUN")) == NULL) || r; + r = ((glGlobalAlphaFactordSUN = (PFNGLGLOBALALPHAFACTORDSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactordSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorfSUN = (PFNGLGLOBALALPHAFACTORFSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorfSUN")) == NULL) || r; + r = ((glGlobalAlphaFactoriSUN = (PFNGLGLOBALALPHAFACTORISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoriSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorsSUN = (PFNGLGLOBALALPHAFACTORSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorsSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorubSUN = (PFNGLGLOBALALPHAFACTORUBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorubSUN")) == NULL) || r; + r = ((glGlobalAlphaFactoruiSUN = (PFNGLGLOBALALPHAFACTORUISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoruiSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorusSUN = (PFNGLGLOBALALPHAFACTORUSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorusSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_global_alpha */ + +#ifdef GL_SUN_mesh_array + +#endif /* GL_SUN_mesh_array */ + +#ifdef GL_SUN_read_video_pixels + +static GLboolean _glewInit_GL_SUN_read_video_pixels (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glReadVideoPixelsSUN = (PFNGLREADVIDEOPIXELSSUNPROC)glewGetProcAddress((const GLubyte*)"glReadVideoPixelsSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_read_video_pixels */ + +#ifdef GL_SUN_slice_accum + +#endif /* GL_SUN_slice_accum */ + +#ifdef GL_SUN_triangle_list + +static GLboolean _glewInit_GL_SUN_triangle_list (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glReplacementCodePointerSUN = (PFNGLREPLACEMENTCODEPOINTERSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodePointerSUN")) == NULL) || r; + r = ((glReplacementCodeubSUN = (PFNGLREPLACEMENTCODEUBSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubSUN")) == NULL) || r; + r = ((glReplacementCodeubvSUN = (PFNGLREPLACEMENTCODEUBVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubvSUN")) == NULL) || r; + r = ((glReplacementCodeuiSUN = (PFNGLREPLACEMENTCODEUISUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiSUN")) == NULL) || r; + r = ((glReplacementCodeuivSUN = (PFNGLREPLACEMENTCODEUIVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuivSUN")) == NULL) || r; + r = ((glReplacementCodeusSUN = (PFNGLREPLACEMENTCODEUSSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusSUN")) == NULL) || r; + r = ((glReplacementCodeusvSUN = (PFNGLREPLACEMENTCODEUSVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusvSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_triangle_list */ + +#ifdef GL_SUN_vertex + +static GLboolean _glewInit_GL_SUN_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColor3fVertex3fSUN = (PFNGLCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fSUN")) == NULL) || r; + r = ((glColor3fVertex3fvSUN = (PFNGLCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fvSUN")) == NULL) || r; + r = ((glColor4fNormal3fVertex3fSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glColor4fNormal3fVertex3fvSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glColor4ubVertex2fSUN = (PFNGLCOLOR4UBVERTEX2FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fSUN")) == NULL) || r; + r = ((glColor4ubVertex2fvSUN = (PFNGLCOLOR4UBVERTEX2FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fvSUN")) == NULL) || r; + r = ((glColor4ubVertex3fSUN = (PFNGLCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fSUN")) == NULL) || r; + r = ((glColor4ubVertex3fvSUN = (PFNGLCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glNormal3fVertex3fSUN = (PFNGLNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fSUN")) == NULL) || r; + r = ((glNormal3fVertex3fvSUN = (PFNGLNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4ubVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4ubVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiVertex3fSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiVertex3fvSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor4ubVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor4ubVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fVertex3fSUN = (PFNGLTEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fVertex3fvSUN = (PFNGLTEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord4fColor4fNormal3fVertex4fSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fSUN")) == NULL) || r; + r = ((glTexCoord4fColor4fNormal3fVertex4fvSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fvSUN")) == NULL) || r; + r = ((glTexCoord4fVertex4fSUN = (PFNGLTEXCOORD4FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fSUN")) == NULL) || r; + r = ((glTexCoord4fVertex4fvSUN = (PFNGLTEXCOORD4FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fvSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_vertex */ + +#ifdef GL_WIN_phong_shading + +#endif /* GL_WIN_phong_shading */ + +#ifdef GL_WIN_specular_fog + +#endif /* GL_WIN_specular_fog */ + +#ifdef GL_WIN_swap_hint + +static GLboolean _glewInit_GL_WIN_swap_hint (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAddSwapHintRectWIN = (PFNGLADDSWAPHINTRECTWINPROC)glewGetProcAddress((const GLubyte*)"glAddSwapHintRectWIN")) == NULL) || r; + + return r; +} + +#endif /* GL_WIN_swap_hint */ + +/* ------------------------------------------------------------------------- */ + +GLboolean GLEWAPIENTRY glewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + start = (const GLubyte*)glGetString(GL_EXTENSIONS); + if (start == 0) + return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +/* ------------------------------------------------------------------------- */ + +#ifndef GLEW_MX +static +#endif +GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) +{ + const GLubyte* s; + GLuint dot; + GLint major, minor; + const GLubyte* extStart; + const GLubyte* extEnd; + /* query opengl version */ + s = glGetString(GL_VERSION); + dot = _glewStrCLen(s, '.'); + if (dot == 0) + return GLEW_ERROR_NO_GL_VERSION; + + major = s[dot-1]-'0'; + minor = s[dot+1]-'0'; + + if (minor < 0 || minor > 9) + minor = 0; + if (major<0 || major>9) + return GLEW_ERROR_NO_GL_VERSION; + + + if (major == 1 && minor == 0) + { + return GLEW_ERROR_GL_VERSION_10_ONLY; + } + else + { + CONST_CAST(GLEW_VERSION_4_4) = ( major > 4 ) || ( major == 4 && minor >= 4 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_4_3) = GLEW_VERSION_4_4 == GL_TRUE || ( major == 4 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_4_2) = GLEW_VERSION_4_3 == GL_TRUE || ( major == 4 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_4_1) = GLEW_VERSION_4_2 == GL_TRUE || ( major == 4 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_4_0) = GLEW_VERSION_4_1 == GL_TRUE || ( major == 4 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_3) = GLEW_VERSION_4_0 == GL_TRUE || ( major == 3 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_2) = GLEW_VERSION_3_3 == GL_TRUE || ( major == 3 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_1) = GLEW_VERSION_3_2 == GL_TRUE || ( major == 3 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_0) = GLEW_VERSION_3_1 == GL_TRUE || ( major == 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_2_1) = GLEW_VERSION_3_0 == GL_TRUE || ( major == 2 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_2_0) = GLEW_VERSION_2_1 == GL_TRUE || ( major == 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_5) = GLEW_VERSION_2_0 == GL_TRUE || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_4) = GLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_3) = GLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_2_1) = GLEW_VERSION_1_3 == GL_TRUE ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_2) = GLEW_VERSION_1_2_1 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_1) = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + } + + /* query opengl extensions string */ + extStart = glGetString(GL_EXTENSIONS); + if (extStart == 0) + extStart = (const GLubyte*)""; + extEnd = extStart + _glewStrLen(extStart); + + /* initialize extensions */ +#ifdef GL_VERSION_1_2 + if (glewExperimental || GLEW_VERSION_1_2) CONST_CAST(GLEW_VERSION_1_2) = !_glewInit_GL_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_2 */ +#ifdef GL_VERSION_1_2_1 +#endif /* GL_VERSION_1_2_1 */ +#ifdef GL_VERSION_1_3 + if (glewExperimental || GLEW_VERSION_1_3) CONST_CAST(GLEW_VERSION_1_3) = !_glewInit_GL_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_3 */ +#ifdef GL_VERSION_1_4 + if (glewExperimental || GLEW_VERSION_1_4) CONST_CAST(GLEW_VERSION_1_4) = !_glewInit_GL_VERSION_1_4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_4 */ +#ifdef GL_VERSION_1_5 + if (glewExperimental || GLEW_VERSION_1_5) CONST_CAST(GLEW_VERSION_1_5) = !_glewInit_GL_VERSION_1_5(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_5 */ +#ifdef GL_VERSION_2_0 + if (glewExperimental || GLEW_VERSION_2_0) CONST_CAST(GLEW_VERSION_2_0) = !_glewInit_GL_VERSION_2_0(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_2_0 */ +#ifdef GL_VERSION_2_1 + if (glewExperimental || GLEW_VERSION_2_1) CONST_CAST(GLEW_VERSION_2_1) = !_glewInit_GL_VERSION_2_1(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_2_1 */ +#ifdef GL_VERSION_3_0 + if (glewExperimental || GLEW_VERSION_3_0) CONST_CAST(GLEW_VERSION_3_0) = !_glewInit_GL_VERSION_3_0(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_3_0 */ +#ifdef GL_VERSION_3_1 + if (glewExperimental || GLEW_VERSION_3_1) CONST_CAST(GLEW_VERSION_3_1) = !_glewInit_GL_VERSION_3_1(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_3_1 */ +#ifdef GL_VERSION_3_2 + if (glewExperimental || GLEW_VERSION_3_2) CONST_CAST(GLEW_VERSION_3_2) = !_glewInit_GL_VERSION_3_2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_3_2 */ +#ifdef GL_VERSION_3_3 + if (glewExperimental || GLEW_VERSION_3_3) CONST_CAST(GLEW_VERSION_3_3) = !_glewInit_GL_VERSION_3_3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_3_3 */ +#ifdef GL_VERSION_4_0 + if (glewExperimental || GLEW_VERSION_4_0) CONST_CAST(GLEW_VERSION_4_0) = !_glewInit_GL_VERSION_4_0(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_4_0 */ +#ifdef GL_VERSION_4_1 +#endif /* GL_VERSION_4_1 */ +#ifdef GL_VERSION_4_2 +#endif /* GL_VERSION_4_2 */ +#ifdef GL_VERSION_4_3 +#endif /* GL_VERSION_4_3 */ +#ifdef GL_VERSION_4_4 +#endif /* GL_VERSION_4_4 */ +#ifdef GL_3DFX_multisample + CONST_CAST(GLEW_3DFX_multisample) = _glewSearchExtension("GL_3DFX_multisample", extStart, extEnd); +#endif /* GL_3DFX_multisample */ +#ifdef GL_3DFX_tbuffer + CONST_CAST(GLEW_3DFX_tbuffer) = _glewSearchExtension("GL_3DFX_tbuffer", extStart, extEnd); + if (glewExperimental || GLEW_3DFX_tbuffer) CONST_CAST(GLEW_3DFX_tbuffer) = !_glewInit_GL_3DFX_tbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_3DFX_tbuffer */ +#ifdef GL_3DFX_texture_compression_FXT1 + CONST_CAST(GLEW_3DFX_texture_compression_FXT1) = _glewSearchExtension("GL_3DFX_texture_compression_FXT1", extStart, extEnd); +#endif /* GL_3DFX_texture_compression_FXT1 */ +#ifdef GL_AMD_blend_minmax_factor + CONST_CAST(GLEW_AMD_blend_minmax_factor) = _glewSearchExtension("GL_AMD_blend_minmax_factor", extStart, extEnd); +#endif /* GL_AMD_blend_minmax_factor */ +#ifdef GL_AMD_conservative_depth + CONST_CAST(GLEW_AMD_conservative_depth) = _glewSearchExtension("GL_AMD_conservative_depth", extStart, extEnd); +#endif /* GL_AMD_conservative_depth */ +#ifdef GL_AMD_debug_output + CONST_CAST(GLEW_AMD_debug_output) = _glewSearchExtension("GL_AMD_debug_output", extStart, extEnd); + if (glewExperimental || GLEW_AMD_debug_output) CONST_CAST(GLEW_AMD_debug_output) = !_glewInit_GL_AMD_debug_output(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_debug_output */ +#ifdef GL_AMD_depth_clamp_separate + CONST_CAST(GLEW_AMD_depth_clamp_separate) = _glewSearchExtension("GL_AMD_depth_clamp_separate", extStart, extEnd); +#endif /* GL_AMD_depth_clamp_separate */ +#ifdef GL_AMD_draw_buffers_blend + CONST_CAST(GLEW_AMD_draw_buffers_blend) = _glewSearchExtension("GL_AMD_draw_buffers_blend", extStart, extEnd); + if (glewExperimental || GLEW_AMD_draw_buffers_blend) CONST_CAST(GLEW_AMD_draw_buffers_blend) = !_glewInit_GL_AMD_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_draw_buffers_blend */ +#ifdef GL_AMD_interleaved_elements + CONST_CAST(GLEW_AMD_interleaved_elements) = _glewSearchExtension("GL_AMD_interleaved_elements", extStart, extEnd); + if (glewExperimental || GLEW_AMD_interleaved_elements) CONST_CAST(GLEW_AMD_interleaved_elements) = !_glewInit_GL_AMD_interleaved_elements(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_interleaved_elements */ +#ifdef GL_AMD_multi_draw_indirect + CONST_CAST(GLEW_AMD_multi_draw_indirect) = _glewSearchExtension("GL_AMD_multi_draw_indirect", extStart, extEnd); + if (glewExperimental || GLEW_AMD_multi_draw_indirect) CONST_CAST(GLEW_AMD_multi_draw_indirect) = !_glewInit_GL_AMD_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_multi_draw_indirect */ +#ifdef GL_AMD_name_gen_delete + CONST_CAST(GLEW_AMD_name_gen_delete) = _glewSearchExtension("GL_AMD_name_gen_delete", extStart, extEnd); + if (glewExperimental || GLEW_AMD_name_gen_delete) CONST_CAST(GLEW_AMD_name_gen_delete) = !_glewInit_GL_AMD_name_gen_delete(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_name_gen_delete */ +#ifdef GL_AMD_performance_monitor + CONST_CAST(GLEW_AMD_performance_monitor) = _glewSearchExtension("GL_AMD_performance_monitor", extStart, extEnd); + if (glewExperimental || GLEW_AMD_performance_monitor) CONST_CAST(GLEW_AMD_performance_monitor) = !_glewInit_GL_AMD_performance_monitor(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_performance_monitor */ +#ifdef GL_AMD_pinned_memory + CONST_CAST(GLEW_AMD_pinned_memory) = _glewSearchExtension("GL_AMD_pinned_memory", extStart, extEnd); +#endif /* GL_AMD_pinned_memory */ +#ifdef GL_AMD_query_buffer_object + CONST_CAST(GLEW_AMD_query_buffer_object) = _glewSearchExtension("GL_AMD_query_buffer_object", extStart, extEnd); +#endif /* GL_AMD_query_buffer_object */ +#ifdef GL_AMD_sample_positions + CONST_CAST(GLEW_AMD_sample_positions) = _glewSearchExtension("GL_AMD_sample_positions", extStart, extEnd); + if (glewExperimental || GLEW_AMD_sample_positions) CONST_CAST(GLEW_AMD_sample_positions) = !_glewInit_GL_AMD_sample_positions(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_sample_positions */ +#ifdef GL_AMD_seamless_cubemap_per_texture + CONST_CAST(GLEW_AMD_seamless_cubemap_per_texture) = _glewSearchExtension("GL_AMD_seamless_cubemap_per_texture", extStart, extEnd); +#endif /* GL_AMD_seamless_cubemap_per_texture */ +#ifdef GL_AMD_shader_stencil_export + CONST_CAST(GLEW_AMD_shader_stencil_export) = _glewSearchExtension("GL_AMD_shader_stencil_export", extStart, extEnd); +#endif /* GL_AMD_shader_stencil_export */ +#ifdef GL_AMD_shader_trinary_minmax + CONST_CAST(GLEW_AMD_shader_trinary_minmax) = _glewSearchExtension("GL_AMD_shader_trinary_minmax", extStart, extEnd); +#endif /* GL_AMD_shader_trinary_minmax */ +#ifdef GL_AMD_sparse_texture + CONST_CAST(GLEW_AMD_sparse_texture) = _glewSearchExtension("GL_AMD_sparse_texture", extStart, extEnd); + if (glewExperimental || GLEW_AMD_sparse_texture) CONST_CAST(GLEW_AMD_sparse_texture) = !_glewInit_GL_AMD_sparse_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_sparse_texture */ +#ifdef GL_AMD_stencil_operation_extended + CONST_CAST(GLEW_AMD_stencil_operation_extended) = _glewSearchExtension("GL_AMD_stencil_operation_extended", extStart, extEnd); + if (glewExperimental || GLEW_AMD_stencil_operation_extended) CONST_CAST(GLEW_AMD_stencil_operation_extended) = !_glewInit_GL_AMD_stencil_operation_extended(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_stencil_operation_extended */ +#ifdef GL_AMD_texture_texture4 + CONST_CAST(GLEW_AMD_texture_texture4) = _glewSearchExtension("GL_AMD_texture_texture4", extStart, extEnd); +#endif /* GL_AMD_texture_texture4 */ +#ifdef GL_AMD_transform_feedback3_lines_triangles + CONST_CAST(GLEW_AMD_transform_feedback3_lines_triangles) = _glewSearchExtension("GL_AMD_transform_feedback3_lines_triangles", extStart, extEnd); +#endif /* GL_AMD_transform_feedback3_lines_triangles */ +#ifdef GL_AMD_vertex_shader_layer + CONST_CAST(GLEW_AMD_vertex_shader_layer) = _glewSearchExtension("GL_AMD_vertex_shader_layer", extStart, extEnd); +#endif /* GL_AMD_vertex_shader_layer */ +#ifdef GL_AMD_vertex_shader_tessellator + CONST_CAST(GLEW_AMD_vertex_shader_tessellator) = _glewSearchExtension("GL_AMD_vertex_shader_tessellator", extStart, extEnd); + if (glewExperimental || GLEW_AMD_vertex_shader_tessellator) CONST_CAST(GLEW_AMD_vertex_shader_tessellator) = !_glewInit_GL_AMD_vertex_shader_tessellator(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_vertex_shader_tessellator */ +#ifdef GL_AMD_vertex_shader_viewport_index + CONST_CAST(GLEW_AMD_vertex_shader_viewport_index) = _glewSearchExtension("GL_AMD_vertex_shader_viewport_index", extStart, extEnd); +#endif /* GL_AMD_vertex_shader_viewport_index */ +#ifdef GL_ANGLE_depth_texture + CONST_CAST(GLEW_ANGLE_depth_texture) = _glewSearchExtension("GL_ANGLE_depth_texture", extStart, extEnd); +#endif /* GL_ANGLE_depth_texture */ +#ifdef GL_ANGLE_framebuffer_blit + CONST_CAST(GLEW_ANGLE_framebuffer_blit) = _glewSearchExtension("GL_ANGLE_framebuffer_blit", extStart, extEnd); + if (glewExperimental || GLEW_ANGLE_framebuffer_blit) CONST_CAST(GLEW_ANGLE_framebuffer_blit) = !_glewInit_GL_ANGLE_framebuffer_blit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ANGLE_framebuffer_blit */ +#ifdef GL_ANGLE_framebuffer_multisample + CONST_CAST(GLEW_ANGLE_framebuffer_multisample) = _glewSearchExtension("GL_ANGLE_framebuffer_multisample", extStart, extEnd); + if (glewExperimental || GLEW_ANGLE_framebuffer_multisample) CONST_CAST(GLEW_ANGLE_framebuffer_multisample) = !_glewInit_GL_ANGLE_framebuffer_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ANGLE_framebuffer_multisample */ +#ifdef GL_ANGLE_instanced_arrays + CONST_CAST(GLEW_ANGLE_instanced_arrays) = _glewSearchExtension("GL_ANGLE_instanced_arrays", extStart, extEnd); + if (glewExperimental || GLEW_ANGLE_instanced_arrays) CONST_CAST(GLEW_ANGLE_instanced_arrays) = !_glewInit_GL_ANGLE_instanced_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ANGLE_instanced_arrays */ +#ifdef GL_ANGLE_pack_reverse_row_order + CONST_CAST(GLEW_ANGLE_pack_reverse_row_order) = _glewSearchExtension("GL_ANGLE_pack_reverse_row_order", extStart, extEnd); +#endif /* GL_ANGLE_pack_reverse_row_order */ +#ifdef GL_ANGLE_program_binary + CONST_CAST(GLEW_ANGLE_program_binary) = _glewSearchExtension("GL_ANGLE_program_binary", extStart, extEnd); +#endif /* GL_ANGLE_program_binary */ +#ifdef GL_ANGLE_texture_compression_dxt1 + CONST_CAST(GLEW_ANGLE_texture_compression_dxt1) = _glewSearchExtension("GL_ANGLE_texture_compression_dxt1", extStart, extEnd); +#endif /* GL_ANGLE_texture_compression_dxt1 */ +#ifdef GL_ANGLE_texture_compression_dxt3 + CONST_CAST(GLEW_ANGLE_texture_compression_dxt3) = _glewSearchExtension("GL_ANGLE_texture_compression_dxt3", extStart, extEnd); +#endif /* GL_ANGLE_texture_compression_dxt3 */ +#ifdef GL_ANGLE_texture_compression_dxt5 + CONST_CAST(GLEW_ANGLE_texture_compression_dxt5) = _glewSearchExtension("GL_ANGLE_texture_compression_dxt5", extStart, extEnd); +#endif /* GL_ANGLE_texture_compression_dxt5 */ +#ifdef GL_ANGLE_texture_usage + CONST_CAST(GLEW_ANGLE_texture_usage) = _glewSearchExtension("GL_ANGLE_texture_usage", extStart, extEnd); +#endif /* GL_ANGLE_texture_usage */ +#ifdef GL_ANGLE_timer_query + CONST_CAST(GLEW_ANGLE_timer_query) = _glewSearchExtension("GL_ANGLE_timer_query", extStart, extEnd); + if (glewExperimental || GLEW_ANGLE_timer_query) CONST_CAST(GLEW_ANGLE_timer_query) = !_glewInit_GL_ANGLE_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ANGLE_timer_query */ +#ifdef GL_ANGLE_translated_shader_source + CONST_CAST(GLEW_ANGLE_translated_shader_source) = _glewSearchExtension("GL_ANGLE_translated_shader_source", extStart, extEnd); + if (glewExperimental || GLEW_ANGLE_translated_shader_source) CONST_CAST(GLEW_ANGLE_translated_shader_source) = !_glewInit_GL_ANGLE_translated_shader_source(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ANGLE_translated_shader_source */ +#ifdef GL_APPLE_aux_depth_stencil + CONST_CAST(GLEW_APPLE_aux_depth_stencil) = _glewSearchExtension("GL_APPLE_aux_depth_stencil", extStart, extEnd); +#endif /* GL_APPLE_aux_depth_stencil */ +#ifdef GL_APPLE_client_storage + CONST_CAST(GLEW_APPLE_client_storage) = _glewSearchExtension("GL_APPLE_client_storage", extStart, extEnd); +#endif /* GL_APPLE_client_storage */ +#ifdef GL_APPLE_element_array + CONST_CAST(GLEW_APPLE_element_array) = _glewSearchExtension("GL_APPLE_element_array", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_element_array) CONST_CAST(GLEW_APPLE_element_array) = !_glewInit_GL_APPLE_element_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_element_array */ +#ifdef GL_APPLE_fence + CONST_CAST(GLEW_APPLE_fence) = _glewSearchExtension("GL_APPLE_fence", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_fence) CONST_CAST(GLEW_APPLE_fence) = !_glewInit_GL_APPLE_fence(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_fence */ +#ifdef GL_APPLE_float_pixels + CONST_CAST(GLEW_APPLE_float_pixels) = _glewSearchExtension("GL_APPLE_float_pixels", extStart, extEnd); +#endif /* GL_APPLE_float_pixels */ +#ifdef GL_APPLE_flush_buffer_range + CONST_CAST(GLEW_APPLE_flush_buffer_range) = _glewSearchExtension("GL_APPLE_flush_buffer_range", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_flush_buffer_range) CONST_CAST(GLEW_APPLE_flush_buffer_range) = !_glewInit_GL_APPLE_flush_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_flush_buffer_range */ +#ifdef GL_APPLE_object_purgeable + CONST_CAST(GLEW_APPLE_object_purgeable) = _glewSearchExtension("GL_APPLE_object_purgeable", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_object_purgeable) CONST_CAST(GLEW_APPLE_object_purgeable) = !_glewInit_GL_APPLE_object_purgeable(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_object_purgeable */ +#ifdef GL_APPLE_pixel_buffer + CONST_CAST(GLEW_APPLE_pixel_buffer) = _glewSearchExtension("GL_APPLE_pixel_buffer", extStart, extEnd); +#endif /* GL_APPLE_pixel_buffer */ +#ifdef GL_APPLE_rgb_422 + CONST_CAST(GLEW_APPLE_rgb_422) = _glewSearchExtension("GL_APPLE_rgb_422", extStart, extEnd); +#endif /* GL_APPLE_rgb_422 */ +#ifdef GL_APPLE_row_bytes + CONST_CAST(GLEW_APPLE_row_bytes) = _glewSearchExtension("GL_APPLE_row_bytes", extStart, extEnd); +#endif /* GL_APPLE_row_bytes */ +#ifdef GL_APPLE_specular_vector + CONST_CAST(GLEW_APPLE_specular_vector) = _glewSearchExtension("GL_APPLE_specular_vector", extStart, extEnd); +#endif /* GL_APPLE_specular_vector */ +#ifdef GL_APPLE_texture_range + CONST_CAST(GLEW_APPLE_texture_range) = _glewSearchExtension("GL_APPLE_texture_range", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_texture_range) CONST_CAST(GLEW_APPLE_texture_range) = !_glewInit_GL_APPLE_texture_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_texture_range */ +#ifdef GL_APPLE_transform_hint + CONST_CAST(GLEW_APPLE_transform_hint) = _glewSearchExtension("GL_APPLE_transform_hint", extStart, extEnd); +#endif /* GL_APPLE_transform_hint */ +#ifdef GL_APPLE_vertex_array_object + CONST_CAST(GLEW_APPLE_vertex_array_object) = _glewSearchExtension("GL_APPLE_vertex_array_object", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_vertex_array_object) CONST_CAST(GLEW_APPLE_vertex_array_object) = !_glewInit_GL_APPLE_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_vertex_array_object */ +#ifdef GL_APPLE_vertex_array_range + CONST_CAST(GLEW_APPLE_vertex_array_range) = _glewSearchExtension("GL_APPLE_vertex_array_range", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_vertex_array_range) CONST_CAST(GLEW_APPLE_vertex_array_range) = !_glewInit_GL_APPLE_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_vertex_array_range */ +#ifdef GL_APPLE_vertex_program_evaluators + CONST_CAST(GLEW_APPLE_vertex_program_evaluators) = _glewSearchExtension("GL_APPLE_vertex_program_evaluators", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_vertex_program_evaluators) CONST_CAST(GLEW_APPLE_vertex_program_evaluators) = !_glewInit_GL_APPLE_vertex_program_evaluators(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_vertex_program_evaluators */ +#ifdef GL_APPLE_ycbcr_422 + CONST_CAST(GLEW_APPLE_ycbcr_422) = _glewSearchExtension("GL_APPLE_ycbcr_422", extStart, extEnd); +#endif /* GL_APPLE_ycbcr_422 */ +#ifdef GL_ARB_ES2_compatibility + CONST_CAST(GLEW_ARB_ES2_compatibility) = _glewSearchExtension("GL_ARB_ES2_compatibility", extStart, extEnd); + if (glewExperimental || GLEW_ARB_ES2_compatibility) CONST_CAST(GLEW_ARB_ES2_compatibility) = !_glewInit_GL_ARB_ES2_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_ES2_compatibility */ +#ifdef GL_ARB_ES3_compatibility + CONST_CAST(GLEW_ARB_ES3_compatibility) = _glewSearchExtension("GL_ARB_ES3_compatibility", extStart, extEnd); +#endif /* GL_ARB_ES3_compatibility */ +#ifdef GL_ARB_arrays_of_arrays + CONST_CAST(GLEW_ARB_arrays_of_arrays) = _glewSearchExtension("GL_ARB_arrays_of_arrays", extStart, extEnd); +#endif /* GL_ARB_arrays_of_arrays */ +#ifdef GL_ARB_base_instance + CONST_CAST(GLEW_ARB_base_instance) = _glewSearchExtension("GL_ARB_base_instance", extStart, extEnd); + if (glewExperimental || GLEW_ARB_base_instance) CONST_CAST(GLEW_ARB_base_instance) = !_glewInit_GL_ARB_base_instance(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_base_instance */ +#ifdef GL_ARB_bindless_texture + CONST_CAST(GLEW_ARB_bindless_texture) = _glewSearchExtension("GL_ARB_bindless_texture", extStart, extEnd); + if (glewExperimental || GLEW_ARB_bindless_texture) CONST_CAST(GLEW_ARB_bindless_texture) = !_glewInit_GL_ARB_bindless_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_bindless_texture */ +#ifdef GL_ARB_blend_func_extended + CONST_CAST(GLEW_ARB_blend_func_extended) = _glewSearchExtension("GL_ARB_blend_func_extended", extStart, extEnd); + if (glewExperimental || GLEW_ARB_blend_func_extended) CONST_CAST(GLEW_ARB_blend_func_extended) = !_glewInit_GL_ARB_blend_func_extended(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_blend_func_extended */ +#ifdef GL_ARB_buffer_storage + CONST_CAST(GLEW_ARB_buffer_storage) = _glewSearchExtension("GL_ARB_buffer_storage", extStart, extEnd); + if (glewExperimental || GLEW_ARB_buffer_storage) CONST_CAST(GLEW_ARB_buffer_storage) = !_glewInit_GL_ARB_buffer_storage(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_buffer_storage */ +#ifdef GL_ARB_cl_event + CONST_CAST(GLEW_ARB_cl_event) = _glewSearchExtension("GL_ARB_cl_event", extStart, extEnd); + if (glewExperimental || GLEW_ARB_cl_event) CONST_CAST(GLEW_ARB_cl_event) = !_glewInit_GL_ARB_cl_event(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_cl_event */ +#ifdef GL_ARB_clear_buffer_object + CONST_CAST(GLEW_ARB_clear_buffer_object) = _glewSearchExtension("GL_ARB_clear_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_clear_buffer_object) CONST_CAST(GLEW_ARB_clear_buffer_object) = !_glewInit_GL_ARB_clear_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_clear_buffer_object */ +#ifdef GL_ARB_clear_texture + CONST_CAST(GLEW_ARB_clear_texture) = _glewSearchExtension("GL_ARB_clear_texture", extStart, extEnd); + if (glewExperimental || GLEW_ARB_clear_texture) CONST_CAST(GLEW_ARB_clear_texture) = !_glewInit_GL_ARB_clear_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_clear_texture */ +#ifdef GL_ARB_color_buffer_float + CONST_CAST(GLEW_ARB_color_buffer_float) = _glewSearchExtension("GL_ARB_color_buffer_float", extStart, extEnd); + if (glewExperimental || GLEW_ARB_color_buffer_float) CONST_CAST(GLEW_ARB_color_buffer_float) = !_glewInit_GL_ARB_color_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_color_buffer_float */ +#ifdef GL_ARB_compatibility + CONST_CAST(GLEW_ARB_compatibility) = _glewSearchExtension("GL_ARB_compatibility", extStart, extEnd); +#endif /* GL_ARB_compatibility */ +#ifdef GL_ARB_compressed_texture_pixel_storage + CONST_CAST(GLEW_ARB_compressed_texture_pixel_storage) = _glewSearchExtension("GL_ARB_compressed_texture_pixel_storage", extStart, extEnd); +#endif /* GL_ARB_compressed_texture_pixel_storage */ +#ifdef GL_ARB_compute_shader + CONST_CAST(GLEW_ARB_compute_shader) = _glewSearchExtension("GL_ARB_compute_shader", extStart, extEnd); + if (glewExperimental || GLEW_ARB_compute_shader) CONST_CAST(GLEW_ARB_compute_shader) = !_glewInit_GL_ARB_compute_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_compute_shader */ +#ifdef GL_ARB_compute_variable_group_size + CONST_CAST(GLEW_ARB_compute_variable_group_size) = _glewSearchExtension("GL_ARB_compute_variable_group_size", extStart, extEnd); + if (glewExperimental || GLEW_ARB_compute_variable_group_size) CONST_CAST(GLEW_ARB_compute_variable_group_size) = !_glewInit_GL_ARB_compute_variable_group_size(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_compute_variable_group_size */ +#ifdef GL_ARB_conservative_depth + CONST_CAST(GLEW_ARB_conservative_depth) = _glewSearchExtension("GL_ARB_conservative_depth", extStart, extEnd); +#endif /* GL_ARB_conservative_depth */ +#ifdef GL_ARB_copy_buffer + CONST_CAST(GLEW_ARB_copy_buffer) = _glewSearchExtension("GL_ARB_copy_buffer", extStart, extEnd); + if (glewExperimental || GLEW_ARB_copy_buffer) CONST_CAST(GLEW_ARB_copy_buffer) = !_glewInit_GL_ARB_copy_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_copy_buffer */ +#ifdef GL_ARB_copy_image + CONST_CAST(GLEW_ARB_copy_image) = _glewSearchExtension("GL_ARB_copy_image", extStart, extEnd); + if (glewExperimental || GLEW_ARB_copy_image) CONST_CAST(GLEW_ARB_copy_image) = !_glewInit_GL_ARB_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_copy_image */ +#ifdef GL_ARB_debug_output + CONST_CAST(GLEW_ARB_debug_output) = _glewSearchExtension("GL_ARB_debug_output", extStart, extEnd); + if (glewExperimental || GLEW_ARB_debug_output) CONST_CAST(GLEW_ARB_debug_output) = !_glewInit_GL_ARB_debug_output(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_debug_output */ +#ifdef GL_ARB_depth_buffer_float + CONST_CAST(GLEW_ARB_depth_buffer_float) = _glewSearchExtension("GL_ARB_depth_buffer_float", extStart, extEnd); +#endif /* GL_ARB_depth_buffer_float */ +#ifdef GL_ARB_depth_clamp + CONST_CAST(GLEW_ARB_depth_clamp) = _glewSearchExtension("GL_ARB_depth_clamp", extStart, extEnd); +#endif /* GL_ARB_depth_clamp */ +#ifdef GL_ARB_depth_texture + CONST_CAST(GLEW_ARB_depth_texture) = _glewSearchExtension("GL_ARB_depth_texture", extStart, extEnd); +#endif /* GL_ARB_depth_texture */ +#ifdef GL_ARB_draw_buffers + CONST_CAST(GLEW_ARB_draw_buffers) = _glewSearchExtension("GL_ARB_draw_buffers", extStart, extEnd); + if (glewExperimental || GLEW_ARB_draw_buffers) CONST_CAST(GLEW_ARB_draw_buffers) = !_glewInit_GL_ARB_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_buffers */ +#ifdef GL_ARB_draw_buffers_blend + CONST_CAST(GLEW_ARB_draw_buffers_blend) = _glewSearchExtension("GL_ARB_draw_buffers_blend", extStart, extEnd); + if (glewExperimental || GLEW_ARB_draw_buffers_blend) CONST_CAST(GLEW_ARB_draw_buffers_blend) = !_glewInit_GL_ARB_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_buffers_blend */ +#ifdef GL_ARB_draw_elements_base_vertex + CONST_CAST(GLEW_ARB_draw_elements_base_vertex) = _glewSearchExtension("GL_ARB_draw_elements_base_vertex", extStart, extEnd); + if (glewExperimental || GLEW_ARB_draw_elements_base_vertex) CONST_CAST(GLEW_ARB_draw_elements_base_vertex) = !_glewInit_GL_ARB_draw_elements_base_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_elements_base_vertex */ +#ifdef GL_ARB_draw_indirect + CONST_CAST(GLEW_ARB_draw_indirect) = _glewSearchExtension("GL_ARB_draw_indirect", extStart, extEnd); + if (glewExperimental || GLEW_ARB_draw_indirect) CONST_CAST(GLEW_ARB_draw_indirect) = !_glewInit_GL_ARB_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_indirect */ +#ifdef GL_ARB_draw_instanced + CONST_CAST(GLEW_ARB_draw_instanced) = _glewSearchExtension("GL_ARB_draw_instanced", extStart, extEnd); +#endif /* GL_ARB_draw_instanced */ +#ifdef GL_ARB_enhanced_layouts + CONST_CAST(GLEW_ARB_enhanced_layouts) = _glewSearchExtension("GL_ARB_enhanced_layouts", extStart, extEnd); +#endif /* GL_ARB_enhanced_layouts */ +#ifdef GL_ARB_explicit_attrib_location + CONST_CAST(GLEW_ARB_explicit_attrib_location) = _glewSearchExtension("GL_ARB_explicit_attrib_location", extStart, extEnd); +#endif /* GL_ARB_explicit_attrib_location */ +#ifdef GL_ARB_explicit_uniform_location + CONST_CAST(GLEW_ARB_explicit_uniform_location) = _glewSearchExtension("GL_ARB_explicit_uniform_location", extStart, extEnd); +#endif /* GL_ARB_explicit_uniform_location */ +#ifdef GL_ARB_fragment_coord_conventions + CONST_CAST(GLEW_ARB_fragment_coord_conventions) = _glewSearchExtension("GL_ARB_fragment_coord_conventions", extStart, extEnd); +#endif /* GL_ARB_fragment_coord_conventions */ +#ifdef GL_ARB_fragment_layer_viewport + CONST_CAST(GLEW_ARB_fragment_layer_viewport) = _glewSearchExtension("GL_ARB_fragment_layer_viewport", extStart, extEnd); +#endif /* GL_ARB_fragment_layer_viewport */ +#ifdef GL_ARB_fragment_program + CONST_CAST(GLEW_ARB_fragment_program) = _glewSearchExtension("GL_ARB_fragment_program", extStart, extEnd); +#endif /* GL_ARB_fragment_program */ +#ifdef GL_ARB_fragment_program_shadow + CONST_CAST(GLEW_ARB_fragment_program_shadow) = _glewSearchExtension("GL_ARB_fragment_program_shadow", extStart, extEnd); +#endif /* GL_ARB_fragment_program_shadow */ +#ifdef GL_ARB_fragment_shader + CONST_CAST(GLEW_ARB_fragment_shader) = _glewSearchExtension("GL_ARB_fragment_shader", extStart, extEnd); +#endif /* GL_ARB_fragment_shader */ +#ifdef GL_ARB_framebuffer_no_attachments + CONST_CAST(GLEW_ARB_framebuffer_no_attachments) = _glewSearchExtension("GL_ARB_framebuffer_no_attachments", extStart, extEnd); + if (glewExperimental || GLEW_ARB_framebuffer_no_attachments) CONST_CAST(GLEW_ARB_framebuffer_no_attachments) = !_glewInit_GL_ARB_framebuffer_no_attachments(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_framebuffer_no_attachments */ +#ifdef GL_ARB_framebuffer_object + CONST_CAST(GLEW_ARB_framebuffer_object) = _glewSearchExtension("GL_ARB_framebuffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_framebuffer_object) CONST_CAST(GLEW_ARB_framebuffer_object) = !_glewInit_GL_ARB_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_framebuffer_object */ +#ifdef GL_ARB_framebuffer_sRGB + CONST_CAST(GLEW_ARB_framebuffer_sRGB) = _glewSearchExtension("GL_ARB_framebuffer_sRGB", extStart, extEnd); +#endif /* GL_ARB_framebuffer_sRGB */ +#ifdef GL_ARB_geometry_shader4 + CONST_CAST(GLEW_ARB_geometry_shader4) = _glewSearchExtension("GL_ARB_geometry_shader4", extStart, extEnd); + if (glewExperimental || GLEW_ARB_geometry_shader4) CONST_CAST(GLEW_ARB_geometry_shader4) = !_glewInit_GL_ARB_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_geometry_shader4 */ +#ifdef GL_ARB_get_program_binary + CONST_CAST(GLEW_ARB_get_program_binary) = _glewSearchExtension("GL_ARB_get_program_binary", extStart, extEnd); + if (glewExperimental || GLEW_ARB_get_program_binary) CONST_CAST(GLEW_ARB_get_program_binary) = !_glewInit_GL_ARB_get_program_binary(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_get_program_binary */ +#ifdef GL_ARB_gpu_shader5 + CONST_CAST(GLEW_ARB_gpu_shader5) = _glewSearchExtension("GL_ARB_gpu_shader5", extStart, extEnd); +#endif /* GL_ARB_gpu_shader5 */ +#ifdef GL_ARB_gpu_shader_fp64 + CONST_CAST(GLEW_ARB_gpu_shader_fp64) = _glewSearchExtension("GL_ARB_gpu_shader_fp64", extStart, extEnd); + if (glewExperimental || GLEW_ARB_gpu_shader_fp64) CONST_CAST(GLEW_ARB_gpu_shader_fp64) = !_glewInit_GL_ARB_gpu_shader_fp64(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_gpu_shader_fp64 */ +#ifdef GL_ARB_half_float_pixel + CONST_CAST(GLEW_ARB_half_float_pixel) = _glewSearchExtension("GL_ARB_half_float_pixel", extStart, extEnd); +#endif /* GL_ARB_half_float_pixel */ +#ifdef GL_ARB_half_float_vertex + CONST_CAST(GLEW_ARB_half_float_vertex) = _glewSearchExtension("GL_ARB_half_float_vertex", extStart, extEnd); +#endif /* GL_ARB_half_float_vertex */ +#ifdef GL_ARB_imaging + CONST_CAST(GLEW_ARB_imaging) = _glewSearchExtension("GL_ARB_imaging", extStart, extEnd); + if (glewExperimental || GLEW_ARB_imaging) CONST_CAST(GLEW_ARB_imaging) = !_glewInit_GL_ARB_imaging(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_imaging */ +#ifdef GL_ARB_indirect_parameters + CONST_CAST(GLEW_ARB_indirect_parameters) = _glewSearchExtension("GL_ARB_indirect_parameters", extStart, extEnd); + if (glewExperimental || GLEW_ARB_indirect_parameters) CONST_CAST(GLEW_ARB_indirect_parameters) = !_glewInit_GL_ARB_indirect_parameters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_indirect_parameters */ +#ifdef GL_ARB_instanced_arrays + CONST_CAST(GLEW_ARB_instanced_arrays) = _glewSearchExtension("GL_ARB_instanced_arrays", extStart, extEnd); + if (glewExperimental || GLEW_ARB_instanced_arrays) CONST_CAST(GLEW_ARB_instanced_arrays) = !_glewInit_GL_ARB_instanced_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_instanced_arrays */ +#ifdef GL_ARB_internalformat_query + CONST_CAST(GLEW_ARB_internalformat_query) = _glewSearchExtension("GL_ARB_internalformat_query", extStart, extEnd); + if (glewExperimental || GLEW_ARB_internalformat_query) CONST_CAST(GLEW_ARB_internalformat_query) = !_glewInit_GL_ARB_internalformat_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_internalformat_query */ +#ifdef GL_ARB_internalformat_query2 + CONST_CAST(GLEW_ARB_internalformat_query2) = _glewSearchExtension("GL_ARB_internalformat_query2", extStart, extEnd); + if (glewExperimental || GLEW_ARB_internalformat_query2) CONST_CAST(GLEW_ARB_internalformat_query2) = !_glewInit_GL_ARB_internalformat_query2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_internalformat_query2 */ +#ifdef GL_ARB_invalidate_subdata + CONST_CAST(GLEW_ARB_invalidate_subdata) = _glewSearchExtension("GL_ARB_invalidate_subdata", extStart, extEnd); + if (glewExperimental || GLEW_ARB_invalidate_subdata) CONST_CAST(GLEW_ARB_invalidate_subdata) = !_glewInit_GL_ARB_invalidate_subdata(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_invalidate_subdata */ +#ifdef GL_ARB_map_buffer_alignment + CONST_CAST(GLEW_ARB_map_buffer_alignment) = _glewSearchExtension("GL_ARB_map_buffer_alignment", extStart, extEnd); +#endif /* GL_ARB_map_buffer_alignment */ +#ifdef GL_ARB_map_buffer_range + CONST_CAST(GLEW_ARB_map_buffer_range) = _glewSearchExtension("GL_ARB_map_buffer_range", extStart, extEnd); + if (glewExperimental || GLEW_ARB_map_buffer_range) CONST_CAST(GLEW_ARB_map_buffer_range) = !_glewInit_GL_ARB_map_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_map_buffer_range */ +#ifdef GL_ARB_matrix_palette + CONST_CAST(GLEW_ARB_matrix_palette) = _glewSearchExtension("GL_ARB_matrix_palette", extStart, extEnd); + if (glewExperimental || GLEW_ARB_matrix_palette) CONST_CAST(GLEW_ARB_matrix_palette) = !_glewInit_GL_ARB_matrix_palette(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_matrix_palette */ +#ifdef GL_ARB_multi_bind + CONST_CAST(GLEW_ARB_multi_bind) = _glewSearchExtension("GL_ARB_multi_bind", extStart, extEnd); + if (glewExperimental || GLEW_ARB_multi_bind) CONST_CAST(GLEW_ARB_multi_bind) = !_glewInit_GL_ARB_multi_bind(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_multi_bind */ +#ifdef GL_ARB_multi_draw_indirect + CONST_CAST(GLEW_ARB_multi_draw_indirect) = _glewSearchExtension("GL_ARB_multi_draw_indirect", extStart, extEnd); + if (glewExperimental || GLEW_ARB_multi_draw_indirect) CONST_CAST(GLEW_ARB_multi_draw_indirect) = !_glewInit_GL_ARB_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_multi_draw_indirect */ +#ifdef GL_ARB_multisample + CONST_CAST(GLEW_ARB_multisample) = _glewSearchExtension("GL_ARB_multisample", extStart, extEnd); + if (glewExperimental || GLEW_ARB_multisample) CONST_CAST(GLEW_ARB_multisample) = !_glewInit_GL_ARB_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_multisample */ +#ifdef GL_ARB_multitexture + CONST_CAST(GLEW_ARB_multitexture) = _glewSearchExtension("GL_ARB_multitexture", extStart, extEnd); + if (glewExperimental || GLEW_ARB_multitexture) CONST_CAST(GLEW_ARB_multitexture) = !_glewInit_GL_ARB_multitexture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_multitexture */ +#ifdef GL_ARB_occlusion_query + CONST_CAST(GLEW_ARB_occlusion_query) = _glewSearchExtension("GL_ARB_occlusion_query", extStart, extEnd); + if (glewExperimental || GLEW_ARB_occlusion_query) CONST_CAST(GLEW_ARB_occlusion_query) = !_glewInit_GL_ARB_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_occlusion_query */ +#ifdef GL_ARB_occlusion_query2 + CONST_CAST(GLEW_ARB_occlusion_query2) = _glewSearchExtension("GL_ARB_occlusion_query2", extStart, extEnd); +#endif /* GL_ARB_occlusion_query2 */ +#ifdef GL_ARB_pixel_buffer_object + CONST_CAST(GLEW_ARB_pixel_buffer_object) = _glewSearchExtension("GL_ARB_pixel_buffer_object", extStart, extEnd); +#endif /* GL_ARB_pixel_buffer_object */ +#ifdef GL_ARB_point_parameters + CONST_CAST(GLEW_ARB_point_parameters) = _glewSearchExtension("GL_ARB_point_parameters", extStart, extEnd); + if (glewExperimental || GLEW_ARB_point_parameters) CONST_CAST(GLEW_ARB_point_parameters) = !_glewInit_GL_ARB_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_point_parameters */ +#ifdef GL_ARB_point_sprite + CONST_CAST(GLEW_ARB_point_sprite) = _glewSearchExtension("GL_ARB_point_sprite", extStart, extEnd); +#endif /* GL_ARB_point_sprite */ +#ifdef GL_ARB_program_interface_query + CONST_CAST(GLEW_ARB_program_interface_query) = _glewSearchExtension("GL_ARB_program_interface_query", extStart, extEnd); + if (glewExperimental || GLEW_ARB_program_interface_query) CONST_CAST(GLEW_ARB_program_interface_query) = !_glewInit_GL_ARB_program_interface_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_program_interface_query */ +#ifdef GL_ARB_provoking_vertex + CONST_CAST(GLEW_ARB_provoking_vertex) = _glewSearchExtension("GL_ARB_provoking_vertex", extStart, extEnd); + if (glewExperimental || GLEW_ARB_provoking_vertex) CONST_CAST(GLEW_ARB_provoking_vertex) = !_glewInit_GL_ARB_provoking_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_provoking_vertex */ +#ifdef GL_ARB_query_buffer_object + CONST_CAST(GLEW_ARB_query_buffer_object) = _glewSearchExtension("GL_ARB_query_buffer_object", extStart, extEnd); +#endif /* GL_ARB_query_buffer_object */ +#ifdef GL_ARB_robust_buffer_access_behavior + CONST_CAST(GLEW_ARB_robust_buffer_access_behavior) = _glewSearchExtension("GL_ARB_robust_buffer_access_behavior", extStart, extEnd); +#endif /* GL_ARB_robust_buffer_access_behavior */ +#ifdef GL_ARB_robustness + CONST_CAST(GLEW_ARB_robustness) = _glewSearchExtension("GL_ARB_robustness", extStart, extEnd); + if (glewExperimental || GLEW_ARB_robustness) CONST_CAST(GLEW_ARB_robustness) = !_glewInit_GL_ARB_robustness(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_robustness */ +#ifdef GL_ARB_robustness_application_isolation + CONST_CAST(GLEW_ARB_robustness_application_isolation) = _glewSearchExtension("GL_ARB_robustness_application_isolation", extStart, extEnd); +#endif /* GL_ARB_robustness_application_isolation */ +#ifdef GL_ARB_robustness_share_group_isolation + CONST_CAST(GLEW_ARB_robustness_share_group_isolation) = _glewSearchExtension("GL_ARB_robustness_share_group_isolation", extStart, extEnd); +#endif /* GL_ARB_robustness_share_group_isolation */ +#ifdef GL_ARB_sample_shading + CONST_CAST(GLEW_ARB_sample_shading) = _glewSearchExtension("GL_ARB_sample_shading", extStart, extEnd); + if (glewExperimental || GLEW_ARB_sample_shading) CONST_CAST(GLEW_ARB_sample_shading) = !_glewInit_GL_ARB_sample_shading(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_sample_shading */ +#ifdef GL_ARB_sampler_objects + CONST_CAST(GLEW_ARB_sampler_objects) = _glewSearchExtension("GL_ARB_sampler_objects", extStart, extEnd); + if (glewExperimental || GLEW_ARB_sampler_objects) CONST_CAST(GLEW_ARB_sampler_objects) = !_glewInit_GL_ARB_sampler_objects(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_sampler_objects */ +#ifdef GL_ARB_seamless_cube_map + CONST_CAST(GLEW_ARB_seamless_cube_map) = _glewSearchExtension("GL_ARB_seamless_cube_map", extStart, extEnd); +#endif /* GL_ARB_seamless_cube_map */ +#ifdef GL_ARB_seamless_cubemap_per_texture + CONST_CAST(GLEW_ARB_seamless_cubemap_per_texture) = _glewSearchExtension("GL_ARB_seamless_cubemap_per_texture", extStart, extEnd); +#endif /* GL_ARB_seamless_cubemap_per_texture */ +#ifdef GL_ARB_separate_shader_objects + CONST_CAST(GLEW_ARB_separate_shader_objects) = _glewSearchExtension("GL_ARB_separate_shader_objects", extStart, extEnd); + if (glewExperimental || GLEW_ARB_separate_shader_objects) CONST_CAST(GLEW_ARB_separate_shader_objects) = !_glewInit_GL_ARB_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_separate_shader_objects */ +#ifdef GL_ARB_shader_atomic_counters + CONST_CAST(GLEW_ARB_shader_atomic_counters) = _glewSearchExtension("GL_ARB_shader_atomic_counters", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shader_atomic_counters) CONST_CAST(GLEW_ARB_shader_atomic_counters) = !_glewInit_GL_ARB_shader_atomic_counters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_atomic_counters */ +#ifdef GL_ARB_shader_bit_encoding + CONST_CAST(GLEW_ARB_shader_bit_encoding) = _glewSearchExtension("GL_ARB_shader_bit_encoding", extStart, extEnd); +#endif /* GL_ARB_shader_bit_encoding */ +#ifdef GL_ARB_shader_draw_parameters + CONST_CAST(GLEW_ARB_shader_draw_parameters) = _glewSearchExtension("GL_ARB_shader_draw_parameters", extStart, extEnd); +#endif /* GL_ARB_shader_draw_parameters */ +#ifdef GL_ARB_shader_group_vote + CONST_CAST(GLEW_ARB_shader_group_vote) = _glewSearchExtension("GL_ARB_shader_group_vote", extStart, extEnd); +#endif /* GL_ARB_shader_group_vote */ +#ifdef GL_ARB_shader_image_load_store + CONST_CAST(GLEW_ARB_shader_image_load_store) = _glewSearchExtension("GL_ARB_shader_image_load_store", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shader_image_load_store) CONST_CAST(GLEW_ARB_shader_image_load_store) = !_glewInit_GL_ARB_shader_image_load_store(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_image_load_store */ +#ifdef GL_ARB_shader_image_size + CONST_CAST(GLEW_ARB_shader_image_size) = _glewSearchExtension("GL_ARB_shader_image_size", extStart, extEnd); +#endif /* GL_ARB_shader_image_size */ +#ifdef GL_ARB_shader_objects + CONST_CAST(GLEW_ARB_shader_objects) = _glewSearchExtension("GL_ARB_shader_objects", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shader_objects) CONST_CAST(GLEW_ARB_shader_objects) = !_glewInit_GL_ARB_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_objects */ +#ifdef GL_ARB_shader_precision + CONST_CAST(GLEW_ARB_shader_precision) = _glewSearchExtension("GL_ARB_shader_precision", extStart, extEnd); +#endif /* GL_ARB_shader_precision */ +#ifdef GL_ARB_shader_stencil_export + CONST_CAST(GLEW_ARB_shader_stencil_export) = _glewSearchExtension("GL_ARB_shader_stencil_export", extStart, extEnd); +#endif /* GL_ARB_shader_stencil_export */ +#ifdef GL_ARB_shader_storage_buffer_object + CONST_CAST(GLEW_ARB_shader_storage_buffer_object) = _glewSearchExtension("GL_ARB_shader_storage_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shader_storage_buffer_object) CONST_CAST(GLEW_ARB_shader_storage_buffer_object) = !_glewInit_GL_ARB_shader_storage_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_storage_buffer_object */ +#ifdef GL_ARB_shader_subroutine + CONST_CAST(GLEW_ARB_shader_subroutine) = _glewSearchExtension("GL_ARB_shader_subroutine", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shader_subroutine) CONST_CAST(GLEW_ARB_shader_subroutine) = !_glewInit_GL_ARB_shader_subroutine(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_subroutine */ +#ifdef GL_ARB_shader_texture_lod + CONST_CAST(GLEW_ARB_shader_texture_lod) = _glewSearchExtension("GL_ARB_shader_texture_lod", extStart, extEnd); +#endif /* GL_ARB_shader_texture_lod */ +#ifdef GL_ARB_shading_language_100 + CONST_CAST(GLEW_ARB_shading_language_100) = _glewSearchExtension("GL_ARB_shading_language_100", extStart, extEnd); +#endif /* GL_ARB_shading_language_100 */ +#ifdef GL_ARB_shading_language_420pack + CONST_CAST(GLEW_ARB_shading_language_420pack) = _glewSearchExtension("GL_ARB_shading_language_420pack", extStart, extEnd); +#endif /* GL_ARB_shading_language_420pack */ +#ifdef GL_ARB_shading_language_include + CONST_CAST(GLEW_ARB_shading_language_include) = _glewSearchExtension("GL_ARB_shading_language_include", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shading_language_include) CONST_CAST(GLEW_ARB_shading_language_include) = !_glewInit_GL_ARB_shading_language_include(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shading_language_include */ +#ifdef GL_ARB_shading_language_packing + CONST_CAST(GLEW_ARB_shading_language_packing) = _glewSearchExtension("GL_ARB_shading_language_packing", extStart, extEnd); +#endif /* GL_ARB_shading_language_packing */ +#ifdef GL_ARB_shadow + CONST_CAST(GLEW_ARB_shadow) = _glewSearchExtension("GL_ARB_shadow", extStart, extEnd); +#endif /* GL_ARB_shadow */ +#ifdef GL_ARB_shadow_ambient + CONST_CAST(GLEW_ARB_shadow_ambient) = _glewSearchExtension("GL_ARB_shadow_ambient", extStart, extEnd); +#endif /* GL_ARB_shadow_ambient */ +#ifdef GL_ARB_sparse_texture + CONST_CAST(GLEW_ARB_sparse_texture) = _glewSearchExtension("GL_ARB_sparse_texture", extStart, extEnd); + if (glewExperimental || GLEW_ARB_sparse_texture) CONST_CAST(GLEW_ARB_sparse_texture) = !_glewInit_GL_ARB_sparse_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_sparse_texture */ +#ifdef GL_ARB_stencil_texturing + CONST_CAST(GLEW_ARB_stencil_texturing) = _glewSearchExtension("GL_ARB_stencil_texturing", extStart, extEnd); +#endif /* GL_ARB_stencil_texturing */ +#ifdef GL_ARB_sync + CONST_CAST(GLEW_ARB_sync) = _glewSearchExtension("GL_ARB_sync", extStart, extEnd); + if (glewExperimental || GLEW_ARB_sync) CONST_CAST(GLEW_ARB_sync) = !_glewInit_GL_ARB_sync(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_sync */ +#ifdef GL_ARB_tessellation_shader + CONST_CAST(GLEW_ARB_tessellation_shader) = _glewSearchExtension("GL_ARB_tessellation_shader", extStart, extEnd); + if (glewExperimental || GLEW_ARB_tessellation_shader) CONST_CAST(GLEW_ARB_tessellation_shader) = !_glewInit_GL_ARB_tessellation_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_tessellation_shader */ +#ifdef GL_ARB_texture_border_clamp + CONST_CAST(GLEW_ARB_texture_border_clamp) = _glewSearchExtension("GL_ARB_texture_border_clamp", extStart, extEnd); +#endif /* GL_ARB_texture_border_clamp */ +#ifdef GL_ARB_texture_buffer_object + CONST_CAST(GLEW_ARB_texture_buffer_object) = _glewSearchExtension("GL_ARB_texture_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_buffer_object) CONST_CAST(GLEW_ARB_texture_buffer_object) = !_glewInit_GL_ARB_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_buffer_object */ +#ifdef GL_ARB_texture_buffer_object_rgb32 + CONST_CAST(GLEW_ARB_texture_buffer_object_rgb32) = _glewSearchExtension("GL_ARB_texture_buffer_object_rgb32", extStart, extEnd); +#endif /* GL_ARB_texture_buffer_object_rgb32 */ +#ifdef GL_ARB_texture_buffer_range + CONST_CAST(GLEW_ARB_texture_buffer_range) = _glewSearchExtension("GL_ARB_texture_buffer_range", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_buffer_range) CONST_CAST(GLEW_ARB_texture_buffer_range) = !_glewInit_GL_ARB_texture_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_buffer_range */ +#ifdef GL_ARB_texture_compression + CONST_CAST(GLEW_ARB_texture_compression) = _glewSearchExtension("GL_ARB_texture_compression", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_compression) CONST_CAST(GLEW_ARB_texture_compression) = !_glewInit_GL_ARB_texture_compression(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_compression */ +#ifdef GL_ARB_texture_compression_bptc + CONST_CAST(GLEW_ARB_texture_compression_bptc) = _glewSearchExtension("GL_ARB_texture_compression_bptc", extStart, extEnd); +#endif /* GL_ARB_texture_compression_bptc */ +#ifdef GL_ARB_texture_compression_rgtc + CONST_CAST(GLEW_ARB_texture_compression_rgtc) = _glewSearchExtension("GL_ARB_texture_compression_rgtc", extStart, extEnd); +#endif /* GL_ARB_texture_compression_rgtc */ +#ifdef GL_ARB_texture_cube_map + CONST_CAST(GLEW_ARB_texture_cube_map) = _glewSearchExtension("GL_ARB_texture_cube_map", extStart, extEnd); +#endif /* GL_ARB_texture_cube_map */ +#ifdef GL_ARB_texture_cube_map_array + CONST_CAST(GLEW_ARB_texture_cube_map_array) = _glewSearchExtension("GL_ARB_texture_cube_map_array", extStart, extEnd); +#endif /* GL_ARB_texture_cube_map_array */ +#ifdef GL_ARB_texture_env_add + CONST_CAST(GLEW_ARB_texture_env_add) = _glewSearchExtension("GL_ARB_texture_env_add", extStart, extEnd); +#endif /* GL_ARB_texture_env_add */ +#ifdef GL_ARB_texture_env_combine + CONST_CAST(GLEW_ARB_texture_env_combine) = _glewSearchExtension("GL_ARB_texture_env_combine", extStart, extEnd); +#endif /* GL_ARB_texture_env_combine */ +#ifdef GL_ARB_texture_env_crossbar + CONST_CAST(GLEW_ARB_texture_env_crossbar) = _glewSearchExtension("GL_ARB_texture_env_crossbar", extStart, extEnd); +#endif /* GL_ARB_texture_env_crossbar */ +#ifdef GL_ARB_texture_env_dot3 + CONST_CAST(GLEW_ARB_texture_env_dot3) = _glewSearchExtension("GL_ARB_texture_env_dot3", extStart, extEnd); +#endif /* GL_ARB_texture_env_dot3 */ +#ifdef GL_ARB_texture_float + CONST_CAST(GLEW_ARB_texture_float) = _glewSearchExtension("GL_ARB_texture_float", extStart, extEnd); +#endif /* GL_ARB_texture_float */ +#ifdef GL_ARB_texture_gather + CONST_CAST(GLEW_ARB_texture_gather) = _glewSearchExtension("GL_ARB_texture_gather", extStart, extEnd); +#endif /* GL_ARB_texture_gather */ +#ifdef GL_ARB_texture_mirror_clamp_to_edge + CONST_CAST(GLEW_ARB_texture_mirror_clamp_to_edge) = _glewSearchExtension("GL_ARB_texture_mirror_clamp_to_edge", extStart, extEnd); +#endif /* GL_ARB_texture_mirror_clamp_to_edge */ +#ifdef GL_ARB_texture_mirrored_repeat + CONST_CAST(GLEW_ARB_texture_mirrored_repeat) = _glewSearchExtension("GL_ARB_texture_mirrored_repeat", extStart, extEnd); +#endif /* GL_ARB_texture_mirrored_repeat */ +#ifdef GL_ARB_texture_multisample + CONST_CAST(GLEW_ARB_texture_multisample) = _glewSearchExtension("GL_ARB_texture_multisample", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_multisample) CONST_CAST(GLEW_ARB_texture_multisample) = !_glewInit_GL_ARB_texture_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_multisample */ +#ifdef GL_ARB_texture_non_power_of_two + CONST_CAST(GLEW_ARB_texture_non_power_of_two) = _glewSearchExtension("GL_ARB_texture_non_power_of_two", extStart, extEnd); +#endif /* GL_ARB_texture_non_power_of_two */ +#ifdef GL_ARB_texture_query_levels + CONST_CAST(GLEW_ARB_texture_query_levels) = _glewSearchExtension("GL_ARB_texture_query_levels", extStart, extEnd); +#endif /* GL_ARB_texture_query_levels */ +#ifdef GL_ARB_texture_query_lod + CONST_CAST(GLEW_ARB_texture_query_lod) = _glewSearchExtension("GL_ARB_texture_query_lod", extStart, extEnd); +#endif /* GL_ARB_texture_query_lod */ +#ifdef GL_ARB_texture_rectangle + CONST_CAST(GLEW_ARB_texture_rectangle) = _glewSearchExtension("GL_ARB_texture_rectangle", extStart, extEnd); +#endif /* GL_ARB_texture_rectangle */ +#ifdef GL_ARB_texture_rg + CONST_CAST(GLEW_ARB_texture_rg) = _glewSearchExtension("GL_ARB_texture_rg", extStart, extEnd); +#endif /* GL_ARB_texture_rg */ +#ifdef GL_ARB_texture_rgb10_a2ui + CONST_CAST(GLEW_ARB_texture_rgb10_a2ui) = _glewSearchExtension("GL_ARB_texture_rgb10_a2ui", extStart, extEnd); +#endif /* GL_ARB_texture_rgb10_a2ui */ +#ifdef GL_ARB_texture_stencil8 + CONST_CAST(GLEW_ARB_texture_stencil8) = _glewSearchExtension("GL_ARB_texture_stencil8", extStart, extEnd); +#endif /* GL_ARB_texture_stencil8 */ +#ifdef GL_ARB_texture_storage + CONST_CAST(GLEW_ARB_texture_storage) = _glewSearchExtension("GL_ARB_texture_storage", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_storage) CONST_CAST(GLEW_ARB_texture_storage) = !_glewInit_GL_ARB_texture_storage(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_storage */ +#ifdef GL_ARB_texture_storage_multisample + CONST_CAST(GLEW_ARB_texture_storage_multisample) = _glewSearchExtension("GL_ARB_texture_storage_multisample", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_storage_multisample) CONST_CAST(GLEW_ARB_texture_storage_multisample) = !_glewInit_GL_ARB_texture_storage_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_storage_multisample */ +#ifdef GL_ARB_texture_swizzle + CONST_CAST(GLEW_ARB_texture_swizzle) = _glewSearchExtension("GL_ARB_texture_swizzle", extStart, extEnd); +#endif /* GL_ARB_texture_swizzle */ +#ifdef GL_ARB_texture_view + CONST_CAST(GLEW_ARB_texture_view) = _glewSearchExtension("GL_ARB_texture_view", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_view) CONST_CAST(GLEW_ARB_texture_view) = !_glewInit_GL_ARB_texture_view(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_view */ +#ifdef GL_ARB_timer_query + CONST_CAST(GLEW_ARB_timer_query) = _glewSearchExtension("GL_ARB_timer_query", extStart, extEnd); + if (glewExperimental || GLEW_ARB_timer_query) CONST_CAST(GLEW_ARB_timer_query) = !_glewInit_GL_ARB_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_timer_query */ +#ifdef GL_ARB_transform_feedback2 + CONST_CAST(GLEW_ARB_transform_feedback2) = _glewSearchExtension("GL_ARB_transform_feedback2", extStart, extEnd); + if (glewExperimental || GLEW_ARB_transform_feedback2) CONST_CAST(GLEW_ARB_transform_feedback2) = !_glewInit_GL_ARB_transform_feedback2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_transform_feedback2 */ +#ifdef GL_ARB_transform_feedback3 + CONST_CAST(GLEW_ARB_transform_feedback3) = _glewSearchExtension("GL_ARB_transform_feedback3", extStart, extEnd); + if (glewExperimental || GLEW_ARB_transform_feedback3) CONST_CAST(GLEW_ARB_transform_feedback3) = !_glewInit_GL_ARB_transform_feedback3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_transform_feedback3 */ +#ifdef GL_ARB_transform_feedback_instanced + CONST_CAST(GLEW_ARB_transform_feedback_instanced) = _glewSearchExtension("GL_ARB_transform_feedback_instanced", extStart, extEnd); + if (glewExperimental || GLEW_ARB_transform_feedback_instanced) CONST_CAST(GLEW_ARB_transform_feedback_instanced) = !_glewInit_GL_ARB_transform_feedback_instanced(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_transform_feedback_instanced */ +#ifdef GL_ARB_transpose_matrix + CONST_CAST(GLEW_ARB_transpose_matrix) = _glewSearchExtension("GL_ARB_transpose_matrix", extStart, extEnd); + if (glewExperimental || GLEW_ARB_transpose_matrix) CONST_CAST(GLEW_ARB_transpose_matrix) = !_glewInit_GL_ARB_transpose_matrix(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_transpose_matrix */ +#ifdef GL_ARB_uniform_buffer_object + CONST_CAST(GLEW_ARB_uniform_buffer_object) = _glewSearchExtension("GL_ARB_uniform_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_uniform_buffer_object) CONST_CAST(GLEW_ARB_uniform_buffer_object) = !_glewInit_GL_ARB_uniform_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_uniform_buffer_object */ +#ifdef GL_ARB_vertex_array_bgra + CONST_CAST(GLEW_ARB_vertex_array_bgra) = _glewSearchExtension("GL_ARB_vertex_array_bgra", extStart, extEnd); +#endif /* GL_ARB_vertex_array_bgra */ +#ifdef GL_ARB_vertex_array_object + CONST_CAST(GLEW_ARB_vertex_array_object) = _glewSearchExtension("GL_ARB_vertex_array_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_array_object) CONST_CAST(GLEW_ARB_vertex_array_object) = !_glewInit_GL_ARB_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_array_object */ +#ifdef GL_ARB_vertex_attrib_64bit + CONST_CAST(GLEW_ARB_vertex_attrib_64bit) = _glewSearchExtension("GL_ARB_vertex_attrib_64bit", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_attrib_64bit) CONST_CAST(GLEW_ARB_vertex_attrib_64bit) = !_glewInit_GL_ARB_vertex_attrib_64bit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_attrib_64bit */ +#ifdef GL_ARB_vertex_attrib_binding + CONST_CAST(GLEW_ARB_vertex_attrib_binding) = _glewSearchExtension("GL_ARB_vertex_attrib_binding", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_attrib_binding) CONST_CAST(GLEW_ARB_vertex_attrib_binding) = !_glewInit_GL_ARB_vertex_attrib_binding(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_attrib_binding */ +#ifdef GL_ARB_vertex_blend + CONST_CAST(GLEW_ARB_vertex_blend) = _glewSearchExtension("GL_ARB_vertex_blend", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_blend) CONST_CAST(GLEW_ARB_vertex_blend) = !_glewInit_GL_ARB_vertex_blend(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_blend */ +#ifdef GL_ARB_vertex_buffer_object + CONST_CAST(GLEW_ARB_vertex_buffer_object) = _glewSearchExtension("GL_ARB_vertex_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_buffer_object) CONST_CAST(GLEW_ARB_vertex_buffer_object) = !_glewInit_GL_ARB_vertex_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_buffer_object */ +#ifdef GL_ARB_vertex_program + CONST_CAST(GLEW_ARB_vertex_program) = _glewSearchExtension("GL_ARB_vertex_program", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_program) CONST_CAST(GLEW_ARB_vertex_program) = !_glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_program */ +#ifdef GL_ARB_vertex_shader + CONST_CAST(GLEW_ARB_vertex_shader) = _glewSearchExtension("GL_ARB_vertex_shader", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_shader) CONST_CAST(GLEW_ARB_vertex_shader) = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_shader */ +#ifdef GL_ARB_vertex_type_10f_11f_11f_rev + CONST_CAST(GLEW_ARB_vertex_type_10f_11f_11f_rev) = _glewSearchExtension("GL_ARB_vertex_type_10f_11f_11f_rev", extStart, extEnd); +#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + CONST_CAST(GLEW_ARB_vertex_type_2_10_10_10_rev) = _glewSearchExtension("GL_ARB_vertex_type_2_10_10_10_rev", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_type_2_10_10_10_rev) CONST_CAST(GLEW_ARB_vertex_type_2_10_10_10_rev) = !_glewInit_GL_ARB_vertex_type_2_10_10_10_rev(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ +#ifdef GL_ARB_viewport_array + CONST_CAST(GLEW_ARB_viewport_array) = _glewSearchExtension("GL_ARB_viewport_array", extStart, extEnd); + if (glewExperimental || GLEW_ARB_viewport_array) CONST_CAST(GLEW_ARB_viewport_array) = !_glewInit_GL_ARB_viewport_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_viewport_array */ +#ifdef GL_ARB_window_pos + CONST_CAST(GLEW_ARB_window_pos) = _glewSearchExtension("GL_ARB_window_pos", extStart, extEnd); + if (glewExperimental || GLEW_ARB_window_pos) CONST_CAST(GLEW_ARB_window_pos) = !_glewInit_GL_ARB_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_window_pos */ +#ifdef GL_ATIX_point_sprites + CONST_CAST(GLEW_ATIX_point_sprites) = _glewSearchExtension("GL_ATIX_point_sprites", extStart, extEnd); +#endif /* GL_ATIX_point_sprites */ +#ifdef GL_ATIX_texture_env_combine3 + CONST_CAST(GLEW_ATIX_texture_env_combine3) = _glewSearchExtension("GL_ATIX_texture_env_combine3", extStart, extEnd); +#endif /* GL_ATIX_texture_env_combine3 */ +#ifdef GL_ATIX_texture_env_route + CONST_CAST(GLEW_ATIX_texture_env_route) = _glewSearchExtension("GL_ATIX_texture_env_route", extStart, extEnd); +#endif /* GL_ATIX_texture_env_route */ +#ifdef GL_ATIX_vertex_shader_output_point_size + CONST_CAST(GLEW_ATIX_vertex_shader_output_point_size) = _glewSearchExtension("GL_ATIX_vertex_shader_output_point_size", extStart, extEnd); +#endif /* GL_ATIX_vertex_shader_output_point_size */ +#ifdef GL_ATI_draw_buffers + CONST_CAST(GLEW_ATI_draw_buffers) = _glewSearchExtension("GL_ATI_draw_buffers", extStart, extEnd); + if (glewExperimental || GLEW_ATI_draw_buffers) CONST_CAST(GLEW_ATI_draw_buffers) = !_glewInit_GL_ATI_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_draw_buffers */ +#ifdef GL_ATI_element_array + CONST_CAST(GLEW_ATI_element_array) = _glewSearchExtension("GL_ATI_element_array", extStart, extEnd); + if (glewExperimental || GLEW_ATI_element_array) CONST_CAST(GLEW_ATI_element_array) = !_glewInit_GL_ATI_element_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_element_array */ +#ifdef GL_ATI_envmap_bumpmap + CONST_CAST(GLEW_ATI_envmap_bumpmap) = _glewSearchExtension("GL_ATI_envmap_bumpmap", extStart, extEnd); + if (glewExperimental || GLEW_ATI_envmap_bumpmap) CONST_CAST(GLEW_ATI_envmap_bumpmap) = !_glewInit_GL_ATI_envmap_bumpmap(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_envmap_bumpmap */ +#ifdef GL_ATI_fragment_shader + CONST_CAST(GLEW_ATI_fragment_shader) = _glewSearchExtension("GL_ATI_fragment_shader", extStart, extEnd); + if (glewExperimental || GLEW_ATI_fragment_shader) CONST_CAST(GLEW_ATI_fragment_shader) = !_glewInit_GL_ATI_fragment_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_fragment_shader */ +#ifdef GL_ATI_map_object_buffer + CONST_CAST(GLEW_ATI_map_object_buffer) = _glewSearchExtension("GL_ATI_map_object_buffer", extStart, extEnd); + if (glewExperimental || GLEW_ATI_map_object_buffer) CONST_CAST(GLEW_ATI_map_object_buffer) = !_glewInit_GL_ATI_map_object_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_map_object_buffer */ +#ifdef GL_ATI_meminfo + CONST_CAST(GLEW_ATI_meminfo) = _glewSearchExtension("GL_ATI_meminfo", extStart, extEnd); +#endif /* GL_ATI_meminfo */ +#ifdef GL_ATI_pn_triangles + CONST_CAST(GLEW_ATI_pn_triangles) = _glewSearchExtension("GL_ATI_pn_triangles", extStart, extEnd); + if (glewExperimental || GLEW_ATI_pn_triangles) CONST_CAST(GLEW_ATI_pn_triangles) = !_glewInit_GL_ATI_pn_triangles(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_pn_triangles */ +#ifdef GL_ATI_separate_stencil + CONST_CAST(GLEW_ATI_separate_stencil) = _glewSearchExtension("GL_ATI_separate_stencil", extStart, extEnd); + if (glewExperimental || GLEW_ATI_separate_stencil) CONST_CAST(GLEW_ATI_separate_stencil) = !_glewInit_GL_ATI_separate_stencil(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_separate_stencil */ +#ifdef GL_ATI_shader_texture_lod + CONST_CAST(GLEW_ATI_shader_texture_lod) = _glewSearchExtension("GL_ATI_shader_texture_lod", extStart, extEnd); +#endif /* GL_ATI_shader_texture_lod */ +#ifdef GL_ATI_text_fragment_shader + CONST_CAST(GLEW_ATI_text_fragment_shader) = _glewSearchExtension("GL_ATI_text_fragment_shader", extStart, extEnd); +#endif /* GL_ATI_text_fragment_shader */ +#ifdef GL_ATI_texture_compression_3dc + CONST_CAST(GLEW_ATI_texture_compression_3dc) = _glewSearchExtension("GL_ATI_texture_compression_3dc", extStart, extEnd); +#endif /* GL_ATI_texture_compression_3dc */ +#ifdef GL_ATI_texture_env_combine3 + CONST_CAST(GLEW_ATI_texture_env_combine3) = _glewSearchExtension("GL_ATI_texture_env_combine3", extStart, extEnd); +#endif /* GL_ATI_texture_env_combine3 */ +#ifdef GL_ATI_texture_float + CONST_CAST(GLEW_ATI_texture_float) = _glewSearchExtension("GL_ATI_texture_float", extStart, extEnd); +#endif /* GL_ATI_texture_float */ +#ifdef GL_ATI_texture_mirror_once + CONST_CAST(GLEW_ATI_texture_mirror_once) = _glewSearchExtension("GL_ATI_texture_mirror_once", extStart, extEnd); +#endif /* GL_ATI_texture_mirror_once */ +#ifdef GL_ATI_vertex_array_object + CONST_CAST(GLEW_ATI_vertex_array_object) = _glewSearchExtension("GL_ATI_vertex_array_object", extStart, extEnd); + if (glewExperimental || GLEW_ATI_vertex_array_object) CONST_CAST(GLEW_ATI_vertex_array_object) = !_glewInit_GL_ATI_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_vertex_array_object */ +#ifdef GL_ATI_vertex_attrib_array_object + CONST_CAST(GLEW_ATI_vertex_attrib_array_object) = _glewSearchExtension("GL_ATI_vertex_attrib_array_object", extStart, extEnd); + if (glewExperimental || GLEW_ATI_vertex_attrib_array_object) CONST_CAST(GLEW_ATI_vertex_attrib_array_object) = !_glewInit_GL_ATI_vertex_attrib_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_vertex_attrib_array_object */ +#ifdef GL_ATI_vertex_streams + CONST_CAST(GLEW_ATI_vertex_streams) = _glewSearchExtension("GL_ATI_vertex_streams", extStart, extEnd); + if (glewExperimental || GLEW_ATI_vertex_streams) CONST_CAST(GLEW_ATI_vertex_streams) = !_glewInit_GL_ATI_vertex_streams(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_vertex_streams */ +#ifdef GL_EXT_422_pixels + CONST_CAST(GLEW_EXT_422_pixels) = _glewSearchExtension("GL_EXT_422_pixels", extStart, extEnd); +#endif /* GL_EXT_422_pixels */ +#ifdef GL_EXT_Cg_shader + CONST_CAST(GLEW_EXT_Cg_shader) = _glewSearchExtension("GL_EXT_Cg_shader", extStart, extEnd); +#endif /* GL_EXT_Cg_shader */ +#ifdef GL_EXT_abgr + CONST_CAST(GLEW_EXT_abgr) = _glewSearchExtension("GL_EXT_abgr", extStart, extEnd); +#endif /* GL_EXT_abgr */ +#ifdef GL_EXT_bgra + CONST_CAST(GLEW_EXT_bgra) = _glewSearchExtension("GL_EXT_bgra", extStart, extEnd); +#endif /* GL_EXT_bgra */ +#ifdef GL_EXT_bindable_uniform + CONST_CAST(GLEW_EXT_bindable_uniform) = _glewSearchExtension("GL_EXT_bindable_uniform", extStart, extEnd); + if (glewExperimental || GLEW_EXT_bindable_uniform) CONST_CAST(GLEW_EXT_bindable_uniform) = !_glewInit_GL_EXT_bindable_uniform(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_bindable_uniform */ +#ifdef GL_EXT_blend_color + CONST_CAST(GLEW_EXT_blend_color) = _glewSearchExtension("GL_EXT_blend_color", extStart, extEnd); + if (glewExperimental || GLEW_EXT_blend_color) CONST_CAST(GLEW_EXT_blend_color) = !_glewInit_GL_EXT_blend_color(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_color */ +#ifdef GL_EXT_blend_equation_separate + CONST_CAST(GLEW_EXT_blend_equation_separate) = _glewSearchExtension("GL_EXT_blend_equation_separate", extStart, extEnd); + if (glewExperimental || GLEW_EXT_blend_equation_separate) CONST_CAST(GLEW_EXT_blend_equation_separate) = !_glewInit_GL_EXT_blend_equation_separate(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_equation_separate */ +#ifdef GL_EXT_blend_func_separate + CONST_CAST(GLEW_EXT_blend_func_separate) = _glewSearchExtension("GL_EXT_blend_func_separate", extStart, extEnd); + if (glewExperimental || GLEW_EXT_blend_func_separate) CONST_CAST(GLEW_EXT_blend_func_separate) = !_glewInit_GL_EXT_blend_func_separate(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_func_separate */ +#ifdef GL_EXT_blend_logic_op + CONST_CAST(GLEW_EXT_blend_logic_op) = _glewSearchExtension("GL_EXT_blend_logic_op", extStart, extEnd); +#endif /* GL_EXT_blend_logic_op */ +#ifdef GL_EXT_blend_minmax + CONST_CAST(GLEW_EXT_blend_minmax) = _glewSearchExtension("GL_EXT_blend_minmax", extStart, extEnd); + if (glewExperimental || GLEW_EXT_blend_minmax) CONST_CAST(GLEW_EXT_blend_minmax) = !_glewInit_GL_EXT_blend_minmax(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_minmax */ +#ifdef GL_EXT_blend_subtract + CONST_CAST(GLEW_EXT_blend_subtract) = _glewSearchExtension("GL_EXT_blend_subtract", extStart, extEnd); +#endif /* GL_EXT_blend_subtract */ +#ifdef GL_EXT_clip_volume_hint + CONST_CAST(GLEW_EXT_clip_volume_hint) = _glewSearchExtension("GL_EXT_clip_volume_hint", extStart, extEnd); +#endif /* GL_EXT_clip_volume_hint */ +#ifdef GL_EXT_cmyka + CONST_CAST(GLEW_EXT_cmyka) = _glewSearchExtension("GL_EXT_cmyka", extStart, extEnd); +#endif /* GL_EXT_cmyka */ +#ifdef GL_EXT_color_subtable + CONST_CAST(GLEW_EXT_color_subtable) = _glewSearchExtension("GL_EXT_color_subtable", extStart, extEnd); + if (glewExperimental || GLEW_EXT_color_subtable) CONST_CAST(GLEW_EXT_color_subtable) = !_glewInit_GL_EXT_color_subtable(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_color_subtable */ +#ifdef GL_EXT_compiled_vertex_array + CONST_CAST(GLEW_EXT_compiled_vertex_array) = _glewSearchExtension("GL_EXT_compiled_vertex_array", extStart, extEnd); + if (glewExperimental || GLEW_EXT_compiled_vertex_array) CONST_CAST(GLEW_EXT_compiled_vertex_array) = !_glewInit_GL_EXT_compiled_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_compiled_vertex_array */ +#ifdef GL_EXT_convolution + CONST_CAST(GLEW_EXT_convolution) = _glewSearchExtension("GL_EXT_convolution", extStart, extEnd); + if (glewExperimental || GLEW_EXT_convolution) CONST_CAST(GLEW_EXT_convolution) = !_glewInit_GL_EXT_convolution(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_convolution */ +#ifdef GL_EXT_coordinate_frame + CONST_CAST(GLEW_EXT_coordinate_frame) = _glewSearchExtension("GL_EXT_coordinate_frame", extStart, extEnd); + if (glewExperimental || GLEW_EXT_coordinate_frame) CONST_CAST(GLEW_EXT_coordinate_frame) = !_glewInit_GL_EXT_coordinate_frame(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_coordinate_frame */ +#ifdef GL_EXT_copy_texture + CONST_CAST(GLEW_EXT_copy_texture) = _glewSearchExtension("GL_EXT_copy_texture", extStart, extEnd); + if (glewExperimental || GLEW_EXT_copy_texture) CONST_CAST(GLEW_EXT_copy_texture) = !_glewInit_GL_EXT_copy_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_copy_texture */ +#ifdef GL_EXT_cull_vertex + CONST_CAST(GLEW_EXT_cull_vertex) = _glewSearchExtension("GL_EXT_cull_vertex", extStart, extEnd); + if (glewExperimental || GLEW_EXT_cull_vertex) CONST_CAST(GLEW_EXT_cull_vertex) = !_glewInit_GL_EXT_cull_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_cull_vertex */ +#ifdef GL_EXT_debug_marker + CONST_CAST(GLEW_EXT_debug_marker) = _glewSearchExtension("GL_EXT_debug_marker", extStart, extEnd); + if (glewExperimental || GLEW_EXT_debug_marker) CONST_CAST(GLEW_EXT_debug_marker) = !_glewInit_GL_EXT_debug_marker(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_debug_marker */ +#ifdef GL_EXT_depth_bounds_test + CONST_CAST(GLEW_EXT_depth_bounds_test) = _glewSearchExtension("GL_EXT_depth_bounds_test", extStart, extEnd); + if (glewExperimental || GLEW_EXT_depth_bounds_test) CONST_CAST(GLEW_EXT_depth_bounds_test) = !_glewInit_GL_EXT_depth_bounds_test(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_depth_bounds_test */ +#ifdef GL_EXT_direct_state_access + CONST_CAST(GLEW_EXT_direct_state_access) = _glewSearchExtension("GL_EXT_direct_state_access", extStart, extEnd); + if (glewExperimental || GLEW_EXT_direct_state_access) CONST_CAST(GLEW_EXT_direct_state_access) = !_glewInit_GL_EXT_direct_state_access(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_direct_state_access */ +#ifdef GL_EXT_draw_buffers2 + CONST_CAST(GLEW_EXT_draw_buffers2) = _glewSearchExtension("GL_EXT_draw_buffers2", extStart, extEnd); + if (glewExperimental || GLEW_EXT_draw_buffers2) CONST_CAST(GLEW_EXT_draw_buffers2) = !_glewInit_GL_EXT_draw_buffers2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_draw_buffers2 */ +#ifdef GL_EXT_draw_instanced + CONST_CAST(GLEW_EXT_draw_instanced) = _glewSearchExtension("GL_EXT_draw_instanced", extStart, extEnd); + if (glewExperimental || GLEW_EXT_draw_instanced) CONST_CAST(GLEW_EXT_draw_instanced) = !_glewInit_GL_EXT_draw_instanced(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_draw_instanced */ +#ifdef GL_EXT_draw_range_elements + CONST_CAST(GLEW_EXT_draw_range_elements) = _glewSearchExtension("GL_EXT_draw_range_elements", extStart, extEnd); + if (glewExperimental || GLEW_EXT_draw_range_elements) CONST_CAST(GLEW_EXT_draw_range_elements) = !_glewInit_GL_EXT_draw_range_elements(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_draw_range_elements */ +#ifdef GL_EXT_fog_coord + CONST_CAST(GLEW_EXT_fog_coord) = _glewSearchExtension("GL_EXT_fog_coord", extStart, extEnd); + if (glewExperimental || GLEW_EXT_fog_coord) CONST_CAST(GLEW_EXT_fog_coord) = !_glewInit_GL_EXT_fog_coord(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_fog_coord */ +#ifdef GL_EXT_fragment_lighting + CONST_CAST(GLEW_EXT_fragment_lighting) = _glewSearchExtension("GL_EXT_fragment_lighting", extStart, extEnd); + if (glewExperimental || GLEW_EXT_fragment_lighting) CONST_CAST(GLEW_EXT_fragment_lighting) = !_glewInit_GL_EXT_fragment_lighting(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_fragment_lighting */ +#ifdef GL_EXT_framebuffer_blit + CONST_CAST(GLEW_EXT_framebuffer_blit) = _glewSearchExtension("GL_EXT_framebuffer_blit", extStart, extEnd); + if (glewExperimental || GLEW_EXT_framebuffer_blit) CONST_CAST(GLEW_EXT_framebuffer_blit) = !_glewInit_GL_EXT_framebuffer_blit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_framebuffer_blit */ +#ifdef GL_EXT_framebuffer_multisample + CONST_CAST(GLEW_EXT_framebuffer_multisample) = _glewSearchExtension("GL_EXT_framebuffer_multisample", extStart, extEnd); + if (glewExperimental || GLEW_EXT_framebuffer_multisample) CONST_CAST(GLEW_EXT_framebuffer_multisample) = !_glewInit_GL_EXT_framebuffer_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_framebuffer_multisample */ +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + CONST_CAST(GLEW_EXT_framebuffer_multisample_blit_scaled) = _glewSearchExtension("GL_EXT_framebuffer_multisample_blit_scaled", extStart, extEnd); +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ +#ifdef GL_EXT_framebuffer_object + CONST_CAST(GLEW_EXT_framebuffer_object) = _glewSearchExtension("GL_EXT_framebuffer_object", extStart, extEnd); + if (glewExperimental || GLEW_EXT_framebuffer_object) CONST_CAST(GLEW_EXT_framebuffer_object) = !_glewInit_GL_EXT_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_framebuffer_object */ +#ifdef GL_EXT_framebuffer_sRGB + CONST_CAST(GLEW_EXT_framebuffer_sRGB) = _glewSearchExtension("GL_EXT_framebuffer_sRGB", extStart, extEnd); +#endif /* GL_EXT_framebuffer_sRGB */ +#ifdef GL_EXT_geometry_shader4 + CONST_CAST(GLEW_EXT_geometry_shader4) = _glewSearchExtension("GL_EXT_geometry_shader4", extStart, extEnd); + if (glewExperimental || GLEW_EXT_geometry_shader4) CONST_CAST(GLEW_EXT_geometry_shader4) = !_glewInit_GL_EXT_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_geometry_shader4 */ +#ifdef GL_EXT_gpu_program_parameters + CONST_CAST(GLEW_EXT_gpu_program_parameters) = _glewSearchExtension("GL_EXT_gpu_program_parameters", extStart, extEnd); + if (glewExperimental || GLEW_EXT_gpu_program_parameters) CONST_CAST(GLEW_EXT_gpu_program_parameters) = !_glewInit_GL_EXT_gpu_program_parameters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_gpu_program_parameters */ +#ifdef GL_EXT_gpu_shader4 + CONST_CAST(GLEW_EXT_gpu_shader4) = _glewSearchExtension("GL_EXT_gpu_shader4", extStart, extEnd); + if (glewExperimental || GLEW_EXT_gpu_shader4) CONST_CAST(GLEW_EXT_gpu_shader4) = !_glewInit_GL_EXT_gpu_shader4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_gpu_shader4 */ +#ifdef GL_EXT_histogram + CONST_CAST(GLEW_EXT_histogram) = _glewSearchExtension("GL_EXT_histogram", extStart, extEnd); + if (glewExperimental || GLEW_EXT_histogram) CONST_CAST(GLEW_EXT_histogram) = !_glewInit_GL_EXT_histogram(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_histogram */ +#ifdef GL_EXT_index_array_formats + CONST_CAST(GLEW_EXT_index_array_formats) = _glewSearchExtension("GL_EXT_index_array_formats", extStart, extEnd); +#endif /* GL_EXT_index_array_formats */ +#ifdef GL_EXT_index_func + CONST_CAST(GLEW_EXT_index_func) = _glewSearchExtension("GL_EXT_index_func", extStart, extEnd); + if (glewExperimental || GLEW_EXT_index_func) CONST_CAST(GLEW_EXT_index_func) = !_glewInit_GL_EXT_index_func(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_index_func */ +#ifdef GL_EXT_index_material + CONST_CAST(GLEW_EXT_index_material) = _glewSearchExtension("GL_EXT_index_material", extStart, extEnd); + if (glewExperimental || GLEW_EXT_index_material) CONST_CAST(GLEW_EXT_index_material) = !_glewInit_GL_EXT_index_material(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_index_material */ +#ifdef GL_EXT_index_texture + CONST_CAST(GLEW_EXT_index_texture) = _glewSearchExtension("GL_EXT_index_texture", extStart, extEnd); +#endif /* GL_EXT_index_texture */ +#ifdef GL_EXT_light_texture + CONST_CAST(GLEW_EXT_light_texture) = _glewSearchExtension("GL_EXT_light_texture", extStart, extEnd); + if (glewExperimental || GLEW_EXT_light_texture) CONST_CAST(GLEW_EXT_light_texture) = !_glewInit_GL_EXT_light_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_light_texture */ +#ifdef GL_EXT_misc_attribute + CONST_CAST(GLEW_EXT_misc_attribute) = _glewSearchExtension("GL_EXT_misc_attribute", extStart, extEnd); +#endif /* GL_EXT_misc_attribute */ +#ifdef GL_EXT_multi_draw_arrays + CONST_CAST(GLEW_EXT_multi_draw_arrays) = _glewSearchExtension("GL_EXT_multi_draw_arrays", extStart, extEnd); + if (glewExperimental || GLEW_EXT_multi_draw_arrays) CONST_CAST(GLEW_EXT_multi_draw_arrays) = !_glewInit_GL_EXT_multi_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_multi_draw_arrays */ +#ifdef GL_EXT_multisample + CONST_CAST(GLEW_EXT_multisample) = _glewSearchExtension("GL_EXT_multisample", extStart, extEnd); + if (glewExperimental || GLEW_EXT_multisample) CONST_CAST(GLEW_EXT_multisample) = !_glewInit_GL_EXT_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_multisample */ +#ifdef GL_EXT_packed_depth_stencil + CONST_CAST(GLEW_EXT_packed_depth_stencil) = _glewSearchExtension("GL_EXT_packed_depth_stencil", extStart, extEnd); +#endif /* GL_EXT_packed_depth_stencil */ +#ifdef GL_EXT_packed_float + CONST_CAST(GLEW_EXT_packed_float) = _glewSearchExtension("GL_EXT_packed_float", extStart, extEnd); +#endif /* GL_EXT_packed_float */ +#ifdef GL_EXT_packed_pixels + CONST_CAST(GLEW_EXT_packed_pixels) = _glewSearchExtension("GL_EXT_packed_pixels", extStart, extEnd); +#endif /* GL_EXT_packed_pixels */ +#ifdef GL_EXT_paletted_texture + CONST_CAST(GLEW_EXT_paletted_texture) = _glewSearchExtension("GL_EXT_paletted_texture", extStart, extEnd); + if (glewExperimental || GLEW_EXT_paletted_texture) CONST_CAST(GLEW_EXT_paletted_texture) = !_glewInit_GL_EXT_paletted_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_paletted_texture */ +#ifdef GL_EXT_pixel_buffer_object + CONST_CAST(GLEW_EXT_pixel_buffer_object) = _glewSearchExtension("GL_EXT_pixel_buffer_object", extStart, extEnd); +#endif /* GL_EXT_pixel_buffer_object */ +#ifdef GL_EXT_pixel_transform + CONST_CAST(GLEW_EXT_pixel_transform) = _glewSearchExtension("GL_EXT_pixel_transform", extStart, extEnd); + if (glewExperimental || GLEW_EXT_pixel_transform) CONST_CAST(GLEW_EXT_pixel_transform) = !_glewInit_GL_EXT_pixel_transform(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_pixel_transform */ +#ifdef GL_EXT_pixel_transform_color_table + CONST_CAST(GLEW_EXT_pixel_transform_color_table) = _glewSearchExtension("GL_EXT_pixel_transform_color_table", extStart, extEnd); +#endif /* GL_EXT_pixel_transform_color_table */ +#ifdef GL_EXT_point_parameters + CONST_CAST(GLEW_EXT_point_parameters) = _glewSearchExtension("GL_EXT_point_parameters", extStart, extEnd); + if (glewExperimental || GLEW_EXT_point_parameters) CONST_CAST(GLEW_EXT_point_parameters) = !_glewInit_GL_EXT_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_point_parameters */ +#ifdef GL_EXT_polygon_offset + CONST_CAST(GLEW_EXT_polygon_offset) = _glewSearchExtension("GL_EXT_polygon_offset", extStart, extEnd); + if (glewExperimental || GLEW_EXT_polygon_offset) CONST_CAST(GLEW_EXT_polygon_offset) = !_glewInit_GL_EXT_polygon_offset(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_polygon_offset */ +#ifdef GL_EXT_provoking_vertex + CONST_CAST(GLEW_EXT_provoking_vertex) = _glewSearchExtension("GL_EXT_provoking_vertex", extStart, extEnd); + if (glewExperimental || GLEW_EXT_provoking_vertex) CONST_CAST(GLEW_EXT_provoking_vertex) = !_glewInit_GL_EXT_provoking_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_provoking_vertex */ +#ifdef GL_EXT_rescale_normal + CONST_CAST(GLEW_EXT_rescale_normal) = _glewSearchExtension("GL_EXT_rescale_normal", extStart, extEnd); +#endif /* GL_EXT_rescale_normal */ +#ifdef GL_EXT_scene_marker + CONST_CAST(GLEW_EXT_scene_marker) = _glewSearchExtension("GL_EXT_scene_marker", extStart, extEnd); + if (glewExperimental || GLEW_EXT_scene_marker) CONST_CAST(GLEW_EXT_scene_marker) = !_glewInit_GL_EXT_scene_marker(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_scene_marker */ +#ifdef GL_EXT_secondary_color + CONST_CAST(GLEW_EXT_secondary_color) = _glewSearchExtension("GL_EXT_secondary_color", extStart, extEnd); + if (glewExperimental || GLEW_EXT_secondary_color) CONST_CAST(GLEW_EXT_secondary_color) = !_glewInit_GL_EXT_secondary_color(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_secondary_color */ +#ifdef GL_EXT_separate_shader_objects + CONST_CAST(GLEW_EXT_separate_shader_objects) = _glewSearchExtension("GL_EXT_separate_shader_objects", extStart, extEnd); + if (glewExperimental || GLEW_EXT_separate_shader_objects) CONST_CAST(GLEW_EXT_separate_shader_objects) = !_glewInit_GL_EXT_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_separate_shader_objects */ +#ifdef GL_EXT_separate_specular_color + CONST_CAST(GLEW_EXT_separate_specular_color) = _glewSearchExtension("GL_EXT_separate_specular_color", extStart, extEnd); +#endif /* GL_EXT_separate_specular_color */ +#ifdef GL_EXT_shader_image_load_store + CONST_CAST(GLEW_EXT_shader_image_load_store) = _glewSearchExtension("GL_EXT_shader_image_load_store", extStart, extEnd); + if (glewExperimental || GLEW_EXT_shader_image_load_store) CONST_CAST(GLEW_EXT_shader_image_load_store) = !_glewInit_GL_EXT_shader_image_load_store(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_shader_image_load_store */ +#ifdef GL_EXT_shadow_funcs + CONST_CAST(GLEW_EXT_shadow_funcs) = _glewSearchExtension("GL_EXT_shadow_funcs", extStart, extEnd); +#endif /* GL_EXT_shadow_funcs */ +#ifdef GL_EXT_shared_texture_palette + CONST_CAST(GLEW_EXT_shared_texture_palette) = _glewSearchExtension("GL_EXT_shared_texture_palette", extStart, extEnd); +#endif /* GL_EXT_shared_texture_palette */ +#ifdef GL_EXT_stencil_clear_tag + CONST_CAST(GLEW_EXT_stencil_clear_tag) = _glewSearchExtension("GL_EXT_stencil_clear_tag", extStart, extEnd); +#endif /* GL_EXT_stencil_clear_tag */ +#ifdef GL_EXT_stencil_two_side + CONST_CAST(GLEW_EXT_stencil_two_side) = _glewSearchExtension("GL_EXT_stencil_two_side", extStart, extEnd); + if (glewExperimental || GLEW_EXT_stencil_two_side) CONST_CAST(GLEW_EXT_stencil_two_side) = !_glewInit_GL_EXT_stencil_two_side(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_stencil_two_side */ +#ifdef GL_EXT_stencil_wrap + CONST_CAST(GLEW_EXT_stencil_wrap) = _glewSearchExtension("GL_EXT_stencil_wrap", extStart, extEnd); +#endif /* GL_EXT_stencil_wrap */ +#ifdef GL_EXT_subtexture + CONST_CAST(GLEW_EXT_subtexture) = _glewSearchExtension("GL_EXT_subtexture", extStart, extEnd); + if (glewExperimental || GLEW_EXT_subtexture) CONST_CAST(GLEW_EXT_subtexture) = !_glewInit_GL_EXT_subtexture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_subtexture */ +#ifdef GL_EXT_texture + CONST_CAST(GLEW_EXT_texture) = _glewSearchExtension("GL_EXT_texture", extStart, extEnd); +#endif /* GL_EXT_texture */ +#ifdef GL_EXT_texture3D + CONST_CAST(GLEW_EXT_texture3D) = _glewSearchExtension("GL_EXT_texture3D", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture3D) CONST_CAST(GLEW_EXT_texture3D) = !_glewInit_GL_EXT_texture3D(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture3D */ +#ifdef GL_EXT_texture_array + CONST_CAST(GLEW_EXT_texture_array) = _glewSearchExtension("GL_EXT_texture_array", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture_array) CONST_CAST(GLEW_EXT_texture_array) = !_glewInit_GL_EXT_texture_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_array */ +#ifdef GL_EXT_texture_buffer_object + CONST_CAST(GLEW_EXT_texture_buffer_object) = _glewSearchExtension("GL_EXT_texture_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture_buffer_object) CONST_CAST(GLEW_EXT_texture_buffer_object) = !_glewInit_GL_EXT_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_buffer_object */ +#ifdef GL_EXT_texture_compression_dxt1 + CONST_CAST(GLEW_EXT_texture_compression_dxt1) = _glewSearchExtension("GL_EXT_texture_compression_dxt1", extStart, extEnd); +#endif /* GL_EXT_texture_compression_dxt1 */ +#ifdef GL_EXT_texture_compression_latc + CONST_CAST(GLEW_EXT_texture_compression_latc) = _glewSearchExtension("GL_EXT_texture_compression_latc", extStart, extEnd); +#endif /* GL_EXT_texture_compression_latc */ +#ifdef GL_EXT_texture_compression_rgtc + CONST_CAST(GLEW_EXT_texture_compression_rgtc) = _glewSearchExtension("GL_EXT_texture_compression_rgtc", extStart, extEnd); +#endif /* GL_EXT_texture_compression_rgtc */ +#ifdef GL_EXT_texture_compression_s3tc + CONST_CAST(GLEW_EXT_texture_compression_s3tc) = _glewSearchExtension("GL_EXT_texture_compression_s3tc", extStart, extEnd); +#endif /* GL_EXT_texture_compression_s3tc */ +#ifdef GL_EXT_texture_cube_map + CONST_CAST(GLEW_EXT_texture_cube_map) = _glewSearchExtension("GL_EXT_texture_cube_map", extStart, extEnd); +#endif /* GL_EXT_texture_cube_map */ +#ifdef GL_EXT_texture_edge_clamp + CONST_CAST(GLEW_EXT_texture_edge_clamp) = _glewSearchExtension("GL_EXT_texture_edge_clamp", extStart, extEnd); +#endif /* GL_EXT_texture_edge_clamp */ +#ifdef GL_EXT_texture_env + CONST_CAST(GLEW_EXT_texture_env) = _glewSearchExtension("GL_EXT_texture_env", extStart, extEnd); +#endif /* GL_EXT_texture_env */ +#ifdef GL_EXT_texture_env_add + CONST_CAST(GLEW_EXT_texture_env_add) = _glewSearchExtension("GL_EXT_texture_env_add", extStart, extEnd); +#endif /* GL_EXT_texture_env_add */ +#ifdef GL_EXT_texture_env_combine + CONST_CAST(GLEW_EXT_texture_env_combine) = _glewSearchExtension("GL_EXT_texture_env_combine", extStart, extEnd); +#endif /* GL_EXT_texture_env_combine */ +#ifdef GL_EXT_texture_env_dot3 + CONST_CAST(GLEW_EXT_texture_env_dot3) = _glewSearchExtension("GL_EXT_texture_env_dot3", extStart, extEnd); +#endif /* GL_EXT_texture_env_dot3 */ +#ifdef GL_EXT_texture_filter_anisotropic + CONST_CAST(GLEW_EXT_texture_filter_anisotropic) = _glewSearchExtension("GL_EXT_texture_filter_anisotropic", extStart, extEnd); +#endif /* GL_EXT_texture_filter_anisotropic */ +#ifdef GL_EXT_texture_integer + CONST_CAST(GLEW_EXT_texture_integer) = _glewSearchExtension("GL_EXT_texture_integer", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture_integer) CONST_CAST(GLEW_EXT_texture_integer) = !_glewInit_GL_EXT_texture_integer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_integer */ +#ifdef GL_EXT_texture_lod_bias + CONST_CAST(GLEW_EXT_texture_lod_bias) = _glewSearchExtension("GL_EXT_texture_lod_bias", extStart, extEnd); +#endif /* GL_EXT_texture_lod_bias */ +#ifdef GL_EXT_texture_mirror_clamp + CONST_CAST(GLEW_EXT_texture_mirror_clamp) = _glewSearchExtension("GL_EXT_texture_mirror_clamp", extStart, extEnd); +#endif /* GL_EXT_texture_mirror_clamp */ +#ifdef GL_EXT_texture_object + CONST_CAST(GLEW_EXT_texture_object) = _glewSearchExtension("GL_EXT_texture_object", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture_object) CONST_CAST(GLEW_EXT_texture_object) = !_glewInit_GL_EXT_texture_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_object */ +#ifdef GL_EXT_texture_perturb_normal + CONST_CAST(GLEW_EXT_texture_perturb_normal) = _glewSearchExtension("GL_EXT_texture_perturb_normal", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture_perturb_normal) CONST_CAST(GLEW_EXT_texture_perturb_normal) = !_glewInit_GL_EXT_texture_perturb_normal(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_perturb_normal */ +#ifdef GL_EXT_texture_rectangle + CONST_CAST(GLEW_EXT_texture_rectangle) = _glewSearchExtension("GL_EXT_texture_rectangle", extStart, extEnd); +#endif /* GL_EXT_texture_rectangle */ +#ifdef GL_EXT_texture_sRGB + CONST_CAST(GLEW_EXT_texture_sRGB) = _glewSearchExtension("GL_EXT_texture_sRGB", extStart, extEnd); +#endif /* GL_EXT_texture_sRGB */ +#ifdef GL_EXT_texture_sRGB_decode + CONST_CAST(GLEW_EXT_texture_sRGB_decode) = _glewSearchExtension("GL_EXT_texture_sRGB_decode", extStart, extEnd); +#endif /* GL_EXT_texture_sRGB_decode */ +#ifdef GL_EXT_texture_shared_exponent + CONST_CAST(GLEW_EXT_texture_shared_exponent) = _glewSearchExtension("GL_EXT_texture_shared_exponent", extStart, extEnd); +#endif /* GL_EXT_texture_shared_exponent */ +#ifdef GL_EXT_texture_snorm + CONST_CAST(GLEW_EXT_texture_snorm) = _glewSearchExtension("GL_EXT_texture_snorm", extStart, extEnd); +#endif /* GL_EXT_texture_snorm */ +#ifdef GL_EXT_texture_swizzle + CONST_CAST(GLEW_EXT_texture_swizzle) = _glewSearchExtension("GL_EXT_texture_swizzle", extStart, extEnd); +#endif /* GL_EXT_texture_swizzle */ +#ifdef GL_EXT_timer_query + CONST_CAST(GLEW_EXT_timer_query) = _glewSearchExtension("GL_EXT_timer_query", extStart, extEnd); + if (glewExperimental || GLEW_EXT_timer_query) CONST_CAST(GLEW_EXT_timer_query) = !_glewInit_GL_EXT_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_timer_query */ +#ifdef GL_EXT_transform_feedback + CONST_CAST(GLEW_EXT_transform_feedback) = _glewSearchExtension("GL_EXT_transform_feedback", extStart, extEnd); + if (glewExperimental || GLEW_EXT_transform_feedback) CONST_CAST(GLEW_EXT_transform_feedback) = !_glewInit_GL_EXT_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_transform_feedback */ +#ifdef GL_EXT_vertex_array + CONST_CAST(GLEW_EXT_vertex_array) = _glewSearchExtension("GL_EXT_vertex_array", extStart, extEnd); + if (glewExperimental || GLEW_EXT_vertex_array) CONST_CAST(GLEW_EXT_vertex_array) = !_glewInit_GL_EXT_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_array */ +#ifdef GL_EXT_vertex_array_bgra + CONST_CAST(GLEW_EXT_vertex_array_bgra) = _glewSearchExtension("GL_EXT_vertex_array_bgra", extStart, extEnd); +#endif /* GL_EXT_vertex_array_bgra */ +#ifdef GL_EXT_vertex_attrib_64bit + CONST_CAST(GLEW_EXT_vertex_attrib_64bit) = _glewSearchExtension("GL_EXT_vertex_attrib_64bit", extStart, extEnd); + if (glewExperimental || GLEW_EXT_vertex_attrib_64bit) CONST_CAST(GLEW_EXT_vertex_attrib_64bit) = !_glewInit_GL_EXT_vertex_attrib_64bit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_attrib_64bit */ +#ifdef GL_EXT_vertex_shader + CONST_CAST(GLEW_EXT_vertex_shader) = _glewSearchExtension("GL_EXT_vertex_shader", extStart, extEnd); + if (glewExperimental || GLEW_EXT_vertex_shader) CONST_CAST(GLEW_EXT_vertex_shader) = !_glewInit_GL_EXT_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_shader */ +#ifdef GL_EXT_vertex_weighting + CONST_CAST(GLEW_EXT_vertex_weighting) = _glewSearchExtension("GL_EXT_vertex_weighting", extStart, extEnd); + if (glewExperimental || GLEW_EXT_vertex_weighting) CONST_CAST(GLEW_EXT_vertex_weighting) = !_glewInit_GL_EXT_vertex_weighting(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_weighting */ +#ifdef GL_EXT_x11_sync_object + CONST_CAST(GLEW_EXT_x11_sync_object) = _glewSearchExtension("GL_EXT_x11_sync_object", extStart, extEnd); + if (glewExperimental || GLEW_EXT_x11_sync_object) CONST_CAST(GLEW_EXT_x11_sync_object) = !_glewInit_GL_EXT_x11_sync_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_x11_sync_object */ +#ifdef GL_GREMEDY_frame_terminator + CONST_CAST(GLEW_GREMEDY_frame_terminator) = _glewSearchExtension("GL_GREMEDY_frame_terminator", extStart, extEnd); + if (glewExperimental || GLEW_GREMEDY_frame_terminator) CONST_CAST(GLEW_GREMEDY_frame_terminator) = !_glewInit_GL_GREMEDY_frame_terminator(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_GREMEDY_frame_terminator */ +#ifdef GL_GREMEDY_string_marker + CONST_CAST(GLEW_GREMEDY_string_marker) = _glewSearchExtension("GL_GREMEDY_string_marker", extStart, extEnd); + if (glewExperimental || GLEW_GREMEDY_string_marker) CONST_CAST(GLEW_GREMEDY_string_marker) = !_glewInit_GL_GREMEDY_string_marker(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_GREMEDY_string_marker */ +#ifdef GL_HP_convolution_border_modes + CONST_CAST(GLEW_HP_convolution_border_modes) = _glewSearchExtension("GL_HP_convolution_border_modes", extStart, extEnd); +#endif /* GL_HP_convolution_border_modes */ +#ifdef GL_HP_image_transform + CONST_CAST(GLEW_HP_image_transform) = _glewSearchExtension("GL_HP_image_transform", extStart, extEnd); + if (glewExperimental || GLEW_HP_image_transform) CONST_CAST(GLEW_HP_image_transform) = !_glewInit_GL_HP_image_transform(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_HP_image_transform */ +#ifdef GL_HP_occlusion_test + CONST_CAST(GLEW_HP_occlusion_test) = _glewSearchExtension("GL_HP_occlusion_test", extStart, extEnd); +#endif /* GL_HP_occlusion_test */ +#ifdef GL_HP_texture_lighting + CONST_CAST(GLEW_HP_texture_lighting) = _glewSearchExtension("GL_HP_texture_lighting", extStart, extEnd); +#endif /* GL_HP_texture_lighting */ +#ifdef GL_IBM_cull_vertex + CONST_CAST(GLEW_IBM_cull_vertex) = _glewSearchExtension("GL_IBM_cull_vertex", extStart, extEnd); +#endif /* GL_IBM_cull_vertex */ +#ifdef GL_IBM_multimode_draw_arrays + CONST_CAST(GLEW_IBM_multimode_draw_arrays) = _glewSearchExtension("GL_IBM_multimode_draw_arrays", extStart, extEnd); + if (glewExperimental || GLEW_IBM_multimode_draw_arrays) CONST_CAST(GLEW_IBM_multimode_draw_arrays) = !_glewInit_GL_IBM_multimode_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_IBM_multimode_draw_arrays */ +#ifdef GL_IBM_rasterpos_clip + CONST_CAST(GLEW_IBM_rasterpos_clip) = _glewSearchExtension("GL_IBM_rasterpos_clip", extStart, extEnd); +#endif /* GL_IBM_rasterpos_clip */ +#ifdef GL_IBM_static_data + CONST_CAST(GLEW_IBM_static_data) = _glewSearchExtension("GL_IBM_static_data", extStart, extEnd); +#endif /* GL_IBM_static_data */ +#ifdef GL_IBM_texture_mirrored_repeat + CONST_CAST(GLEW_IBM_texture_mirrored_repeat) = _glewSearchExtension("GL_IBM_texture_mirrored_repeat", extStart, extEnd); +#endif /* GL_IBM_texture_mirrored_repeat */ +#ifdef GL_IBM_vertex_array_lists + CONST_CAST(GLEW_IBM_vertex_array_lists) = _glewSearchExtension("GL_IBM_vertex_array_lists", extStart, extEnd); + if (glewExperimental || GLEW_IBM_vertex_array_lists) CONST_CAST(GLEW_IBM_vertex_array_lists) = !_glewInit_GL_IBM_vertex_array_lists(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_IBM_vertex_array_lists */ +#ifdef GL_INGR_color_clamp + CONST_CAST(GLEW_INGR_color_clamp) = _glewSearchExtension("GL_INGR_color_clamp", extStart, extEnd); +#endif /* GL_INGR_color_clamp */ +#ifdef GL_INGR_interlace_read + CONST_CAST(GLEW_INGR_interlace_read) = _glewSearchExtension("GL_INGR_interlace_read", extStart, extEnd); +#endif /* GL_INGR_interlace_read */ +#ifdef GL_INTEL_map_texture + CONST_CAST(GLEW_INTEL_map_texture) = _glewSearchExtension("GL_INTEL_map_texture", extStart, extEnd); + if (glewExperimental || GLEW_INTEL_map_texture) CONST_CAST(GLEW_INTEL_map_texture) = !_glewInit_GL_INTEL_map_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_INTEL_map_texture */ +#ifdef GL_INTEL_parallel_arrays + CONST_CAST(GLEW_INTEL_parallel_arrays) = _glewSearchExtension("GL_INTEL_parallel_arrays", extStart, extEnd); + if (glewExperimental || GLEW_INTEL_parallel_arrays) CONST_CAST(GLEW_INTEL_parallel_arrays) = !_glewInit_GL_INTEL_parallel_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_INTEL_parallel_arrays */ +#ifdef GL_INTEL_texture_scissor + CONST_CAST(GLEW_INTEL_texture_scissor) = _glewSearchExtension("GL_INTEL_texture_scissor", extStart, extEnd); + if (glewExperimental || GLEW_INTEL_texture_scissor) CONST_CAST(GLEW_INTEL_texture_scissor) = !_glewInit_GL_INTEL_texture_scissor(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_INTEL_texture_scissor */ +#ifdef GL_KHR_debug + CONST_CAST(GLEW_KHR_debug) = _glewSearchExtension("GL_KHR_debug", extStart, extEnd); + if (glewExperimental || GLEW_KHR_debug) CONST_CAST(GLEW_KHR_debug) = !_glewInit_GL_KHR_debug(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_KHR_debug */ +#ifdef GL_KHR_texture_compression_astc_ldr + CONST_CAST(GLEW_KHR_texture_compression_astc_ldr) = _glewSearchExtension("GL_KHR_texture_compression_astc_ldr", extStart, extEnd); +#endif /* GL_KHR_texture_compression_astc_ldr */ +#ifdef GL_KTX_buffer_region + CONST_CAST(GLEW_KTX_buffer_region) = _glewSearchExtension("GL_KTX_buffer_region", extStart, extEnd); + if (glewExperimental || GLEW_KTX_buffer_region) CONST_CAST(GLEW_KTX_buffer_region) = !_glewInit_GL_KTX_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_KTX_buffer_region */ +#ifdef GL_MESAX_texture_stack + CONST_CAST(GLEW_MESAX_texture_stack) = _glewSearchExtension("GL_MESAX_texture_stack", extStart, extEnd); +#endif /* GL_MESAX_texture_stack */ +#ifdef GL_MESA_pack_invert + CONST_CAST(GLEW_MESA_pack_invert) = _glewSearchExtension("GL_MESA_pack_invert", extStart, extEnd); +#endif /* GL_MESA_pack_invert */ +#ifdef GL_MESA_resize_buffers + CONST_CAST(GLEW_MESA_resize_buffers) = _glewSearchExtension("GL_MESA_resize_buffers", extStart, extEnd); + if (glewExperimental || GLEW_MESA_resize_buffers) CONST_CAST(GLEW_MESA_resize_buffers) = !_glewInit_GL_MESA_resize_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_MESA_resize_buffers */ +#ifdef GL_MESA_window_pos + CONST_CAST(GLEW_MESA_window_pos) = _glewSearchExtension("GL_MESA_window_pos", extStart, extEnd); + if (glewExperimental || GLEW_MESA_window_pos) CONST_CAST(GLEW_MESA_window_pos) = !_glewInit_GL_MESA_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_MESA_window_pos */ +#ifdef GL_MESA_ycbcr_texture + CONST_CAST(GLEW_MESA_ycbcr_texture) = _glewSearchExtension("GL_MESA_ycbcr_texture", extStart, extEnd); +#endif /* GL_MESA_ycbcr_texture */ +#ifdef GL_NVX_conditional_render + CONST_CAST(GLEW_NVX_conditional_render) = _glewSearchExtension("GL_NVX_conditional_render", extStart, extEnd); + if (glewExperimental || GLEW_NVX_conditional_render) CONST_CAST(GLEW_NVX_conditional_render) = !_glewInit_GL_NVX_conditional_render(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NVX_conditional_render */ +#ifdef GL_NVX_gpu_memory_info + CONST_CAST(GLEW_NVX_gpu_memory_info) = _glewSearchExtension("GL_NVX_gpu_memory_info", extStart, extEnd); +#endif /* GL_NVX_gpu_memory_info */ +#ifdef GL_NV_bindless_multi_draw_indirect + CONST_CAST(GLEW_NV_bindless_multi_draw_indirect) = _glewSearchExtension("GL_NV_bindless_multi_draw_indirect", extStart, extEnd); + if (glewExperimental || GLEW_NV_bindless_multi_draw_indirect) CONST_CAST(GLEW_NV_bindless_multi_draw_indirect) = !_glewInit_GL_NV_bindless_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_bindless_multi_draw_indirect */ +#ifdef GL_NV_bindless_texture + CONST_CAST(GLEW_NV_bindless_texture) = _glewSearchExtension("GL_NV_bindless_texture", extStart, extEnd); + if (glewExperimental || GLEW_NV_bindless_texture) CONST_CAST(GLEW_NV_bindless_texture) = !_glewInit_GL_NV_bindless_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_bindless_texture */ +#ifdef GL_NV_blend_equation_advanced + CONST_CAST(GLEW_NV_blend_equation_advanced) = _glewSearchExtension("GL_NV_blend_equation_advanced", extStart, extEnd); + if (glewExperimental || GLEW_NV_blend_equation_advanced) CONST_CAST(GLEW_NV_blend_equation_advanced) = !_glewInit_GL_NV_blend_equation_advanced(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_blend_equation_advanced */ +#ifdef GL_NV_blend_equation_advanced_coherent + CONST_CAST(GLEW_NV_blend_equation_advanced_coherent) = _glewSearchExtension("GL_NV_blend_equation_advanced_coherent", extStart, extEnd); +#endif /* GL_NV_blend_equation_advanced_coherent */ +#ifdef GL_NV_blend_square + CONST_CAST(GLEW_NV_blend_square) = _glewSearchExtension("GL_NV_blend_square", extStart, extEnd); +#endif /* GL_NV_blend_square */ +#ifdef GL_NV_compute_program5 + CONST_CAST(GLEW_NV_compute_program5) = _glewSearchExtension("GL_NV_compute_program5", extStart, extEnd); +#endif /* GL_NV_compute_program5 */ +#ifdef GL_NV_conditional_render + CONST_CAST(GLEW_NV_conditional_render) = _glewSearchExtension("GL_NV_conditional_render", extStart, extEnd); + if (glewExperimental || GLEW_NV_conditional_render) CONST_CAST(GLEW_NV_conditional_render) = !_glewInit_GL_NV_conditional_render(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_conditional_render */ +#ifdef GL_NV_copy_depth_to_color + CONST_CAST(GLEW_NV_copy_depth_to_color) = _glewSearchExtension("GL_NV_copy_depth_to_color", extStart, extEnd); +#endif /* GL_NV_copy_depth_to_color */ +#ifdef GL_NV_copy_image + CONST_CAST(GLEW_NV_copy_image) = _glewSearchExtension("GL_NV_copy_image", extStart, extEnd); + if (glewExperimental || GLEW_NV_copy_image) CONST_CAST(GLEW_NV_copy_image) = !_glewInit_GL_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_copy_image */ +#ifdef GL_NV_deep_texture3D + CONST_CAST(GLEW_NV_deep_texture3D) = _glewSearchExtension("GL_NV_deep_texture3D", extStart, extEnd); +#endif /* GL_NV_deep_texture3D */ +#ifdef GL_NV_depth_buffer_float + CONST_CAST(GLEW_NV_depth_buffer_float) = _glewSearchExtension("GL_NV_depth_buffer_float", extStart, extEnd); + if (glewExperimental || GLEW_NV_depth_buffer_float) CONST_CAST(GLEW_NV_depth_buffer_float) = !_glewInit_GL_NV_depth_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_depth_buffer_float */ +#ifdef GL_NV_depth_clamp + CONST_CAST(GLEW_NV_depth_clamp) = _glewSearchExtension("GL_NV_depth_clamp", extStart, extEnd); +#endif /* GL_NV_depth_clamp */ +#ifdef GL_NV_depth_range_unclamped + CONST_CAST(GLEW_NV_depth_range_unclamped) = _glewSearchExtension("GL_NV_depth_range_unclamped", extStart, extEnd); +#endif /* GL_NV_depth_range_unclamped */ +#ifdef GL_NV_draw_texture + CONST_CAST(GLEW_NV_draw_texture) = _glewSearchExtension("GL_NV_draw_texture", extStart, extEnd); + if (glewExperimental || GLEW_NV_draw_texture) CONST_CAST(GLEW_NV_draw_texture) = !_glewInit_GL_NV_draw_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_draw_texture */ +#ifdef GL_NV_evaluators + CONST_CAST(GLEW_NV_evaluators) = _glewSearchExtension("GL_NV_evaluators", extStart, extEnd); + if (glewExperimental || GLEW_NV_evaluators) CONST_CAST(GLEW_NV_evaluators) = !_glewInit_GL_NV_evaluators(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_evaluators */ +#ifdef GL_NV_explicit_multisample + CONST_CAST(GLEW_NV_explicit_multisample) = _glewSearchExtension("GL_NV_explicit_multisample", extStart, extEnd); + if (glewExperimental || GLEW_NV_explicit_multisample) CONST_CAST(GLEW_NV_explicit_multisample) = !_glewInit_GL_NV_explicit_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_explicit_multisample */ +#ifdef GL_NV_fence + CONST_CAST(GLEW_NV_fence) = _glewSearchExtension("GL_NV_fence", extStart, extEnd); + if (glewExperimental || GLEW_NV_fence) CONST_CAST(GLEW_NV_fence) = !_glewInit_GL_NV_fence(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_fence */ +#ifdef GL_NV_float_buffer + CONST_CAST(GLEW_NV_float_buffer) = _glewSearchExtension("GL_NV_float_buffer", extStart, extEnd); +#endif /* GL_NV_float_buffer */ +#ifdef GL_NV_fog_distance + CONST_CAST(GLEW_NV_fog_distance) = _glewSearchExtension("GL_NV_fog_distance", extStart, extEnd); +#endif /* GL_NV_fog_distance */ +#ifdef GL_NV_fragment_program + CONST_CAST(GLEW_NV_fragment_program) = _glewSearchExtension("GL_NV_fragment_program", extStart, extEnd); + if (glewExperimental || GLEW_NV_fragment_program) CONST_CAST(GLEW_NV_fragment_program) = !_glewInit_GL_NV_fragment_program(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_fragment_program */ +#ifdef GL_NV_fragment_program2 + CONST_CAST(GLEW_NV_fragment_program2) = _glewSearchExtension("GL_NV_fragment_program2", extStart, extEnd); +#endif /* GL_NV_fragment_program2 */ +#ifdef GL_NV_fragment_program4 + CONST_CAST(GLEW_NV_fragment_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); +#endif /* GL_NV_fragment_program4 */ +#ifdef GL_NV_fragment_program_option + CONST_CAST(GLEW_NV_fragment_program_option) = _glewSearchExtension("GL_NV_fragment_program_option", extStart, extEnd); +#endif /* GL_NV_fragment_program_option */ +#ifdef GL_NV_framebuffer_multisample_coverage + CONST_CAST(GLEW_NV_framebuffer_multisample_coverage) = _glewSearchExtension("GL_NV_framebuffer_multisample_coverage", extStart, extEnd); + if (glewExperimental || GLEW_NV_framebuffer_multisample_coverage) CONST_CAST(GLEW_NV_framebuffer_multisample_coverage) = !_glewInit_GL_NV_framebuffer_multisample_coverage(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_framebuffer_multisample_coverage */ +#ifdef GL_NV_geometry_program4 + CONST_CAST(GLEW_NV_geometry_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); + if (glewExperimental || GLEW_NV_geometry_program4) CONST_CAST(GLEW_NV_geometry_program4) = !_glewInit_GL_NV_geometry_program4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_geometry_program4 */ +#ifdef GL_NV_geometry_shader4 + CONST_CAST(GLEW_NV_geometry_shader4) = _glewSearchExtension("GL_NV_geometry_shader4", extStart, extEnd); +#endif /* GL_NV_geometry_shader4 */ +#ifdef GL_NV_gpu_program4 + CONST_CAST(GLEW_NV_gpu_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); + if (glewExperimental || GLEW_NV_gpu_program4) CONST_CAST(GLEW_NV_gpu_program4) = !_glewInit_GL_NV_gpu_program4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_gpu_program4 */ +#ifdef GL_NV_gpu_program5 + CONST_CAST(GLEW_NV_gpu_program5) = _glewSearchExtension("GL_NV_gpu_program5", extStart, extEnd); +#endif /* GL_NV_gpu_program5 */ +#ifdef GL_NV_gpu_program5_mem_extended + CONST_CAST(GLEW_NV_gpu_program5_mem_extended) = _glewSearchExtension("GL_NV_gpu_program5_mem_extended", extStart, extEnd); +#endif /* GL_NV_gpu_program5_mem_extended */ +#ifdef GL_NV_gpu_program_fp64 + CONST_CAST(GLEW_NV_gpu_program_fp64) = _glewSearchExtension("GL_NV_gpu_program_fp64", extStart, extEnd); +#endif /* GL_NV_gpu_program_fp64 */ +#ifdef GL_NV_gpu_shader5 + CONST_CAST(GLEW_NV_gpu_shader5) = _glewSearchExtension("GL_NV_gpu_shader5", extStart, extEnd); + if (glewExperimental || GLEW_NV_gpu_shader5) CONST_CAST(GLEW_NV_gpu_shader5) = !_glewInit_GL_NV_gpu_shader5(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_gpu_shader5 */ +#ifdef GL_NV_half_float + CONST_CAST(GLEW_NV_half_float) = _glewSearchExtension("GL_NV_half_float", extStart, extEnd); + if (glewExperimental || GLEW_NV_half_float) CONST_CAST(GLEW_NV_half_float) = !_glewInit_GL_NV_half_float(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_half_float */ +#ifdef GL_NV_light_max_exponent + CONST_CAST(GLEW_NV_light_max_exponent) = _glewSearchExtension("GL_NV_light_max_exponent", extStart, extEnd); +#endif /* GL_NV_light_max_exponent */ +#ifdef GL_NV_multisample_coverage + CONST_CAST(GLEW_NV_multisample_coverage) = _glewSearchExtension("GL_NV_multisample_coverage", extStart, extEnd); +#endif /* GL_NV_multisample_coverage */ +#ifdef GL_NV_multisample_filter_hint + CONST_CAST(GLEW_NV_multisample_filter_hint) = _glewSearchExtension("GL_NV_multisample_filter_hint", extStart, extEnd); +#endif /* GL_NV_multisample_filter_hint */ +#ifdef GL_NV_occlusion_query + CONST_CAST(GLEW_NV_occlusion_query) = _glewSearchExtension("GL_NV_occlusion_query", extStart, extEnd); + if (glewExperimental || GLEW_NV_occlusion_query) CONST_CAST(GLEW_NV_occlusion_query) = !_glewInit_GL_NV_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_occlusion_query */ +#ifdef GL_NV_packed_depth_stencil + CONST_CAST(GLEW_NV_packed_depth_stencil) = _glewSearchExtension("GL_NV_packed_depth_stencil", extStart, extEnd); +#endif /* GL_NV_packed_depth_stencil */ +#ifdef GL_NV_parameter_buffer_object + CONST_CAST(GLEW_NV_parameter_buffer_object) = _glewSearchExtension("GL_NV_parameter_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_NV_parameter_buffer_object) CONST_CAST(GLEW_NV_parameter_buffer_object) = !_glewInit_GL_NV_parameter_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_parameter_buffer_object */ +#ifdef GL_NV_parameter_buffer_object2 + CONST_CAST(GLEW_NV_parameter_buffer_object2) = _glewSearchExtension("GL_NV_parameter_buffer_object2", extStart, extEnd); +#endif /* GL_NV_parameter_buffer_object2 */ +#ifdef GL_NV_path_rendering + CONST_CAST(GLEW_NV_path_rendering) = _glewSearchExtension("GL_NV_path_rendering", extStart, extEnd); + if (glewExperimental || GLEW_NV_path_rendering) CONST_CAST(GLEW_NV_path_rendering) = !_glewInit_GL_NV_path_rendering(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_path_rendering */ +#ifdef GL_NV_pixel_data_range + CONST_CAST(GLEW_NV_pixel_data_range) = _glewSearchExtension("GL_NV_pixel_data_range", extStart, extEnd); + if (glewExperimental || GLEW_NV_pixel_data_range) CONST_CAST(GLEW_NV_pixel_data_range) = !_glewInit_GL_NV_pixel_data_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_pixel_data_range */ +#ifdef GL_NV_point_sprite + CONST_CAST(GLEW_NV_point_sprite) = _glewSearchExtension("GL_NV_point_sprite", extStart, extEnd); + if (glewExperimental || GLEW_NV_point_sprite) CONST_CAST(GLEW_NV_point_sprite) = !_glewInit_GL_NV_point_sprite(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_point_sprite */ +#ifdef GL_NV_present_video + CONST_CAST(GLEW_NV_present_video) = _glewSearchExtension("GL_NV_present_video", extStart, extEnd); + if (glewExperimental || GLEW_NV_present_video) CONST_CAST(GLEW_NV_present_video) = !_glewInit_GL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_present_video */ +#ifdef GL_NV_primitive_restart + CONST_CAST(GLEW_NV_primitive_restart) = _glewSearchExtension("GL_NV_primitive_restart", extStart, extEnd); + if (glewExperimental || GLEW_NV_primitive_restart) CONST_CAST(GLEW_NV_primitive_restart) = !_glewInit_GL_NV_primitive_restart(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_primitive_restart */ +#ifdef GL_NV_register_combiners + CONST_CAST(GLEW_NV_register_combiners) = _glewSearchExtension("GL_NV_register_combiners", extStart, extEnd); + if (glewExperimental || GLEW_NV_register_combiners) CONST_CAST(GLEW_NV_register_combiners) = !_glewInit_GL_NV_register_combiners(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_register_combiners */ +#ifdef GL_NV_register_combiners2 + CONST_CAST(GLEW_NV_register_combiners2) = _glewSearchExtension("GL_NV_register_combiners2", extStart, extEnd); + if (glewExperimental || GLEW_NV_register_combiners2) CONST_CAST(GLEW_NV_register_combiners2) = !_glewInit_GL_NV_register_combiners2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_register_combiners2 */ +#ifdef GL_NV_shader_atomic_counters + CONST_CAST(GLEW_NV_shader_atomic_counters) = _glewSearchExtension("GL_NV_shader_atomic_counters", extStart, extEnd); +#endif /* GL_NV_shader_atomic_counters */ +#ifdef GL_NV_shader_atomic_float + CONST_CAST(GLEW_NV_shader_atomic_float) = _glewSearchExtension("GL_NV_shader_atomic_float", extStart, extEnd); +#endif /* GL_NV_shader_atomic_float */ +#ifdef GL_NV_shader_buffer_load + CONST_CAST(GLEW_NV_shader_buffer_load) = _glewSearchExtension("GL_NV_shader_buffer_load", extStart, extEnd); + if (glewExperimental || GLEW_NV_shader_buffer_load) CONST_CAST(GLEW_NV_shader_buffer_load) = !_glewInit_GL_NV_shader_buffer_load(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_shader_buffer_load */ +#ifdef GL_NV_shader_storage_buffer_object + CONST_CAST(GLEW_NV_shader_storage_buffer_object) = _glewSearchExtension("GL_NV_shader_storage_buffer_object", extStart, extEnd); +#endif /* GL_NV_shader_storage_buffer_object */ +#ifdef GL_NV_tessellation_program5 + CONST_CAST(GLEW_NV_tessellation_program5) = _glewSearchExtension("GL_NV_gpu_program5", extStart, extEnd); +#endif /* GL_NV_tessellation_program5 */ +#ifdef GL_NV_texgen_emboss + CONST_CAST(GLEW_NV_texgen_emboss) = _glewSearchExtension("GL_NV_texgen_emboss", extStart, extEnd); +#endif /* GL_NV_texgen_emboss */ +#ifdef GL_NV_texgen_reflection + CONST_CAST(GLEW_NV_texgen_reflection) = _glewSearchExtension("GL_NV_texgen_reflection", extStart, extEnd); +#endif /* GL_NV_texgen_reflection */ +#ifdef GL_NV_texture_barrier + CONST_CAST(GLEW_NV_texture_barrier) = _glewSearchExtension("GL_NV_texture_barrier", extStart, extEnd); + if (glewExperimental || GLEW_NV_texture_barrier) CONST_CAST(GLEW_NV_texture_barrier) = !_glewInit_GL_NV_texture_barrier(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_texture_barrier */ +#ifdef GL_NV_texture_compression_vtc + CONST_CAST(GLEW_NV_texture_compression_vtc) = _glewSearchExtension("GL_NV_texture_compression_vtc", extStart, extEnd); +#endif /* GL_NV_texture_compression_vtc */ +#ifdef GL_NV_texture_env_combine4 + CONST_CAST(GLEW_NV_texture_env_combine4) = _glewSearchExtension("GL_NV_texture_env_combine4", extStart, extEnd); +#endif /* GL_NV_texture_env_combine4 */ +#ifdef GL_NV_texture_expand_normal + CONST_CAST(GLEW_NV_texture_expand_normal) = _glewSearchExtension("GL_NV_texture_expand_normal", extStart, extEnd); +#endif /* GL_NV_texture_expand_normal */ +#ifdef GL_NV_texture_multisample + CONST_CAST(GLEW_NV_texture_multisample) = _glewSearchExtension("GL_NV_texture_multisample", extStart, extEnd); + if (glewExperimental || GLEW_NV_texture_multisample) CONST_CAST(GLEW_NV_texture_multisample) = !_glewInit_GL_NV_texture_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_texture_multisample */ +#ifdef GL_NV_texture_rectangle + CONST_CAST(GLEW_NV_texture_rectangle) = _glewSearchExtension("GL_NV_texture_rectangle", extStart, extEnd); +#endif /* GL_NV_texture_rectangle */ +#ifdef GL_NV_texture_shader + CONST_CAST(GLEW_NV_texture_shader) = _glewSearchExtension("GL_NV_texture_shader", extStart, extEnd); +#endif /* GL_NV_texture_shader */ +#ifdef GL_NV_texture_shader2 + CONST_CAST(GLEW_NV_texture_shader2) = _glewSearchExtension("GL_NV_texture_shader2", extStart, extEnd); +#endif /* GL_NV_texture_shader2 */ +#ifdef GL_NV_texture_shader3 + CONST_CAST(GLEW_NV_texture_shader3) = _glewSearchExtension("GL_NV_texture_shader3", extStart, extEnd); +#endif /* GL_NV_texture_shader3 */ +#ifdef GL_NV_transform_feedback + CONST_CAST(GLEW_NV_transform_feedback) = _glewSearchExtension("GL_NV_transform_feedback", extStart, extEnd); + if (glewExperimental || GLEW_NV_transform_feedback) CONST_CAST(GLEW_NV_transform_feedback) = !_glewInit_GL_NV_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_transform_feedback */ +#ifdef GL_NV_transform_feedback2 + CONST_CAST(GLEW_NV_transform_feedback2) = _glewSearchExtension("GL_NV_transform_feedback2", extStart, extEnd); + if (glewExperimental || GLEW_NV_transform_feedback2) CONST_CAST(GLEW_NV_transform_feedback2) = !_glewInit_GL_NV_transform_feedback2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_transform_feedback2 */ +#ifdef GL_NV_vdpau_interop + CONST_CAST(GLEW_NV_vdpau_interop) = _glewSearchExtension("GL_NV_vdpau_interop", extStart, extEnd); + if (glewExperimental || GLEW_NV_vdpau_interop) CONST_CAST(GLEW_NV_vdpau_interop) = !_glewInit_GL_NV_vdpau_interop(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vdpau_interop */ +#ifdef GL_NV_vertex_array_range + CONST_CAST(GLEW_NV_vertex_array_range) = _glewSearchExtension("GL_NV_vertex_array_range", extStart, extEnd); + if (glewExperimental || GLEW_NV_vertex_array_range) CONST_CAST(GLEW_NV_vertex_array_range) = !_glewInit_GL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_array_range */ +#ifdef GL_NV_vertex_array_range2 + CONST_CAST(GLEW_NV_vertex_array_range2) = _glewSearchExtension("GL_NV_vertex_array_range2", extStart, extEnd); +#endif /* GL_NV_vertex_array_range2 */ +#ifdef GL_NV_vertex_attrib_integer_64bit + CONST_CAST(GLEW_NV_vertex_attrib_integer_64bit) = _glewSearchExtension("GL_NV_vertex_attrib_integer_64bit", extStart, extEnd); + if (glewExperimental || GLEW_NV_vertex_attrib_integer_64bit) CONST_CAST(GLEW_NV_vertex_attrib_integer_64bit) = !_glewInit_GL_NV_vertex_attrib_integer_64bit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_attrib_integer_64bit */ +#ifdef GL_NV_vertex_buffer_unified_memory + CONST_CAST(GLEW_NV_vertex_buffer_unified_memory) = _glewSearchExtension("GL_NV_vertex_buffer_unified_memory", extStart, extEnd); + if (glewExperimental || GLEW_NV_vertex_buffer_unified_memory) CONST_CAST(GLEW_NV_vertex_buffer_unified_memory) = !_glewInit_GL_NV_vertex_buffer_unified_memory(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_buffer_unified_memory */ +#ifdef GL_NV_vertex_program + CONST_CAST(GLEW_NV_vertex_program) = _glewSearchExtension("GL_NV_vertex_program", extStart, extEnd); + if (glewExperimental || GLEW_NV_vertex_program) CONST_CAST(GLEW_NV_vertex_program) = !_glewInit_GL_NV_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_program */ +#ifdef GL_NV_vertex_program1_1 + CONST_CAST(GLEW_NV_vertex_program1_1) = _glewSearchExtension("GL_NV_vertex_program1_1", extStart, extEnd); +#endif /* GL_NV_vertex_program1_1 */ +#ifdef GL_NV_vertex_program2 + CONST_CAST(GLEW_NV_vertex_program2) = _glewSearchExtension("GL_NV_vertex_program2", extStart, extEnd); +#endif /* GL_NV_vertex_program2 */ +#ifdef GL_NV_vertex_program2_option + CONST_CAST(GLEW_NV_vertex_program2_option) = _glewSearchExtension("GL_NV_vertex_program2_option", extStart, extEnd); +#endif /* GL_NV_vertex_program2_option */ +#ifdef GL_NV_vertex_program3 + CONST_CAST(GLEW_NV_vertex_program3) = _glewSearchExtension("GL_NV_vertex_program3", extStart, extEnd); +#endif /* GL_NV_vertex_program3 */ +#ifdef GL_NV_vertex_program4 + CONST_CAST(GLEW_NV_vertex_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); +#endif /* GL_NV_vertex_program4 */ +#ifdef GL_NV_video_capture + CONST_CAST(GLEW_NV_video_capture) = _glewSearchExtension("GL_NV_video_capture", extStart, extEnd); + if (glewExperimental || GLEW_NV_video_capture) CONST_CAST(GLEW_NV_video_capture) = !_glewInit_GL_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_video_capture */ +#ifdef GL_OES_byte_coordinates + CONST_CAST(GLEW_OES_byte_coordinates) = _glewSearchExtension("GL_OES_byte_coordinates", extStart, extEnd); +#endif /* GL_OES_byte_coordinates */ +#ifdef GL_OES_compressed_paletted_texture + CONST_CAST(GLEW_OES_compressed_paletted_texture) = _glewSearchExtension("GL_OES_compressed_paletted_texture", extStart, extEnd); +#endif /* GL_OES_compressed_paletted_texture */ +#ifdef GL_OES_read_format + CONST_CAST(GLEW_OES_read_format) = _glewSearchExtension("GL_OES_read_format", extStart, extEnd); +#endif /* GL_OES_read_format */ +#ifdef GL_OES_single_precision + CONST_CAST(GLEW_OES_single_precision) = _glewSearchExtension("GL_OES_single_precision", extStart, extEnd); + if (glewExperimental || GLEW_OES_single_precision) CONST_CAST(GLEW_OES_single_precision) = !_glewInit_GL_OES_single_precision(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_OES_single_precision */ +#ifdef GL_OML_interlace + CONST_CAST(GLEW_OML_interlace) = _glewSearchExtension("GL_OML_interlace", extStart, extEnd); +#endif /* GL_OML_interlace */ +#ifdef GL_OML_resample + CONST_CAST(GLEW_OML_resample) = _glewSearchExtension("GL_OML_resample", extStart, extEnd); +#endif /* GL_OML_resample */ +#ifdef GL_OML_subsample + CONST_CAST(GLEW_OML_subsample) = _glewSearchExtension("GL_OML_subsample", extStart, extEnd); +#endif /* GL_OML_subsample */ +#ifdef GL_PGI_misc_hints + CONST_CAST(GLEW_PGI_misc_hints) = _glewSearchExtension("GL_PGI_misc_hints", extStart, extEnd); +#endif /* GL_PGI_misc_hints */ +#ifdef GL_PGI_vertex_hints + CONST_CAST(GLEW_PGI_vertex_hints) = _glewSearchExtension("GL_PGI_vertex_hints", extStart, extEnd); +#endif /* GL_PGI_vertex_hints */ +#ifdef GL_REGAL_ES1_0_compatibility + CONST_CAST(GLEW_REGAL_ES1_0_compatibility) = _glewSearchExtension("GL_REGAL_ES1_0_compatibility", extStart, extEnd); + if (glewExperimental || GLEW_REGAL_ES1_0_compatibility) CONST_CAST(GLEW_REGAL_ES1_0_compatibility) = !_glewInit_GL_REGAL_ES1_0_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_REGAL_ES1_0_compatibility */ +#ifdef GL_REGAL_ES1_1_compatibility + CONST_CAST(GLEW_REGAL_ES1_1_compatibility) = _glewSearchExtension("GL_REGAL_ES1_1_compatibility", extStart, extEnd); + if (glewExperimental || GLEW_REGAL_ES1_1_compatibility) CONST_CAST(GLEW_REGAL_ES1_1_compatibility) = !_glewInit_GL_REGAL_ES1_1_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_REGAL_ES1_1_compatibility */ +#ifdef GL_REGAL_enable + CONST_CAST(GLEW_REGAL_enable) = _glewSearchExtension("GL_REGAL_enable", extStart, extEnd); +#endif /* GL_REGAL_enable */ +#ifdef GL_REGAL_error_string + CONST_CAST(GLEW_REGAL_error_string) = _glewSearchExtension("GL_REGAL_error_string", extStart, extEnd); + if (glewExperimental || GLEW_REGAL_error_string) CONST_CAST(GLEW_REGAL_error_string) = !_glewInit_GL_REGAL_error_string(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_REGAL_error_string */ +#ifdef GL_REGAL_extension_query + CONST_CAST(GLEW_REGAL_extension_query) = _glewSearchExtension("GL_REGAL_extension_query", extStart, extEnd); + if (glewExperimental || GLEW_REGAL_extension_query) CONST_CAST(GLEW_REGAL_extension_query) = !_glewInit_GL_REGAL_extension_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_REGAL_extension_query */ +#ifdef GL_REGAL_log + CONST_CAST(GLEW_REGAL_log) = _glewSearchExtension("GL_REGAL_log", extStart, extEnd); + if (glewExperimental || GLEW_REGAL_log) CONST_CAST(GLEW_REGAL_log) = !_glewInit_GL_REGAL_log(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_REGAL_log */ +#ifdef GL_REND_screen_coordinates + CONST_CAST(GLEW_REND_screen_coordinates) = _glewSearchExtension("GL_REND_screen_coordinates", extStart, extEnd); +#endif /* GL_REND_screen_coordinates */ +#ifdef GL_S3_s3tc + CONST_CAST(GLEW_S3_s3tc) = _glewSearchExtension("GL_S3_s3tc", extStart, extEnd); +#endif /* GL_S3_s3tc */ +#ifdef GL_SGIS_color_range + CONST_CAST(GLEW_SGIS_color_range) = _glewSearchExtension("GL_SGIS_color_range", extStart, extEnd); +#endif /* GL_SGIS_color_range */ +#ifdef GL_SGIS_detail_texture + CONST_CAST(GLEW_SGIS_detail_texture) = _glewSearchExtension("GL_SGIS_detail_texture", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_detail_texture) CONST_CAST(GLEW_SGIS_detail_texture) = !_glewInit_GL_SGIS_detail_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_detail_texture */ +#ifdef GL_SGIS_fog_function + CONST_CAST(GLEW_SGIS_fog_function) = _glewSearchExtension("GL_SGIS_fog_function", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_fog_function) CONST_CAST(GLEW_SGIS_fog_function) = !_glewInit_GL_SGIS_fog_function(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_fog_function */ +#ifdef GL_SGIS_generate_mipmap + CONST_CAST(GLEW_SGIS_generate_mipmap) = _glewSearchExtension("GL_SGIS_generate_mipmap", extStart, extEnd); +#endif /* GL_SGIS_generate_mipmap */ +#ifdef GL_SGIS_multisample + CONST_CAST(GLEW_SGIS_multisample) = _glewSearchExtension("GL_SGIS_multisample", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_multisample) CONST_CAST(GLEW_SGIS_multisample) = !_glewInit_GL_SGIS_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_multisample */ +#ifdef GL_SGIS_pixel_texture + CONST_CAST(GLEW_SGIS_pixel_texture) = _glewSearchExtension("GL_SGIS_pixel_texture", extStart, extEnd); +#endif /* GL_SGIS_pixel_texture */ +#ifdef GL_SGIS_point_line_texgen + CONST_CAST(GLEW_SGIS_point_line_texgen) = _glewSearchExtension("GL_SGIS_point_line_texgen", extStart, extEnd); +#endif /* GL_SGIS_point_line_texgen */ +#ifdef GL_SGIS_sharpen_texture + CONST_CAST(GLEW_SGIS_sharpen_texture) = _glewSearchExtension("GL_SGIS_sharpen_texture", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_sharpen_texture) CONST_CAST(GLEW_SGIS_sharpen_texture) = !_glewInit_GL_SGIS_sharpen_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_sharpen_texture */ +#ifdef GL_SGIS_texture4D + CONST_CAST(GLEW_SGIS_texture4D) = _glewSearchExtension("GL_SGIS_texture4D", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_texture4D) CONST_CAST(GLEW_SGIS_texture4D) = !_glewInit_GL_SGIS_texture4D(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_texture4D */ +#ifdef GL_SGIS_texture_border_clamp + CONST_CAST(GLEW_SGIS_texture_border_clamp) = _glewSearchExtension("GL_SGIS_texture_border_clamp", extStart, extEnd); +#endif /* GL_SGIS_texture_border_clamp */ +#ifdef GL_SGIS_texture_edge_clamp + CONST_CAST(GLEW_SGIS_texture_edge_clamp) = _glewSearchExtension("GL_SGIS_texture_edge_clamp", extStart, extEnd); +#endif /* GL_SGIS_texture_edge_clamp */ +#ifdef GL_SGIS_texture_filter4 + CONST_CAST(GLEW_SGIS_texture_filter4) = _glewSearchExtension("GL_SGIS_texture_filter4", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_texture_filter4) CONST_CAST(GLEW_SGIS_texture_filter4) = !_glewInit_GL_SGIS_texture_filter4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_texture_filter4 */ +#ifdef GL_SGIS_texture_lod + CONST_CAST(GLEW_SGIS_texture_lod) = _glewSearchExtension("GL_SGIS_texture_lod", extStart, extEnd); +#endif /* GL_SGIS_texture_lod */ +#ifdef GL_SGIS_texture_select + CONST_CAST(GLEW_SGIS_texture_select) = _glewSearchExtension("GL_SGIS_texture_select", extStart, extEnd); +#endif /* GL_SGIS_texture_select */ +#ifdef GL_SGIX_async + CONST_CAST(GLEW_SGIX_async) = _glewSearchExtension("GL_SGIX_async", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_async) CONST_CAST(GLEW_SGIX_async) = !_glewInit_GL_SGIX_async(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_async */ +#ifdef GL_SGIX_async_histogram + CONST_CAST(GLEW_SGIX_async_histogram) = _glewSearchExtension("GL_SGIX_async_histogram", extStart, extEnd); +#endif /* GL_SGIX_async_histogram */ +#ifdef GL_SGIX_async_pixel + CONST_CAST(GLEW_SGIX_async_pixel) = _glewSearchExtension("GL_SGIX_async_pixel", extStart, extEnd); +#endif /* GL_SGIX_async_pixel */ +#ifdef GL_SGIX_blend_alpha_minmax + CONST_CAST(GLEW_SGIX_blend_alpha_minmax) = _glewSearchExtension("GL_SGIX_blend_alpha_minmax", extStart, extEnd); +#endif /* GL_SGIX_blend_alpha_minmax */ +#ifdef GL_SGIX_clipmap + CONST_CAST(GLEW_SGIX_clipmap) = _glewSearchExtension("GL_SGIX_clipmap", extStart, extEnd); +#endif /* GL_SGIX_clipmap */ +#ifdef GL_SGIX_convolution_accuracy + CONST_CAST(GLEW_SGIX_convolution_accuracy) = _glewSearchExtension("GL_SGIX_convolution_accuracy", extStart, extEnd); +#endif /* GL_SGIX_convolution_accuracy */ +#ifdef GL_SGIX_depth_texture + CONST_CAST(GLEW_SGIX_depth_texture) = _glewSearchExtension("GL_SGIX_depth_texture", extStart, extEnd); +#endif /* GL_SGIX_depth_texture */ +#ifdef GL_SGIX_flush_raster + CONST_CAST(GLEW_SGIX_flush_raster) = _glewSearchExtension("GL_SGIX_flush_raster", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_flush_raster) CONST_CAST(GLEW_SGIX_flush_raster) = !_glewInit_GL_SGIX_flush_raster(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_flush_raster */ +#ifdef GL_SGIX_fog_offset + CONST_CAST(GLEW_SGIX_fog_offset) = _glewSearchExtension("GL_SGIX_fog_offset", extStart, extEnd); +#endif /* GL_SGIX_fog_offset */ +#ifdef GL_SGIX_fog_texture + CONST_CAST(GLEW_SGIX_fog_texture) = _glewSearchExtension("GL_SGIX_fog_texture", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_fog_texture) CONST_CAST(GLEW_SGIX_fog_texture) = !_glewInit_GL_SGIX_fog_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_fog_texture */ +#ifdef GL_SGIX_fragment_specular_lighting + CONST_CAST(GLEW_SGIX_fragment_specular_lighting) = _glewSearchExtension("GL_SGIX_fragment_specular_lighting", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_fragment_specular_lighting) CONST_CAST(GLEW_SGIX_fragment_specular_lighting) = !_glewInit_GL_SGIX_fragment_specular_lighting(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_fragment_specular_lighting */ +#ifdef GL_SGIX_framezoom + CONST_CAST(GLEW_SGIX_framezoom) = _glewSearchExtension("GL_SGIX_framezoom", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_framezoom) CONST_CAST(GLEW_SGIX_framezoom) = !_glewInit_GL_SGIX_framezoom(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_framezoom */ +#ifdef GL_SGIX_interlace + CONST_CAST(GLEW_SGIX_interlace) = _glewSearchExtension("GL_SGIX_interlace", extStart, extEnd); +#endif /* GL_SGIX_interlace */ +#ifdef GL_SGIX_ir_instrument1 + CONST_CAST(GLEW_SGIX_ir_instrument1) = _glewSearchExtension("GL_SGIX_ir_instrument1", extStart, extEnd); +#endif /* GL_SGIX_ir_instrument1 */ +#ifdef GL_SGIX_list_priority + CONST_CAST(GLEW_SGIX_list_priority) = _glewSearchExtension("GL_SGIX_list_priority", extStart, extEnd); +#endif /* GL_SGIX_list_priority */ +#ifdef GL_SGIX_pixel_texture + CONST_CAST(GLEW_SGIX_pixel_texture) = _glewSearchExtension("GL_SGIX_pixel_texture", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_pixel_texture) CONST_CAST(GLEW_SGIX_pixel_texture) = !_glewInit_GL_SGIX_pixel_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_pixel_texture */ +#ifdef GL_SGIX_pixel_texture_bits + CONST_CAST(GLEW_SGIX_pixel_texture_bits) = _glewSearchExtension("GL_SGIX_pixel_texture_bits", extStart, extEnd); +#endif /* GL_SGIX_pixel_texture_bits */ +#ifdef GL_SGIX_reference_plane + CONST_CAST(GLEW_SGIX_reference_plane) = _glewSearchExtension("GL_SGIX_reference_plane", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_reference_plane) CONST_CAST(GLEW_SGIX_reference_plane) = !_glewInit_GL_SGIX_reference_plane(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_reference_plane */ +#ifdef GL_SGIX_resample + CONST_CAST(GLEW_SGIX_resample) = _glewSearchExtension("GL_SGIX_resample", extStart, extEnd); +#endif /* GL_SGIX_resample */ +#ifdef GL_SGIX_shadow + CONST_CAST(GLEW_SGIX_shadow) = _glewSearchExtension("GL_SGIX_shadow", extStart, extEnd); +#endif /* GL_SGIX_shadow */ +#ifdef GL_SGIX_shadow_ambient + CONST_CAST(GLEW_SGIX_shadow_ambient) = _glewSearchExtension("GL_SGIX_shadow_ambient", extStart, extEnd); +#endif /* GL_SGIX_shadow_ambient */ +#ifdef GL_SGIX_sprite + CONST_CAST(GLEW_SGIX_sprite) = _glewSearchExtension("GL_SGIX_sprite", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_sprite) CONST_CAST(GLEW_SGIX_sprite) = !_glewInit_GL_SGIX_sprite(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_sprite */ +#ifdef GL_SGIX_tag_sample_buffer + CONST_CAST(GLEW_SGIX_tag_sample_buffer) = _glewSearchExtension("GL_SGIX_tag_sample_buffer", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_tag_sample_buffer) CONST_CAST(GLEW_SGIX_tag_sample_buffer) = !_glewInit_GL_SGIX_tag_sample_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_tag_sample_buffer */ +#ifdef GL_SGIX_texture_add_env + CONST_CAST(GLEW_SGIX_texture_add_env) = _glewSearchExtension("GL_SGIX_texture_add_env", extStart, extEnd); +#endif /* GL_SGIX_texture_add_env */ +#ifdef GL_SGIX_texture_coordinate_clamp + CONST_CAST(GLEW_SGIX_texture_coordinate_clamp) = _glewSearchExtension("GL_SGIX_texture_coordinate_clamp", extStart, extEnd); +#endif /* GL_SGIX_texture_coordinate_clamp */ +#ifdef GL_SGIX_texture_lod_bias + CONST_CAST(GLEW_SGIX_texture_lod_bias) = _glewSearchExtension("GL_SGIX_texture_lod_bias", extStart, extEnd); +#endif /* GL_SGIX_texture_lod_bias */ +#ifdef GL_SGIX_texture_multi_buffer + CONST_CAST(GLEW_SGIX_texture_multi_buffer) = _glewSearchExtension("GL_SGIX_texture_multi_buffer", extStart, extEnd); +#endif /* GL_SGIX_texture_multi_buffer */ +#ifdef GL_SGIX_texture_range + CONST_CAST(GLEW_SGIX_texture_range) = _glewSearchExtension("GL_SGIX_texture_range", extStart, extEnd); +#endif /* GL_SGIX_texture_range */ +#ifdef GL_SGIX_texture_scale_bias + CONST_CAST(GLEW_SGIX_texture_scale_bias) = _glewSearchExtension("GL_SGIX_texture_scale_bias", extStart, extEnd); +#endif /* GL_SGIX_texture_scale_bias */ +#ifdef GL_SGIX_vertex_preclip + CONST_CAST(GLEW_SGIX_vertex_preclip) = _glewSearchExtension("GL_SGIX_vertex_preclip", extStart, extEnd); +#endif /* GL_SGIX_vertex_preclip */ +#ifdef GL_SGIX_vertex_preclip_hint + CONST_CAST(GLEW_SGIX_vertex_preclip_hint) = _glewSearchExtension("GL_SGIX_vertex_preclip_hint", extStart, extEnd); +#endif /* GL_SGIX_vertex_preclip_hint */ +#ifdef GL_SGIX_ycrcb + CONST_CAST(GLEW_SGIX_ycrcb) = _glewSearchExtension("GL_SGIX_ycrcb", extStart, extEnd); +#endif /* GL_SGIX_ycrcb */ +#ifdef GL_SGI_color_matrix + CONST_CAST(GLEW_SGI_color_matrix) = _glewSearchExtension("GL_SGI_color_matrix", extStart, extEnd); +#endif /* GL_SGI_color_matrix */ +#ifdef GL_SGI_color_table + CONST_CAST(GLEW_SGI_color_table) = _glewSearchExtension("GL_SGI_color_table", extStart, extEnd); + if (glewExperimental || GLEW_SGI_color_table) CONST_CAST(GLEW_SGI_color_table) = !_glewInit_GL_SGI_color_table(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGI_color_table */ +#ifdef GL_SGI_texture_color_table + CONST_CAST(GLEW_SGI_texture_color_table) = _glewSearchExtension("GL_SGI_texture_color_table", extStart, extEnd); +#endif /* GL_SGI_texture_color_table */ +#ifdef GL_SUNX_constant_data + CONST_CAST(GLEW_SUNX_constant_data) = _glewSearchExtension("GL_SUNX_constant_data", extStart, extEnd); + if (glewExperimental || GLEW_SUNX_constant_data) CONST_CAST(GLEW_SUNX_constant_data) = !_glewInit_GL_SUNX_constant_data(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUNX_constant_data */ +#ifdef GL_SUN_convolution_border_modes + CONST_CAST(GLEW_SUN_convolution_border_modes) = _glewSearchExtension("GL_SUN_convolution_border_modes", extStart, extEnd); +#endif /* GL_SUN_convolution_border_modes */ +#ifdef GL_SUN_global_alpha + CONST_CAST(GLEW_SUN_global_alpha) = _glewSearchExtension("GL_SUN_global_alpha", extStart, extEnd); + if (glewExperimental || GLEW_SUN_global_alpha) CONST_CAST(GLEW_SUN_global_alpha) = !_glewInit_GL_SUN_global_alpha(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_global_alpha */ +#ifdef GL_SUN_mesh_array + CONST_CAST(GLEW_SUN_mesh_array) = _glewSearchExtension("GL_SUN_mesh_array", extStart, extEnd); +#endif /* GL_SUN_mesh_array */ +#ifdef GL_SUN_read_video_pixels + CONST_CAST(GLEW_SUN_read_video_pixels) = _glewSearchExtension("GL_SUN_read_video_pixels", extStart, extEnd); + if (glewExperimental || GLEW_SUN_read_video_pixels) CONST_CAST(GLEW_SUN_read_video_pixels) = !_glewInit_GL_SUN_read_video_pixels(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_read_video_pixels */ +#ifdef GL_SUN_slice_accum + CONST_CAST(GLEW_SUN_slice_accum) = _glewSearchExtension("GL_SUN_slice_accum", extStart, extEnd); +#endif /* GL_SUN_slice_accum */ +#ifdef GL_SUN_triangle_list + CONST_CAST(GLEW_SUN_triangle_list) = _glewSearchExtension("GL_SUN_triangle_list", extStart, extEnd); + if (glewExperimental || GLEW_SUN_triangle_list) CONST_CAST(GLEW_SUN_triangle_list) = !_glewInit_GL_SUN_triangle_list(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_triangle_list */ +#ifdef GL_SUN_vertex + CONST_CAST(GLEW_SUN_vertex) = _glewSearchExtension("GL_SUN_vertex", extStart, extEnd); + if (glewExperimental || GLEW_SUN_vertex) CONST_CAST(GLEW_SUN_vertex) = !_glewInit_GL_SUN_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_vertex */ +#ifdef GL_WIN_phong_shading + CONST_CAST(GLEW_WIN_phong_shading) = _glewSearchExtension("GL_WIN_phong_shading", extStart, extEnd); +#endif /* GL_WIN_phong_shading */ +#ifdef GL_WIN_specular_fog + CONST_CAST(GLEW_WIN_specular_fog) = _glewSearchExtension("GL_WIN_specular_fog", extStart, extEnd); +#endif /* GL_WIN_specular_fog */ +#ifdef GL_WIN_swap_hint + CONST_CAST(GLEW_WIN_swap_hint) = _glewSearchExtension("GL_WIN_swap_hint", extStart, extEnd); + if (glewExperimental || GLEW_WIN_swap_hint) CONST_CAST(GLEW_WIN_swap_hint) = !_glewInit_GL_WIN_swap_hint(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_WIN_swap_hint */ + + return GLEW_OK; +} + + +#if defined(_WIN32) + +#if !defined(GLEW_MX) + +PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL = NULL; + +PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD = NULL; +PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD = NULL; +PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD = NULL; +PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD = NULL; +PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD = NULL; +PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD = NULL; +PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD = NULL; +PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD = NULL; +PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD = NULL; + +PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB = NULL; +PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB = NULL; +PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB = NULL; +PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB = NULL; + +PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB = NULL; + +PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB = NULL; + +PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB = NULL; +PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB = NULL; + +PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB = NULL; +PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB = NULL; +PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB = NULL; +PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB = NULL; +PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB = NULL; + +PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB = NULL; +PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB = NULL; +PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB = NULL; + +PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB = NULL; +PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB = NULL; +PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB = NULL; + +PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT = NULL; +PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT = NULL; +PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT = NULL; +PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT = NULL; + +PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT = NULL; + +PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT = NULL; +PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT = NULL; + +PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT = NULL; +PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT = NULL; +PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT = NULL; +PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT = NULL; +PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT = NULL; + +PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT = NULL; +PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT = NULL; +PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT = NULL; + +PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT = NULL; +PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT = NULL; + +PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D = NULL; +PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D = NULL; + +PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D = NULL; +PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D = NULL; +PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D = NULL; +PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D = NULL; + +PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D = NULL; +PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D = NULL; +PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D = NULL; +PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D = NULL; +PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D = NULL; +PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D = NULL; +PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D = NULL; +PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D = NULL; +PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D = NULL; +PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D = NULL; +PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D = NULL; +PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D = NULL; + +PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D = NULL; +PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D = NULL; +PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D = NULL; +PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D = NULL; + +PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D = NULL; +PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D = NULL; +PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D = NULL; +PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D = NULL; + +PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D = NULL; +PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D = NULL; +PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D = NULL; +PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D = NULL; + +PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV = NULL; +PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV = NULL; +PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV = NULL; +PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV = NULL; +PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV = NULL; +PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV = NULL; +PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV = NULL; +PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV = NULL; + +PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV = NULL; + +PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV = NULL; +PFNWGLDELETEDCNVPROC __wglewDeleteDCNV = NULL; +PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV = NULL; +PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV = NULL; +PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV = NULL; + +PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV = NULL; +PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV = NULL; +PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV = NULL; + +PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV = NULL; +PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV = NULL; +PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV = NULL; +PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV = NULL; +PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV = NULL; +PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV = NULL; + +PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV = NULL; +PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV = NULL; + +PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV = NULL; +PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV = NULL; +PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV = NULL; +PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV = NULL; +PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV = NULL; + +PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV = NULL; +PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV = NULL; +PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV = NULL; +PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV = NULL; +PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV = NULL; +PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV = NULL; + +PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML = NULL; +PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML = NULL; +PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML = NULL; +PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML = NULL; +PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML = NULL; +PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML = NULL; +GLboolean __WGLEW_3DFX_multisample = GL_FALSE; +GLboolean __WGLEW_3DL_stereo_control = GL_FALSE; +GLboolean __WGLEW_AMD_gpu_association = GL_FALSE; +GLboolean __WGLEW_ARB_buffer_region = GL_FALSE; +GLboolean __WGLEW_ARB_create_context = GL_FALSE; +GLboolean __WGLEW_ARB_create_context_profile = GL_FALSE; +GLboolean __WGLEW_ARB_create_context_robustness = GL_FALSE; +GLboolean __WGLEW_ARB_extensions_string = GL_FALSE; +GLboolean __WGLEW_ARB_framebuffer_sRGB = GL_FALSE; +GLboolean __WGLEW_ARB_make_current_read = GL_FALSE; +GLboolean __WGLEW_ARB_multisample = GL_FALSE; +GLboolean __WGLEW_ARB_pbuffer = GL_FALSE; +GLboolean __WGLEW_ARB_pixel_format = GL_FALSE; +GLboolean __WGLEW_ARB_pixel_format_float = GL_FALSE; +GLboolean __WGLEW_ARB_render_texture = GL_FALSE; +GLboolean __WGLEW_ARB_robustness_application_isolation = GL_FALSE; +GLboolean __WGLEW_ARB_robustness_share_group_isolation = GL_FALSE; +GLboolean __WGLEW_ATI_pixel_format_float = GL_FALSE; +GLboolean __WGLEW_ATI_render_texture_rectangle = GL_FALSE; +GLboolean __WGLEW_EXT_create_context_es2_profile = GL_FALSE; +GLboolean __WGLEW_EXT_create_context_es_profile = GL_FALSE; +GLboolean __WGLEW_EXT_depth_float = GL_FALSE; +GLboolean __WGLEW_EXT_display_color_table = GL_FALSE; +GLboolean __WGLEW_EXT_extensions_string = GL_FALSE; +GLboolean __WGLEW_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean __WGLEW_EXT_make_current_read = GL_FALSE; +GLboolean __WGLEW_EXT_multisample = GL_FALSE; +GLboolean __WGLEW_EXT_pbuffer = GL_FALSE; +GLboolean __WGLEW_EXT_pixel_format = GL_FALSE; +GLboolean __WGLEW_EXT_pixel_format_packed_float = GL_FALSE; +GLboolean __WGLEW_EXT_swap_control = GL_FALSE; +GLboolean __WGLEW_EXT_swap_control_tear = GL_FALSE; +GLboolean __WGLEW_I3D_digital_video_control = GL_FALSE; +GLboolean __WGLEW_I3D_gamma = GL_FALSE; +GLboolean __WGLEW_I3D_genlock = GL_FALSE; +GLboolean __WGLEW_I3D_image_buffer = GL_FALSE; +GLboolean __WGLEW_I3D_swap_frame_lock = GL_FALSE; +GLboolean __WGLEW_I3D_swap_frame_usage = GL_FALSE; +GLboolean __WGLEW_NV_DX_interop = GL_FALSE; +GLboolean __WGLEW_NV_DX_interop2 = GL_FALSE; +GLboolean __WGLEW_NV_copy_image = GL_FALSE; +GLboolean __WGLEW_NV_float_buffer = GL_FALSE; +GLboolean __WGLEW_NV_gpu_affinity = GL_FALSE; +GLboolean __WGLEW_NV_multisample_coverage = GL_FALSE; +GLboolean __WGLEW_NV_present_video = GL_FALSE; +GLboolean __WGLEW_NV_render_depth_texture = GL_FALSE; +GLboolean __WGLEW_NV_render_texture_rectangle = GL_FALSE; +GLboolean __WGLEW_NV_swap_group = GL_FALSE; +GLboolean __WGLEW_NV_vertex_array_range = GL_FALSE; +GLboolean __WGLEW_NV_video_capture = GL_FALSE; +GLboolean __WGLEW_NV_video_output = GL_FALSE; +GLboolean __WGLEW_OML_sync_control = GL_FALSE; + +#endif /* !GLEW_MX */ + +#ifdef WGL_3DFX_multisample + +#endif /* WGL_3DFX_multisample */ + +#ifdef WGL_3DL_stereo_control + +static GLboolean _glewInit_WGL_3DL_stereo_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglSetStereoEmitterState3DL = (PFNWGLSETSTEREOEMITTERSTATE3DLPROC)glewGetProcAddress((const GLubyte*)"wglSetStereoEmitterState3DL")) == NULL) || r; + + return r; +} + +#endif /* WGL_3DL_stereo_control */ + +#ifdef WGL_AMD_gpu_association + +static GLboolean _glewInit_WGL_AMD_gpu_association (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBlitContextFramebufferAMD = (PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC)glewGetProcAddress((const GLubyte*)"wglBlitContextFramebufferAMD")) == NULL) || r; + r = ((wglCreateAssociatedContextAMD = (PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAMD")) == NULL) || r; + r = ((wglCreateAssociatedContextAttribsAMD = (PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAttribsAMD")) == NULL) || r; + r = ((wglDeleteAssociatedContextAMD = (PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglDeleteAssociatedContextAMD")) == NULL) || r; + r = ((wglGetContextGPUIDAMD = (PFNWGLGETCONTEXTGPUIDAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetContextGPUIDAMD")) == NULL) || r; + r = ((wglGetCurrentAssociatedContextAMD = (PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentAssociatedContextAMD")) == NULL) || r; + r = ((wglGetGPUIDsAMD = (PFNWGLGETGPUIDSAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUIDsAMD")) == NULL) || r; + r = ((wglGetGPUInfoAMD = (PFNWGLGETGPUINFOAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUInfoAMD")) == NULL) || r; + r = ((wglMakeAssociatedContextCurrentAMD = (PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)glewGetProcAddress((const GLubyte*)"wglMakeAssociatedContextCurrentAMD")) == NULL) || r; + + return r; +} + +#endif /* WGL_AMD_gpu_association */ + +#ifdef WGL_ARB_buffer_region + +static GLboolean _glewInit_WGL_ARB_buffer_region (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreateBufferRegionARB = (PFNWGLCREATEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateBufferRegionARB")) == NULL) || r; + r = ((wglDeleteBufferRegionARB = (PFNWGLDELETEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglDeleteBufferRegionARB")) == NULL) || r; + r = ((wglRestoreBufferRegionARB = (PFNWGLRESTOREBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglRestoreBufferRegionARB")) == NULL) || r; + r = ((wglSaveBufferRegionARB = (PFNWGLSAVEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglSaveBufferRegionARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_buffer_region */ + +#ifdef WGL_ARB_create_context + +static GLboolean _glewInit_WGL_ARB_create_context (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateContextAttribsARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_create_context */ + +#ifdef WGL_ARB_create_context_profile + +#endif /* WGL_ARB_create_context_profile */ + +#ifdef WGL_ARB_create_context_robustness + +#endif /* WGL_ARB_create_context_robustness */ + +#ifdef WGL_ARB_extensions_string + +static GLboolean _glewInit_WGL_ARB_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_extensions_string */ + +#ifdef WGL_ARB_framebuffer_sRGB + +#endif /* WGL_ARB_framebuffer_sRGB */ + +#ifdef WGL_ARB_make_current_read + +static GLboolean _glewInit_WGL_ARB_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetCurrentReadDCARB = (PFNWGLGETCURRENTREADDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCARB")) == NULL) || r; + r = ((wglMakeContextCurrentARB = (PFNWGLMAKECONTEXTCURRENTARBPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_make_current_read */ + +#ifdef WGL_ARB_multisample + +#endif /* WGL_ARB_multisample */ + +#ifdef WGL_ARB_pbuffer + +static GLboolean _glewInit_WGL_ARB_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferARB")) == NULL) || r; + r = ((wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferARB")) == NULL) || r; + r = ((wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCARB")) == NULL) || r; + r = ((wglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferARB")) == NULL) || r; + r = ((wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_pbuffer */ + +#ifdef WGL_ARB_pixel_format + +static GLboolean _glewInit_WGL_ARB_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatARB")) == NULL) || r; + r = ((wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvARB")) == NULL) || r; + r = ((wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_pixel_format */ + +#ifdef WGL_ARB_pixel_format_float + +#endif /* WGL_ARB_pixel_format_float */ + +#ifdef WGL_ARB_render_texture + +static GLboolean _glewInit_WGL_ARB_render_texture (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindTexImageARB = (PFNWGLBINDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglBindTexImageARB")) == NULL) || r; + r = ((wglReleaseTexImageARB = (PFNWGLRELEASETEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglReleaseTexImageARB")) == NULL) || r; + r = ((wglSetPbufferAttribARB = (PFNWGLSETPBUFFERATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"wglSetPbufferAttribARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_render_texture */ + +#ifdef WGL_ARB_robustness_application_isolation + +#endif /* WGL_ARB_robustness_application_isolation */ + +#ifdef WGL_ARB_robustness_share_group_isolation + +#endif /* WGL_ARB_robustness_share_group_isolation */ + +#ifdef WGL_ATI_pixel_format_float + +#endif /* WGL_ATI_pixel_format_float */ + +#ifdef WGL_ATI_render_texture_rectangle + +#endif /* WGL_ATI_render_texture_rectangle */ + +#ifdef WGL_EXT_create_context_es2_profile + +#endif /* WGL_EXT_create_context_es2_profile */ + +#ifdef WGL_EXT_create_context_es_profile + +#endif /* WGL_EXT_create_context_es_profile */ + +#ifdef WGL_EXT_depth_float + +#endif /* WGL_EXT_depth_float */ + +#ifdef WGL_EXT_display_color_table + +static GLboolean _glewInit_WGL_EXT_display_color_table (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindDisplayColorTableEXT = (PFNWGLBINDDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglBindDisplayColorTableEXT")) == NULL) || r; + r = ((wglCreateDisplayColorTableEXT = (PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglCreateDisplayColorTableEXT")) == NULL) || r; + r = ((wglDestroyDisplayColorTableEXT = (PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyDisplayColorTableEXT")) == NULL) || r; + r = ((wglLoadDisplayColorTableEXT = (PFNWGLLOADDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglLoadDisplayColorTableEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_display_color_table */ + +#ifdef WGL_EXT_extensions_string + +static GLboolean _glewInit_WGL_EXT_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_extensions_string */ + +#ifdef WGL_EXT_framebuffer_sRGB + +#endif /* WGL_EXT_framebuffer_sRGB */ + +#ifdef WGL_EXT_make_current_read + +static GLboolean _glewInit_WGL_EXT_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetCurrentReadDCEXT = (PFNWGLGETCURRENTREADDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCEXT")) == NULL) || r; + r = ((wglMakeContextCurrentEXT = (PFNWGLMAKECONTEXTCURRENTEXTPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_make_current_read */ + +#ifdef WGL_EXT_multisample + +#endif /* WGL_EXT_multisample */ + +#ifdef WGL_EXT_pbuffer + +static GLboolean _glewInit_WGL_EXT_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreatePbufferEXT = (PFNWGLCREATEPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferEXT")) == NULL) || r; + r = ((wglDestroyPbufferEXT = (PFNWGLDESTROYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferEXT")) == NULL) || r; + r = ((wglGetPbufferDCEXT = (PFNWGLGETPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCEXT")) == NULL) || r; + r = ((wglQueryPbufferEXT = (PFNWGLQUERYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferEXT")) == NULL) || r; + r = ((wglReleasePbufferDCEXT = (PFNWGLRELEASEPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_pbuffer */ + +#ifdef WGL_EXT_pixel_format + +static GLboolean _glewInit_WGL_EXT_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglChoosePixelFormatEXT = (PFNWGLCHOOSEPIXELFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatEXT")) == NULL) || r; + r = ((wglGetPixelFormatAttribfvEXT = (PFNWGLGETPIXELFORMATATTRIBFVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvEXT")) == NULL) || r; + r = ((wglGetPixelFormatAttribivEXT = (PFNWGLGETPIXELFORMATATTRIBIVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_pixel_format */ + +#ifdef WGL_EXT_pixel_format_packed_float + +#endif /* WGL_EXT_pixel_format_packed_float */ + +#ifdef WGL_EXT_swap_control + +static GLboolean _glewInit_WGL_EXT_swap_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetSwapIntervalEXT")) == NULL) || r; + r = ((wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglSwapIntervalEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_swap_control */ + +#ifdef WGL_EXT_swap_control_tear + +#endif /* WGL_EXT_swap_control_tear */ + +#ifdef WGL_I3D_digital_video_control + +static GLboolean _glewInit_WGL_I3D_digital_video_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetDigitalVideoParametersI3D = (PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetDigitalVideoParametersI3D")) == NULL) || r; + r = ((wglSetDigitalVideoParametersI3D = (PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetDigitalVideoParametersI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_digital_video_control */ + +#ifdef WGL_I3D_gamma + +static GLboolean _glewInit_WGL_I3D_gamma (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetGammaTableI3D = (PFNWGLGETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableI3D")) == NULL) || r; + r = ((wglGetGammaTableParametersI3D = (PFNWGLGETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableParametersI3D")) == NULL) || r; + r = ((wglSetGammaTableI3D = (PFNWGLSETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableI3D")) == NULL) || r; + r = ((wglSetGammaTableParametersI3D = (PFNWGLSETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableParametersI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_gamma */ + +#ifdef WGL_I3D_genlock + +static GLboolean _glewInit_WGL_I3D_genlock (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglDisableGenlockI3D = (PFNWGLDISABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableGenlockI3D")) == NULL) || r; + r = ((wglEnableGenlockI3D = (PFNWGLENABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableGenlockI3D")) == NULL) || r; + r = ((wglGenlockSampleRateI3D = (PFNWGLGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSampleRateI3D")) == NULL) || r; + r = ((wglGenlockSourceDelayI3D = (PFNWGLGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceDelayI3D")) == NULL) || r; + r = ((wglGenlockSourceEdgeI3D = (PFNWGLGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceEdgeI3D")) == NULL) || r; + r = ((wglGenlockSourceI3D = (PFNWGLGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceI3D")) == NULL) || r; + r = ((wglGetGenlockSampleRateI3D = (PFNWGLGETGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSampleRateI3D")) == NULL) || r; + r = ((wglGetGenlockSourceDelayI3D = (PFNWGLGETGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceDelayI3D")) == NULL) || r; + r = ((wglGetGenlockSourceEdgeI3D = (PFNWGLGETGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceEdgeI3D")) == NULL) || r; + r = ((wglGetGenlockSourceI3D = (PFNWGLGETGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceI3D")) == NULL) || r; + r = ((wglIsEnabledGenlockI3D = (PFNWGLISENABLEDGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledGenlockI3D")) == NULL) || r; + r = ((wglQueryGenlockMaxSourceDelayI3D = (PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryGenlockMaxSourceDelayI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_genlock */ + +#ifdef WGL_I3D_image_buffer + +static GLboolean _glewInit_WGL_I3D_image_buffer (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglAssociateImageBufferEventsI3D = (PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglAssociateImageBufferEventsI3D")) == NULL) || r; + r = ((wglCreateImageBufferI3D = (PFNWGLCREATEIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglCreateImageBufferI3D")) == NULL) || r; + r = ((wglDestroyImageBufferI3D = (PFNWGLDESTROYIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglDestroyImageBufferI3D")) == NULL) || r; + r = ((wglReleaseImageBufferEventsI3D = (PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglReleaseImageBufferEventsI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_image_buffer */ + +#ifdef WGL_I3D_swap_frame_lock + +static GLboolean _glewInit_WGL_I3D_swap_frame_lock (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglDisableFrameLockI3D = (PFNWGLDISABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableFrameLockI3D")) == NULL) || r; + r = ((wglEnableFrameLockI3D = (PFNWGLENABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableFrameLockI3D")) == NULL) || r; + r = ((wglIsEnabledFrameLockI3D = (PFNWGLISENABLEDFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledFrameLockI3D")) == NULL) || r; + r = ((wglQueryFrameLockMasterI3D = (PFNWGLQUERYFRAMELOCKMASTERI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameLockMasterI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_swap_frame_lock */ + +#ifdef WGL_I3D_swap_frame_usage + +static GLboolean _glewInit_WGL_I3D_swap_frame_usage (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBeginFrameTrackingI3D = (PFNWGLBEGINFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglBeginFrameTrackingI3D")) == NULL) || r; + r = ((wglEndFrameTrackingI3D = (PFNWGLENDFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglEndFrameTrackingI3D")) == NULL) || r; + r = ((wglGetFrameUsageI3D = (PFNWGLGETFRAMEUSAGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetFrameUsageI3D")) == NULL) || r; + r = ((wglQueryFrameTrackingI3D = (PFNWGLQUERYFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameTrackingI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_swap_frame_usage */ + +#ifdef WGL_NV_DX_interop + +static GLboolean _glewInit_WGL_NV_DX_interop (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglDXCloseDeviceNV = (PFNWGLDXCLOSEDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXCloseDeviceNV")) == NULL) || r; + r = ((wglDXLockObjectsNV = (PFNWGLDXLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXLockObjectsNV")) == NULL) || r; + r = ((wglDXObjectAccessNV = (PFNWGLDXOBJECTACCESSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXObjectAccessNV")) == NULL) || r; + r = ((wglDXOpenDeviceNV = (PFNWGLDXOPENDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXOpenDeviceNV")) == NULL) || r; + r = ((wglDXRegisterObjectNV = (PFNWGLDXREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXRegisterObjectNV")) == NULL) || r; + r = ((wglDXSetResourceShareHandleNV = (PFNWGLDXSETRESOURCESHAREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"wglDXSetResourceShareHandleNV")) == NULL) || r; + r = ((wglDXUnlockObjectsNV = (PFNWGLDXUNLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnlockObjectsNV")) == NULL) || r; + r = ((wglDXUnregisterObjectNV = (PFNWGLDXUNREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnregisterObjectNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_DX_interop */ + +#ifdef WGL_NV_DX_interop2 + +#endif /* WGL_NV_DX_interop2 */ + +#ifdef WGL_NV_copy_image + +static GLboolean _glewInit_WGL_NV_copy_image (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCopyImageSubDataNV = (PFNWGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"wglCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_copy_image */ + +#ifdef WGL_NV_float_buffer + +#endif /* WGL_NV_float_buffer */ + +#ifdef WGL_NV_gpu_affinity + +static GLboolean _glewInit_WGL_NV_gpu_affinity (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreateAffinityDCNV = (PFNWGLCREATEAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglCreateAffinityDCNV")) == NULL) || r; + r = ((wglDeleteDCNV = (PFNWGLDELETEDCNVPROC)glewGetProcAddress((const GLubyte*)"wglDeleteDCNV")) == NULL) || r; + r = ((wglEnumGpuDevicesNV = (PFNWGLENUMGPUDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpuDevicesNV")) == NULL) || r; + r = ((wglEnumGpusFromAffinityDCNV = (PFNWGLENUMGPUSFROMAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusFromAffinityDCNV")) == NULL) || r; + r = ((wglEnumGpusNV = (PFNWGLENUMGPUSNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_gpu_affinity */ + +#ifdef WGL_NV_multisample_coverage + +#endif /* WGL_NV_multisample_coverage */ + +#ifdef WGL_NV_present_video + +static GLboolean _glewInit_WGL_NV_present_video (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindVideoDeviceNV = (PFNWGLBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoDeviceNV")) == NULL) || r; + r = ((wglEnumerateVideoDevicesNV = (PFNWGLENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoDevicesNV")) == NULL) || r; + r = ((wglQueryCurrentContextNV = (PFNWGLQUERYCURRENTCONTEXTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryCurrentContextNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_present_video */ + +#ifdef WGL_NV_render_depth_texture + +#endif /* WGL_NV_render_depth_texture */ + +#ifdef WGL_NV_render_texture_rectangle + +#endif /* WGL_NV_render_texture_rectangle */ + +#ifdef WGL_NV_swap_group + +static GLboolean _glewInit_WGL_NV_swap_group (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindSwapBarrierNV = (PFNWGLBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"wglBindSwapBarrierNV")) == NULL) || r; + r = ((wglJoinSwapGroupNV = (PFNWGLJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglJoinSwapGroupNV")) == NULL) || r; + r = ((wglQueryFrameCountNV = (PFNWGLQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameCountNV")) == NULL) || r; + r = ((wglQueryMaxSwapGroupsNV = (PFNWGLQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryMaxSwapGroupsNV")) == NULL) || r; + r = ((wglQuerySwapGroupNV = (PFNWGLQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglQuerySwapGroupNV")) == NULL) || r; + r = ((wglResetFrameCountNV = (PFNWGLRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglResetFrameCountNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_swap_group */ + +#ifdef WGL_NV_vertex_array_range + +static GLboolean _glewInit_WGL_NV_vertex_array_range (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglAllocateMemoryNV = (PFNWGLALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglAllocateMemoryNV")) == NULL) || r; + r = ((wglFreeMemoryNV = (PFNWGLFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglFreeMemoryNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_vertex_array_range */ + +#ifdef WGL_NV_video_capture + +static GLboolean _glewInit_WGL_NV_video_capture (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindVideoCaptureDeviceNV = (PFNWGLBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoCaptureDeviceNV")) == NULL) || r; + r = ((wglEnumerateVideoCaptureDevicesNV = (PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoCaptureDevicesNV")) == NULL) || r; + r = ((wglLockVideoCaptureDeviceNV = (PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglLockVideoCaptureDeviceNV")) == NULL) || r; + r = ((wglQueryVideoCaptureDeviceNV = (PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglQueryVideoCaptureDeviceNV")) == NULL) || r; + r = ((wglReleaseVideoCaptureDeviceNV = (PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoCaptureDeviceNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_video_capture */ + +#ifdef WGL_NV_video_output + +static GLboolean _glewInit_WGL_NV_video_output (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindVideoImageNV = (PFNWGLBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoImageNV")) == NULL) || r; + r = ((wglGetVideoDeviceNV = (PFNWGLGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoDeviceNV")) == NULL) || r; + r = ((wglGetVideoInfoNV = (PFNWGLGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoInfoNV")) == NULL) || r; + r = ((wglReleaseVideoDeviceNV = (PFNWGLRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoDeviceNV")) == NULL) || r; + r = ((wglReleaseVideoImageNV = (PFNWGLRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoImageNV")) == NULL) || r; + r = ((wglSendPbufferToVideoNV = (PFNWGLSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"wglSendPbufferToVideoNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_video_output */ + +#ifdef WGL_OML_sync_control + +static GLboolean _glewInit_WGL_OML_sync_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetMscRateOML = (PFNWGLGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetMscRateOML")) == NULL) || r; + r = ((wglGetSyncValuesOML = (PFNWGLGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetSyncValuesOML")) == NULL) || r; + r = ((wglSwapBuffersMscOML = (PFNWGLSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapBuffersMscOML")) == NULL) || r; + r = ((wglSwapLayerBuffersMscOML = (PFNWGLSWAPLAYERBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapLayerBuffersMscOML")) == NULL) || r; + r = ((wglWaitForMscOML = (PFNWGLWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForMscOML")) == NULL) || r; + r = ((wglWaitForSbcOML = (PFNWGLWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForSbcOML")) == NULL) || r; + + return r; +} + +#endif /* WGL_OML_sync_control */ + +/* ------------------------------------------------------------------------- */ + +static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL; +static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL; + +GLboolean GLEWAPIENTRY wglewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + if (_wglewGetExtensionsStringARB == NULL) + if (_wglewGetExtensionsStringEXT == NULL) + return GL_FALSE; + else + start = (const GLubyte*)_wglewGetExtensionsStringEXT(); + else + start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); + if (start == 0) + return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +GLenum GLEWAPIENTRY wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST) +{ + GLboolean crippled; + const GLubyte* extStart; + const GLubyte* extEnd; + /* find wgl extension string query functions */ + _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB"); + _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT"); + /* query wgl extension string */ + if (_wglewGetExtensionsStringARB == NULL) + if (_wglewGetExtensionsStringEXT == NULL) + extStart = (const GLubyte*)""; + else + extStart = (const GLubyte*)_wglewGetExtensionsStringEXT(); + else + extStart = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); + extEnd = extStart + _glewStrLen(extStart); + /* initialize extensions */ + crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL; +#ifdef WGL_3DFX_multisample + CONST_CAST(WGLEW_3DFX_multisample) = _glewSearchExtension("WGL_3DFX_multisample", extStart, extEnd); +#endif /* WGL_3DFX_multisample */ +#ifdef WGL_3DL_stereo_control + CONST_CAST(WGLEW_3DL_stereo_control) = _glewSearchExtension("WGL_3DL_stereo_control", extStart, extEnd); + if (glewExperimental || WGLEW_3DL_stereo_control|| crippled) CONST_CAST(WGLEW_3DL_stereo_control)= !_glewInit_WGL_3DL_stereo_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_3DL_stereo_control */ +#ifdef WGL_AMD_gpu_association + CONST_CAST(WGLEW_AMD_gpu_association) = _glewSearchExtension("WGL_AMD_gpu_association", extStart, extEnd); + if (glewExperimental || WGLEW_AMD_gpu_association|| crippled) CONST_CAST(WGLEW_AMD_gpu_association)= !_glewInit_WGL_AMD_gpu_association(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_AMD_gpu_association */ +#ifdef WGL_ARB_buffer_region + CONST_CAST(WGLEW_ARB_buffer_region) = _glewSearchExtension("WGL_ARB_buffer_region", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_buffer_region|| crippled) CONST_CAST(WGLEW_ARB_buffer_region)= !_glewInit_WGL_ARB_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_buffer_region */ +#ifdef WGL_ARB_create_context + CONST_CAST(WGLEW_ARB_create_context) = _glewSearchExtension("WGL_ARB_create_context", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_create_context|| crippled) CONST_CAST(WGLEW_ARB_create_context)= !_glewInit_WGL_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_create_context */ +#ifdef WGL_ARB_create_context_profile + CONST_CAST(WGLEW_ARB_create_context_profile) = _glewSearchExtension("WGL_ARB_create_context_profile", extStart, extEnd); +#endif /* WGL_ARB_create_context_profile */ +#ifdef WGL_ARB_create_context_robustness + CONST_CAST(WGLEW_ARB_create_context_robustness) = _glewSearchExtension("WGL_ARB_create_context_robustness", extStart, extEnd); +#endif /* WGL_ARB_create_context_robustness */ +#ifdef WGL_ARB_extensions_string + CONST_CAST(WGLEW_ARB_extensions_string) = _glewSearchExtension("WGL_ARB_extensions_string", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_extensions_string|| crippled) CONST_CAST(WGLEW_ARB_extensions_string)= !_glewInit_WGL_ARB_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_extensions_string */ +#ifdef WGL_ARB_framebuffer_sRGB + CONST_CAST(WGLEW_ARB_framebuffer_sRGB) = _glewSearchExtension("WGL_ARB_framebuffer_sRGB", extStart, extEnd); +#endif /* WGL_ARB_framebuffer_sRGB */ +#ifdef WGL_ARB_make_current_read + CONST_CAST(WGLEW_ARB_make_current_read) = _glewSearchExtension("WGL_ARB_make_current_read", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_make_current_read|| crippled) CONST_CAST(WGLEW_ARB_make_current_read)= !_glewInit_WGL_ARB_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_make_current_read */ +#ifdef WGL_ARB_multisample + CONST_CAST(WGLEW_ARB_multisample) = _glewSearchExtension("WGL_ARB_multisample", extStart, extEnd); +#endif /* WGL_ARB_multisample */ +#ifdef WGL_ARB_pbuffer + CONST_CAST(WGLEW_ARB_pbuffer) = _glewSearchExtension("WGL_ARB_pbuffer", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_pbuffer|| crippled) CONST_CAST(WGLEW_ARB_pbuffer)= !_glewInit_WGL_ARB_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_pbuffer */ +#ifdef WGL_ARB_pixel_format + CONST_CAST(WGLEW_ARB_pixel_format) = _glewSearchExtension("WGL_ARB_pixel_format", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_pixel_format|| crippled) CONST_CAST(WGLEW_ARB_pixel_format)= !_glewInit_WGL_ARB_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_pixel_format */ +#ifdef WGL_ARB_pixel_format_float + CONST_CAST(WGLEW_ARB_pixel_format_float) = _glewSearchExtension("WGL_ARB_pixel_format_float", extStart, extEnd); +#endif /* WGL_ARB_pixel_format_float */ +#ifdef WGL_ARB_render_texture + CONST_CAST(WGLEW_ARB_render_texture) = _glewSearchExtension("WGL_ARB_render_texture", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_render_texture|| crippled) CONST_CAST(WGLEW_ARB_render_texture)= !_glewInit_WGL_ARB_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_render_texture */ +#ifdef WGL_ARB_robustness_application_isolation + CONST_CAST(WGLEW_ARB_robustness_application_isolation) = _glewSearchExtension("WGL_ARB_robustness_application_isolation", extStart, extEnd); +#endif /* WGL_ARB_robustness_application_isolation */ +#ifdef WGL_ARB_robustness_share_group_isolation + CONST_CAST(WGLEW_ARB_robustness_share_group_isolation) = _glewSearchExtension("WGL_ARB_robustness_share_group_isolation", extStart, extEnd); +#endif /* WGL_ARB_robustness_share_group_isolation */ +#ifdef WGL_ATI_pixel_format_float + CONST_CAST(WGLEW_ATI_pixel_format_float) = _glewSearchExtension("WGL_ATI_pixel_format_float", extStart, extEnd); +#endif /* WGL_ATI_pixel_format_float */ +#ifdef WGL_ATI_render_texture_rectangle + CONST_CAST(WGLEW_ATI_render_texture_rectangle) = _glewSearchExtension("WGL_ATI_render_texture_rectangle", extStart, extEnd); +#endif /* WGL_ATI_render_texture_rectangle */ +#ifdef WGL_EXT_create_context_es2_profile + CONST_CAST(WGLEW_EXT_create_context_es2_profile) = _glewSearchExtension("WGL_EXT_create_context_es2_profile", extStart, extEnd); +#endif /* WGL_EXT_create_context_es2_profile */ +#ifdef WGL_EXT_create_context_es_profile + CONST_CAST(WGLEW_EXT_create_context_es_profile) = _glewSearchExtension("WGL_EXT_create_context_es_profile", extStart, extEnd); +#endif /* WGL_EXT_create_context_es_profile */ +#ifdef WGL_EXT_depth_float + CONST_CAST(WGLEW_EXT_depth_float) = _glewSearchExtension("WGL_EXT_depth_float", extStart, extEnd); +#endif /* WGL_EXT_depth_float */ +#ifdef WGL_EXT_display_color_table + CONST_CAST(WGLEW_EXT_display_color_table) = _glewSearchExtension("WGL_EXT_display_color_table", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_display_color_table|| crippled) CONST_CAST(WGLEW_EXT_display_color_table)= !_glewInit_WGL_EXT_display_color_table(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_display_color_table */ +#ifdef WGL_EXT_extensions_string + CONST_CAST(WGLEW_EXT_extensions_string) = _glewSearchExtension("WGL_EXT_extensions_string", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_extensions_string|| crippled) CONST_CAST(WGLEW_EXT_extensions_string)= !_glewInit_WGL_EXT_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_extensions_string */ +#ifdef WGL_EXT_framebuffer_sRGB + CONST_CAST(WGLEW_EXT_framebuffer_sRGB) = _glewSearchExtension("WGL_EXT_framebuffer_sRGB", extStart, extEnd); +#endif /* WGL_EXT_framebuffer_sRGB */ +#ifdef WGL_EXT_make_current_read + CONST_CAST(WGLEW_EXT_make_current_read) = _glewSearchExtension("WGL_EXT_make_current_read", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_make_current_read|| crippled) CONST_CAST(WGLEW_EXT_make_current_read)= !_glewInit_WGL_EXT_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_make_current_read */ +#ifdef WGL_EXT_multisample + CONST_CAST(WGLEW_EXT_multisample) = _glewSearchExtension("WGL_EXT_multisample", extStart, extEnd); +#endif /* WGL_EXT_multisample */ +#ifdef WGL_EXT_pbuffer + CONST_CAST(WGLEW_EXT_pbuffer) = _glewSearchExtension("WGL_EXT_pbuffer", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_pbuffer|| crippled) CONST_CAST(WGLEW_EXT_pbuffer)= !_glewInit_WGL_EXT_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_pbuffer */ +#ifdef WGL_EXT_pixel_format + CONST_CAST(WGLEW_EXT_pixel_format) = _glewSearchExtension("WGL_EXT_pixel_format", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_pixel_format|| crippled) CONST_CAST(WGLEW_EXT_pixel_format)= !_glewInit_WGL_EXT_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_pixel_format */ +#ifdef WGL_EXT_pixel_format_packed_float + CONST_CAST(WGLEW_EXT_pixel_format_packed_float) = _glewSearchExtension("WGL_EXT_pixel_format_packed_float", extStart, extEnd); +#endif /* WGL_EXT_pixel_format_packed_float */ +#ifdef WGL_EXT_swap_control + CONST_CAST(WGLEW_EXT_swap_control) = _glewSearchExtension("WGL_EXT_swap_control", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_swap_control|| crippled) CONST_CAST(WGLEW_EXT_swap_control)= !_glewInit_WGL_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_swap_control */ +#ifdef WGL_EXT_swap_control_tear + CONST_CAST(WGLEW_EXT_swap_control_tear) = _glewSearchExtension("WGL_EXT_swap_control_tear", extStart, extEnd); +#endif /* WGL_EXT_swap_control_tear */ +#ifdef WGL_I3D_digital_video_control + CONST_CAST(WGLEW_I3D_digital_video_control) = _glewSearchExtension("WGL_I3D_digital_video_control", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_digital_video_control|| crippled) CONST_CAST(WGLEW_I3D_digital_video_control)= !_glewInit_WGL_I3D_digital_video_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_digital_video_control */ +#ifdef WGL_I3D_gamma + CONST_CAST(WGLEW_I3D_gamma) = _glewSearchExtension("WGL_I3D_gamma", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_gamma|| crippled) CONST_CAST(WGLEW_I3D_gamma)= !_glewInit_WGL_I3D_gamma(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_gamma */ +#ifdef WGL_I3D_genlock + CONST_CAST(WGLEW_I3D_genlock) = _glewSearchExtension("WGL_I3D_genlock", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_genlock|| crippled) CONST_CAST(WGLEW_I3D_genlock)= !_glewInit_WGL_I3D_genlock(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_genlock */ +#ifdef WGL_I3D_image_buffer + CONST_CAST(WGLEW_I3D_image_buffer) = _glewSearchExtension("WGL_I3D_image_buffer", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_image_buffer|| crippled) CONST_CAST(WGLEW_I3D_image_buffer)= !_glewInit_WGL_I3D_image_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_image_buffer */ +#ifdef WGL_I3D_swap_frame_lock + CONST_CAST(WGLEW_I3D_swap_frame_lock) = _glewSearchExtension("WGL_I3D_swap_frame_lock", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_swap_frame_lock|| crippled) CONST_CAST(WGLEW_I3D_swap_frame_lock)= !_glewInit_WGL_I3D_swap_frame_lock(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_swap_frame_lock */ +#ifdef WGL_I3D_swap_frame_usage + CONST_CAST(WGLEW_I3D_swap_frame_usage) = _glewSearchExtension("WGL_I3D_swap_frame_usage", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_swap_frame_usage|| crippled) CONST_CAST(WGLEW_I3D_swap_frame_usage)= !_glewInit_WGL_I3D_swap_frame_usage(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_swap_frame_usage */ +#ifdef WGL_NV_DX_interop + CONST_CAST(WGLEW_NV_DX_interop) = _glewSearchExtension("WGL_NV_DX_interop", extStart, extEnd); + if (glewExperimental || WGLEW_NV_DX_interop|| crippled) CONST_CAST(WGLEW_NV_DX_interop)= !_glewInit_WGL_NV_DX_interop(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_DX_interop */ +#ifdef WGL_NV_DX_interop2 + CONST_CAST(WGLEW_NV_DX_interop2) = _glewSearchExtension("WGL_NV_DX_interop2", extStart, extEnd); +#endif /* WGL_NV_DX_interop2 */ +#ifdef WGL_NV_copy_image + CONST_CAST(WGLEW_NV_copy_image) = _glewSearchExtension("WGL_NV_copy_image", extStart, extEnd); + if (glewExperimental || WGLEW_NV_copy_image|| crippled) CONST_CAST(WGLEW_NV_copy_image)= !_glewInit_WGL_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_copy_image */ +#ifdef WGL_NV_float_buffer + CONST_CAST(WGLEW_NV_float_buffer) = _glewSearchExtension("WGL_NV_float_buffer", extStart, extEnd); +#endif /* WGL_NV_float_buffer */ +#ifdef WGL_NV_gpu_affinity + CONST_CAST(WGLEW_NV_gpu_affinity) = _glewSearchExtension("WGL_NV_gpu_affinity", extStart, extEnd); + if (glewExperimental || WGLEW_NV_gpu_affinity|| crippled) CONST_CAST(WGLEW_NV_gpu_affinity)= !_glewInit_WGL_NV_gpu_affinity(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_gpu_affinity */ +#ifdef WGL_NV_multisample_coverage + CONST_CAST(WGLEW_NV_multisample_coverage) = _glewSearchExtension("WGL_NV_multisample_coverage", extStart, extEnd); +#endif /* WGL_NV_multisample_coverage */ +#ifdef WGL_NV_present_video + CONST_CAST(WGLEW_NV_present_video) = _glewSearchExtension("WGL_NV_present_video", extStart, extEnd); + if (glewExperimental || WGLEW_NV_present_video|| crippled) CONST_CAST(WGLEW_NV_present_video)= !_glewInit_WGL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_present_video */ +#ifdef WGL_NV_render_depth_texture + CONST_CAST(WGLEW_NV_render_depth_texture) = _glewSearchExtension("WGL_NV_render_depth_texture", extStart, extEnd); +#endif /* WGL_NV_render_depth_texture */ +#ifdef WGL_NV_render_texture_rectangle + CONST_CAST(WGLEW_NV_render_texture_rectangle) = _glewSearchExtension("WGL_NV_render_texture_rectangle", extStart, extEnd); +#endif /* WGL_NV_render_texture_rectangle */ +#ifdef WGL_NV_swap_group + CONST_CAST(WGLEW_NV_swap_group) = _glewSearchExtension("WGL_NV_swap_group", extStart, extEnd); + if (glewExperimental || WGLEW_NV_swap_group|| crippled) CONST_CAST(WGLEW_NV_swap_group)= !_glewInit_WGL_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_swap_group */ +#ifdef WGL_NV_vertex_array_range + CONST_CAST(WGLEW_NV_vertex_array_range) = _glewSearchExtension("WGL_NV_vertex_array_range", extStart, extEnd); + if (glewExperimental || WGLEW_NV_vertex_array_range|| crippled) CONST_CAST(WGLEW_NV_vertex_array_range)= !_glewInit_WGL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_vertex_array_range */ +#ifdef WGL_NV_video_capture + CONST_CAST(WGLEW_NV_video_capture) = _glewSearchExtension("WGL_NV_video_capture", extStart, extEnd); + if (glewExperimental || WGLEW_NV_video_capture|| crippled) CONST_CAST(WGLEW_NV_video_capture)= !_glewInit_WGL_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_video_capture */ +#ifdef WGL_NV_video_output + CONST_CAST(WGLEW_NV_video_output) = _glewSearchExtension("WGL_NV_video_output", extStart, extEnd); + if (glewExperimental || WGLEW_NV_video_output|| crippled) CONST_CAST(WGLEW_NV_video_output)= !_glewInit_WGL_NV_video_output(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_video_output */ +#ifdef WGL_OML_sync_control + CONST_CAST(WGLEW_OML_sync_control) = _glewSearchExtension("WGL_OML_sync_control", extStart, extEnd); + if (glewExperimental || WGLEW_OML_sync_control|| crippled) CONST_CAST(WGLEW_OML_sync_control)= !_glewInit_WGL_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_OML_sync_control */ + + return GLEW_OK; +} + +#elif !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) + +PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay = NULL; + +PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig = NULL; +PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext = NULL; +PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer = NULL; +PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap = NULL; +PFNGLXCREATEWINDOWPROC __glewXCreateWindow = NULL; +PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer = NULL; +PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap = NULL; +PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow = NULL; +PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable = NULL; +PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib = NULL; +PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs = NULL; +PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent = NULL; +PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig = NULL; +PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent = NULL; +PFNGLXQUERYCONTEXTPROC __glewXQueryContext = NULL; +PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable = NULL; +PFNGLXSELECTEVENTPROC __glewXSelectEvent = NULL; + +PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC __glewXBlitContextFramebufferAMD = NULL; +PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC __glewXCreateAssociatedContextAMD = NULL; +PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __glewXCreateAssociatedContextAttribsAMD = NULL; +PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC __glewXDeleteAssociatedContextAMD = NULL; +PFNGLXGETCONTEXTGPUIDAMDPROC __glewXGetContextGPUIDAMD = NULL; +PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC __glewXGetCurrentAssociatedContextAMD = NULL; +PFNGLXGETGPUIDSAMDPROC __glewXGetGPUIDsAMD = NULL; +PFNGLXGETGPUINFOAMDPROC __glewXGetGPUInfoAMD = NULL; +PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __glewXMakeAssociatedContextCurrentAMD = NULL; + +PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB = NULL; + +PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI = NULL; +PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI = NULL; +PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI = NULL; + +PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT = NULL; +PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT = NULL; +PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT = NULL; +PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT = NULL; + +PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT = NULL; + +PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT = NULL; +PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT = NULL; + +PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA = NULL; + +PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA = NULL; + +PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA = NULL; + +PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA = NULL; + +PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA = NULL; + +PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA = NULL; +PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA = NULL; + +PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV = NULL; + +PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV = NULL; +PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV = NULL; + +PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV = NULL; +PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV = NULL; +PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV = NULL; +PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV = NULL; +PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV = NULL; +PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV = NULL; + +PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV = NULL; +PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV = NULL; + +PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV = NULL; +PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV = NULL; +PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV = NULL; +PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV = NULL; +PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV = NULL; + +PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV = NULL; +PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV = NULL; +PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV = NULL; +PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV = NULL; +PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV = NULL; +PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV = NULL; + +PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML = NULL; +PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML = NULL; +PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML = NULL; +PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML = NULL; +PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML = NULL; + +PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX = NULL; +PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX = NULL; +PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX = NULL; +PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX = NULL; +PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX = NULL; +PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX = NULL; + +PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX = NULL; +PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX = NULL; +PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX = NULL; +PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX = NULL; +PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX = NULL; +PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX = NULL; +PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX = NULL; +PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX = NULL; + +PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX = NULL; +PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX = NULL; +PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX = NULL; +PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX = NULL; +PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX = NULL; + +PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX = NULL; +PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX = NULL; + +PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX = NULL; + +PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX = NULL; +PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX = NULL; +PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX = NULL; +PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX = NULL; +PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX = NULL; + +PFNGLXCUSHIONSGIPROC __glewXCushionSGI = NULL; + +PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI = NULL; +PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI = NULL; + +PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI = NULL; + +PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI = NULL; +PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI = NULL; + +PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN = NULL; + +PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN = NULL; +PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN = NULL; + +#if !defined(GLEW_MX) + +GLboolean __GLXEW_VERSION_1_0 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_1 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_2 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_3 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_4 = GL_FALSE; +GLboolean __GLXEW_3DFX_multisample = GL_FALSE; +GLboolean __GLXEW_AMD_gpu_association = GL_FALSE; +GLboolean __GLXEW_ARB_create_context = GL_FALSE; +GLboolean __GLXEW_ARB_create_context_profile = GL_FALSE; +GLboolean __GLXEW_ARB_create_context_robustness = GL_FALSE; +GLboolean __GLXEW_ARB_fbconfig_float = GL_FALSE; +GLboolean __GLXEW_ARB_framebuffer_sRGB = GL_FALSE; +GLboolean __GLXEW_ARB_get_proc_address = GL_FALSE; +GLboolean __GLXEW_ARB_multisample = GL_FALSE; +GLboolean __GLXEW_ARB_robustness_application_isolation = GL_FALSE; +GLboolean __GLXEW_ARB_robustness_share_group_isolation = GL_FALSE; +GLboolean __GLXEW_ARB_vertex_buffer_object = GL_FALSE; +GLboolean __GLXEW_ATI_pixel_format_float = GL_FALSE; +GLboolean __GLXEW_ATI_render_texture = GL_FALSE; +GLboolean __GLXEW_EXT_buffer_age = GL_FALSE; +GLboolean __GLXEW_EXT_create_context_es2_profile = GL_FALSE; +GLboolean __GLXEW_EXT_create_context_es_profile = GL_FALSE; +GLboolean __GLXEW_EXT_fbconfig_packed_float = GL_FALSE; +GLboolean __GLXEW_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean __GLXEW_EXT_import_context = GL_FALSE; +GLboolean __GLXEW_EXT_scene_marker = GL_FALSE; +GLboolean __GLXEW_EXT_swap_control = GL_FALSE; +GLboolean __GLXEW_EXT_swap_control_tear = GL_FALSE; +GLboolean __GLXEW_EXT_texture_from_pixmap = GL_FALSE; +GLboolean __GLXEW_EXT_visual_info = GL_FALSE; +GLboolean __GLXEW_EXT_visual_rating = GL_FALSE; +GLboolean __GLXEW_INTEL_swap_event = GL_FALSE; +GLboolean __GLXEW_MESA_agp_offset = GL_FALSE; +GLboolean __GLXEW_MESA_copy_sub_buffer = GL_FALSE; +GLboolean __GLXEW_MESA_pixmap_colormap = GL_FALSE; +GLboolean __GLXEW_MESA_release_buffers = GL_FALSE; +GLboolean __GLXEW_MESA_set_3dfx_mode = GL_FALSE; +GLboolean __GLXEW_MESA_swap_control = GL_FALSE; +GLboolean __GLXEW_NV_copy_image = GL_FALSE; +GLboolean __GLXEW_NV_float_buffer = GL_FALSE; +GLboolean __GLXEW_NV_multisample_coverage = GL_FALSE; +GLboolean __GLXEW_NV_present_video = GL_FALSE; +GLboolean __GLXEW_NV_swap_group = GL_FALSE; +GLboolean __GLXEW_NV_vertex_array_range = GL_FALSE; +GLboolean __GLXEW_NV_video_capture = GL_FALSE; +GLboolean __GLXEW_NV_video_output = GL_FALSE; +GLboolean __GLXEW_OML_swap_method = GL_FALSE; +GLboolean __GLXEW_OML_sync_control = GL_FALSE; +GLboolean __GLXEW_SGIS_blended_overlay = GL_FALSE; +GLboolean __GLXEW_SGIS_color_range = GL_FALSE; +GLboolean __GLXEW_SGIS_multisample = GL_FALSE; +GLboolean __GLXEW_SGIS_shared_multisample = GL_FALSE; +GLboolean __GLXEW_SGIX_fbconfig = GL_FALSE; +GLboolean __GLXEW_SGIX_hyperpipe = GL_FALSE; +GLboolean __GLXEW_SGIX_pbuffer = GL_FALSE; +GLboolean __GLXEW_SGIX_swap_barrier = GL_FALSE; +GLboolean __GLXEW_SGIX_swap_group = GL_FALSE; +GLboolean __GLXEW_SGIX_video_resize = GL_FALSE; +GLboolean __GLXEW_SGIX_visual_select_group = GL_FALSE; +GLboolean __GLXEW_SGI_cushion = GL_FALSE; +GLboolean __GLXEW_SGI_make_current_read = GL_FALSE; +GLboolean __GLXEW_SGI_swap_control = GL_FALSE; +GLboolean __GLXEW_SGI_video_sync = GL_FALSE; +GLboolean __GLXEW_SUN_get_transparent_index = GL_FALSE; +GLboolean __GLXEW_SUN_video_resize = GL_FALSE; + +#endif /* !GLEW_MX */ + +#ifdef GLX_VERSION_1_2 + +static GLboolean _glewInit_GLX_VERSION_1_2 (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentDisplay")) == NULL) || r; + + return r; +} + +#endif /* GLX_VERSION_1_2 */ + +#ifdef GLX_VERSION_1_3 + +static GLboolean _glewInit_GLX_VERSION_1_3 (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfig")) == NULL) || r; + r = ((glXCreateNewContext = (PFNGLXCREATENEWCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXCreateNewContext")) == NULL) || r; + r = ((glXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXCreatePbuffer")) == NULL) || r; + r = ((glXCreatePixmap = (PFNGLXCREATEPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXCreatePixmap")) == NULL) || r; + r = ((glXCreateWindow = (PFNGLXCREATEWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXCreateWindow")) == NULL) || r; + r = ((glXDestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPbuffer")) == NULL) || r; + r = ((glXDestroyPixmap = (PFNGLXDESTROYPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPixmap")) == NULL) || r; + r = ((glXDestroyWindow = (PFNGLXDESTROYWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXDestroyWindow")) == NULL) || r; + r = ((glXGetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawable")) == NULL) || r; + r = ((glXGetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttrib")) == NULL) || r; + r = ((glXGetFBConfigs = (PFNGLXGETFBCONFIGSPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigs")) == NULL) || r; + r = ((glXGetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEvent")) == NULL) || r; + r = ((glXGetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfig")) == NULL) || r; + r = ((glXMakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC)glewGetProcAddress((const GLubyte*)"glXMakeContextCurrent")) == NULL) || r; + r = ((glXQueryContext = (PFNGLXQUERYCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContext")) == NULL) || r; + r = ((glXQueryDrawable = (PFNGLXQUERYDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXQueryDrawable")) == NULL) || r; + r = ((glXSelectEvent = (PFNGLXSELECTEVENTPROC)glewGetProcAddress((const GLubyte*)"glXSelectEvent")) == NULL) || r; + + return r; +} + +#endif /* GLX_VERSION_1_3 */ + +#ifdef GLX_VERSION_1_4 + +#endif /* GLX_VERSION_1_4 */ + +#ifdef GLX_3DFX_multisample + +#endif /* GLX_3DFX_multisample */ + +#ifdef GLX_AMD_gpu_association + +static GLboolean _glewInit_GLX_AMD_gpu_association (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBlitContextFramebufferAMD = (PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC)glewGetProcAddress((const GLubyte*)"glXBlitContextFramebufferAMD")) == NULL) || r; + r = ((glXCreateAssociatedContextAMD = (PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXCreateAssociatedContextAMD")) == NULL) || r; + r = ((glXCreateAssociatedContextAttribsAMD = (PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)glewGetProcAddress((const GLubyte*)"glXCreateAssociatedContextAttribsAMD")) == NULL) || r; + r = ((glXDeleteAssociatedContextAMD = (PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXDeleteAssociatedContextAMD")) == NULL) || r; + r = ((glXGetContextGPUIDAMD = (PFNGLXGETCONTEXTGPUIDAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetContextGPUIDAMD")) == NULL) || r; + r = ((glXGetCurrentAssociatedContextAMD = (PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentAssociatedContextAMD")) == NULL) || r; + r = ((glXGetGPUIDsAMD = (PFNGLXGETGPUIDSAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetGPUIDsAMD")) == NULL) || r; + r = ((glXGetGPUInfoAMD = (PFNGLXGETGPUINFOAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetGPUInfoAMD")) == NULL) || r; + r = ((glXMakeAssociatedContextCurrentAMD = (PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)glewGetProcAddress((const GLubyte*)"glXMakeAssociatedContextCurrentAMD")) == NULL) || r; + + return r; +} + +#endif /* GLX_AMD_gpu_association */ + +#ifdef GLX_ARB_create_context + +static GLboolean _glewInit_GLX_ARB_create_context (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB")) == NULL) || r; + + return r; +} + +#endif /* GLX_ARB_create_context */ + +#ifdef GLX_ARB_create_context_profile + +#endif /* GLX_ARB_create_context_profile */ + +#ifdef GLX_ARB_create_context_robustness + +#endif /* GLX_ARB_create_context_robustness */ + +#ifdef GLX_ARB_fbconfig_float + +#endif /* GLX_ARB_fbconfig_float */ + +#ifdef GLX_ARB_framebuffer_sRGB + +#endif /* GLX_ARB_framebuffer_sRGB */ + +#ifdef GLX_ARB_get_proc_address + +#endif /* GLX_ARB_get_proc_address */ + +#ifdef GLX_ARB_multisample + +#endif /* GLX_ARB_multisample */ + +#ifdef GLX_ARB_robustness_application_isolation + +#endif /* GLX_ARB_robustness_application_isolation */ + +#ifdef GLX_ARB_robustness_share_group_isolation + +#endif /* GLX_ARB_robustness_share_group_isolation */ + +#ifdef GLX_ARB_vertex_buffer_object + +#endif /* GLX_ARB_vertex_buffer_object */ + +#ifdef GLX_ATI_pixel_format_float + +#endif /* GLX_ATI_pixel_format_float */ + +#ifdef GLX_ATI_render_texture + +static GLboolean _glewInit_GLX_ATI_render_texture (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindTexImageATI = (PFNGLXBINDTEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageATI")) == NULL) || r; + r = ((glXDrawableAttribATI = (PFNGLXDRAWABLEATTRIBATIPROC)glewGetProcAddress((const GLubyte*)"glXDrawableAttribATI")) == NULL) || r; + r = ((glXReleaseTexImageATI = (PFNGLXRELEASETEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageATI")) == NULL) || r; + + return r; +} + +#endif /* GLX_ATI_render_texture */ + +#ifdef GLX_EXT_buffer_age + +#endif /* GLX_EXT_buffer_age */ + +#ifdef GLX_EXT_create_context_es2_profile + +#endif /* GLX_EXT_create_context_es2_profile */ + +#ifdef GLX_EXT_create_context_es_profile + +#endif /* GLX_EXT_create_context_es_profile */ + +#ifdef GLX_EXT_fbconfig_packed_float + +#endif /* GLX_EXT_fbconfig_packed_float */ + +#ifdef GLX_EXT_framebuffer_sRGB + +#endif /* GLX_EXT_framebuffer_sRGB */ + +#ifdef GLX_EXT_import_context + +static GLboolean _glewInit_GLX_EXT_import_context (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXFreeContextEXT = (PFNGLXFREECONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXFreeContextEXT")) == NULL) || r; + r = ((glXGetContextIDEXT = (PFNGLXGETCONTEXTIDEXTPROC)glewGetProcAddress((const GLubyte*)"glXGetContextIDEXT")) == NULL) || r; + r = ((glXImportContextEXT = (PFNGLXIMPORTCONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXImportContextEXT")) == NULL) || r; + r = ((glXQueryContextInfoEXT = (PFNGLXQUERYCONTEXTINFOEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContextInfoEXT")) == NULL) || r; + + return r; +} + +#endif /* GLX_EXT_import_context */ + +#ifdef GLX_EXT_scene_marker + +#endif /* GLX_EXT_scene_marker */ + +#ifdef GLX_EXT_swap_control + +static GLboolean _glewInit_GLX_EXT_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalEXT")) == NULL) || r; + + return r; +} + +#endif /* GLX_EXT_swap_control */ + +#ifdef GLX_EXT_swap_control_tear + +#endif /* GLX_EXT_swap_control_tear */ + +#ifdef GLX_EXT_texture_from_pixmap + +static GLboolean _glewInit_GLX_EXT_texture_from_pixmap (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageEXT")) == NULL) || r; + r = ((glXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageEXT")) == NULL) || r; + + return r; +} + +#endif /* GLX_EXT_texture_from_pixmap */ + +#ifdef GLX_EXT_visual_info + +#endif /* GLX_EXT_visual_info */ + +#ifdef GLX_EXT_visual_rating + +#endif /* GLX_EXT_visual_rating */ + +#ifdef GLX_INTEL_swap_event + +#endif /* GLX_INTEL_swap_event */ + +#ifdef GLX_MESA_agp_offset + +static GLboolean _glewInit_GLX_MESA_agp_offset (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetAGPOffsetMESA = (PFNGLXGETAGPOFFSETMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetAGPOffsetMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_agp_offset */ + +#ifdef GLX_MESA_copy_sub_buffer + +static GLboolean _glewInit_GLX_MESA_copy_sub_buffer (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCopySubBufferMESA = (PFNGLXCOPYSUBBUFFERMESAPROC)glewGetProcAddress((const GLubyte*)"glXCopySubBufferMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_copy_sub_buffer */ + +#ifdef GLX_MESA_pixmap_colormap + +static GLboolean _glewInit_GLX_MESA_pixmap_colormap (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCreateGLXPixmapMESA = (PFNGLXCREATEGLXPIXMAPMESAPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_pixmap_colormap */ + +#ifdef GLX_MESA_release_buffers + +static GLboolean _glewInit_GLX_MESA_release_buffers (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXReleaseBuffersMESA = (PFNGLXRELEASEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glXReleaseBuffersMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_release_buffers */ + +#ifdef GLX_MESA_set_3dfx_mode + +static GLboolean _glewInit_GLX_MESA_set_3dfx_mode (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXSet3DfxModeMESA = (PFNGLXSET3DFXMODEMESAPROC)glewGetProcAddress((const GLubyte*)"glXSet3DfxModeMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_set_3dfx_mode */ + +#ifdef GLX_MESA_swap_control + +static GLboolean _glewInit_GLX_MESA_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetSwapIntervalMESA = (PFNGLXGETSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetSwapIntervalMESA")) == NULL) || r; + r = ((glXSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_swap_control */ + +#ifdef GLX_NV_copy_image + +static GLboolean _glewInit_GLX_NV_copy_image (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCopyImageSubDataNV = (PFNGLXCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_copy_image */ + +#ifdef GLX_NV_float_buffer + +#endif /* GLX_NV_float_buffer */ + +#ifdef GLX_NV_multisample_coverage + +#endif /* GLX_NV_multisample_coverage */ + +#ifdef GLX_NV_present_video + +static GLboolean _glewInit_GLX_NV_present_video (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindVideoDeviceNV = (PFNGLXBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoDeviceNV")) == NULL) || r; + r = ((glXEnumerateVideoDevicesNV = (PFNGLXENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoDevicesNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_present_video */ + +#ifdef GLX_NV_swap_group + +static GLboolean _glewInit_GLX_NV_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindSwapBarrierNV = (PFNGLXBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierNV")) == NULL) || r; + r = ((glXJoinSwapGroupNV = (PFNGLXJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupNV")) == NULL) || r; + r = ((glXQueryFrameCountNV = (PFNGLXQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryFrameCountNV")) == NULL) || r; + r = ((glXQueryMaxSwapGroupsNV = (PFNGLXQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapGroupsNV")) == NULL) || r; + r = ((glXQuerySwapGroupNV = (PFNGLXQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXQuerySwapGroupNV")) == NULL) || r; + r = ((glXResetFrameCountNV = (PFNGLXRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXResetFrameCountNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_swap_group */ + +#ifdef GLX_NV_vertex_array_range + +static GLboolean _glewInit_GLX_NV_vertex_array_range (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXAllocateMemoryNV = (PFNGLXALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXAllocateMemoryNV")) == NULL) || r; + r = ((glXFreeMemoryNV = (PFNGLXFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXFreeMemoryNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_vertex_array_range */ + +#ifdef GLX_NV_video_capture + +static GLboolean _glewInit_GLX_NV_video_capture (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindVideoCaptureDeviceNV = (PFNGLXBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoCaptureDeviceNV")) == NULL) || r; + r = ((glXEnumerateVideoCaptureDevicesNV = (PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoCaptureDevicesNV")) == NULL) || r; + r = ((glXLockVideoCaptureDeviceNV = (PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXLockVideoCaptureDeviceNV")) == NULL) || r; + r = ((glXQueryVideoCaptureDeviceNV = (PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXQueryVideoCaptureDeviceNV")) == NULL) || r; + r = ((glXReleaseVideoCaptureDeviceNV = (PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoCaptureDeviceNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_video_capture */ + +#ifdef GLX_NV_video_output + +static GLboolean _glewInit_GLX_NV_video_output (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindVideoImageNV = (PFNGLXBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoImageNV")) == NULL) || r; + r = ((glXGetVideoDeviceNV = (PFNGLXGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoDeviceNV")) == NULL) || r; + r = ((glXGetVideoInfoNV = (PFNGLXGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoInfoNV")) == NULL) || r; + r = ((glXReleaseVideoDeviceNV = (PFNGLXRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoDeviceNV")) == NULL) || r; + r = ((glXReleaseVideoImageNV = (PFNGLXRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoImageNV")) == NULL) || r; + r = ((glXSendPbufferToVideoNV = (PFNGLXSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"glXSendPbufferToVideoNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_video_output */ + +#ifdef GLX_OML_swap_method + +#endif /* GLX_OML_swap_method */ + +#ifdef GLX_OML_sync_control + +static GLboolean _glewInit_GLX_OML_sync_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetMscRateOML = (PFNGLXGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetMscRateOML")) == NULL) || r; + r = ((glXGetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetSyncValuesOML")) == NULL) || r; + r = ((glXSwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXSwapBuffersMscOML")) == NULL) || r; + r = ((glXWaitForMscOML = (PFNGLXWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForMscOML")) == NULL) || r; + r = ((glXWaitForSbcOML = (PFNGLXWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForSbcOML")) == NULL) || r; + + return r; +} + +#endif /* GLX_OML_sync_control */ + +#ifdef GLX_SGIS_blended_overlay + +#endif /* GLX_SGIS_blended_overlay */ + +#ifdef GLX_SGIS_color_range + +#endif /* GLX_SGIS_color_range */ + +#ifdef GLX_SGIS_multisample + +#endif /* GLX_SGIS_multisample */ + +#ifdef GLX_SGIS_shared_multisample + +#endif /* GLX_SGIS_shared_multisample */ + +#ifdef GLX_SGIX_fbconfig + +static GLboolean _glewInit_GLX_SGIX_fbconfig (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfigSGIX")) == NULL) || r; + r = ((glXCreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextWithConfigSGIX")) == NULL) || r; + r = ((glXCreateGLXPixmapWithConfigSGIX = (PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapWithConfigSGIX")) == NULL) || r; + r = ((glXGetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttribSGIX")) == NULL) || r; + r = ((glXGetFBConfigFromVisualSGIX = (PFNGLXGETFBCONFIGFROMVISUALSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigFromVisualSGIX")) == NULL) || r; + r = ((glXGetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfigSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_fbconfig */ + +#ifdef GLX_SGIX_hyperpipe + +static GLboolean _glewInit_GLX_SGIX_hyperpipe (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindHyperpipeSGIX = (PFNGLXBINDHYPERPIPESGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindHyperpipeSGIX")) == NULL) || r; + r = ((glXDestroyHyperpipeConfigSGIX = (PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyHyperpipeConfigSGIX")) == NULL) || r; + r = ((glXHyperpipeAttribSGIX = (PFNGLXHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeAttribSGIX")) == NULL) || r; + r = ((glXHyperpipeConfigSGIX = (PFNGLXHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeConfigSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeAttribSGIX = (PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeAttribSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeBestAttribSGIX = (PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeBestAttribSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeConfigSGIX = (PFNGLXQUERYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeConfigSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeNetworkSGIX = (PFNGLXQUERYHYPERPIPENETWORKSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeNetworkSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_hyperpipe */ + +#ifdef GLX_SGIX_pbuffer + +static GLboolean _glewInit_GLX_SGIX_pbuffer (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPbufferSGIX")) == NULL) || r; + r = ((glXDestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyGLXPbufferSGIX")) == NULL) || r; + r = ((glXGetSelectedEventSGIX = (PFNGLXGETSELECTEDEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEventSGIX")) == NULL) || r; + r = ((glXQueryGLXPbufferSGIX = (PFNGLXQUERYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryGLXPbufferSGIX")) == NULL) || r; + r = ((glXSelectEventSGIX = (PFNGLXSELECTEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXSelectEventSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_pbuffer */ + +#ifdef GLX_SGIX_swap_barrier + +static GLboolean _glewInit_GLX_SGIX_swap_barrier (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindSwapBarrierSGIX = (PFNGLXBINDSWAPBARRIERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierSGIX")) == NULL) || r; + r = ((glXQueryMaxSwapBarriersSGIX = (PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapBarriersSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_swap_barrier */ + +#ifdef GLX_SGIX_swap_group + +static GLboolean _glewInit_GLX_SGIX_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXJoinSwapGroupSGIX = (PFNGLXJOINSWAPGROUPSGIXPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_swap_group */ + +#ifdef GLX_SGIX_video_resize + +static GLboolean _glewInit_GLX_SGIX_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindChannelToWindowSGIX = (PFNGLXBINDCHANNELTOWINDOWSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindChannelToWindowSGIX")) == NULL) || r; + r = ((glXChannelRectSGIX = (PFNGLXCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSGIX")) == NULL) || r; + r = ((glXChannelRectSyncSGIX = (PFNGLXCHANNELRECTSYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSyncSGIX")) == NULL) || r; + r = ((glXQueryChannelDeltasSGIX = (PFNGLXQUERYCHANNELDELTASSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelDeltasSGIX")) == NULL) || r; + r = ((glXQueryChannelRectSGIX = (PFNGLXQUERYCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelRectSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_video_resize */ + +#ifdef GLX_SGIX_visual_select_group + +#endif /* GLX_SGIX_visual_select_group */ + +#ifdef GLX_SGI_cushion + +static GLboolean _glewInit_GLX_SGI_cushion (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCushionSGI = (PFNGLXCUSHIONSGIPROC)glewGetProcAddress((const GLubyte*)"glXCushionSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_cushion */ + +#ifdef GLX_SGI_make_current_read + +static GLboolean _glewInit_GLX_SGI_make_current_read (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetCurrentReadDrawableSGI = (PFNGLXGETCURRENTREADDRAWABLESGIPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawableSGI")) == NULL) || r; + r = ((glXMakeCurrentReadSGI = (PFNGLXMAKECURRENTREADSGIPROC)glewGetProcAddress((const GLubyte*)"glXMakeCurrentReadSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_make_current_read */ + +#ifdef GLX_SGI_swap_control + +static GLboolean _glewInit_GLX_SGI_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_swap_control */ + +#ifdef GLX_SGI_video_sync + +static GLboolean _glewInit_GLX_SGI_video_sync (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoSyncSGI")) == NULL) || r; + r = ((glXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXWaitVideoSyncSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_video_sync */ + +#ifdef GLX_SUN_get_transparent_index + +static GLboolean _glewInit_GLX_SUN_get_transparent_index (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetTransparentIndexSUN = (PFNGLXGETTRANSPARENTINDEXSUNPROC)glewGetProcAddress((const GLubyte*)"glXGetTransparentIndexSUN")) == NULL) || r; + + return r; +} + +#endif /* GLX_SUN_get_transparent_index */ + +#ifdef GLX_SUN_video_resize + +static GLboolean _glewInit_GLX_SUN_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetVideoResizeSUN = (PFNGLXGETVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoResizeSUN")) == NULL) || r; + r = ((glXVideoResizeSUN = (PFNGLXVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXVideoResizeSUN")) == NULL) || r; + + return r; +} + +#endif /* GLX_SUN_video_resize */ + +/* ------------------------------------------------------------------------ */ + +GLboolean glxewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + + if (glXGetCurrentDisplay == NULL) return GL_FALSE; + start = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); + if (0 == start) return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST) +{ + int major, minor; + const GLubyte* extStart; + const GLubyte* extEnd; + /* initialize core GLX 1.2 */ + if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY; + /* initialize flags */ + CONST_CAST(GLXEW_VERSION_1_0) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_1) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_2) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_3) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_4) = GL_TRUE; + /* query GLX version */ + glXQueryVersion(glXGetCurrentDisplay(), &major, &minor); + if (major == 1 && minor <= 3) + { + switch (minor) + { + case 3: + CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE; + break; + case 2: + CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE; + CONST_CAST(GLXEW_VERSION_1_3) = GL_FALSE; + break; + default: + return GLEW_ERROR_GLX_VERSION_11_ONLY; + break; + } + } + /* query GLX extension string */ + extStart = 0; + if (glXGetCurrentDisplay != NULL) + extStart = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); + if (extStart == 0) + extStart = (const GLubyte *)""; + extEnd = extStart + _glewStrLen(extStart); + /* initialize extensions */ +#ifdef GLX_VERSION_1_3 + if (glewExperimental || GLXEW_VERSION_1_3) CONST_CAST(GLXEW_VERSION_1_3) = !_glewInit_GLX_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_VERSION_1_3 */ +#ifdef GLX_3DFX_multisample + CONST_CAST(GLXEW_3DFX_multisample) = _glewSearchExtension("GLX_3DFX_multisample", extStart, extEnd); +#endif /* GLX_3DFX_multisample */ +#ifdef GLX_AMD_gpu_association + CONST_CAST(GLXEW_AMD_gpu_association) = _glewSearchExtension("GLX_AMD_gpu_association", extStart, extEnd); + if (glewExperimental || GLXEW_AMD_gpu_association) CONST_CAST(GLXEW_AMD_gpu_association) = !_glewInit_GLX_AMD_gpu_association(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_AMD_gpu_association */ +#ifdef GLX_ARB_create_context + CONST_CAST(GLXEW_ARB_create_context) = _glewSearchExtension("GLX_ARB_create_context", extStart, extEnd); + if (glewExperimental || GLXEW_ARB_create_context) CONST_CAST(GLXEW_ARB_create_context) = !_glewInit_GLX_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_ARB_create_context */ +#ifdef GLX_ARB_create_context_profile + CONST_CAST(GLXEW_ARB_create_context_profile) = _glewSearchExtension("GLX_ARB_create_context_profile", extStart, extEnd); +#endif /* GLX_ARB_create_context_profile */ +#ifdef GLX_ARB_create_context_robustness + CONST_CAST(GLXEW_ARB_create_context_robustness) = _glewSearchExtension("GLX_ARB_create_context_robustness", extStart, extEnd); +#endif /* GLX_ARB_create_context_robustness */ +#ifdef GLX_ARB_fbconfig_float + CONST_CAST(GLXEW_ARB_fbconfig_float) = _glewSearchExtension("GLX_ARB_fbconfig_float", extStart, extEnd); +#endif /* GLX_ARB_fbconfig_float */ +#ifdef GLX_ARB_framebuffer_sRGB + CONST_CAST(GLXEW_ARB_framebuffer_sRGB) = _glewSearchExtension("GLX_ARB_framebuffer_sRGB", extStart, extEnd); +#endif /* GLX_ARB_framebuffer_sRGB */ +#ifdef GLX_ARB_get_proc_address + CONST_CAST(GLXEW_ARB_get_proc_address) = _glewSearchExtension("GLX_ARB_get_proc_address", extStart, extEnd); +#endif /* GLX_ARB_get_proc_address */ +#ifdef GLX_ARB_multisample + CONST_CAST(GLXEW_ARB_multisample) = _glewSearchExtension("GLX_ARB_multisample", extStart, extEnd); +#endif /* GLX_ARB_multisample */ +#ifdef GLX_ARB_robustness_application_isolation + CONST_CAST(GLXEW_ARB_robustness_application_isolation) = _glewSearchExtension("GLX_ARB_robustness_application_isolation", extStart, extEnd); +#endif /* GLX_ARB_robustness_application_isolation */ +#ifdef GLX_ARB_robustness_share_group_isolation + CONST_CAST(GLXEW_ARB_robustness_share_group_isolation) = _glewSearchExtension("GLX_ARB_robustness_share_group_isolation", extStart, extEnd); +#endif /* GLX_ARB_robustness_share_group_isolation */ +#ifdef GLX_ARB_vertex_buffer_object + CONST_CAST(GLXEW_ARB_vertex_buffer_object) = _glewSearchExtension("GLX_ARB_vertex_buffer_object", extStart, extEnd); +#endif /* GLX_ARB_vertex_buffer_object */ +#ifdef GLX_ATI_pixel_format_float + CONST_CAST(GLXEW_ATI_pixel_format_float) = _glewSearchExtension("GLX_ATI_pixel_format_float", extStart, extEnd); +#endif /* GLX_ATI_pixel_format_float */ +#ifdef GLX_ATI_render_texture + CONST_CAST(GLXEW_ATI_render_texture) = _glewSearchExtension("GLX_ATI_render_texture", extStart, extEnd); + if (glewExperimental || GLXEW_ATI_render_texture) CONST_CAST(GLXEW_ATI_render_texture) = !_glewInit_GLX_ATI_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_ATI_render_texture */ +#ifdef GLX_EXT_buffer_age + CONST_CAST(GLXEW_EXT_buffer_age) = _glewSearchExtension("GLX_EXT_buffer_age", extStart, extEnd); +#endif /* GLX_EXT_buffer_age */ +#ifdef GLX_EXT_create_context_es2_profile + CONST_CAST(GLXEW_EXT_create_context_es2_profile) = _glewSearchExtension("GLX_EXT_create_context_es2_profile", extStart, extEnd); +#endif /* GLX_EXT_create_context_es2_profile */ +#ifdef GLX_EXT_create_context_es_profile + CONST_CAST(GLXEW_EXT_create_context_es_profile) = _glewSearchExtension("GLX_EXT_create_context_es_profile", extStart, extEnd); +#endif /* GLX_EXT_create_context_es_profile */ +#ifdef GLX_EXT_fbconfig_packed_float + CONST_CAST(GLXEW_EXT_fbconfig_packed_float) = _glewSearchExtension("GLX_EXT_fbconfig_packed_float", extStart, extEnd); +#endif /* GLX_EXT_fbconfig_packed_float */ +#ifdef GLX_EXT_framebuffer_sRGB + CONST_CAST(GLXEW_EXT_framebuffer_sRGB) = _glewSearchExtension("GLX_EXT_framebuffer_sRGB", extStart, extEnd); +#endif /* GLX_EXT_framebuffer_sRGB */ +#ifdef GLX_EXT_import_context + CONST_CAST(GLXEW_EXT_import_context) = _glewSearchExtension("GLX_EXT_import_context", extStart, extEnd); + if (glewExperimental || GLXEW_EXT_import_context) CONST_CAST(GLXEW_EXT_import_context) = !_glewInit_GLX_EXT_import_context(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_EXT_import_context */ +#ifdef GLX_EXT_scene_marker + CONST_CAST(GLXEW_EXT_scene_marker) = _glewSearchExtension("GLX_EXT_scene_marker", extStart, extEnd); +#endif /* GLX_EXT_scene_marker */ +#ifdef GLX_EXT_swap_control + CONST_CAST(GLXEW_EXT_swap_control) = _glewSearchExtension("GLX_EXT_swap_control", extStart, extEnd); + if (glewExperimental || GLXEW_EXT_swap_control) CONST_CAST(GLXEW_EXT_swap_control) = !_glewInit_GLX_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_EXT_swap_control */ +#ifdef GLX_EXT_swap_control_tear + CONST_CAST(GLXEW_EXT_swap_control_tear) = _glewSearchExtension("GLX_EXT_swap_control_tear", extStart, extEnd); +#endif /* GLX_EXT_swap_control_tear */ +#ifdef GLX_EXT_texture_from_pixmap + CONST_CAST(GLXEW_EXT_texture_from_pixmap) = _glewSearchExtension("GLX_EXT_texture_from_pixmap", extStart, extEnd); + if (glewExperimental || GLXEW_EXT_texture_from_pixmap) CONST_CAST(GLXEW_EXT_texture_from_pixmap) = !_glewInit_GLX_EXT_texture_from_pixmap(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_EXT_texture_from_pixmap */ +#ifdef GLX_EXT_visual_info + CONST_CAST(GLXEW_EXT_visual_info) = _glewSearchExtension("GLX_EXT_visual_info", extStart, extEnd); +#endif /* GLX_EXT_visual_info */ +#ifdef GLX_EXT_visual_rating + CONST_CAST(GLXEW_EXT_visual_rating) = _glewSearchExtension("GLX_EXT_visual_rating", extStart, extEnd); +#endif /* GLX_EXT_visual_rating */ +#ifdef GLX_INTEL_swap_event + CONST_CAST(GLXEW_INTEL_swap_event) = _glewSearchExtension("GLX_INTEL_swap_event", extStart, extEnd); +#endif /* GLX_INTEL_swap_event */ +#ifdef GLX_MESA_agp_offset + CONST_CAST(GLXEW_MESA_agp_offset) = _glewSearchExtension("GLX_MESA_agp_offset", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_agp_offset) CONST_CAST(GLXEW_MESA_agp_offset) = !_glewInit_GLX_MESA_agp_offset(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_agp_offset */ +#ifdef GLX_MESA_copy_sub_buffer + CONST_CAST(GLXEW_MESA_copy_sub_buffer) = _glewSearchExtension("GLX_MESA_copy_sub_buffer", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_copy_sub_buffer) CONST_CAST(GLXEW_MESA_copy_sub_buffer) = !_glewInit_GLX_MESA_copy_sub_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_copy_sub_buffer */ +#ifdef GLX_MESA_pixmap_colormap + CONST_CAST(GLXEW_MESA_pixmap_colormap) = _glewSearchExtension("GLX_MESA_pixmap_colormap", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_pixmap_colormap) CONST_CAST(GLXEW_MESA_pixmap_colormap) = !_glewInit_GLX_MESA_pixmap_colormap(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_pixmap_colormap */ +#ifdef GLX_MESA_release_buffers + CONST_CAST(GLXEW_MESA_release_buffers) = _glewSearchExtension("GLX_MESA_release_buffers", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_release_buffers) CONST_CAST(GLXEW_MESA_release_buffers) = !_glewInit_GLX_MESA_release_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_release_buffers */ +#ifdef GLX_MESA_set_3dfx_mode + CONST_CAST(GLXEW_MESA_set_3dfx_mode) = _glewSearchExtension("GLX_MESA_set_3dfx_mode", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_set_3dfx_mode) CONST_CAST(GLXEW_MESA_set_3dfx_mode) = !_glewInit_GLX_MESA_set_3dfx_mode(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_set_3dfx_mode */ +#ifdef GLX_MESA_swap_control + CONST_CAST(GLXEW_MESA_swap_control) = _glewSearchExtension("GLX_MESA_swap_control", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_swap_control) CONST_CAST(GLXEW_MESA_swap_control) = !_glewInit_GLX_MESA_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_swap_control */ +#ifdef GLX_NV_copy_image + CONST_CAST(GLXEW_NV_copy_image) = _glewSearchExtension("GLX_NV_copy_image", extStart, extEnd); + if (glewExperimental || GLXEW_NV_copy_image) CONST_CAST(GLXEW_NV_copy_image) = !_glewInit_GLX_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_copy_image */ +#ifdef GLX_NV_float_buffer + CONST_CAST(GLXEW_NV_float_buffer) = _glewSearchExtension("GLX_NV_float_buffer", extStart, extEnd); +#endif /* GLX_NV_float_buffer */ +#ifdef GLX_NV_multisample_coverage + CONST_CAST(GLXEW_NV_multisample_coverage) = _glewSearchExtension("GLX_NV_multisample_coverage", extStart, extEnd); +#endif /* GLX_NV_multisample_coverage */ +#ifdef GLX_NV_present_video + CONST_CAST(GLXEW_NV_present_video) = _glewSearchExtension("GLX_NV_present_video", extStart, extEnd); + if (glewExperimental || GLXEW_NV_present_video) CONST_CAST(GLXEW_NV_present_video) = !_glewInit_GLX_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_present_video */ +#ifdef GLX_NV_swap_group + CONST_CAST(GLXEW_NV_swap_group) = _glewSearchExtension("GLX_NV_swap_group", extStart, extEnd); + if (glewExperimental || GLXEW_NV_swap_group) CONST_CAST(GLXEW_NV_swap_group) = !_glewInit_GLX_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_swap_group */ +#ifdef GLX_NV_vertex_array_range + CONST_CAST(GLXEW_NV_vertex_array_range) = _glewSearchExtension("GLX_NV_vertex_array_range", extStart, extEnd); + if (glewExperimental || GLXEW_NV_vertex_array_range) CONST_CAST(GLXEW_NV_vertex_array_range) = !_glewInit_GLX_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_vertex_array_range */ +#ifdef GLX_NV_video_capture + CONST_CAST(GLXEW_NV_video_capture) = _glewSearchExtension("GLX_NV_video_capture", extStart, extEnd); + if (glewExperimental || GLXEW_NV_video_capture) CONST_CAST(GLXEW_NV_video_capture) = !_glewInit_GLX_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_video_capture */ +#ifdef GLX_NV_video_output + CONST_CAST(GLXEW_NV_video_output) = _glewSearchExtension("GLX_NV_video_output", extStart, extEnd); + if (glewExperimental || GLXEW_NV_video_output) CONST_CAST(GLXEW_NV_video_output) = !_glewInit_GLX_NV_video_output(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_video_output */ +#ifdef GLX_OML_swap_method + CONST_CAST(GLXEW_OML_swap_method) = _glewSearchExtension("GLX_OML_swap_method", extStart, extEnd); +#endif /* GLX_OML_swap_method */ +#ifdef GLX_OML_sync_control + CONST_CAST(GLXEW_OML_sync_control) = _glewSearchExtension("GLX_OML_sync_control", extStart, extEnd); + if (glewExperimental || GLXEW_OML_sync_control) CONST_CAST(GLXEW_OML_sync_control) = !_glewInit_GLX_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_OML_sync_control */ +#ifdef GLX_SGIS_blended_overlay + CONST_CAST(GLXEW_SGIS_blended_overlay) = _glewSearchExtension("GLX_SGIS_blended_overlay", extStart, extEnd); +#endif /* GLX_SGIS_blended_overlay */ +#ifdef GLX_SGIS_color_range + CONST_CAST(GLXEW_SGIS_color_range) = _glewSearchExtension("GLX_SGIS_color_range", extStart, extEnd); +#endif /* GLX_SGIS_color_range */ +#ifdef GLX_SGIS_multisample + CONST_CAST(GLXEW_SGIS_multisample) = _glewSearchExtension("GLX_SGIS_multisample", extStart, extEnd); +#endif /* GLX_SGIS_multisample */ +#ifdef GLX_SGIS_shared_multisample + CONST_CAST(GLXEW_SGIS_shared_multisample) = _glewSearchExtension("GLX_SGIS_shared_multisample", extStart, extEnd); +#endif /* GLX_SGIS_shared_multisample */ +#ifdef GLX_SGIX_fbconfig + CONST_CAST(GLXEW_SGIX_fbconfig) = _glewSearchExtension("GLX_SGIX_fbconfig", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_fbconfig) CONST_CAST(GLXEW_SGIX_fbconfig) = !_glewInit_GLX_SGIX_fbconfig(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_fbconfig */ +#ifdef GLX_SGIX_hyperpipe + CONST_CAST(GLXEW_SGIX_hyperpipe) = _glewSearchExtension("GLX_SGIX_hyperpipe", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_hyperpipe) CONST_CAST(GLXEW_SGIX_hyperpipe) = !_glewInit_GLX_SGIX_hyperpipe(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_hyperpipe */ +#ifdef GLX_SGIX_pbuffer + CONST_CAST(GLXEW_SGIX_pbuffer) = _glewSearchExtension("GLX_SGIX_pbuffer", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_pbuffer) CONST_CAST(GLXEW_SGIX_pbuffer) = !_glewInit_GLX_SGIX_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_pbuffer */ +#ifdef GLX_SGIX_swap_barrier + CONST_CAST(GLXEW_SGIX_swap_barrier) = _glewSearchExtension("GLX_SGIX_swap_barrier", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_swap_barrier) CONST_CAST(GLXEW_SGIX_swap_barrier) = !_glewInit_GLX_SGIX_swap_barrier(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_swap_barrier */ +#ifdef GLX_SGIX_swap_group + CONST_CAST(GLXEW_SGIX_swap_group) = _glewSearchExtension("GLX_SGIX_swap_group", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_swap_group) CONST_CAST(GLXEW_SGIX_swap_group) = !_glewInit_GLX_SGIX_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_swap_group */ +#ifdef GLX_SGIX_video_resize + CONST_CAST(GLXEW_SGIX_video_resize) = _glewSearchExtension("GLX_SGIX_video_resize", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_video_resize) CONST_CAST(GLXEW_SGIX_video_resize) = !_glewInit_GLX_SGIX_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_video_resize */ +#ifdef GLX_SGIX_visual_select_group + CONST_CAST(GLXEW_SGIX_visual_select_group) = _glewSearchExtension("GLX_SGIX_visual_select_group", extStart, extEnd); +#endif /* GLX_SGIX_visual_select_group */ +#ifdef GLX_SGI_cushion + CONST_CAST(GLXEW_SGI_cushion) = _glewSearchExtension("GLX_SGI_cushion", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_cushion) CONST_CAST(GLXEW_SGI_cushion) = !_glewInit_GLX_SGI_cushion(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_cushion */ +#ifdef GLX_SGI_make_current_read + CONST_CAST(GLXEW_SGI_make_current_read) = _glewSearchExtension("GLX_SGI_make_current_read", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_make_current_read) CONST_CAST(GLXEW_SGI_make_current_read) = !_glewInit_GLX_SGI_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_make_current_read */ +#ifdef GLX_SGI_swap_control + CONST_CAST(GLXEW_SGI_swap_control) = _glewSearchExtension("GLX_SGI_swap_control", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_swap_control) CONST_CAST(GLXEW_SGI_swap_control) = !_glewInit_GLX_SGI_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_swap_control */ +#ifdef GLX_SGI_video_sync + CONST_CAST(GLXEW_SGI_video_sync) = _glewSearchExtension("GLX_SGI_video_sync", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_video_sync) CONST_CAST(GLXEW_SGI_video_sync) = !_glewInit_GLX_SGI_video_sync(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_video_sync */ +#ifdef GLX_SUN_get_transparent_index + CONST_CAST(GLXEW_SUN_get_transparent_index) = _glewSearchExtension("GLX_SUN_get_transparent_index", extStart, extEnd); + if (glewExperimental || GLXEW_SUN_get_transparent_index) CONST_CAST(GLXEW_SUN_get_transparent_index) = !_glewInit_GLX_SUN_get_transparent_index(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SUN_get_transparent_index */ +#ifdef GLX_SUN_video_resize + CONST_CAST(GLXEW_SUN_video_resize) = _glewSearchExtension("GLX_SUN_video_resize", extStart, extEnd); + if (glewExperimental || GLXEW_SUN_video_resize) CONST_CAST(GLXEW_SUN_video_resize) = !_glewInit_GLX_SUN_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SUN_video_resize */ + + return GLEW_OK; +} + +#endif /* !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */ + +/* ------------------------------------------------------------------------ */ + +const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error) +{ + static const GLubyte* _glewErrorString[] = + { + (const GLubyte*)"No error", + (const GLubyte*)"Missing GL version", + (const GLubyte*)"GL 1.1 and up are not supported", + (const GLubyte*)"GLX 1.2 and up are not supported", + (const GLubyte*)"Unknown error" + }; + const int max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1; + return _glewErrorString[(int)error > max_error ? max_error : (int)error]; +} + +const GLubyte * GLEWAPIENTRY glewGetString (GLenum name) +{ + static const GLubyte* _glewString[] = + { + (const GLubyte*)NULL, + (const GLubyte*)"1.10.0", + (const GLubyte*)"1", + (const GLubyte*)"10", + (const GLubyte*)"0" + }; + const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1; + return _glewString[(int)name > max_string ? 0 : (int)name]; +} + +/* ------------------------------------------------------------------------ */ + +GLboolean glewExperimental = GL_FALSE; + +#if !defined(GLEW_MX) + +#if defined(_WIN32) +extern GLenum GLEWAPIENTRY wglewContextInit (void); +#elif !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) +extern GLenum GLEWAPIENTRY glxewContextInit (void); +#endif /* _WIN32 */ + +GLenum GLEWAPIENTRY glewInit (void) +{ + GLenum r; + r = glewContextInit(); + if ( r != 0 ) return r; +#if defined(_WIN32) + return wglewContextInit(); +#elif !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) /* _UNIX */ + return glxewContextInit(); +#else + return r; +#endif /* _WIN32 */ +} + +#endif /* !GLEW_MX */ +#ifdef GLEW_MX +GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext* ctx, const char* name) +#else +GLboolean GLEWAPIENTRY glewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if (_glewStrSame1(&pos, &len, (const GLubyte*)"GL_", 3)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) + { +#ifdef GL_VERSION_1_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) + { + ret = GLEW_VERSION_1_2; + continue; + } +#endif +#ifdef GL_VERSION_1_2_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2_1", 5)) + { + ret = GLEW_VERSION_1_2_1; + continue; + } +#endif +#ifdef GL_VERSION_1_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) + { + ret = GLEW_VERSION_1_3; + continue; + } +#endif +#ifdef GL_VERSION_1_4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) + { + ret = GLEW_VERSION_1_4; + continue; + } +#endif +#ifdef GL_VERSION_1_5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_5", 3)) + { + ret = GLEW_VERSION_1_5; + continue; + } +#endif +#ifdef GL_VERSION_2_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_0", 3)) + { + ret = GLEW_VERSION_2_0; + continue; + } +#endif +#ifdef GL_VERSION_2_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_1", 3)) + { + ret = GLEW_VERSION_2_1; + continue; + } +#endif +#ifdef GL_VERSION_3_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_0", 3)) + { + ret = GLEW_VERSION_3_0; + continue; + } +#endif +#ifdef GL_VERSION_3_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_1", 3)) + { + ret = GLEW_VERSION_3_1; + continue; + } +#endif +#ifdef GL_VERSION_3_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_2", 3)) + { + ret = GLEW_VERSION_3_2; + continue; + } +#endif +#ifdef GL_VERSION_3_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_3", 3)) + { + ret = GLEW_VERSION_3_3; + continue; + } +#endif +#ifdef GL_VERSION_4_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_0", 3)) + { + ret = GLEW_VERSION_4_0; + continue; + } +#endif +#ifdef GL_VERSION_4_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_1", 3)) + { + ret = GLEW_VERSION_4_1; + continue; + } +#endif +#ifdef GL_VERSION_4_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_2", 3)) + { + ret = GLEW_VERSION_4_2; + continue; + } +#endif +#ifdef GL_VERSION_4_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_3", 3)) + { + ret = GLEW_VERSION_4_3; + continue; + } +#endif +#ifdef GL_VERSION_4_4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_4", 3)) + { + ret = GLEW_VERSION_4_4; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef GL_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_3DFX_multisample; + continue; + } +#endif +#ifdef GL_3DFX_tbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tbuffer", 7)) + { + ret = GLEW_3DFX_tbuffer; + continue; + } +#endif +#ifdef GL_3DFX_texture_compression_FXT1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_FXT1", 24)) + { + ret = GLEW_3DFX_texture_compression_FXT1; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef GL_AMD_blend_minmax_factor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax_factor", 19)) + { + ret = GLEW_AMD_blend_minmax_factor; + continue; + } +#endif +#ifdef GL_AMD_conservative_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) + { + ret = GLEW_AMD_conservative_depth; + continue; + } +#endif +#ifdef GL_AMD_debug_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) + { + ret = GLEW_AMD_debug_output; + continue; + } +#endif +#ifdef GL_AMD_depth_clamp_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp_separate", 20)) + { + ret = GLEW_AMD_depth_clamp_separate; + continue; + } +#endif +#ifdef GL_AMD_draw_buffers_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) + { + ret = GLEW_AMD_draw_buffers_blend; + continue; + } +#endif +#ifdef GL_AMD_interleaved_elements + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interleaved_elements", 20)) + { + ret = GLEW_AMD_interleaved_elements; + continue; + } +#endif +#ifdef GL_AMD_multi_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) + { + ret = GLEW_AMD_multi_draw_indirect; + continue; + } +#endif +#ifdef GL_AMD_name_gen_delete + if (_glewStrSame3(&pos, &len, (const GLubyte*)"name_gen_delete", 15)) + { + ret = GLEW_AMD_name_gen_delete; + continue; + } +#endif +#ifdef GL_AMD_performance_monitor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"performance_monitor", 19)) + { + ret = GLEW_AMD_performance_monitor; + continue; + } +#endif +#ifdef GL_AMD_pinned_memory + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pinned_memory", 13)) + { + ret = GLEW_AMD_pinned_memory; + continue; + } +#endif +#ifdef GL_AMD_query_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_buffer_object", 19)) + { + ret = GLEW_AMD_query_buffer_object; + continue; + } +#endif +#ifdef GL_AMD_sample_positions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_positions", 16)) + { + ret = GLEW_AMD_sample_positions; + continue; + } +#endif +#ifdef GL_AMD_seamless_cubemap_per_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cubemap_per_texture", 28)) + { + ret = GLEW_AMD_seamless_cubemap_per_texture; + continue; + } +#endif +#ifdef GL_AMD_shader_stencil_export + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) + { + ret = GLEW_AMD_shader_stencil_export; + continue; + } +#endif +#ifdef GL_AMD_shader_trinary_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_trinary_minmax", 21)) + { + ret = GLEW_AMD_shader_trinary_minmax; + continue; + } +#endif +#ifdef GL_AMD_sparse_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture", 14)) + { + ret = GLEW_AMD_sparse_texture; + continue; + } +#endif +#ifdef GL_AMD_stencil_operation_extended + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_operation_extended", 26)) + { + ret = GLEW_AMD_stencil_operation_extended; + continue; + } +#endif +#ifdef GL_AMD_texture_texture4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_texture4", 16)) + { + ret = GLEW_AMD_texture_texture4; + continue; + } +#endif +#ifdef GL_AMD_transform_feedback3_lines_triangles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3_lines_triangles", 35)) + { + ret = GLEW_AMD_transform_feedback3_lines_triangles; + continue; + } +#endif +#ifdef GL_AMD_vertex_shader_layer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_layer", 19)) + { + ret = GLEW_AMD_vertex_shader_layer; + continue; + } +#endif +#ifdef GL_AMD_vertex_shader_tessellator + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_tessellator", 25)) + { + ret = GLEW_AMD_vertex_shader_tessellator; + continue; + } +#endif +#ifdef GL_AMD_vertex_shader_viewport_index + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_viewport_index", 28)) + { + ret = GLEW_AMD_vertex_shader_viewport_index; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ANGLE_", 6)) + { +#ifdef GL_ANGLE_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) + { + ret = GLEW_ANGLE_depth_texture; + continue; + } +#endif +#ifdef GL_ANGLE_framebuffer_blit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16)) + { + ret = GLEW_ANGLE_framebuffer_blit; + continue; + } +#endif +#ifdef GL_ANGLE_framebuffer_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) + { + ret = GLEW_ANGLE_framebuffer_multisample; + continue; + } +#endif +#ifdef GL_ANGLE_instanced_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) + { + ret = GLEW_ANGLE_instanced_arrays; + continue; + } +#endif +#ifdef GL_ANGLE_pack_reverse_row_order + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_reverse_row_order", 22)) + { + ret = GLEW_ANGLE_pack_reverse_row_order; + continue; + } +#endif +#ifdef GL_ANGLE_program_binary + if (_glewStrSame3(&pos, &len, (const GLubyte*)"program_binary", 14)) + { + ret = GLEW_ANGLE_program_binary; + continue; + } +#endif +#ifdef GL_ANGLE_texture_compression_dxt1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24)) + { + ret = GLEW_ANGLE_texture_compression_dxt1; + continue; + } +#endif +#ifdef GL_ANGLE_texture_compression_dxt3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt3", 24)) + { + ret = GLEW_ANGLE_texture_compression_dxt3; + continue; + } +#endif +#ifdef GL_ANGLE_texture_compression_dxt5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt5", 24)) + { + ret = GLEW_ANGLE_texture_compression_dxt5; + continue; + } +#endif +#ifdef GL_ANGLE_texture_usage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_usage", 13)) + { + ret = GLEW_ANGLE_texture_usage; + continue; + } +#endif +#ifdef GL_ANGLE_timer_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) + { + ret = GLEW_ANGLE_timer_query; + continue; + } +#endif +#ifdef GL_ANGLE_translated_shader_source + if (_glewStrSame3(&pos, &len, (const GLubyte*)"translated_shader_source", 24)) + { + ret = GLEW_ANGLE_translated_shader_source; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"APPLE_", 6)) + { +#ifdef GL_APPLE_aux_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"aux_depth_stencil", 17)) + { + ret = GLEW_APPLE_aux_depth_stencil; + continue; + } +#endif +#ifdef GL_APPLE_client_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"client_storage", 14)) + { + ret = GLEW_APPLE_client_storage; + continue; + } +#endif +#ifdef GL_APPLE_element_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) + { + ret = GLEW_APPLE_element_array; + continue; + } +#endif +#ifdef GL_APPLE_fence + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) + { + ret = GLEW_APPLE_fence; + continue; + } +#endif +#ifdef GL_APPLE_float_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_pixels", 12)) + { + ret = GLEW_APPLE_float_pixels; + continue; + } +#endif +#ifdef GL_APPLE_flush_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_buffer_range", 18)) + { + ret = GLEW_APPLE_flush_buffer_range; + continue; + } +#endif +#ifdef GL_APPLE_object_purgeable + if (_glewStrSame3(&pos, &len, (const GLubyte*)"object_purgeable", 16)) + { + ret = GLEW_APPLE_object_purgeable; + continue; + } +#endif +#ifdef GL_APPLE_pixel_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer", 12)) + { + ret = GLEW_APPLE_pixel_buffer; + continue; + } +#endif +#ifdef GL_APPLE_rgb_422 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rgb_422", 7)) + { + ret = GLEW_APPLE_rgb_422; + continue; + } +#endif +#ifdef GL_APPLE_row_bytes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"row_bytes", 9)) + { + ret = GLEW_APPLE_row_bytes; + continue; + } +#endif +#ifdef GL_APPLE_specular_vector + if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_vector", 15)) + { + ret = GLEW_APPLE_specular_vector; + continue; + } +#endif +#ifdef GL_APPLE_texture_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) + { + ret = GLEW_APPLE_texture_range; + continue; + } +#endif +#ifdef GL_APPLE_transform_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_hint", 14)) + { + ret = GLEW_APPLE_transform_hint; + continue; + } +#endif +#ifdef GL_APPLE_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_APPLE_vertex_array_object; + continue; + } +#endif +#ifdef GL_APPLE_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLEW_APPLE_vertex_array_range; + continue; + } +#endif +#ifdef GL_APPLE_vertex_program_evaluators + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program_evaluators", 25)) + { + ret = GLEW_APPLE_vertex_program_evaluators; + continue; + } +#endif +#ifdef GL_APPLE_ycbcr_422 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_422", 9)) + { + ret = GLEW_APPLE_ycbcr_422; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef GL_ARB_ES2_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES2_compatibility", 17)) + { + ret = GLEW_ARB_ES2_compatibility; + continue; + } +#endif +#ifdef GL_ARB_ES3_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES3_compatibility", 17)) + { + ret = GLEW_ARB_ES3_compatibility; + continue; + } +#endif +#ifdef GL_ARB_arrays_of_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"arrays_of_arrays", 16)) + { + ret = GLEW_ARB_arrays_of_arrays; + continue; + } +#endif +#ifdef GL_ARB_base_instance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"base_instance", 13)) + { + ret = GLEW_ARB_base_instance; + continue; + } +#endif +#ifdef GL_ARB_bindless_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_texture", 16)) + { + ret = GLEW_ARB_bindless_texture; + continue; + } +#endif +#ifdef GL_ARB_blend_func_extended + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_extended", 19)) + { + ret = GLEW_ARB_blend_func_extended; + continue; + } +#endif +#ifdef GL_ARB_buffer_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_storage", 14)) + { + ret = GLEW_ARB_buffer_storage; + continue; + } +#endif +#ifdef GL_ARB_cl_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cl_event", 8)) + { + ret = GLEW_ARB_cl_event; + continue; + } +#endif +#ifdef GL_ARB_clear_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clear_buffer_object", 19)) + { + ret = GLEW_ARB_clear_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_clear_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clear_texture", 13)) + { + ret = GLEW_ARB_clear_texture; + continue; + } +#endif +#ifdef GL_ARB_color_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_buffer_float", 18)) + { + ret = GLEW_ARB_color_buffer_float; + continue; + } +#endif +#ifdef GL_ARB_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compatibility", 13)) + { + ret = GLEW_ARB_compatibility; + continue; + } +#endif +#ifdef GL_ARB_compressed_texture_pixel_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_texture_pixel_storage", 32)) + { + ret = GLEW_ARB_compressed_texture_pixel_storage; + continue; + } +#endif +#ifdef GL_ARB_compute_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_shader", 14)) + { + ret = GLEW_ARB_compute_shader; + continue; + } +#endif +#ifdef GL_ARB_compute_variable_group_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_variable_group_size", 27)) + { + ret = GLEW_ARB_compute_variable_group_size; + continue; + } +#endif +#ifdef GL_ARB_conservative_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) + { + ret = GLEW_ARB_conservative_depth; + continue; + } +#endif +#ifdef GL_ARB_copy_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_buffer", 11)) + { + ret = GLEW_ARB_copy_buffer; + continue; + } +#endif +#ifdef GL_ARB_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLEW_ARB_copy_image; + continue; + } +#endif +#ifdef GL_ARB_debug_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) + { + ret = GLEW_ARB_debug_output; + continue; + } +#endif +#ifdef GL_ARB_depth_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) + { + ret = GLEW_ARB_depth_buffer_float; + continue; + } +#endif +#ifdef GL_ARB_depth_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) + { + ret = GLEW_ARB_depth_clamp; + continue; + } +#endif +#ifdef GL_ARB_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) + { + ret = GLEW_ARB_depth_texture; + continue; + } +#endif +#ifdef GL_ARB_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) + { + ret = GLEW_ARB_draw_buffers; + continue; + } +#endif +#ifdef GL_ARB_draw_buffers_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) + { + ret = GLEW_ARB_draw_buffers_blend; + continue; + } +#endif +#ifdef GL_ARB_draw_elements_base_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_elements_base_vertex", 25)) + { + ret = GLEW_ARB_draw_elements_base_vertex; + continue; + } +#endif +#ifdef GL_ARB_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_indirect", 13)) + { + ret = GLEW_ARB_draw_indirect; + continue; + } +#endif +#ifdef GL_ARB_draw_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) + { + ret = GLEW_ARB_draw_instanced; + continue; + } +#endif +#ifdef GL_ARB_enhanced_layouts + if (_glewStrSame3(&pos, &len, (const GLubyte*)"enhanced_layouts", 16)) + { + ret = GLEW_ARB_enhanced_layouts; + continue; + } +#endif +#ifdef GL_ARB_explicit_attrib_location + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_attrib_location", 24)) + { + ret = GLEW_ARB_explicit_attrib_location; + continue; + } +#endif +#ifdef GL_ARB_explicit_uniform_location + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_uniform_location", 25)) + { + ret = GLEW_ARB_explicit_uniform_location; + continue; + } +#endif +#ifdef GL_ARB_fragment_coord_conventions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_coord_conventions", 26)) + { + ret = GLEW_ARB_fragment_coord_conventions; + continue; + } +#endif +#ifdef GL_ARB_fragment_layer_viewport + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_layer_viewport", 23)) + { + ret = GLEW_ARB_fragment_layer_viewport; + continue; + } +#endif +#ifdef GL_ARB_fragment_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) + { + ret = GLEW_ARB_fragment_program; + continue; + } +#endif +#ifdef GL_ARB_fragment_program_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_shadow", 23)) + { + ret = GLEW_ARB_fragment_program_shadow; + continue; + } +#endif +#ifdef GL_ARB_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) + { + ret = GLEW_ARB_fragment_shader; + continue; + } +#endif +#ifdef GL_ARB_framebuffer_no_attachments + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_no_attachments", 26)) + { + ret = GLEW_ARB_framebuffer_no_attachments; + continue; + } +#endif +#ifdef GL_ARB_framebuffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) + { + ret = GLEW_ARB_framebuffer_object; + continue; + } +#endif +#ifdef GL_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLEW_ARB_framebuffer_sRGB; + continue; + } +#endif +#ifdef GL_ARB_geometry_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) + { + ret = GLEW_ARB_geometry_shader4; + continue; + } +#endif +#ifdef GL_ARB_get_program_binary + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_program_binary", 18)) + { + ret = GLEW_ARB_get_program_binary; + continue; + } +#endif +#ifdef GL_ARB_gpu_shader5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) + { + ret = GLEW_ARB_gpu_shader5; + continue; + } +#endif +#ifdef GL_ARB_gpu_shader_fp64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_fp64", 15)) + { + ret = GLEW_ARB_gpu_shader_fp64; + continue; + } +#endif +#ifdef GL_ARB_half_float_pixel + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_pixel", 16)) + { + ret = GLEW_ARB_half_float_pixel; + continue; + } +#endif +#ifdef GL_ARB_half_float_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_vertex", 17)) + { + ret = GLEW_ARB_half_float_vertex; + continue; + } +#endif +#ifdef GL_ARB_imaging + if (_glewStrSame3(&pos, &len, (const GLubyte*)"imaging", 7)) + { + ret = GLEW_ARB_imaging; + continue; + } +#endif +#ifdef GL_ARB_indirect_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"indirect_parameters", 19)) + { + ret = GLEW_ARB_indirect_parameters; + continue; + } +#endif +#ifdef GL_ARB_instanced_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) + { + ret = GLEW_ARB_instanced_arrays; + continue; + } +#endif +#ifdef GL_ARB_internalformat_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query", 20)) + { + ret = GLEW_ARB_internalformat_query; + continue; + } +#endif +#ifdef GL_ARB_internalformat_query2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query2", 21)) + { + ret = GLEW_ARB_internalformat_query2; + continue; + } +#endif +#ifdef GL_ARB_invalidate_subdata + if (_glewStrSame3(&pos, &len, (const GLubyte*)"invalidate_subdata", 18)) + { + ret = GLEW_ARB_invalidate_subdata; + continue; + } +#endif +#ifdef GL_ARB_map_buffer_alignment + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_alignment", 20)) + { + ret = GLEW_ARB_map_buffer_alignment; + continue; + } +#endif +#ifdef GL_ARB_map_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_range", 16)) + { + ret = GLEW_ARB_map_buffer_range; + continue; + } +#endif +#ifdef GL_ARB_matrix_palette + if (_glewStrSame3(&pos, &len, (const GLubyte*)"matrix_palette", 14)) + { + ret = GLEW_ARB_matrix_palette; + continue; + } +#endif +#ifdef GL_ARB_multi_bind + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_bind", 10)) + { + ret = GLEW_ARB_multi_bind; + continue; + } +#endif +#ifdef GL_ARB_multi_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) + { + ret = GLEW_ARB_multi_draw_indirect; + continue; + } +#endif +#ifdef GL_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_ARB_multisample; + continue; + } +#endif +#ifdef GL_ARB_multitexture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multitexture", 12)) + { + ret = GLEW_ARB_multitexture; + continue; + } +#endif +#ifdef GL_ARB_occlusion_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) + { + ret = GLEW_ARB_occlusion_query; + continue; + } +#endif +#ifdef GL_ARB_occlusion_query2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query2", 16)) + { + ret = GLEW_ARB_occlusion_query2; + continue; + } +#endif +#ifdef GL_ARB_pixel_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) + { + ret = GLEW_ARB_pixel_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_point_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) + { + ret = GLEW_ARB_point_parameters; + continue; + } +#endif +#ifdef GL_ARB_point_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) + { + ret = GLEW_ARB_point_sprite; + continue; + } +#endif +#ifdef GL_ARB_program_interface_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"program_interface_query", 23)) + { + ret = GLEW_ARB_program_interface_query; + continue; + } +#endif +#ifdef GL_ARB_provoking_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) + { + ret = GLEW_ARB_provoking_vertex; + continue; + } +#endif +#ifdef GL_ARB_query_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_buffer_object", 19)) + { + ret = GLEW_ARB_query_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_robust_buffer_access_behavior + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robust_buffer_access_behavior", 29)) + { + ret = GLEW_ARB_robust_buffer_access_behavior; + continue; + } +#endif +#ifdef GL_ARB_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness", 10)) + { + ret = GLEW_ARB_robustness; + continue; + } +#endif +#ifdef GL_ARB_robustness_application_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) + { + ret = GLEW_ARB_robustness_application_isolation; + continue; + } +#endif +#ifdef GL_ARB_robustness_share_group_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) + { + ret = GLEW_ARB_robustness_share_group_isolation; + continue; + } +#endif +#ifdef GL_ARB_sample_shading + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_shading", 14)) + { + ret = GLEW_ARB_sample_shading; + continue; + } +#endif +#ifdef GL_ARB_sampler_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sampler_objects", 15)) + { + ret = GLEW_ARB_sampler_objects; + continue; + } +#endif +#ifdef GL_ARB_seamless_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cube_map", 17)) + { + ret = GLEW_ARB_seamless_cube_map; + continue; + } +#endif +#ifdef GL_ARB_seamless_cubemap_per_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cubemap_per_texture", 28)) + { + ret = GLEW_ARB_seamless_cubemap_per_texture; + continue; + } +#endif +#ifdef GL_ARB_separate_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) + { + ret = GLEW_ARB_separate_shader_objects; + continue; + } +#endif +#ifdef GL_ARB_shader_atomic_counters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counters", 22)) + { + ret = GLEW_ARB_shader_atomic_counters; + continue; + } +#endif +#ifdef GL_ARB_shader_bit_encoding + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_bit_encoding", 19)) + { + ret = GLEW_ARB_shader_bit_encoding; + continue; + } +#endif +#ifdef GL_ARB_shader_draw_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_draw_parameters", 22)) + { + ret = GLEW_ARB_shader_draw_parameters; + continue; + } +#endif +#ifdef GL_ARB_shader_group_vote + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_group_vote", 17)) + { + ret = GLEW_ARB_shader_group_vote; + continue; + } +#endif +#ifdef GL_ARB_shader_image_load_store + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) + { + ret = GLEW_ARB_shader_image_load_store; + continue; + } +#endif +#ifdef GL_ARB_shader_image_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_size", 17)) + { + ret = GLEW_ARB_shader_image_size; + continue; + } +#endif +#ifdef GL_ARB_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_objects", 14)) + { + ret = GLEW_ARB_shader_objects; + continue; + } +#endif +#ifdef GL_ARB_shader_precision + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_precision", 16)) + { + ret = GLEW_ARB_shader_precision; + continue; + } +#endif +#ifdef GL_ARB_shader_stencil_export + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) + { + ret = GLEW_ARB_shader_stencil_export; + continue; + } +#endif +#ifdef GL_ARB_shader_storage_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_storage_buffer_object", 28)) + { + ret = GLEW_ARB_shader_storage_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_shader_subroutine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_subroutine", 17)) + { + ret = GLEW_ARB_shader_subroutine; + continue; + } +#endif +#ifdef GL_ARB_shader_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) + { + ret = GLEW_ARB_shader_texture_lod; + continue; + } +#endif +#ifdef GL_ARB_shading_language_100 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_100", 20)) + { + ret = GLEW_ARB_shading_language_100; + continue; + } +#endif +#ifdef GL_ARB_shading_language_420pack + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_420pack", 24)) + { + ret = GLEW_ARB_shading_language_420pack; + continue; + } +#endif +#ifdef GL_ARB_shading_language_include + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_include", 24)) + { + ret = GLEW_ARB_shading_language_include; + continue; + } +#endif +#ifdef GL_ARB_shading_language_packing + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_packing", 24)) + { + ret = GLEW_ARB_shading_language_packing; + continue; + } +#endif +#ifdef GL_ARB_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) + { + ret = GLEW_ARB_shadow; + continue; + } +#endif +#ifdef GL_ARB_shadow_ambient + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) + { + ret = GLEW_ARB_shadow_ambient; + continue; + } +#endif +#ifdef GL_ARB_sparse_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture", 14)) + { + ret = GLEW_ARB_sparse_texture; + continue; + } +#endif +#ifdef GL_ARB_stencil_texturing + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_texturing", 17)) + { + ret = GLEW_ARB_stencil_texturing; + continue; + } +#endif +#ifdef GL_ARB_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync", 4)) + { + ret = GLEW_ARB_sync; + continue; + } +#endif +#ifdef GL_ARB_tessellation_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_shader", 19)) + { + ret = GLEW_ARB_tessellation_shader; + continue; + } +#endif +#ifdef GL_ARB_texture_border_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) + { + ret = GLEW_ARB_texture_border_clamp; + continue; + } +#endif +#ifdef GL_ARB_texture_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21)) + { + ret = GLEW_ARB_texture_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_texture_buffer_object_rgb32 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object_rgb32", 27)) + { + ret = GLEW_ARB_texture_buffer_object_rgb32; + continue; + } +#endif +#ifdef GL_ARB_texture_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_range", 20)) + { + ret = GLEW_ARB_texture_buffer_range; + continue; + } +#endif +#ifdef GL_ARB_texture_compression + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression", 19)) + { + ret = GLEW_ARB_texture_compression; + continue; + } +#endif +#ifdef GL_ARB_texture_compression_bptc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_bptc", 24)) + { + ret = GLEW_ARB_texture_compression_bptc; + continue; + } +#endif +#ifdef GL_ARB_texture_compression_rgtc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24)) + { + ret = GLEW_ARB_texture_compression_rgtc; + continue; + } +#endif +#ifdef GL_ARB_texture_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) + { + ret = GLEW_ARB_texture_cube_map; + continue; + } +#endif +#ifdef GL_ARB_texture_cube_map_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map_array", 22)) + { + ret = GLEW_ARB_texture_cube_map_array; + continue; + } +#endif +#ifdef GL_ARB_texture_env_add + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) + { + ret = GLEW_ARB_texture_env_add; + continue; + } +#endif +#ifdef GL_ARB_texture_env_combine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) + { + ret = GLEW_ARB_texture_env_combine; + continue; + } +#endif +#ifdef GL_ARB_texture_env_crossbar + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_crossbar", 20)) + { + ret = GLEW_ARB_texture_env_crossbar; + continue; + } +#endif +#ifdef GL_ARB_texture_env_dot3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) + { + ret = GLEW_ARB_texture_env_dot3; + continue; + } +#endif +#ifdef GL_ARB_texture_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) + { + ret = GLEW_ARB_texture_float; + continue; + } +#endif +#ifdef GL_ARB_texture_gather + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_gather", 14)) + { + ret = GLEW_ARB_texture_gather; + continue; + } +#endif +#ifdef GL_ARB_texture_mirror_clamp_to_edge + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_clamp_to_edge", 28)) + { + ret = GLEW_ARB_texture_mirror_clamp_to_edge; + continue; + } +#endif +#ifdef GL_ARB_texture_mirrored_repeat + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) + { + ret = GLEW_ARB_texture_mirrored_repeat; + continue; + } +#endif +#ifdef GL_ARB_texture_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19)) + { + ret = GLEW_ARB_texture_multisample; + continue; + } +#endif +#ifdef GL_ARB_texture_non_power_of_two + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_non_power_of_two", 24)) + { + ret = GLEW_ARB_texture_non_power_of_two; + continue; + } +#endif +#ifdef GL_ARB_texture_query_levels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_levels", 20)) + { + ret = GLEW_ARB_texture_query_levels; + continue; + } +#endif +#ifdef GL_ARB_texture_query_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_lod", 17)) + { + ret = GLEW_ARB_texture_query_lod; + continue; + } +#endif +#ifdef GL_ARB_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_ARB_texture_rectangle; + continue; + } +#endif +#ifdef GL_ARB_texture_rg + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rg", 10)) + { + ret = GLEW_ARB_texture_rg; + continue; + } +#endif +#ifdef GL_ARB_texture_rgb10_a2ui + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rgb10_a2ui", 18)) + { + ret = GLEW_ARB_texture_rgb10_a2ui; + continue; + } +#endif +#ifdef GL_ARB_texture_stencil8 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_stencil8", 16)) + { + ret = GLEW_ARB_texture_stencil8; + continue; + } +#endif +#ifdef GL_ARB_texture_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage", 15)) + { + ret = GLEW_ARB_texture_storage; + continue; + } +#endif +#ifdef GL_ARB_texture_storage_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage_multisample", 27)) + { + ret = GLEW_ARB_texture_storage_multisample; + continue; + } +#endif +#ifdef GL_ARB_texture_swizzle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) + { + ret = GLEW_ARB_texture_swizzle; + continue; + } +#endif +#ifdef GL_ARB_texture_view + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_view", 12)) + { + ret = GLEW_ARB_texture_view; + continue; + } +#endif +#ifdef GL_ARB_timer_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) + { + ret = GLEW_ARB_timer_query; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) + { + ret = GLEW_ARB_transform_feedback2; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3", 19)) + { + ret = GLEW_ARB_transform_feedback3; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback_instanced", 28)) + { + ret = GLEW_ARB_transform_feedback_instanced; + continue; + } +#endif +#ifdef GL_ARB_transpose_matrix + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transpose_matrix", 16)) + { + ret = GLEW_ARB_transpose_matrix; + continue; + } +#endif +#ifdef GL_ARB_uniform_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"uniform_buffer_object", 21)) + { + ret = GLEW_ARB_uniform_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_array_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) + { + ret = GLEW_ARB_vertex_array_bgra; + continue; + } +#endif +#ifdef GL_ARB_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_ARB_vertex_array_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_attrib_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) + { + ret = GLEW_ARB_vertex_attrib_64bit; + continue; + } +#endif +#ifdef GL_ARB_vertex_attrib_binding + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_binding", 21)) + { + ret = GLEW_ARB_vertex_attrib_binding; + continue; + } +#endif +#ifdef GL_ARB_vertex_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_blend", 12)) + { + ret = GLEW_ARB_vertex_blend; + continue; + } +#endif +#ifdef GL_ARB_vertex_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) + { + ret = GLEW_ARB_vertex_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) + { + ret = GLEW_ARB_vertex_program; + continue; + } +#endif +#ifdef GL_ARB_vertex_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) + { + ret = GLEW_ARB_vertex_shader; + continue; + } +#endif +#ifdef GL_ARB_vertex_type_10f_11f_11f_rev + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_type_10f_11f_11f_rev", 27)) + { + ret = GLEW_ARB_vertex_type_10f_11f_11f_rev; + continue; + } +#endif +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_type_2_10_10_10_rev", 26)) + { + ret = GLEW_ARB_vertex_type_2_10_10_10_rev; + continue; + } +#endif +#ifdef GL_ARB_viewport_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_array", 14)) + { + ret = GLEW_ARB_viewport_array; + continue; + } +#endif +#ifdef GL_ARB_window_pos + if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) + { + ret = GLEW_ARB_window_pos; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATIX_", 5)) + { +#ifdef GL_ATIX_point_sprites + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprites", 13)) + { + ret = GLEW_ATIX_point_sprites; + continue; + } +#endif +#ifdef GL_ATIX_texture_env_combine3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) + { + ret = GLEW_ATIX_texture_env_combine3; + continue; + } +#endif +#ifdef GL_ATIX_texture_env_route + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_route", 17)) + { + ret = GLEW_ATIX_texture_env_route; + continue; + } +#endif +#ifdef GL_ATIX_vertex_shader_output_point_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_output_point_size", 31)) + { + ret = GLEW_ATIX_vertex_shader_output_point_size; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef GL_ATI_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) + { + ret = GLEW_ATI_draw_buffers; + continue; + } +#endif +#ifdef GL_ATI_element_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) + { + ret = GLEW_ATI_element_array; + continue; + } +#endif +#ifdef GL_ATI_envmap_bumpmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"envmap_bumpmap", 14)) + { + ret = GLEW_ATI_envmap_bumpmap; + continue; + } +#endif +#ifdef GL_ATI_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) + { + ret = GLEW_ATI_fragment_shader; + continue; + } +#endif +#ifdef GL_ATI_map_object_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_object_buffer", 17)) + { + ret = GLEW_ATI_map_object_buffer; + continue; + } +#endif +#ifdef GL_ATI_meminfo + if (_glewStrSame3(&pos, &len, (const GLubyte*)"meminfo", 7)) + { + ret = GLEW_ATI_meminfo; + continue; + } +#endif +#ifdef GL_ATI_pn_triangles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pn_triangles", 12)) + { + ret = GLEW_ATI_pn_triangles; + continue; + } +#endif +#ifdef GL_ATI_separate_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_stencil", 16)) + { + ret = GLEW_ATI_separate_stencil; + continue; + } +#endif +#ifdef GL_ATI_shader_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) + { + ret = GLEW_ATI_shader_texture_lod; + continue; + } +#endif +#ifdef GL_ATI_text_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"text_fragment_shader", 20)) + { + ret = GLEW_ATI_text_fragment_shader; + continue; + } +#endif +#ifdef GL_ATI_texture_compression_3dc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_3dc", 23)) + { + ret = GLEW_ATI_texture_compression_3dc; + continue; + } +#endif +#ifdef GL_ATI_texture_env_combine3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) + { + ret = GLEW_ATI_texture_env_combine3; + continue; + } +#endif +#ifdef GL_ATI_texture_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) + { + ret = GLEW_ATI_texture_float; + continue; + } +#endif +#ifdef GL_ATI_texture_mirror_once + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_once", 19)) + { + ret = GLEW_ATI_texture_mirror_once; + continue; + } +#endif +#ifdef GL_ATI_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_ATI_vertex_array_object; + continue; + } +#endif +#ifdef GL_ATI_vertex_attrib_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_array_object", 26)) + { + ret = GLEW_ATI_vertex_attrib_array_object; + continue; + } +#endif +#ifdef GL_ATI_vertex_streams + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_streams", 14)) + { + ret = GLEW_ATI_vertex_streams; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef GL_EXT_422_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"422_pixels", 10)) + { + ret = GLEW_EXT_422_pixels; + continue; + } +#endif +#ifdef GL_EXT_Cg_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"Cg_shader", 9)) + { + ret = GLEW_EXT_Cg_shader; + continue; + } +#endif +#ifdef GL_EXT_abgr + if (_glewStrSame3(&pos, &len, (const GLubyte*)"abgr", 4)) + { + ret = GLEW_EXT_abgr; + continue; + } +#endif +#ifdef GL_EXT_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bgra", 4)) + { + ret = GLEW_EXT_bgra; + continue; + } +#endif +#ifdef GL_EXT_bindable_uniform + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindable_uniform", 16)) + { + ret = GLEW_EXT_bindable_uniform; + continue; + } +#endif +#ifdef GL_EXT_blend_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_color", 11)) + { + ret = GLEW_EXT_blend_color; + continue; + } +#endif +#ifdef GL_EXT_blend_equation_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_separate", 23)) + { + ret = GLEW_EXT_blend_equation_separate; + continue; + } +#endif +#ifdef GL_EXT_blend_func_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_separate", 19)) + { + ret = GLEW_EXT_blend_func_separate; + continue; + } +#endif +#ifdef GL_EXT_blend_logic_op + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_logic_op", 14)) + { + ret = GLEW_EXT_blend_logic_op; + continue; + } +#endif +#ifdef GL_EXT_blend_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax", 12)) + { + ret = GLEW_EXT_blend_minmax; + continue; + } +#endif +#ifdef GL_EXT_blend_subtract + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_subtract", 14)) + { + ret = GLEW_EXT_blend_subtract; + continue; + } +#endif +#ifdef GL_EXT_clip_volume_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_volume_hint", 16)) + { + ret = GLEW_EXT_clip_volume_hint; + continue; + } +#endif +#ifdef GL_EXT_cmyka + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cmyka", 5)) + { + ret = GLEW_EXT_cmyka; + continue; + } +#endif +#ifdef GL_EXT_color_subtable + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_subtable", 14)) + { + ret = GLEW_EXT_color_subtable; + continue; + } +#endif +#ifdef GL_EXT_compiled_vertex_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compiled_vertex_array", 21)) + { + ret = GLEW_EXT_compiled_vertex_array; + continue; + } +#endif +#ifdef GL_EXT_convolution + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution", 11)) + { + ret = GLEW_EXT_convolution; + continue; + } +#endif +#ifdef GL_EXT_coordinate_frame + if (_glewStrSame3(&pos, &len, (const GLubyte*)"coordinate_frame", 16)) + { + ret = GLEW_EXT_coordinate_frame; + continue; + } +#endif +#ifdef GL_EXT_copy_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_texture", 12)) + { + ret = GLEW_EXT_copy_texture; + continue; + } +#endif +#ifdef GL_EXT_cull_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) + { + ret = GLEW_EXT_cull_vertex; + continue; + } +#endif +#ifdef GL_EXT_debug_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_marker", 12)) + { + ret = GLEW_EXT_debug_marker; + continue; + } +#endif +#ifdef GL_EXT_depth_bounds_test + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_bounds_test", 17)) + { + ret = GLEW_EXT_depth_bounds_test; + continue; + } +#endif +#ifdef GL_EXT_direct_state_access + if (_glewStrSame3(&pos, &len, (const GLubyte*)"direct_state_access", 19)) + { + ret = GLEW_EXT_direct_state_access; + continue; + } +#endif +#ifdef GL_EXT_draw_buffers2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers2", 13)) + { + ret = GLEW_EXT_draw_buffers2; + continue; + } +#endif +#ifdef GL_EXT_draw_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) + { + ret = GLEW_EXT_draw_instanced; + continue; + } +#endif +#ifdef GL_EXT_draw_range_elements + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_range_elements", 19)) + { + ret = GLEW_EXT_draw_range_elements; + continue; + } +#endif +#ifdef GL_EXT_fog_coord + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_coord", 9)) + { + ret = GLEW_EXT_fog_coord; + continue; + } +#endif +#ifdef GL_EXT_fragment_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_lighting", 17)) + { + ret = GLEW_EXT_fragment_lighting; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_blit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16)) + { + ret = GLEW_EXT_framebuffer_blit; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) + { + ret = GLEW_EXT_framebuffer_multisample; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_blit_scaled", 35)) + { + ret = GLEW_EXT_framebuffer_multisample_blit_scaled; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) + { + ret = GLEW_EXT_framebuffer_object; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLEW_EXT_framebuffer_sRGB; + continue; + } +#endif +#ifdef GL_EXT_geometry_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) + { + ret = GLEW_EXT_geometry_shader4; + continue; + } +#endif +#ifdef GL_EXT_gpu_program_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_parameters", 22)) + { + ret = GLEW_EXT_gpu_program_parameters; + continue; + } +#endif +#ifdef GL_EXT_gpu_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader4", 11)) + { + ret = GLEW_EXT_gpu_shader4; + continue; + } +#endif +#ifdef GL_EXT_histogram + if (_glewStrSame3(&pos, &len, (const GLubyte*)"histogram", 9)) + { + ret = GLEW_EXT_histogram; + continue; + } +#endif +#ifdef GL_EXT_index_array_formats + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_array_formats", 19)) + { + ret = GLEW_EXT_index_array_formats; + continue; + } +#endif +#ifdef GL_EXT_index_func + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_func", 10)) + { + ret = GLEW_EXT_index_func; + continue; + } +#endif +#ifdef GL_EXT_index_material + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_material", 14)) + { + ret = GLEW_EXT_index_material; + continue; + } +#endif +#ifdef GL_EXT_index_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_texture", 13)) + { + ret = GLEW_EXT_index_texture; + continue; + } +#endif +#ifdef GL_EXT_light_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_texture", 13)) + { + ret = GLEW_EXT_light_texture; + continue; + } +#endif +#ifdef GL_EXT_misc_attribute + if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_attribute", 14)) + { + ret = GLEW_EXT_misc_attribute; + continue; + } +#endif +#ifdef GL_EXT_multi_draw_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_arrays", 17)) + { + ret = GLEW_EXT_multi_draw_arrays; + continue; + } +#endif +#ifdef GL_EXT_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_EXT_multisample; + continue; + } +#endif +#ifdef GL_EXT_packed_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) + { + ret = GLEW_EXT_packed_depth_stencil; + continue; + } +#endif +#ifdef GL_EXT_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_float", 12)) + { + ret = GLEW_EXT_packed_float; + continue; + } +#endif +#ifdef GL_EXT_packed_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_pixels", 13)) + { + ret = GLEW_EXT_packed_pixels; + continue; + } +#endif +#ifdef GL_EXT_paletted_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"paletted_texture", 16)) + { + ret = GLEW_EXT_paletted_texture; + continue; + } +#endif +#ifdef GL_EXT_pixel_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) + { + ret = GLEW_EXT_pixel_buffer_object; + continue; + } +#endif +#ifdef GL_EXT_pixel_transform + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform", 15)) + { + ret = GLEW_EXT_pixel_transform; + continue; + } +#endif +#ifdef GL_EXT_pixel_transform_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform_color_table", 27)) + { + ret = GLEW_EXT_pixel_transform_color_table; + continue; + } +#endif +#ifdef GL_EXT_point_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) + { + ret = GLEW_EXT_point_parameters; + continue; + } +#endif +#ifdef GL_EXT_polygon_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_offset", 14)) + { + ret = GLEW_EXT_polygon_offset; + continue; + } +#endif +#ifdef GL_EXT_provoking_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) + { + ret = GLEW_EXT_provoking_vertex; + continue; + } +#endif +#ifdef GL_EXT_rescale_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rescale_normal", 14)) + { + ret = GLEW_EXT_rescale_normal; + continue; + } +#endif +#ifdef GL_EXT_scene_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) + { + ret = GLEW_EXT_scene_marker; + continue; + } +#endif +#ifdef GL_EXT_secondary_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"secondary_color", 15)) + { + ret = GLEW_EXT_secondary_color; + continue; + } +#endif +#ifdef GL_EXT_separate_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) + { + ret = GLEW_EXT_separate_shader_objects; + continue; + } +#endif +#ifdef GL_EXT_separate_specular_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_specular_color", 23)) + { + ret = GLEW_EXT_separate_specular_color; + continue; + } +#endif +#ifdef GL_EXT_shader_image_load_store + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) + { + ret = GLEW_EXT_shader_image_load_store; + continue; + } +#endif +#ifdef GL_EXT_shadow_funcs + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_funcs", 12)) + { + ret = GLEW_EXT_shadow_funcs; + continue; + } +#endif +#ifdef GL_EXT_shared_texture_palette + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_texture_palette", 22)) + { + ret = GLEW_EXT_shared_texture_palette; + continue; + } +#endif +#ifdef GL_EXT_stencil_clear_tag + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_clear_tag", 17)) + { + ret = GLEW_EXT_stencil_clear_tag; + continue; + } +#endif +#ifdef GL_EXT_stencil_two_side + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_two_side", 16)) + { + ret = GLEW_EXT_stencil_two_side; + continue; + } +#endif +#ifdef GL_EXT_stencil_wrap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_wrap", 12)) + { + ret = GLEW_EXT_stencil_wrap; + continue; + } +#endif +#ifdef GL_EXT_subtexture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"subtexture", 10)) + { + ret = GLEW_EXT_subtexture; + continue; + } +#endif +#ifdef GL_EXT_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture", 7)) + { + ret = GLEW_EXT_texture; + continue; + } +#endif +#ifdef GL_EXT_texture3D + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture3D", 9)) + { + ret = GLEW_EXT_texture3D; + continue; + } +#endif +#ifdef GL_EXT_texture_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_array", 13)) + { + ret = GLEW_EXT_texture_array; + continue; + } +#endif +#ifdef GL_EXT_texture_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21)) + { + ret = GLEW_EXT_texture_buffer_object; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_dxt1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24)) + { + ret = GLEW_EXT_texture_compression_dxt1; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_latc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_latc", 24)) + { + ret = GLEW_EXT_texture_compression_latc; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_rgtc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24)) + { + ret = GLEW_EXT_texture_compression_rgtc; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_s3tc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_s3tc", 24)) + { + ret = GLEW_EXT_texture_compression_s3tc; + continue; + } +#endif +#ifdef GL_EXT_texture_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) + { + ret = GLEW_EXT_texture_cube_map; + continue; + } +#endif +#ifdef GL_EXT_texture_edge_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) + { + ret = GLEW_EXT_texture_edge_clamp; + continue; + } +#endif +#ifdef GL_EXT_texture_env + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env", 11)) + { + ret = GLEW_EXT_texture_env; + continue; + } +#endif +#ifdef GL_EXT_texture_env_add + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) + { + ret = GLEW_EXT_texture_env_add; + continue; + } +#endif +#ifdef GL_EXT_texture_env_combine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) + { + ret = GLEW_EXT_texture_env_combine; + continue; + } +#endif +#ifdef GL_EXT_texture_env_dot3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) + { + ret = GLEW_EXT_texture_env_dot3; + continue; + } +#endif +#ifdef GL_EXT_texture_filter_anisotropic + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_anisotropic", 26)) + { + ret = GLEW_EXT_texture_filter_anisotropic; + continue; + } +#endif +#ifdef GL_EXT_texture_integer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_integer", 15)) + { + ret = GLEW_EXT_texture_integer; + continue; + } +#endif +#ifdef GL_EXT_texture_lod_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) + { + ret = GLEW_EXT_texture_lod_bias; + continue; + } +#endif +#ifdef GL_EXT_texture_mirror_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_clamp", 20)) + { + ret = GLEW_EXT_texture_mirror_clamp; + continue; + } +#endif +#ifdef GL_EXT_texture_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_object", 14)) + { + ret = GLEW_EXT_texture_object; + continue; + } +#endif +#ifdef GL_EXT_texture_perturb_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_perturb_normal", 22)) + { + ret = GLEW_EXT_texture_perturb_normal; + continue; + } +#endif +#ifdef GL_EXT_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_EXT_texture_rectangle; + continue; + } +#endif +#ifdef GL_EXT_texture_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB", 12)) + { + ret = GLEW_EXT_texture_sRGB; + continue; + } +#endif +#ifdef GL_EXT_texture_sRGB_decode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB_decode", 19)) + { + ret = GLEW_EXT_texture_sRGB_decode; + continue; + } +#endif +#ifdef GL_EXT_texture_shared_exponent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shared_exponent", 23)) + { + ret = GLEW_EXT_texture_shared_exponent; + continue; + } +#endif +#ifdef GL_EXT_texture_snorm + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_snorm", 13)) + { + ret = GLEW_EXT_texture_snorm; + continue; + } +#endif +#ifdef GL_EXT_texture_swizzle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) + { + ret = GLEW_EXT_texture_swizzle; + continue; + } +#endif +#ifdef GL_EXT_timer_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) + { + ret = GLEW_EXT_timer_query; + continue; + } +#endif +#ifdef GL_EXT_transform_feedback + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18)) + { + ret = GLEW_EXT_transform_feedback; + continue; + } +#endif +#ifdef GL_EXT_vertex_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array", 12)) + { + ret = GLEW_EXT_vertex_array; + continue; + } +#endif +#ifdef GL_EXT_vertex_array_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) + { + ret = GLEW_EXT_vertex_array_bgra; + continue; + } +#endif +#ifdef GL_EXT_vertex_attrib_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) + { + ret = GLEW_EXT_vertex_attrib_64bit; + continue; + } +#endif +#ifdef GL_EXT_vertex_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) + { + ret = GLEW_EXT_vertex_shader; + continue; + } +#endif +#ifdef GL_EXT_vertex_weighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_weighting", 16)) + { + ret = GLEW_EXT_vertex_weighting; + continue; + } +#endif +#ifdef GL_EXT_x11_sync_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"x11_sync_object", 15)) + { + ret = GLEW_EXT_x11_sync_object; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"GREMEDY_", 8)) + { +#ifdef GL_GREMEDY_frame_terminator + if (_glewStrSame3(&pos, &len, (const GLubyte*)"frame_terminator", 16)) + { + ret = GLEW_GREMEDY_frame_terminator; + continue; + } +#endif +#ifdef GL_GREMEDY_string_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"string_marker", 13)) + { + ret = GLEW_GREMEDY_string_marker; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"HP_", 3)) + { +#ifdef GL_HP_convolution_border_modes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) + { + ret = GLEW_HP_convolution_border_modes; + continue; + } +#endif +#ifdef GL_HP_image_transform + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_transform", 15)) + { + ret = GLEW_HP_image_transform; + continue; + } +#endif +#ifdef GL_HP_occlusion_test + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_test", 14)) + { + ret = GLEW_HP_occlusion_test; + continue; + } +#endif +#ifdef GL_HP_texture_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lighting", 16)) + { + ret = GLEW_HP_texture_lighting; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"IBM_", 4)) + { +#ifdef GL_IBM_cull_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) + { + ret = GLEW_IBM_cull_vertex; + continue; + } +#endif +#ifdef GL_IBM_multimode_draw_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multimode_draw_arrays", 21)) + { + ret = GLEW_IBM_multimode_draw_arrays; + continue; + } +#endif +#ifdef GL_IBM_rasterpos_clip + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rasterpos_clip", 14)) + { + ret = GLEW_IBM_rasterpos_clip; + continue; + } +#endif +#ifdef GL_IBM_static_data + if (_glewStrSame3(&pos, &len, (const GLubyte*)"static_data", 11)) + { + ret = GLEW_IBM_static_data; + continue; + } +#endif +#ifdef GL_IBM_texture_mirrored_repeat + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) + { + ret = GLEW_IBM_texture_mirrored_repeat; + continue; + } +#endif +#ifdef GL_IBM_vertex_array_lists + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_lists", 18)) + { + ret = GLEW_IBM_vertex_array_lists; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INGR_", 5)) + { +#ifdef GL_INGR_color_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_clamp", 11)) + { + ret = GLEW_INGR_color_clamp; + continue; + } +#endif +#ifdef GL_INGR_interlace_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace_read", 14)) + { + ret = GLEW_INGR_interlace_read; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) + { +#ifdef GL_INTEL_map_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_texture", 11)) + { + ret = GLEW_INTEL_map_texture; + continue; + } +#endif +#ifdef GL_INTEL_parallel_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parallel_arrays", 15)) + { + ret = GLEW_INTEL_parallel_arrays; + continue; + } +#endif +#ifdef GL_INTEL_texture_scissor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scissor", 15)) + { + ret = GLEW_INTEL_texture_scissor; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"KHR_", 4)) + { +#ifdef GL_KHR_debug + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug", 5)) + { + ret = GLEW_KHR_debug; + continue; + } +#endif +#ifdef GL_KHR_texture_compression_astc_ldr + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_ldr", 28)) + { + ret = GLEW_KHR_texture_compression_astc_ldr; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"KTX_", 4)) + { +#ifdef GL_KTX_buffer_region + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) + { + ret = GLEW_KTX_buffer_region; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESAX_", 6)) + { +#ifdef GL_MESAX_texture_stack + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_stack", 13)) + { + ret = GLEW_MESAX_texture_stack; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) + { +#ifdef GL_MESA_pack_invert + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_invert", 11)) + { + ret = GLEW_MESA_pack_invert; + continue; + } +#endif +#ifdef GL_MESA_resize_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resize_buffers", 14)) + { + ret = GLEW_MESA_resize_buffers; + continue; + } +#endif +#ifdef GL_MESA_window_pos + if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) + { + ret = GLEW_MESA_window_pos; + continue; + } +#endif +#ifdef GL_MESA_ycbcr_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_texture", 13)) + { + ret = GLEW_MESA_ycbcr_texture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NVX_", 4)) + { +#ifdef GL_NVX_conditional_render + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render", 18)) + { + ret = GLEW_NVX_conditional_render; + continue; + } +#endif +#ifdef GL_NVX_gpu_memory_info + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_memory_info", 15)) + { + ret = GLEW_NVX_gpu_memory_info; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef GL_NV_bindless_multi_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_multi_draw_indirect", 28)) + { + ret = GLEW_NV_bindless_multi_draw_indirect; + continue; + } +#endif +#ifdef GL_NV_bindless_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_texture", 16)) + { + ret = GLEW_NV_bindless_texture; + continue; + } +#endif +#ifdef GL_NV_blend_equation_advanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced", 23)) + { + ret = GLEW_NV_blend_equation_advanced; + continue; + } +#endif +#ifdef GL_NV_blend_equation_advanced_coherent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced_coherent", 32)) + { + ret = GLEW_NV_blend_equation_advanced_coherent; + continue; + } +#endif +#ifdef GL_NV_blend_square + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_square", 12)) + { + ret = GLEW_NV_blend_square; + continue; + } +#endif +#ifdef GL_NV_compute_program5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_program5", 16)) + { + ret = GLEW_NV_compute_program5; + continue; + } +#endif +#ifdef GL_NV_conditional_render + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render", 18)) + { + ret = GLEW_NV_conditional_render; + continue; + } +#endif +#ifdef GL_NV_copy_depth_to_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_depth_to_color", 19)) + { + ret = GLEW_NV_copy_depth_to_color; + continue; + } +#endif +#ifdef GL_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLEW_NV_copy_image; + continue; + } +#endif +#ifdef GL_NV_deep_texture3D + if (_glewStrSame3(&pos, &len, (const GLubyte*)"deep_texture3D", 14)) + { + ret = GLEW_NV_deep_texture3D; + continue; + } +#endif +#ifdef GL_NV_depth_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) + { + ret = GLEW_NV_depth_buffer_float; + continue; + } +#endif +#ifdef GL_NV_depth_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) + { + ret = GLEW_NV_depth_clamp; + continue; + } +#endif +#ifdef GL_NV_depth_range_unclamped + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_range_unclamped", 21)) + { + ret = GLEW_NV_depth_range_unclamped; + continue; + } +#endif +#ifdef GL_NV_draw_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_texture", 12)) + { + ret = GLEW_NV_draw_texture; + continue; + } +#endif +#ifdef GL_NV_evaluators + if (_glewStrSame3(&pos, &len, (const GLubyte*)"evaluators", 10)) + { + ret = GLEW_NV_evaluators; + continue; + } +#endif +#ifdef GL_NV_explicit_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_multisample", 20)) + { + ret = GLEW_NV_explicit_multisample; + continue; + } +#endif +#ifdef GL_NV_fence + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) + { + ret = GLEW_NV_fence; + continue; + } +#endif +#ifdef GL_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = GLEW_NV_float_buffer; + continue; + } +#endif +#ifdef GL_NV_fog_distance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_distance", 12)) + { + ret = GLEW_NV_fog_distance; + continue; + } +#endif +#ifdef GL_NV_fragment_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) + { + ret = GLEW_NV_fragment_program; + continue; + } +#endif +#ifdef GL_NV_fragment_program2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program2", 17)) + { + ret = GLEW_NV_fragment_program2; + continue; + } +#endif +#ifdef GL_NV_fragment_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program4", 17)) + { + ret = GLEW_NV_fragment_program4; + continue; + } +#endif +#ifdef GL_NV_fragment_program_option + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_option", 23)) + { + ret = GLEW_NV_fragment_program_option; + continue; + } +#endif +#ifdef GL_NV_framebuffer_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_coverage", 32)) + { + ret = GLEW_NV_framebuffer_multisample_coverage; + continue; + } +#endif +#ifdef GL_NV_geometry_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_program4", 17)) + { + ret = GLEW_NV_geometry_program4; + continue; + } +#endif +#ifdef GL_NV_geometry_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) + { + ret = GLEW_NV_geometry_shader4; + continue; + } +#endif +#ifdef GL_NV_gpu_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program4", 12)) + { + ret = GLEW_NV_gpu_program4; + continue; + } +#endif +#ifdef GL_NV_gpu_program5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program5", 12)) + { + ret = GLEW_NV_gpu_program5; + continue; + } +#endif +#ifdef GL_NV_gpu_program5_mem_extended + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program5_mem_extended", 25)) + { + ret = GLEW_NV_gpu_program5_mem_extended; + continue; + } +#endif +#ifdef GL_NV_gpu_program_fp64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_fp64", 16)) + { + ret = GLEW_NV_gpu_program_fp64; + continue; + } +#endif +#ifdef GL_NV_gpu_shader5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) + { + ret = GLEW_NV_gpu_shader5; + continue; + } +#endif +#ifdef GL_NV_half_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float", 10)) + { + ret = GLEW_NV_half_float; + continue; + } +#endif +#ifdef GL_NV_light_max_exponent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_max_exponent", 18)) + { + ret = GLEW_NV_light_max_exponent; + continue; + } +#endif +#ifdef GL_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = GLEW_NV_multisample_coverage; + continue; + } +#endif +#ifdef GL_NV_multisample_filter_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_filter_hint", 23)) + { + ret = GLEW_NV_multisample_filter_hint; + continue; + } +#endif +#ifdef GL_NV_occlusion_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) + { + ret = GLEW_NV_occlusion_query; + continue; + } +#endif +#ifdef GL_NV_packed_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) + { + ret = GLEW_NV_packed_depth_stencil; + continue; + } +#endif +#ifdef GL_NV_parameter_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object", 23)) + { + ret = GLEW_NV_parameter_buffer_object; + continue; + } +#endif +#ifdef GL_NV_parameter_buffer_object2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object2", 24)) + { + ret = GLEW_NV_parameter_buffer_object2; + continue; + } +#endif +#ifdef GL_NV_path_rendering + if (_glewStrSame3(&pos, &len, (const GLubyte*)"path_rendering", 14)) + { + ret = GLEW_NV_path_rendering; + continue; + } +#endif +#ifdef GL_NV_pixel_data_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_data_range", 16)) + { + ret = GLEW_NV_pixel_data_range; + continue; + } +#endif +#ifdef GL_NV_point_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) + { + ret = GLEW_NV_point_sprite; + continue; + } +#endif +#ifdef GL_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = GLEW_NV_present_video; + continue; + } +#endif +#ifdef GL_NV_primitive_restart + if (_glewStrSame3(&pos, &len, (const GLubyte*)"primitive_restart", 17)) + { + ret = GLEW_NV_primitive_restart; + continue; + } +#endif +#ifdef GL_NV_register_combiners + if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners", 18)) + { + ret = GLEW_NV_register_combiners; + continue; + } +#endif +#ifdef GL_NV_register_combiners2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners2", 19)) + { + ret = GLEW_NV_register_combiners2; + continue; + } +#endif +#ifdef GL_NV_shader_atomic_counters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counters", 22)) + { + ret = GLEW_NV_shader_atomic_counters; + continue; + } +#endif +#ifdef GL_NV_shader_atomic_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_float", 19)) + { + ret = GLEW_NV_shader_atomic_float; + continue; + } +#endif +#ifdef GL_NV_shader_buffer_load + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_buffer_load", 18)) + { + ret = GLEW_NV_shader_buffer_load; + continue; + } +#endif +#ifdef GL_NV_shader_storage_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_storage_buffer_object", 28)) + { + ret = GLEW_NV_shader_storage_buffer_object; + continue; + } +#endif +#ifdef GL_NV_tessellation_program5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_program5", 21)) + { + ret = GLEW_NV_tessellation_program5; + continue; + } +#endif +#ifdef GL_NV_texgen_emboss + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_emboss", 13)) + { + ret = GLEW_NV_texgen_emboss; + continue; + } +#endif +#ifdef GL_NV_texgen_reflection + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_reflection", 17)) + { + ret = GLEW_NV_texgen_reflection; + continue; + } +#endif +#ifdef GL_NV_texture_barrier + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_barrier", 15)) + { + ret = GLEW_NV_texture_barrier; + continue; + } +#endif +#ifdef GL_NV_texture_compression_vtc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_vtc", 23)) + { + ret = GLEW_NV_texture_compression_vtc; + continue; + } +#endif +#ifdef GL_NV_texture_env_combine4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine4", 20)) + { + ret = GLEW_NV_texture_env_combine4; + continue; + } +#endif +#ifdef GL_NV_texture_expand_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_expand_normal", 21)) + { + ret = GLEW_NV_texture_expand_normal; + continue; + } +#endif +#ifdef GL_NV_texture_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19)) + { + ret = GLEW_NV_texture_multisample; + continue; + } +#endif +#ifdef GL_NV_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_NV_texture_rectangle; + continue; + } +#endif +#ifdef GL_NV_texture_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader", 14)) + { + ret = GLEW_NV_texture_shader; + continue; + } +#endif +#ifdef GL_NV_texture_shader2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader2", 15)) + { + ret = GLEW_NV_texture_shader2; + continue; + } +#endif +#ifdef GL_NV_texture_shader3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader3", 15)) + { + ret = GLEW_NV_texture_shader3; + continue; + } +#endif +#ifdef GL_NV_transform_feedback + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18)) + { + ret = GLEW_NV_transform_feedback; + continue; + } +#endif +#ifdef GL_NV_transform_feedback2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) + { + ret = GLEW_NV_transform_feedback2; + continue; + } +#endif +#ifdef GL_NV_vdpau_interop + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vdpau_interop", 13)) + { + ret = GLEW_NV_vdpau_interop; + continue; + } +#endif +#ifdef GL_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLEW_NV_vertex_array_range; + continue; + } +#endif +#ifdef GL_NV_vertex_array_range2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range2", 19)) + { + ret = GLEW_NV_vertex_array_range2; + continue; + } +#endif +#ifdef GL_NV_vertex_attrib_integer_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_integer_64bit", 27)) + { + ret = GLEW_NV_vertex_attrib_integer_64bit; + continue; + } +#endif +#ifdef GL_NV_vertex_buffer_unified_memory + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_unified_memory", 28)) + { + ret = GLEW_NV_vertex_buffer_unified_memory; + continue; + } +#endif +#ifdef GL_NV_vertex_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) + { + ret = GLEW_NV_vertex_program; + continue; + } +#endif +#ifdef GL_NV_vertex_program1_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program1_1", 17)) + { + ret = GLEW_NV_vertex_program1_1; + continue; + } +#endif +#ifdef GL_NV_vertex_program2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2", 15)) + { + ret = GLEW_NV_vertex_program2; + continue; + } +#endif +#ifdef GL_NV_vertex_program2_option + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2_option", 22)) + { + ret = GLEW_NV_vertex_program2_option; + continue; + } +#endif +#ifdef GL_NV_vertex_program3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program3", 15)) + { + ret = GLEW_NV_vertex_program3; + continue; + } +#endif +#ifdef GL_NV_vertex_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program4", 15)) + { + ret = GLEW_NV_vertex_program4; + continue; + } +#endif +#ifdef GL_NV_video_capture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) + { + ret = GLEW_NV_video_capture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OES_", 4)) + { +#ifdef GL_OES_byte_coordinates + if (_glewStrSame3(&pos, &len, (const GLubyte*)"byte_coordinates", 16)) + { + ret = GLEW_OES_byte_coordinates; + continue; + } +#endif +#ifdef GL_OES_compressed_paletted_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_paletted_texture", 27)) + { + ret = GLEW_OES_compressed_paletted_texture; + continue; + } +#endif +#ifdef GL_OES_read_format + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_format", 11)) + { + ret = GLEW_OES_read_format; + continue; + } +#endif +#ifdef GL_OES_single_precision + if (_glewStrSame3(&pos, &len, (const GLubyte*)"single_precision", 16)) + { + ret = GLEW_OES_single_precision; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef GL_OML_interlace + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) + { + ret = GLEW_OML_interlace; + continue; + } +#endif +#ifdef GL_OML_resample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) + { + ret = GLEW_OML_resample; + continue; + } +#endif +#ifdef GL_OML_subsample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"subsample", 9)) + { + ret = GLEW_OML_subsample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"PGI_", 4)) + { +#ifdef GL_PGI_misc_hints + if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_hints", 10)) + { + ret = GLEW_PGI_misc_hints; + continue; + } +#endif +#ifdef GL_PGI_vertex_hints + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_hints", 12)) + { + ret = GLEW_PGI_vertex_hints; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"REGAL_", 6)) + { +#ifdef GL_REGAL_ES1_0_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES1_0_compatibility", 19)) + { + ret = GLEW_REGAL_ES1_0_compatibility; + continue; + } +#endif +#ifdef GL_REGAL_ES1_1_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES1_1_compatibility", 19)) + { + ret = GLEW_REGAL_ES1_1_compatibility; + continue; + } +#endif +#ifdef GL_REGAL_enable + if (_glewStrSame3(&pos, &len, (const GLubyte*)"enable", 6)) + { + ret = GLEW_REGAL_enable; + continue; + } +#endif +#ifdef GL_REGAL_error_string + if (_glewStrSame3(&pos, &len, (const GLubyte*)"error_string", 12)) + { + ret = GLEW_REGAL_error_string; + continue; + } +#endif +#ifdef GL_REGAL_extension_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extension_query", 15)) + { + ret = GLEW_REGAL_extension_query; + continue; + } +#endif +#ifdef GL_REGAL_log + if (_glewStrSame3(&pos, &len, (const GLubyte*)"log", 3)) + { + ret = GLEW_REGAL_log; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"REND_", 5)) + { +#ifdef GL_REND_screen_coordinates + if (_glewStrSame3(&pos, &len, (const GLubyte*)"screen_coordinates", 18)) + { + ret = GLEW_REND_screen_coordinates; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"S3_", 3)) + { +#ifdef GL_S3_s3tc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"s3tc", 4)) + { + ret = GLEW_S3_s3tc; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) + { +#ifdef GL_SGIS_color_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) + { + ret = GLEW_SGIS_color_range; + continue; + } +#endif +#ifdef GL_SGIS_detail_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"detail_texture", 14)) + { + ret = GLEW_SGIS_detail_texture; + continue; + } +#endif +#ifdef GL_SGIS_fog_function + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_function", 12)) + { + ret = GLEW_SGIS_fog_function; + continue; + } +#endif +#ifdef GL_SGIS_generate_mipmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"generate_mipmap", 15)) + { + ret = GLEW_SGIS_generate_mipmap; + continue; + } +#endif +#ifdef GL_SGIS_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_SGIS_multisample; + continue; + } +#endif +#ifdef GL_SGIS_pixel_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) + { + ret = GLEW_SGIS_pixel_texture; + continue; + } +#endif +#ifdef GL_SGIS_point_line_texgen + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_line_texgen", 17)) + { + ret = GLEW_SGIS_point_line_texgen; + continue; + } +#endif +#ifdef GL_SGIS_sharpen_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sharpen_texture", 15)) + { + ret = GLEW_SGIS_sharpen_texture; + continue; + } +#endif +#ifdef GL_SGIS_texture4D + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture4D", 9)) + { + ret = GLEW_SGIS_texture4D; + continue; + } +#endif +#ifdef GL_SGIS_texture_border_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) + { + ret = GLEW_SGIS_texture_border_clamp; + continue; + } +#endif +#ifdef GL_SGIS_texture_edge_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) + { + ret = GLEW_SGIS_texture_edge_clamp; + continue; + } +#endif +#ifdef GL_SGIS_texture_filter4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter4", 15)) + { + ret = GLEW_SGIS_texture_filter4; + continue; + } +#endif +#ifdef GL_SGIS_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod", 11)) + { + ret = GLEW_SGIS_texture_lod; + continue; + } +#endif +#ifdef GL_SGIS_texture_select + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_select", 14)) + { + ret = GLEW_SGIS_texture_select; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) + { +#ifdef GL_SGIX_async + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async", 5)) + { + ret = GLEW_SGIX_async; + continue; + } +#endif +#ifdef GL_SGIX_async_histogram + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_histogram", 15)) + { + ret = GLEW_SGIX_async_histogram; + continue; + } +#endif +#ifdef GL_SGIX_async_pixel + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_pixel", 11)) + { + ret = GLEW_SGIX_async_pixel; + continue; + } +#endif +#ifdef GL_SGIX_blend_alpha_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_alpha_minmax", 18)) + { + ret = GLEW_SGIX_blend_alpha_minmax; + continue; + } +#endif +#ifdef GL_SGIX_clipmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clipmap", 7)) + { + ret = GLEW_SGIX_clipmap; + continue; + } +#endif +#ifdef GL_SGIX_convolution_accuracy + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_accuracy", 20)) + { + ret = GLEW_SGIX_convolution_accuracy; + continue; + } +#endif +#ifdef GL_SGIX_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) + { + ret = GLEW_SGIX_depth_texture; + continue; + } +#endif +#ifdef GL_SGIX_flush_raster + if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_raster", 12)) + { + ret = GLEW_SGIX_flush_raster; + continue; + } +#endif +#ifdef GL_SGIX_fog_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_offset", 10)) + { + ret = GLEW_SGIX_fog_offset; + continue; + } +#endif +#ifdef GL_SGIX_fog_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_texture", 11)) + { + ret = GLEW_SGIX_fog_texture; + continue; + } +#endif +#ifdef GL_SGIX_fragment_specular_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_specular_lighting", 26)) + { + ret = GLEW_SGIX_fragment_specular_lighting; + continue; + } +#endif +#ifdef GL_SGIX_framezoom + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framezoom", 9)) + { + ret = GLEW_SGIX_framezoom; + continue; + } +#endif +#ifdef GL_SGIX_interlace + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) + { + ret = GLEW_SGIX_interlace; + continue; + } +#endif +#ifdef GL_SGIX_ir_instrument1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ir_instrument1", 14)) + { + ret = GLEW_SGIX_ir_instrument1; + continue; + } +#endif +#ifdef GL_SGIX_list_priority + if (_glewStrSame3(&pos, &len, (const GLubyte*)"list_priority", 13)) + { + ret = GLEW_SGIX_list_priority; + continue; + } +#endif +#ifdef GL_SGIX_pixel_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) + { + ret = GLEW_SGIX_pixel_texture; + continue; + } +#endif +#ifdef GL_SGIX_pixel_texture_bits + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture_bits", 18)) + { + ret = GLEW_SGIX_pixel_texture_bits; + continue; + } +#endif +#ifdef GL_SGIX_reference_plane + if (_glewStrSame3(&pos, &len, (const GLubyte*)"reference_plane", 15)) + { + ret = GLEW_SGIX_reference_plane; + continue; + } +#endif +#ifdef GL_SGIX_resample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) + { + ret = GLEW_SGIX_resample; + continue; + } +#endif +#ifdef GL_SGIX_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) + { + ret = GLEW_SGIX_shadow; + continue; + } +#endif +#ifdef GL_SGIX_shadow_ambient + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) + { + ret = GLEW_SGIX_shadow_ambient; + continue; + } +#endif +#ifdef GL_SGIX_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sprite", 6)) + { + ret = GLEW_SGIX_sprite; + continue; + } +#endif +#ifdef GL_SGIX_tag_sample_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tag_sample_buffer", 17)) + { + ret = GLEW_SGIX_tag_sample_buffer; + continue; + } +#endif +#ifdef GL_SGIX_texture_add_env + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_add_env", 15)) + { + ret = GLEW_SGIX_texture_add_env; + continue; + } +#endif +#ifdef GL_SGIX_texture_coordinate_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_coordinate_clamp", 24)) + { + ret = GLEW_SGIX_texture_coordinate_clamp; + continue; + } +#endif +#ifdef GL_SGIX_texture_lod_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) + { + ret = GLEW_SGIX_texture_lod_bias; + continue; + } +#endif +#ifdef GL_SGIX_texture_multi_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multi_buffer", 20)) + { + ret = GLEW_SGIX_texture_multi_buffer; + continue; + } +#endif +#ifdef GL_SGIX_texture_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) + { + ret = GLEW_SGIX_texture_range; + continue; + } +#endif +#ifdef GL_SGIX_texture_scale_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scale_bias", 18)) + { + ret = GLEW_SGIX_texture_scale_bias; + continue; + } +#endif +#ifdef GL_SGIX_vertex_preclip + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip", 14)) + { + ret = GLEW_SGIX_vertex_preclip; + continue; + } +#endif +#ifdef GL_SGIX_vertex_preclip_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip_hint", 19)) + { + ret = GLEW_SGIX_vertex_preclip_hint; + continue; + } +#endif +#ifdef GL_SGIX_ycrcb + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycrcb", 5)) + { + ret = GLEW_SGIX_ycrcb; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) + { +#ifdef GL_SGI_color_matrix + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_matrix", 12)) + { + ret = GLEW_SGI_color_matrix; + continue; + } +#endif +#ifdef GL_SGI_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_table", 11)) + { + ret = GLEW_SGI_color_table; + continue; + } +#endif +#ifdef GL_SGI_texture_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_color_table", 19)) + { + ret = GLEW_SGI_texture_color_table; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUNX_", 5)) + { +#ifdef GL_SUNX_constant_data + if (_glewStrSame3(&pos, &len, (const GLubyte*)"constant_data", 13)) + { + ret = GLEW_SUNX_constant_data; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) + { +#ifdef GL_SUN_convolution_border_modes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) + { + ret = GLEW_SUN_convolution_border_modes; + continue; + } +#endif +#ifdef GL_SUN_global_alpha + if (_glewStrSame3(&pos, &len, (const GLubyte*)"global_alpha", 12)) + { + ret = GLEW_SUN_global_alpha; + continue; + } +#endif +#ifdef GL_SUN_mesh_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"mesh_array", 10)) + { + ret = GLEW_SUN_mesh_array; + continue; + } +#endif +#ifdef GL_SUN_read_video_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_video_pixels", 17)) + { + ret = GLEW_SUN_read_video_pixels; + continue; + } +#endif +#ifdef GL_SUN_slice_accum + if (_glewStrSame3(&pos, &len, (const GLubyte*)"slice_accum", 11)) + { + ret = GLEW_SUN_slice_accum; + continue; + } +#endif +#ifdef GL_SUN_triangle_list + if (_glewStrSame3(&pos, &len, (const GLubyte*)"triangle_list", 13)) + { + ret = GLEW_SUN_triangle_list; + continue; + } +#endif +#ifdef GL_SUN_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex", 6)) + { + ret = GLEW_SUN_vertex; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"WIN_", 4)) + { +#ifdef GL_WIN_phong_shading + if (_glewStrSame3(&pos, &len, (const GLubyte*)"phong_shading", 13)) + { + ret = GLEW_WIN_phong_shading; + continue; + } +#endif +#ifdef GL_WIN_specular_fog + if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_fog", 12)) + { + ret = GLEW_WIN_specular_fog; + continue; + } +#endif +#ifdef GL_WIN_swap_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_hint", 9)) + { + ret = GLEW_WIN_swap_hint; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#if defined(_WIN32) + +#if defined(GLEW_MX) +GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext* ctx, const char* name) +#else +GLboolean GLEWAPIENTRY wglewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if (_glewStrSame1(&pos, &len, (const GLubyte*)"WGL_", 4)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef WGL_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_3DFX_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DL_", 4)) + { +#ifdef WGL_3DL_stereo_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stereo_control", 14)) + { + ret = WGLEW_3DL_stereo_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef WGL_AMD_gpu_association + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) + { + ret = WGLEW_AMD_gpu_association; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef WGL_ARB_buffer_region + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) + { + ret = WGLEW_ARB_buffer_region; + continue; + } +#endif +#ifdef WGL_ARB_create_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) + { + ret = WGLEW_ARB_create_context; + continue; + } +#endif +#ifdef WGL_ARB_create_context_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) + { + ret = WGLEW_ARB_create_context_profile; + continue; + } +#endif +#ifdef WGL_ARB_create_context_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) + { + ret = WGLEW_ARB_create_context_robustness; + continue; + } +#endif +#ifdef WGL_ARB_extensions_string + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) + { + ret = WGLEW_ARB_extensions_string; + continue; + } +#endif +#ifdef WGL_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = WGLEW_ARB_framebuffer_sRGB; + continue; + } +#endif +#ifdef WGL_ARB_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = WGLEW_ARB_make_current_read; + continue; + } +#endif +#ifdef WGL_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_ARB_multisample; + continue; + } +#endif +#ifdef WGL_ARB_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = WGLEW_ARB_pbuffer; + continue; + } +#endif +#ifdef WGL_ARB_pixel_format + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) + { + ret = WGLEW_ARB_pixel_format; + continue; + } +#endif +#ifdef WGL_ARB_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = WGLEW_ARB_pixel_format_float; + continue; + } +#endif +#ifdef WGL_ARB_render_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) + { + ret = WGLEW_ARB_render_texture; + continue; + } +#endif +#ifdef WGL_ARB_robustness_application_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) + { + ret = WGLEW_ARB_robustness_application_isolation; + continue; + } +#endif +#ifdef WGL_ARB_robustness_share_group_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) + { + ret = WGLEW_ARB_robustness_share_group_isolation; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef WGL_ATI_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = WGLEW_ATI_pixel_format_float; + continue; + } +#endif +#ifdef WGL_ATI_render_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) + { + ret = WGLEW_ATI_render_texture_rectangle; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef WGL_EXT_create_context_es2_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) + { + ret = WGLEW_EXT_create_context_es2_profile; + continue; + } +#endif +#ifdef WGL_EXT_create_context_es_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25)) + { + ret = WGLEW_EXT_create_context_es_profile; + continue; + } +#endif +#ifdef WGL_EXT_depth_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_float", 11)) + { + ret = WGLEW_EXT_depth_float; + continue; + } +#endif +#ifdef WGL_EXT_display_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"display_color_table", 19)) + { + ret = WGLEW_EXT_display_color_table; + continue; + } +#endif +#ifdef WGL_EXT_extensions_string + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) + { + ret = WGLEW_EXT_extensions_string; + continue; + } +#endif +#ifdef WGL_EXT_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = WGLEW_EXT_framebuffer_sRGB; + continue; + } +#endif +#ifdef WGL_EXT_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = WGLEW_EXT_make_current_read; + continue; + } +#endif +#ifdef WGL_EXT_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_EXT_multisample; + continue; + } +#endif +#ifdef WGL_EXT_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = WGLEW_EXT_pbuffer; + continue; + } +#endif +#ifdef WGL_EXT_pixel_format + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) + { + ret = WGLEW_EXT_pixel_format; + continue; + } +#endif +#ifdef WGL_EXT_pixel_format_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_packed_float", 25)) + { + ret = WGLEW_EXT_pixel_format_packed_float; + continue; + } +#endif +#ifdef WGL_EXT_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = WGLEW_EXT_swap_control; + continue; + } +#endif +#ifdef WGL_EXT_swap_control_tear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17)) + { + ret = WGLEW_EXT_swap_control_tear; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"I3D_", 4)) + { +#ifdef WGL_I3D_digital_video_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"digital_video_control", 21)) + { + ret = WGLEW_I3D_digital_video_control; + continue; + } +#endif +#ifdef WGL_I3D_gamma + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gamma", 5)) + { + ret = WGLEW_I3D_gamma; + continue; + } +#endif +#ifdef WGL_I3D_genlock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"genlock", 7)) + { + ret = WGLEW_I3D_genlock; + continue; + } +#endif +#ifdef WGL_I3D_image_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_buffer", 12)) + { + ret = WGLEW_I3D_image_buffer; + continue; + } +#endif +#ifdef WGL_I3D_swap_frame_lock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_lock", 15)) + { + ret = WGLEW_I3D_swap_frame_lock; + continue; + } +#endif +#ifdef WGL_I3D_swap_frame_usage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_usage", 16)) + { + ret = WGLEW_I3D_swap_frame_usage; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef WGL_NV_DX_interop + if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop", 10)) + { + ret = WGLEW_NV_DX_interop; + continue; + } +#endif +#ifdef WGL_NV_DX_interop2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop2", 11)) + { + ret = WGLEW_NV_DX_interop2; + continue; + } +#endif +#ifdef WGL_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = WGLEW_NV_copy_image; + continue; + } +#endif +#ifdef WGL_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = WGLEW_NV_float_buffer; + continue; + } +#endif +#ifdef WGL_NV_gpu_affinity + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_affinity", 12)) + { + ret = WGLEW_NV_gpu_affinity; + continue; + } +#endif +#ifdef WGL_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = WGLEW_NV_multisample_coverage; + continue; + } +#endif +#ifdef WGL_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = WGLEW_NV_present_video; + continue; + } +#endif +#ifdef WGL_NV_render_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_depth_texture", 20)) + { + ret = WGLEW_NV_render_depth_texture; + continue; + } +#endif +#ifdef WGL_NV_render_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) + { + ret = WGLEW_NV_render_texture_rectangle; + continue; + } +#endif +#ifdef WGL_NV_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = WGLEW_NV_swap_group; + continue; + } +#endif +#ifdef WGL_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = WGLEW_NV_vertex_array_range; + continue; + } +#endif +#ifdef WGL_NV_video_capture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) + { + ret = WGLEW_NV_video_capture; + continue; + } +#endif +#ifdef WGL_NV_video_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_output", 12)) + { + ret = WGLEW_NV_video_output; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef WGL_OML_sync_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) + { + ret = WGLEW_OML_sync_control; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + +#if defined(GLEW_MX) +GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name) +#else +GLboolean glxewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if(_glewStrSame1(&pos, &len, (const GLubyte*)"GLX_", 4)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) + { +#ifdef GLX_VERSION_1_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) + { + ret = GLXEW_VERSION_1_2; + continue; + } +#endif +#ifdef GLX_VERSION_1_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) + { + ret = GLXEW_VERSION_1_3; + continue; + } +#endif +#ifdef GLX_VERSION_1_4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) + { + ret = GLXEW_VERSION_1_4; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef GLX_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_3DFX_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef GLX_AMD_gpu_association + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) + { + ret = GLXEW_AMD_gpu_association; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef GLX_ARB_create_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) + { + ret = GLXEW_ARB_create_context; + continue; + } +#endif +#ifdef GLX_ARB_create_context_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) + { + ret = GLXEW_ARB_create_context_profile; + continue; + } +#endif +#ifdef GLX_ARB_create_context_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) + { + ret = GLXEW_ARB_create_context_robustness; + continue; + } +#endif +#ifdef GLX_ARB_fbconfig_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_float", 14)) + { + ret = GLXEW_ARB_fbconfig_float; + continue; + } +#endif +#ifdef GLX_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLXEW_ARB_framebuffer_sRGB; + continue; + } +#endif +#ifdef GLX_ARB_get_proc_address + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_proc_address", 16)) + { + ret = GLXEW_ARB_get_proc_address; + continue; + } +#endif +#ifdef GLX_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_ARB_multisample; + continue; + } +#endif +#ifdef GLX_ARB_robustness_application_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) + { + ret = GLXEW_ARB_robustness_application_isolation; + continue; + } +#endif +#ifdef GLX_ARB_robustness_share_group_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) + { + ret = GLXEW_ARB_robustness_share_group_isolation; + continue; + } +#endif +#ifdef GLX_ARB_vertex_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) + { + ret = GLXEW_ARB_vertex_buffer_object; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef GLX_ATI_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = GLXEW_ATI_pixel_format_float; + continue; + } +#endif +#ifdef GLX_ATI_render_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) + { + ret = GLXEW_ATI_render_texture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef GLX_EXT_buffer_age + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_age", 10)) + { + ret = GLXEW_EXT_buffer_age; + continue; + } +#endif +#ifdef GLX_EXT_create_context_es2_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) + { + ret = GLXEW_EXT_create_context_es2_profile; + continue; + } +#endif +#ifdef GLX_EXT_create_context_es_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25)) + { + ret = GLXEW_EXT_create_context_es_profile; + continue; + } +#endif +#ifdef GLX_EXT_fbconfig_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_packed_float", 21)) + { + ret = GLXEW_EXT_fbconfig_packed_float; + continue; + } +#endif +#ifdef GLX_EXT_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLXEW_EXT_framebuffer_sRGB; + continue; + } +#endif +#ifdef GLX_EXT_import_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"import_context", 14)) + { + ret = GLXEW_EXT_import_context; + continue; + } +#endif +#ifdef GLX_EXT_scene_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) + { + ret = GLXEW_EXT_scene_marker; + continue; + } +#endif +#ifdef GLX_EXT_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_EXT_swap_control; + continue; + } +#endif +#ifdef GLX_EXT_swap_control_tear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17)) + { + ret = GLXEW_EXT_swap_control_tear; + continue; + } +#endif +#ifdef GLX_EXT_texture_from_pixmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_from_pixmap", 19)) + { + ret = GLXEW_EXT_texture_from_pixmap; + continue; + } +#endif +#ifdef GLX_EXT_visual_info + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_info", 11)) + { + ret = GLXEW_EXT_visual_info; + continue; + } +#endif +#ifdef GLX_EXT_visual_rating + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_rating", 13)) + { + ret = GLXEW_EXT_visual_rating; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) + { +#ifdef GLX_INTEL_swap_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_event", 10)) + { + ret = GLXEW_INTEL_swap_event; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) + { +#ifdef GLX_MESA_agp_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"agp_offset", 10)) + { + ret = GLXEW_MESA_agp_offset; + continue; + } +#endif +#ifdef GLX_MESA_copy_sub_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_sub_buffer", 15)) + { + ret = GLXEW_MESA_copy_sub_buffer; + continue; + } +#endif +#ifdef GLX_MESA_pixmap_colormap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixmap_colormap", 15)) + { + ret = GLXEW_MESA_pixmap_colormap; + continue; + } +#endif +#ifdef GLX_MESA_release_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"release_buffers", 15)) + { + ret = GLXEW_MESA_release_buffers; + continue; + } +#endif +#ifdef GLX_MESA_set_3dfx_mode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"set_3dfx_mode", 13)) + { + ret = GLXEW_MESA_set_3dfx_mode; + continue; + } +#endif +#ifdef GLX_MESA_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_MESA_swap_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef GLX_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLXEW_NV_copy_image; + continue; + } +#endif +#ifdef GLX_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = GLXEW_NV_float_buffer; + continue; + } +#endif +#ifdef GLX_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = GLXEW_NV_multisample_coverage; + continue; + } +#endif +#ifdef GLX_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = GLXEW_NV_present_video; + continue; + } +#endif +#ifdef GLX_NV_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = GLXEW_NV_swap_group; + continue; + } +#endif +#ifdef GLX_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLXEW_NV_vertex_array_range; + continue; + } +#endif +#ifdef GLX_NV_video_capture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) + { + ret = GLXEW_NV_video_capture; + continue; + } +#endif +#ifdef GLX_NV_video_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_output", 12)) + { + ret = GLXEW_NV_video_output; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef GLX_OML_swap_method + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_method", 11)) + { + ret = GLXEW_OML_swap_method; + continue; + } +#endif +#ifdef GLX_OML_sync_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) + { + ret = GLXEW_OML_sync_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) + { +#ifdef GLX_SGIS_blended_overlay + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blended_overlay", 15)) + { + ret = GLXEW_SGIS_blended_overlay; + continue; + } +#endif +#ifdef GLX_SGIS_color_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) + { + ret = GLXEW_SGIS_color_range; + continue; + } +#endif +#ifdef GLX_SGIS_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_SGIS_multisample; + continue; + } +#endif +#ifdef GLX_SGIS_shared_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_multisample", 18)) + { + ret = GLXEW_SGIS_shared_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) + { +#ifdef GLX_SGIX_fbconfig + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig", 8)) + { + ret = GLXEW_SGIX_fbconfig; + continue; + } +#endif +#ifdef GLX_SGIX_hyperpipe + if (_glewStrSame3(&pos, &len, (const GLubyte*)"hyperpipe", 9)) + { + ret = GLXEW_SGIX_hyperpipe; + continue; + } +#endif +#ifdef GLX_SGIX_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = GLXEW_SGIX_pbuffer; + continue; + } +#endif +#ifdef GLX_SGIX_swap_barrier + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_barrier", 12)) + { + ret = GLXEW_SGIX_swap_barrier; + continue; + } +#endif +#ifdef GLX_SGIX_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = GLXEW_SGIX_swap_group; + continue; + } +#endif +#ifdef GLX_SGIX_video_resize + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) + { + ret = GLXEW_SGIX_video_resize; + continue; + } +#endif +#ifdef GLX_SGIX_visual_select_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_select_group", 19)) + { + ret = GLXEW_SGIX_visual_select_group; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) + { +#ifdef GLX_SGI_cushion + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cushion", 7)) + { + ret = GLXEW_SGI_cushion; + continue; + } +#endif +#ifdef GLX_SGI_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = GLXEW_SGI_make_current_read; + continue; + } +#endif +#ifdef GLX_SGI_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_SGI_swap_control; + continue; + } +#endif +#ifdef GLX_SGI_video_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_sync", 10)) + { + ret = GLXEW_SGI_video_sync; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) + { +#ifdef GLX_SUN_get_transparent_index + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_transparent_index", 21)) + { + ret = GLXEW_SUN_get_transparent_index; + continue; + } +#endif +#ifdef GLX_SUN_video_resize + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) + { + ret = GLXEW_SUN_video_resize; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#endif /* _WIN32 */ diff --git a/external/steamworks/steamworksexample/glstringosx.h b/external/steamworks/steamworksexample/glstringosx.h new file mode 100644 index 0000000..32aa551 --- /dev/null +++ b/external/steamworks/steamworksexample/glstringosx.h @@ -0,0 +1,46 @@ + +#ifdef __OBJC__ // this declaration only appears for files compiling with objc enabled + +#import +#import +#import +#import +#import + +@interface GLString : NSObject { + CGLContextObj cgl_ctx; // current context at time of texture creation + GLuint texName; + NSSize texSize; + + NSAttributedString * string; + NSFont * font; + NSColor * textColor; // default is opaque white + NSRect border; + uint32_t flags; + + BOOL requiresUpdate; +} + +- (id) initWithString:(NSString *)aString withFont:(NSFont *)inFont withTextColor:(NSColor *)color inBox:(NSRect *)box withFlags:(uint32_t) inFlags; + +- (void) dealloc; + +- (GLuint) texName; // 0 if no texture allocated +- (NSSize) texSize; // actually size of texture generated in texels, (0, 0) if no texture allocated +- (NSColor *) textColor; // get the pre-multiplied default text color (includes alpha) string attributes could override this +- (NSRect) border; // bounds for rect +- (NSFont *)font; +- (uint32_t) flags; // get the pre-multiplied default text color (includes alpha) string attributes could override this + +- (void) setFont:(NSFont *)inFont; +- (void) setColor:(NSColor *)color; +- (void) setBox:(NSRect *)box; +- (void) setFlags:(uint32_t) inFlags; + +- (void) genTexture; // generates the texture without drawing texture to current context +- (void) drawWithBounds:(NSRect)bounds; // will update the texture if required due to change in settings (note context should be setup to be orthographic scaled to per pixel scale) +- (void) drawAtPoint:(NSPoint)point; + +@end + +#endif \ No newline at end of file diff --git a/external/steamworks/steamworksexample/glstringosx.mm b/external/steamworks/steamworksexample/glstringosx.mm new file mode 100644 index 0000000..a9325ee --- /dev/null +++ b/external/steamworks/steamworksexample/glstringosx.mm @@ -0,0 +1,255 @@ +#include "stdafx.h" +#include "GameEngine.h" + +#import "glstringosx.h" + +// GLString follows + +@implementation GLString + +- (void) deleteTexture +{ + if (texName && cgl_ctx) { + (*cgl_ctx->disp.delete_textures)(cgl_ctx->rend, 1, &texName); + texName = 0; // ensure it is zeroed for failure cases + cgl_ctx = 0; + } +} + +- (void) dealloc +{ + [self deleteTexture]; + [textColor release]; + [string release]; + [super dealloc]; +} + +// designated initializer +- (id) initWithString:(NSString *)aString withFont:(NSFont *) inFont withTextColor:(NSColor *)color inBox:(NSRect *)box withFlags:(uint32_t) inFlags +{ + [super init]; + cgl_ctx = NULL; + texName = 0; + texSize.width = 0.0f; + texSize.height = 0.0f; + + [color retain]; + textColor = color; + + [inFont retain]; + font = inFont; + + flags = inFlags; + + NSMutableDictionary *attribs = [NSMutableDictionary dictionary]; + [attribs setObject: font forKey: NSFontAttributeName]; + [attribs setObject: textColor forKey: NSForegroundColorAttributeName]; + + string = [[NSAttributedString alloc] initWithString:aString attributes:attribs]; + + border = *box; + + requiresUpdate = YES; + return self; +} + +- (void) setFont:(NSFont *)inFont +{ + if ( [font isEqual: inFont] ) + return; + + [string release]; + [font release]; + + [inFont retain]; + font = inFont; + + NSMutableDictionary *attribs = [NSMutableDictionary dictionary]; + [attribs setObject: font forKey: NSFontAttributeName]; + [attribs setObject: textColor forKey: NSForegroundColorAttributeName]; + + string = [[NSAttributedString alloc] initWithString:[string string] attributes:attribs]; + + requiresUpdate = YES; +} + +- (void) setColor:(NSColor *)color +{ + if ( [textColor isEqual:color] ) + return; + + [string release]; + [textColor release]; + + [color retain]; + textColor = color; + + NSMutableDictionary *attribs = [NSMutableDictionary dictionary]; + [attribs setObject: font forKey: NSFontAttributeName]; + [attribs setObject: textColor forKey: NSForegroundColorAttributeName]; + + string = [[NSAttributedString alloc] initWithString:[string string] attributes:attribs]; + + requiresUpdate = YES; +} + +- (void) setBox:(NSRect *)box +{ + if ( NSEqualRects(border, *box ) ) + return; + + border = *box; + requiresUpdate = YES; +} + +- (void) setFlags:(uint32_t) inFlags +{ + if ( inFlags == flags ) + return; + + flags = inFlags; + requiresUpdate = YES; +} + + +// generates the texture without drawing texture to current context +- (void) genTexture +{ + NSSize previousSize = texSize; + + NSBitmapImageRep *bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL + pixelsWide:border.size.width + pixelsHigh:border.size.height + bitsPerSample:8 + samplesPerPixel:4 + hasAlpha:YES + isPlanar:NO + colorSpaceName:NSCalibratedRGBColorSpace + bytesPerRow:border.size.width * 4 + bitsPerPixel:0]; + + [textColor set]; + + float x = 0.0f; + float y = (border.size.height - [string size].height)/2; + + if ( flags & TEXTPOS_CENTER ) + x = (border.size.width - [string size].width)/2; + else if ( flags & TEXTPOS_RIGHT ) + x = border.size.width - [string size].width; + + [NSGraphicsContext saveGraphicsState]; + NSGraphicsContext *context = [NSGraphicsContext graphicsContextWithBitmapImageRep:bitmap]; + [context setShouldAntialias:YES]; + [NSGraphicsContext setCurrentContext:context]; + + [string drawAtPoint:NSMakePoint(x, y)]; // draw at offset position + + [NSGraphicsContext restoreGraphicsState]; + + texSize.width = [bitmap pixelsWide]; + texSize.height = [bitmap pixelsHigh]; + + if ( (cgl_ctx = CGLGetCurrentContext () ) ) + { // if we successfully retrieve a current context (required) + glPushAttrib(GL_TEXTURE_BIT); + if (0 == texName) glGenTextures (1, &texName); + glBindTexture (GL_TEXTURE_RECTANGLE_EXT, texName); + if (NSEqualSizes(previousSize, texSize)) { + glTexSubImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, texSize.width, texSize.height, [bitmap hasAlpha] ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYTE, [bitmap bitmapData]); + } else { + glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA, texSize.width, texSize.height, 0, [bitmap hasAlpha] ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYTE, [bitmap bitmapData]); + } + glPopAttrib(); + } + else + { + NSLog (@"-genTexture: Failure to get current OpenGL context\n"); + + } + [bitmap release]; + + requiresUpdate = NO; +} + +- (GLuint) texName +{ + return texName; +} + +- (NSSize) texSize +{ + return texSize; +} + +- (void) setTextColor:(NSColor *)color // set default text color +{ + [color retain]; + [textColor release]; + textColor = color; + requiresUpdate = YES; +} + +- (NSColor *) textColor +{ + return textColor; +} + +- (NSRect) border +{ + return border; +} + +- (NSFont *)font +{ + return font; +} + +- (uint32_t) flags +{ + return flags; +} + +- (void) drawWithBounds:(NSRect)bounds +{ + if (requiresUpdate) + [self genTexture]; + if (texName) + { + glPushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT | GL_COLOR_BUFFER_BIT); // GL_COLOR_BUFFER_BIT for glBlendFunc, GL_ENABLE_BIT for glEnable / glDisable + + glDisable (GL_DEPTH_TEST); // ensure text is not remove by depth buffer test. + glEnable (GL_BLEND); // for text fading + glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); // ditto + glEnable (GL_TEXTURE_RECTANGLE_EXT); + + glBindTexture (GL_TEXTURE_RECTANGLE_EXT, texName); + glBegin (GL_QUADS); + glTexCoord2f (0.0f, 0.0f); // draw upper left in world coordinates + glVertex2f (bounds.origin.x, bounds.origin.y); + + glTexCoord2f (0.0f, texSize.height); // draw lower left in world coordinates + glVertex2f (bounds.origin.x, bounds.origin.y + bounds.size.height); + + glTexCoord2f (texSize.width, texSize.height); // draw upper right in world coordinates + glVertex2f (bounds.origin.x + bounds.size.width, bounds.origin.y + bounds.size.height); + + glTexCoord2f (texSize.width, 0.0f); // draw lower right in world coordinates + glVertex2f (bounds.origin.x + bounds.size.width, bounds.origin.y); + glEnd (); + + glPopAttrib(); + } +} + +- (void) drawAtPoint:(NSPoint)point +{ + if (requiresUpdate) + [self genTexture]; // ensure size is calculated for bounds + if (texName) // if successful + [self drawWithBounds:NSMakeRect (point.x, point.y, texSize.width, texSize.height)]; +} + +@end diff --git a/external/steamworks/steamworksexample/htmlsurface.cpp b/external/steamworks/steamworksexample/htmlsurface.cpp new file mode 100644 index 0000000..10c0600 --- /dev/null +++ b/external/steamworks/steamworksexample/htmlsurface.cpp @@ -0,0 +1,224 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class to render a HTML page on the screen +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" +#include "htmlsurface.h" +#include "SpaceWarClient.h" + +#define HTML_TEXT_HEIGHT 20 + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CHTMLSurface::CHTMLSurface( IGameEngine *pGameEngine ) +{ + m_pGameEngine = pGameEngine; + m_unBrowserHandle = INVALID_HTMLBROWSER; + m_hHTMLTexture = -1; + + m_unHTMLWide = m_pGameEngine->GetViewportWidth() - 100; + m_unHTMLTall = m_pGameEngine->GetViewportHeight() - 100; + + SteamHTMLSurface()->Init(); + SteamHTMLSurface()->SetSize( m_unBrowserHandle, m_unHTMLWide, m_unHTMLTall ); +} + + + +//----------------------------------------------------------------------------- +// Purpose: Destructor +//----------------------------------------------------------------------------- +CHTMLSurface::~CHTMLSurface() +{ + if ( m_unBrowserHandle ) + SteamHTMLSurface()->RemoveBrowser( m_unBrowserHandle ); + m_unBrowserHandle = INVALID_HTMLBROWSER; +} + + + +//----------------------------------------------------------------------------- +// Purpose: RunFrame +//----------------------------------------------------------------------------- +void CHTMLSurface::RunFrame() +{ + if ( m_pGameEngine->BIsKeyDown( VK_ESCAPE ) || + m_pGameEngine->BIsControllerActionActive( eControllerDigitalAction_MenuCancel ) ) + { + SpaceWarClient()->SetGameState( k_EClientGameMenu ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: draw the page +//----------------------------------------------------------------------------- +void CHTMLSurface::Render() +{ + if (m_hHTMLTexture >= 0) + { + RECT rect; + rect.left = 50; + rect.top = 50; + rect.right = m_unHTMLWide + rect.left; + rect.bottom = m_unHTMLTall + rect.top; + + m_pGameEngine->BDrawTexturedRect( (float)rect.left, (float)rect.top, (float)rect.right, (float)rect.bottom, + 0.0f, 0.0f, 1.0, 1.0, D3DCOLOR_ARGB( 255, 255, 255, 255 ), m_hHTMLTexture ); + } + + RECT rect; + rect.top = m_unHTMLTall + 70; + rect.bottom = rect.top + HTML_TEXT_HEIGHT; + rect.left = m_unHTMLWide/2 - 200; + rect.right = rect.left + 400; + + char rgchBuffer[256]; + sprintf_safe( rgchBuffer, "Hit ESC to return to main menu" ); + m_pGameEngine->BDrawString( m_hDisplayFont, rect, D3DCOLOR_ARGB( 255, 25, 200, 25 ), TEXTPOS_CENTER | TEXTPOS_VCENTER, rgchBuffer ); +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CHTMLSurface::Show() +{ + m_hDisplayFont = m_pGameEngine->HCreateFont(HTML_TEXT_HEIGHT, FW_MEDIUM, false, "Arial"); + if (!m_hDisplayFont) + OutputDebugString("RemoteStorage font was not created properly, text won't draw\n"); + + SteamAPICall_t hSteamAPICall = SteamHTMLSurface()->CreateBrowser( "SpaceWars Test", NULL ); + m_SteamCallResultBrowserReady.Set( hSteamAPICall, this, &CHTMLSurface::OnBrowserReady ); + +} + + +//----------------------------------------------------------------------------- +// Purpose: the page asked to be closed +//----------------------------------------------------------------------------- +void CHTMLSurface::OnCloseBrowser( HTML_CloseBrowser_t *pParam ) +{ + m_unBrowserHandle = INVALID_HTMLBROWSER; + +} + + +//----------------------------------------------------------------------------- +// Purpose: the browser is ready to load pages and start sending us textures to render +//----------------------------------------------------------------------------- +void CHTMLSurface::OnBrowserReady( HTML_BrowserReady_t *pBrowserReady, bool bIOFailure ) +{ + if (bIOFailure) + return; + + m_unBrowserHandle = pBrowserReady->unBrowserHandle; + SteamHTMLSurface()->SetSize( m_unBrowserHandle, m_unHTMLWide, m_unHTMLTall ); + SteamHTMLSurface()->SetDPIScalingFactor( m_unBrowserHandle, 2.0f ); + SteamHTMLSurface()->LoadURL( m_unBrowserHandle, "http://steamcommunity.com/", NULL ); +} + + +//----------------------------------------------------------------------------- +// Purpose: we have a new texture to present +//----------------------------------------------------------------------------- +void CHTMLSurface::OnNeedsPaint( HTML_NeedsPaint_t *pParam ) +{ + if ( m_hHTMLTexture < 0 ) + m_hHTMLTexture = m_pGameEngine->HCreateTexture( (byte *)pParam->pBGRA, pParam->unWide, pParam->unTall, eTextureFormat_BGRA ); + else + m_pGameEngine->UpdateTexture( m_hHTMLTexture, (byte *)pParam->pBGRA, pParam->unWide, pParam->unTall, eTextureFormat_BGRA ); + + if (pParam->unWide != m_unHTMLWide) + OutputDebugString( "bad texture width for html\n" ); + if (pParam->unTall != m_unHTMLTall) + OutputDebugString( "bad texture height for html\n" ); + +} + + +//----------------------------------------------------------------------------- +// Purpose: the underlying browser object restarted, update our handle if needed +//----------------------------------------------------------------------------- +void CHTMLSurface::OnBrowserRestarted( HTML_BrowserRestarted_t *pParam ) +{ + if ( pParam->unOldBrowserHandle == m_unBrowserHandle ) + { + HTML_BrowserReady_t ready; + ready.unBrowserHandle = pParam->unBrowserHandle;; + OnBrowserReady( &ready, false ); + } +} + + + +//----------------------------------------------------------------------------- +// Purpose: the page requested that a URL be loaded, should we allow it? +//----------------------------------------------------------------------------- +void CHTMLSurface::OnStartRequest( HTML_StartRequest_t *pParam ) +{ + // MUST call AllowStartRequest once for every OnStartRequest callback! + SteamHTMLSurface()->AllowStartRequest( m_unBrowserHandle, true ); +} + + +//----------------------------------------------------------------------------- +// Purpose: the page has requested a modal javascript message box +//----------------------------------------------------------------------------- +void CHTMLSurface::OnJSAlert( HTML_JSAlert_t *pParam ) +{ + // MUST call JSDialogResponse once for every OnJSAlert callback! + + // ShowModalMessageBox( pParam->pchMessage ); + SteamHTMLSurface()->JSDialogResponse( m_unBrowserHandle, true ); +} + + +//----------------------------------------------------------------------------- +// Purpose: the page has requested a modal javascript yes/no dialog box +//----------------------------------------------------------------------------- +void CHTMLSurface::OnJSConfirm( HTML_JSConfirm_t *pParam ) +{ + // MUST call JSDialogResponse once for every OnJSConfirm callback! + + // if ( ShowModalYesNoDialogBox( pParam->pchMessage ) == BUTTON_NO ); + // SteamHTMLSurface()->JSDialogResponse( m_unBrowserHandle, false ); + // else + SteamHTMLSurface()->JSDialogResponse( m_unBrowserHandle, true ); +} + + +//----------------------------------------------------------------------------- +// Purpose: the page has requested a local file upload dialog box. +//----------------------------------------------------------------------------- +void CHTMLSurface::OnUploadLocalFile( HTML_FileOpenDialog_t *pParam ) +{ + // MUST call FileLoadDialogResponse once for every OnLocalFileBrowse callback! + + // Most applications do NOT want to allow the web browser to upload local file + // content from the customer's hard drive to the remote web server! That would + // be a pretty big security hole, unless you carefully vetted every file path. + SteamHTMLSurface()->FileLoadDialogResponse( m_unBrowserHandle, NULL ); + + // But if you did want to allow it, you would do something like this: + // ... show modal file selection dialog box ... + // ... verify that the selected files are safe to upload ... + // std::vector< const char * > vecUTF8FilenamesArray; + // ... populate vecUTF8FilenamesArray ... + // vecUTF8FilenamesArray.push_back( NULL ); + // SteamHTMLSurface()->FileLoadDialogResponse( m_unBrowserHandle, &vecUTF8FilenamesArray[0] ); +} + + +//----------------------------------------------------------------------------- +// Purpose: the page is now fully loaded +//----------------------------------------------------------------------------- +void CHTMLSurface::OnFinishedRequest( HTML_FinishedRequest_t *pParam ) +{ + // Uncomment this if you want to scale a pages contents when you display it + //SteamHTMLSurface()->SetPageScaleFactor( m_unBrowserHandle, 2.0, 0, 0 ); +} diff --git a/external/steamworks/steamworksexample/htmlsurface.h b/external/steamworks/steamworksexample/htmlsurface.h new file mode 100644 index 0000000..f06f4b1 --- /dev/null +++ b/external/steamworks/steamworksexample/htmlsurface.h @@ -0,0 +1,60 @@ +//========= Copyright © 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for handling finding servers, getting their details, and displaying +// them inside the game +// +// $NoKeywords: $ +//============================================================================= + +#ifndef HTMLSURFACE_H +#define HTMLSURFACE_H + +#include "SpaceWar.h" +#include "GameEngine.h" +#include "steam/steam_api.h" +#include "steam/isteamhtmlsurface.h" + + +class CHTMLSurface +{ +public: + CHTMLSurface( IGameEngine *pGameEngine ); + ~CHTMLSurface(); + + // Run a frame (to handle kb input and such as well as render) + void RunFrame(); + + void Render(); + + void Show(); + +private: + STEAM_CALLBACK( CHTMLSurface, OnStartRequest, HTML_StartRequest_t ); // REQUIRED + STEAM_CALLBACK( CHTMLSurface, OnJSAlert, HTML_JSAlert_t ); // REQUIRED + STEAM_CALLBACK( CHTMLSurface, OnJSConfirm, HTML_JSConfirm_t ); // REQUIRED + STEAM_CALLBACK( CHTMLSurface, OnUploadLocalFile, HTML_FileOpenDialog_t ); // REQUIRED + + STEAM_CALLBACK( CHTMLSurface, OnNeedsPaint, HTML_NeedsPaint_t ); + STEAM_CALLBACK( CHTMLSurface, OnCloseBrowser, HTML_CloseBrowser_t ); + STEAM_CALLBACK( CHTMLSurface, OnFinishedRequest, HTML_FinishedRequest_t ); + STEAM_CALLBACK( CHTMLSurface, OnBrowserRestarted, HTML_BrowserRestarted_t ); + + + void OnBrowserReady( HTML_BrowserReady_t *pBrowserReady, bool bIOFailure ); + CCallResult< CHTMLSurface, HTML_BrowserReady_t > m_SteamCallResultBrowserReady; + + + // Pointer to engine instance (so we can draw stuff) + IGameEngine *m_pGameEngine; + + HGAMEFONT m_hDisplayFont; + + HHTMLBrowser m_unBrowserHandle; // handle to the html surface object + HGAMETEXTURE m_hHTMLTexture; // the texture data for the page + + uint32 m_unHTMLWide; // the size of the html page we want to show + uint32 m_unHTMLTall; + +}; + +#endif //HTMLSURFACE_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/musicplayer.cpp b/external/steamworks/steamworksexample/musicplayer.cpp new file mode 100644 index 0000000..6a821c7 --- /dev/null +++ b/external/steamworks/steamworksexample/musicplayer.cpp @@ -0,0 +1,206 @@ +//========= Copyright � 1996-2009, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for tracking leaderboards +// +//============================================================================= + +#include "stdafx.h" +#include "musicplayer.h" +#include "BaseMenu.h" +#include + +//----------------------------------------------------------------------------- +// Purpose: Menu that shows a music player +//----------------------------------------------------------------------------- +class CMusicPlayerMenu : public CBaseMenu< MusicPlayerMenuItem_t > +{ +public: + + //----------------------------------------------------------------------------- + // Purpose: Constructor + //----------------------------------------------------------------------------- + CMusicPlayerMenu( IGameEngine *pGameEngine ) + : CBaseMenu< MusicPlayerMenuItem_t >( pGameEngine ) + , m_menuItemPause( "Pause" ) + , m_menuItemPlay( "Play" ) + , m_menuItemPlayPrevious( "Play Previous" ) + , m_menuItemPlayNext( "Play Next" ) + , m_menuItemIncreaseVolume( "Increase Volume" ) + , m_menuItemDecreaseVolume( "Decrease Volume" ) + , m_menuItemBack( "Back" ) + { + } + + //----------------------------------------------------------------------------- + // Purpose: Creates menu + //----------------------------------------------------------------------------- + void Rebuild() + { + PushSelectedItem(); + ClearMenuItems(); + + AddMenuItem( CMusicPlayerMenu::MenuItem_t( "Pause", m_menuItemPause ) ); + AddMenuItem( CMusicPlayerMenu::MenuItem_t( "Play", m_menuItemPlay ) ); + AddMenuItem( CMusicPlayerMenu::MenuItem_t( "Play Previous", m_menuItemPlayPrevious ) ); + AddMenuItem( CMusicPlayerMenu::MenuItem_t( "Play Next", m_menuItemPlayNext ) ); + AddMenuItem( CMusicPlayerMenu::MenuItem_t( "Increase Volume", m_menuItemIncreaseVolume ) ); + AddMenuItem( CMusicPlayerMenu::MenuItem_t( "Decrease Volume", m_menuItemDecreaseVolume ) ); + AddMenuItem( CMusicPlayerMenu::MenuItem_t( "Return to main menu", m_menuItemBack ) ); + + UpdateHeading(); + + PopSelectedItem(); + } + + + //----------------------------------------------------------------------------- + // Purpose: + //----------------------------------------------------------------------------- + void UpdateHeading() + { + const char *pchEnabled = "Disabled"; + + if ( SteamMusic()->BIsEnabled() ) + { + pchEnabled = "Enabled"; + } + + const char *pchPlaybackStatus = ""; + AudioPlayback_Status nStatus = SteamMusic()->GetPlaybackStatus(); + switch( nStatus ) + { + case AudioPlayback_Undefined: + pchPlaybackStatus = "Undefined"; + break; + case AudioPlayback_Playing: + pchPlaybackStatus = "Playing"; + break; + case AudioPlayback_Paused: + pchPlaybackStatus = "Paused"; + break; + case AudioPlayback_Idle: + pchPlaybackStatus = "Done"; + break; + }; + + + // Music Volume is between 0.0 and 1.0: multiply by ten, so its equivalent to Big Picture display. + float flVolume = SteamMusic()->GetVolume(); + int nVolume = int( flVolume * 10 ); + + sprintf_safe( m_szHeadingString, "Music: %s Status: %s Volume: %d", pchEnabled, pchPlaybackStatus, nVolume ); + SetHeading( m_szHeadingString ); + } + + + //----------------------------------------------------------------------------- + // Purpose: variables + //----------------------------------------------------------------------------- + char m_szHeadingString[255]; // String to show in server browser + + MusicPlayerMenuItem_t m_menuItemPause; + MusicPlayerMenuItem_t m_menuItemPlay; + MusicPlayerMenuItem_t m_menuItemPlayPrevious; + MusicPlayerMenuItem_t m_menuItemPlayNext; + + MusicPlayerMenuItem_t m_menuItemIncreaseVolume; + MusicPlayerMenuItem_t m_menuItemDecreaseVolume; + + MusicPlayerMenuItem_t m_menuItemBack; +}; + + + + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CMusicPlayer::CMusicPlayer( IGameEngine *pGameEngine ) + : m_pGameEngine( pGameEngine ) + , m_CallbackVolumeChanged( this, &CMusicPlayer::OnVolumeChanged ) + , m_CallbackPlaybackStatusHasChanged( this, &CMusicPlayer::OnPlaybackStatusHasChanged ) +{ + m_pMusicPlayerMenu = new CMusicPlayerMenu( pGameEngine ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Run a frame +//----------------------------------------------------------------------------- +void CMusicPlayer::RunFrame() +{ + m_pMusicPlayerMenu->RunFrame(); +} + + +//----------------------------------------------------------------------------- +// Purpose: Handles menu actions +//----------------------------------------------------------------------------- +void CMusicPlayer::OnMenuSelection( MusicPlayerMenuItem_t selection ) +{ + if (selection == m_pMusicPlayerMenu->m_menuItemPlay) + { + SteamMusic()->Play(); + } + else if (selection == m_pMusicPlayerMenu->m_menuItemPause) + { + SteamMusic()->Pause(); + } + else if (selection == m_pMusicPlayerMenu->m_menuItemPlayPrevious) + { + SteamMusic()->PlayPrevious(); + } + else if (selection == m_pMusicPlayerMenu->m_menuItemPlayNext) + { + SteamMusic()->PlayNext(); + } + else if (selection == m_pMusicPlayerMenu->m_menuItemIncreaseVolume) + { + // conversion necessary, because the UI in big picture shows 10 bars, + // but volume is a value between 0.0 and 1.0 + float flVolume = SteamMusic()->GetVolume(); + int nVolume = int( flVolume * 10 ); + nVolume = MIN( nVolume + 1, 10 ); + SteamMusic()->SetVolume( (float)nVolume * 0.1f ); + } + else if (selection == m_pMusicPlayerMenu->m_menuItemDecreaseVolume) + { + // conversion necessary, because the UI in big picture shows 10 bars, + // but volume is a value between 0.0 and 1.0 + float flVolume = SteamMusic()->GetVolume(); + int nVolume = int( flVolume * 10 ); + nVolume = MAX( nVolume - 1, 0 ); + SteamMusic()->SetVolume( (float)nVolume * 0.1f ); + } + else if (selection == m_pMusicPlayerMenu->m_menuItemBack) + { + SpaceWarClient()->SetGameState(k_EClientGameMenu); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: Shows / Refreshes +//----------------------------------------------------------------------------- +void CMusicPlayer::Show() +{ + m_pMusicPlayerMenu->Rebuild(); +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CMusicPlayer::OnPlaybackStatusHasChanged( PlaybackStatusHasChanged_t *pPlaybackStatusHasChanged ) +{ + m_pMusicPlayerMenu->UpdateHeading(); +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CMusicPlayer::OnVolumeChanged( VolumeHasChanged_t *pVolumeChanged ) +{ + m_pMusicPlayerMenu->UpdateHeading(); +} \ No newline at end of file diff --git a/external/steamworks/steamworksexample/musicplayer.h b/external/steamworks/steamworksexample/musicplayer.h new file mode 100644 index 0000000..f5a4c1f --- /dev/null +++ b/external/steamworks/steamworksexample/musicplayer.h @@ -0,0 +1,54 @@ +//========= Copyright © 1996-2009, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for controlling the Music Player +// +//============================================================================= + +#ifndef MUSICPLAYER_H +#define MUSICPLAYER_H + +#include "GameEngine.h" + +class CMusicPlayerMenu; + + +struct MusicPlayerMenuItem_t +{ + const char *m_pchCommand; + + MusicPlayerMenuItem_t() : m_pchCommand( "" ) {} + MusicPlayerMenuItem_t( const char *pchCommand ) : m_pchCommand( pchCommand ) {} + + bool operator==( const MusicPlayerMenuItem_t& rhs ) const + { + return strncmp( m_pchCommand, rhs.m_pchCommand, strlen( m_pchCommand ) ) == 0; + } +}; + + + +class CMusicPlayer +{ +public: + // Constructor + CMusicPlayer( IGameEngine *pGameEngine ); + + // Run a frame + void RunFrame(); + + // shows / refreshes music player + void Show(); + + // handles input from menu + void OnMenuSelection( MusicPlayerMenuItem_t selection ); + +private: + + IGameEngine *m_pGameEngine; + CMusicPlayerMenu *m_pMusicPlayerMenu; + + STEAM_CALLBACK( CMusicPlayer, OnPlaybackStatusHasChanged, PlaybackStatusHasChanged_t, m_CallbackPlaybackStatusHasChanged ); + STEAM_CALLBACK( CMusicPlayer, OnVolumeChanged, VolumeHasChanged_t, m_CallbackVolumeChanged ); +}; + +#endif // MUSICPLAYER_H \ No newline at end of file diff --git a/external/steamworks/steamworksexample/osx/steam_appid.txt b/external/steamworks/steamworksexample/osx/steam_appid.txt new file mode 100644 index 0000000..7ad8022 --- /dev/null +++ b/external/steamworks/steamworksexample/osx/steam_appid.txt @@ -0,0 +1 @@ +480 \ No newline at end of file diff --git a/external/steamworks/steamworksexample/osx/steamworksexample-info.plist b/external/steamworks/steamworksexample/osx/steamworksexample-info.plist new file mode 100644 index 0000000..3c2ea04 --- /dev/null +++ b/external/steamworks/steamworksexample/osx/steamworksexample-info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDocumentTypes + + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.valvesoftware.steam.steamworksexample + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleURLTypes + + CFBundleVersion + 1 + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NSPrincipalClass + + NSServices + + UTExportedTypeDeclarations + + UTImportedTypeDeclarations + + + diff --git a/external/steamworks/steamworksexample/osx/steamworksexample.entitlements b/external/steamworks/steamworksexample/osx/steamworksexample.entitlements new file mode 100644 index 0000000..e59cdaf --- /dev/null +++ b/external/steamworks/steamworksexample/osx/steamworksexample.entitlements @@ -0,0 +1,11 @@ + + + + + com.apple.security.cs.disable-library-validation + + + com.apple.security.cs.allow-dyld-environment-variables + + + diff --git a/external/steamworks/steamworksexample/p2pauth.cpp b/external/steamworks/steamworksexample/p2pauth.cpp new file mode 100644 index 0000000..b0140bd --- /dev/null +++ b/external/steamworks/steamworksexample/p2pauth.cpp @@ -0,0 +1,282 @@ +//========= Copyright © 1996-2004, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + + +#include "stdafx.h" +#include "SpaceWarClient.h" +#include "p2pauth.h" + +//----------------------------------------------------------------------------- +// Purpose: constructor +//----------------------------------------------------------------------------- +CP2PAuthPlayer::CP2PAuthPlayer( IGameEngine *pGameEngine, CSteamID steamID, HSteamNetConnection hServerConn ) +: m_CallbackBeginAuthResponse( this, &CP2PAuthPlayer::OnBeginAuthResponse ) +, m_steamID( steamID ) +, m_hServerConnection( hServerConn ) +{ + m_pGameEngine = pGameEngine; + m_bSentTicket = false; + m_bSubmittedHisTicket = false; + m_bHaveAnswer = false; + m_ulConnectTime = GetGameTimeInSeconds(); + m_cubTicketIGaveThisUser = 0; + m_cubTicketHeGaveMe = 0; +} + + +//----------------------------------------------------------------------------- +// Purpose: destructor +//----------------------------------------------------------------------------- +CP2PAuthPlayer::~CP2PAuthPlayer() +{ + EndGame(); +} + + +//----------------------------------------------------------------------------- +// Purpose: the steam backend has responded +//----------------------------------------------------------------------------- +void CP2PAuthPlayer::OnBeginAuthResponse( ValidateAuthTicketResponse_t *pCallback ) +{ + if ( m_steamID == pCallback->m_SteamID ) + { + char rgch[128]; + sprintf( rgch, "P2P:: Received steam response for account=%d\n", m_steamID.GetAccountID() ); + OutputDebugString( rgch ); + m_ulAnswerTime = GetGameTimeInSeconds(); + m_bHaveAnswer = true; + m_eAuthSessionResponse = pCallback->m_eAuthSessionResponse; + } +} + + +void CP2PAuthPlayer::StartAuthPlayer() +{ + // Create a ticket if we haven't yet + if ( m_cubTicketIGaveThisUser == 0 ) + { + SteamNetworkingIdentity snid; + snid.SetSteamID( m_steamID ); + m_hAuthTicketIGaveThisUser = SteamUser()->GetAuthSessionTicket( m_rgubTicketIGaveThisUser, sizeof( m_rgubTicketIGaveThisUser ), &m_cubTicketIGaveThisUser, &snid ); + } + + // Send the ticket to the server. It will relay to the client + MsgP2PSendingTicket_t msg; + msg.SetToken( m_rgubTicketIGaveThisUser, m_cubTicketIGaveThisUser ); + msg.SetSteamID( m_steamID.ConvertToUint64() ); + + int64 nIgnoreMessageID; + if ( SteamNetworkingSockets()->SendMessageToConnection( m_hServerConnection, &msg, sizeof(msg), k_nSteamNetworkingSend_Reliable, &nIgnoreMessageID ) == k_EResultOK ) + { + m_bSentTicket = true; + } + + // start a timer on this, if we dont get a ticket back within reasonable time, mark him timed out + m_ulTicketTime = GetGameTimeInSeconds(); +} + + +//----------------------------------------------------------------------------- +// Purpose: is this auth ok? +//----------------------------------------------------------------------------- +bool CP2PAuthPlayer::BIsAuthOk() +{ + if ( m_steamID.IsValid() ) + { + // Timeout if we fail to establish communication with this player + if ( !m_bSentTicket && !m_bSubmittedHisTicket ) + { + if ( GetGameTimeInSeconds() - m_ulConnectTime > 30 ) + { + char rgch[128]; + sprintf( rgch, "P2P:: Nothing received for account=%d\n", m_steamID.GetAccountID() ); + OutputDebugString( rgch ); + return false; + } + } + // first ticket check: if i submitted his ticket - was it good? + if ( m_bSubmittedHisTicket && m_eBeginAuthSessionResult != k_EBeginAuthSessionResultOK ) + { + char rgch[128]; + sprintf( rgch, "P2P:: Ticket from account=%d was bad\n", m_steamID.GetAccountID() ); + OutputDebugString( rgch ); + return false; + } + // second ticket check: if the steam backend replied, was that good? + if ( m_bHaveAnswer && m_eAuthSessionResponse != k_EAuthSessionResponseOK ) + { + char rgch[128]; + sprintf( rgch, "P2P:: Steam response for account=%d was bad\n", m_steamID.GetAccountID() ); + OutputDebugString( rgch ); + return false; + } + // last: if i sent him a ticket and he has not reciprocated, time out after 30 sec + if ( m_bSentTicket && !m_bSubmittedHisTicket ) + { + if ( GetGameTimeInSeconds() - m_ulTicketTime > 30 ) + { + char rgch[128]; + sprintf( rgch, "P2P:: No ticket received for account=%d\n", m_steamID.GetAccountID() ); + OutputDebugString( rgch ); + return false; + } + } + } + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: the game engine is telling us about someone who left the game +//----------------------------------------------------------------------------- +void CP2PAuthPlayer::EndGame() +{ + if ( m_bSentTicket ) + { + SteamUser()->CancelAuthTicket( m_hAuthTicketIGaveThisUser ); + m_bSentTicket = false; + } + if ( m_bSubmittedHisTicket ) + { + SteamUser()->EndAuthSession( m_steamID ); + m_bSubmittedHisTicket = false; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: message from another player providing his ticket +//----------------------------------------------------------------------------- +void CP2PAuthPlayer::HandleP2PSendingTicket( const MsgP2PSendingTicket_t *pMsg ) +{ + m_cubTicketHeGaveMe = pMsg->GetTokenLen(); + memcpy( m_rgubTicketHeGaveMe, pMsg->GetTokenPtr(), m_cubTicketHeGaveMe ); + m_eBeginAuthSessionResult = SteamUser()->BeginAuthSession( m_rgubTicketHeGaveMe, m_cubTicketHeGaveMe, m_steamID ); + m_bSubmittedHisTicket = true; + char rgch[128]; + sprintf( rgch, "P2P:: ReceivedTicket from account=%d \n", m_steamID.GetAccountID() ); + OutputDebugString( rgch ); + if ( !m_bSentTicket ) + StartAuthPlayer(); +} + + +//----------------------------------------------------------------------------- +// Purpose: utility wrapper +//----------------------------------------------------------------------------- +CSteamID CP2PAuthPlayer::GetSteamID() +{ + return SteamUser()->GetSteamID(); +} + + +//----------------------------------------------------------------------------- +// Purpose: constructor +//----------------------------------------------------------------------------- +CP2PAuthedGame::CP2PAuthedGame( IGameEngine *pGameEngine ) +{ + m_pGameEngine = pGameEngine; + m_hConnServer = k_HSteamNetConnection_Invalid; + + // no players yet + for ( int i = 0; i < MAX_PLAYERS_PER_SERVER; i++ ) + { + m_rgpP2PAuthPlayer[i] = NULL; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: game with this player is over +//----------------------------------------------------------------------------- +void CP2PAuthedGame::PlayerDisconnect( int iSlot ) +{ + if ( m_rgpP2PAuthPlayer[iSlot] ) + { + m_rgpP2PAuthPlayer[iSlot]->EndGame(); + delete m_rgpP2PAuthPlayer[iSlot]; + m_rgpP2PAuthPlayer[iSlot] = NULL; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: game is over, disconnect everyone +//----------------------------------------------------------------------------- +void CP2PAuthedGame::EndGame() +{ + for ( int i = 0; i < MAX_PLAYERS_PER_SERVER; i++ ) + { + if ( m_rgpP2PAuthPlayer[i] ) + { + m_rgpP2PAuthPlayer[i]->EndGame(); + delete m_rgpP2PAuthPlayer[i]; + m_rgpP2PAuthPlayer[i] = NULL; + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: initialize player +//----------------------------------------------------------------------------- +void CP2PAuthedGame::InternalInitPlayer( int iSlot, CSteamID steamID, bool bStartAuthProcess ) +{ + char rgch[128]; + sprintf( rgch, "P2P:: StartAuthPlayer slot=%d account=%d \n", iSlot, steamID.GetAccountID() ); + OutputDebugString( rgch ); + m_rgpP2PAuthPlayer[iSlot] = new CP2PAuthPlayer( m_pGameEngine, steamID, m_hConnServer ); + if ( bStartAuthProcess ) + m_rgpP2PAuthPlayer[iSlot]->StartAuthPlayer(); +} + + +//----------------------------------------------------------------------------- +// Purpose: game host register this player, we wait for this player +// to start the auth process by sending us his ticket, then we will +// reciprocate +//----------------------------------------------------------------------------- +void CP2PAuthedGame::RegisterPlayer( int iSlot, CSteamID steamID ) +{ + if (iSlot < MAX_PLAYERS_PER_SERVER) + InternalInitPlayer( iSlot, steamID, false ); +} +//----------------------------------------------------------------------------- +// Purpose: start the auth process by sending ticket to this player +// he will reciprocate +//----------------------------------------------------------------------------- +void CP2PAuthedGame::StartAuthPlayer( int iSlot, CSteamID steamID ) +{ + if (iSlot < MAX_PLAYERS_PER_SERVER) + InternalInitPlayer( iSlot, steamID, true ); +} + + +//----------------------------------------------------------------------------- +// Purpose: message handler +//----------------------------------------------------------------------------- +void CP2PAuthedGame::HandleP2PSendingTicket( const void *pMessage ) +{ + const MsgP2PSendingTicket_t *pMsg = (const MsgP2PSendingTicket_t*)pMessage; + for ( int i = 0; i < MAX_PLAYERS_PER_SERVER; i++ ) + { + if ( m_rgpP2PAuthPlayer[i] && m_rgpP2PAuthPlayer[i]->GetSteamID() == pMsg->GetSteamID() ) + { + m_rgpP2PAuthPlayer[i]->HandleP2PSendingTicket( pMsg ); + break; + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: utility wrapper +//----------------------------------------------------------------------------- +CSteamID CP2PAuthedGame::GetSteamID() +{ + return SteamUser()->GetSteamID(); +} diff --git a/external/steamworks/steamworksexample/p2pauth.h b/external/steamworks/steamworksexample/p2pauth.h new file mode 100644 index 0000000..5e86cc2 --- /dev/null +++ b/external/steamworks/steamworksexample/p2pauth.h @@ -0,0 +1,74 @@ +//========= Copyright © 1996-2004, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + + + +const int k_cMaxSockets = 16; +class CP2PAuthPlayer; + +bool SendAuthTicketToConnection( CSteamID steamIDFrom, HSteamNetConnection hConnectionTo, uint32 cubTicket, uint8 *pubTicket ); + +//----------------------------------------------------------------------------- +// Purpose: one player p2p auth process state machine +//----------------------------------------------------------------------------- +class CP2PAuthPlayer +{ +public: + CP2PAuthPlayer( IGameEngine *pGameEngine, CSteamID steamID, HSteamNetConnection hServerConn ); + ~CP2PAuthPlayer(); + void EndGame(); + void StartAuthPlayer(); + bool BIsAuthOk(); + void HandleP2PSendingTicket( const MsgP2PSendingTicket_t *pMsg ); + + CSteamID GetSteamID(); + + STEAM_CALLBACK( CP2PAuthPlayer, OnBeginAuthResponse, ValidateAuthTicketResponse_t, m_CallbackBeginAuthResponse ); + + const CSteamID m_steamID; + const HSteamNetConnection m_hServerConnection; +private: + uint64 GetGameTimeInSeconds() + { + return m_pGameEngine->GetGameTickCount()/1000; + } + bool m_bSentTicket; + bool m_bSubmittedHisTicket; + bool m_bHaveAnswer; + uint64 m_ulConnectTime; + uint64 m_ulTicketTime; + uint64 m_ulAnswerTime; + uint32 m_cubTicketIGaveThisUser; + uint8 m_rgubTicketIGaveThisUser[1024]; + uint32 m_cubTicketHeGaveMe; + uint8 m_rgubTicketHeGaveMe[1024]; + HAuthTicket m_hAuthTicketIGaveThisUser; + EBeginAuthSessionResult m_eBeginAuthSessionResult; + EAuthSessionResponse m_eAuthSessionResponse; + + IGameEngine *m_pGameEngine; +}; + +//----------------------------------------------------------------------------- +// Purpose: simple wrapper for multiple players +//----------------------------------------------------------------------------- +class CP2PAuthedGame +{ +public: + CP2PAuthedGame( IGameEngine *pGameEngine ); + void PlayerDisconnect( int iSlot ); + void EndGame(); + void StartAuthPlayer( int iSlot, CSteamID steamID ); + void RegisterPlayer( int iSlot, CSteamID steamID ); + void HandleP2PSendingTicket( const void *pMessage ); + CSteamID GetSteamID(); + void InternalInitPlayer( int iSlot, CSteamID steamID, bool bStartAuthProcess ); + + CP2PAuthPlayer *m_rgpP2PAuthPlayer[MAX_PLAYERS_PER_SERVER]; + IGameEngine *m_pGameEngine; + HSteamNetConnection m_hConnServer; +}; diff --git a/external/steamworks/steamworksexample/release/steam_appid.txt b/external/steamworks/steamworksexample/release/steam_appid.txt new file mode 100644 index 0000000..7ad8022 --- /dev/null +++ b/external/steamworks/steamworksexample/release/steam_appid.txt @@ -0,0 +1 @@ +480 \ No newline at end of file diff --git a/external/steamworks/steamworksexample/richpresenceloc.vdf b/external/steamworks/steamworksexample/richpresenceloc.vdf new file mode 100644 index 0000000..da5e26f --- /dev/null +++ b/external/steamworks/steamworksexample/richpresenceloc.vdf @@ -0,0 +1,27 @@ +"lang" +{ + "english" + { + "tokens" + { + "#StatusWithoutScore" "{#Status_%gamestatus%}" + "#StatusWithScore" "{#Status_%gamestatus%}: %score%" + "#Status_AtMainMenu" "At the main menu" + "#Status_WaitingForMatch" "Waiting for match" + "#Status_Winning" "Winning" + "#Status_Losing" "Losing" + "#Status_Tied" "Tied" + } + } + "french" + { + "tokens" + { + "#Status_AtMainMenu" "Au menu principal" + "#Status_WaitingForMatch" "En attente de match" + "#Status_Winning" "Gagnant" + "#Status_Losing" "Perdant" + "#Status_Tied" "Egalité" + } + } +} diff --git a/external/steamworks/steamworksexample/stdafx.cpp b/external/steamworks/steamworksexample/stdafx.cpp new file mode 100644 index 0000000..a8ea6de --- /dev/null +++ b/external/steamworks/steamworksexample/stdafx.cpp @@ -0,0 +1,20 @@ +//========= Copyright © 1996-2008 Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +// stdafx.cpp : source file that includes just the standard includes +// SteamworksExample.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" +#include +#ifdef WIN32 +#include +#include +#endif + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/external/steamworks/steamworksexample/stdafx.h b/external/steamworks/steamworksexample/stdafx.h new file mode 100644 index 0000000..ccdf331 --- /dev/null +++ b/external/steamworks/steamworksexample/stdafx.h @@ -0,0 +1,244 @@ +//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + + +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include +#include + +#define MAX(a,b) (((a) > (b)) ? (a) : (b)) +#define MIN(a,b) (((a) < (b)) ? (a) : (b)) + +#ifdef WIN32 + +// Modify the following defines if you have to target a platform prior to the ones specified below. +// Refer to MSDN for the latest info on corresponding values for different platforms. +// Allow use of features specific to Windows 8.1 or later. +// Change this to the appropriate value to target other versions of Windows. +#ifndef WINVER +#define WINVER 0x0602 +#endif + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0602 +#endif + +#ifndef _WIN32_WINDOWS +#define _WIN32_WINDOWS 0x0602 +#endif + +#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later. +#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE. +#endif + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers + +#pragma comment( lib, "d3d9.lib" ) +#pragma comment( lib, "d3dx9.lib" ) +#pragma comment( lib, "dxguid.lib" ) + +// Windows Header Files: +#include +#include + +// Winsock +#include +#pragma comment(lib, "ws2_32.lib" ) + +// d3d header files +#include "d3d9.h" +#include "d3dx9.h" + +// XAudio2 header files +#include + +typedef __int16 int16; +typedef unsigned __int16 uint16; +typedef __int32 int32; +typedef unsigned __int32 uint32; +typedef __int64 int64; +typedef unsigned __int64 uint64; + +#include "steam/isteamuserstats.h" +#include "steam/isteamremotestorage.h" +#include "steam/isteammatchmaking.h" +#include "steam/steam_gameserver.h" + +#elif defined(POSIX) + +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(OSX) + #include +#endif + +#define ARRAYSIZE(A) ( sizeof(A)/sizeof(A[0]) ) +// Need to define some types on POSIX +typedef short int16; +typedef unsigned short uint16; +typedef int int32; +typedef unsigned int uint32; +typedef long long int64; +typedef unsigned long long uint64; +typedef uint32 DWORD; +typedef DWORD HWND; +typedef DWORD HINSTANCE; +typedef short SHORT; +typedef long LONG; +typedef unsigned char byte; +typedef unsigned char uint8; + +/* Font Weights */ +#define FW_DONTCARE 0 +#define FW_THIN 100 +#define FW_EXTRALIGHT 200 +#define FW_LIGHT 300 +#define FW_NORMAL 400 +#define FW_MEDIUM 500 +#define FW_SEMIBOLD 600 +#define FW_BOLD 700 +#define FW_EXTRABOLD 800 +#define FW_HEAVY 900 + +/* Some VK_ defines from windows, we'll map these for posix */ +#define VK_BACK 0x08 +#define VK_TAB 0x09 +#define VK_RETURN 0x0D +#define VK_SHIFT 0x10 +#define VK_CONTROL 0x11 +#define VK_ESCAPE 0x1B +#define VK_SPACE 0x20 +#define VK_LEFT 0x25 +#define VK_UP 0x26 +#define VK_RIGHT 0x27 +#define VK_DOWN 0x28 +#define VK_SELECT 0x29 +#define VK_F5 0x74 + +#ifndef VALVE_RECT_DEFINED +#define VALVE_RECT_DEFINED + + typedef struct tagRECT + { + LONG left; + LONG top; + LONG right; + LONG bottom; + } RECT; + + #define _RECT tagRECT +#endif + +#define D3DCOLOR_ARGB(a,r,g,b) \ + ((DWORD)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff))) + +// Macros for converting ARGB DWORD color representation into opengl formats... +#define COLOR_RED( color ) \ + (GLubyte)(((color)>>16)&0xff) + +#define COLOR_GREEN( color ) \ + (GLubyte)(((color)>>8)&0xff) + +#define COLOR_BLUE( color ) \ + (GLubyte)((color)&0xff) + +#define COLOR_ALPHA( color ) \ + (GLubyte)(((color)>>24)&0xff) + +#define DWARGB_TO_DWRGBA(color) \ + ((DWORD)(( (((((color)>>16)&0xff))<<24)|(((((color)>>8)&0xff))<<16)|((color&0xff)<<8)|((color)>>24)&0xff))) + +#define DWARGB_TO_DWABGR(color) \ + ((DWORD)(( (((((color)>>24)&0xff))<<24)|(((((color))&0xff))<<16)|(((color>>8)&0xff)<<8)|((color)>>16)&0xff))) + +#define DWRGBA_TO_DWARGB(color) \ + ((DWORD)(( (((((color))&0xff))<<24)|(((((color>>24))&0xff))<<16)|(((color>>16)&0xff)<<8)|((color)>>8)&0xff))) + +// steam api header file +#include "steam/steam_api.h" +#include "steam/isteamuserstats.h" +#include "steam/isteamremotestorage.h" +#include "steam/isteammatchmaking.h" +#include "steam/steam_gameserver.h" + +extern void OutputDebugString( const char *pchMsg ); +extern int Alert( const char *lpCaption, const char *lpText ); +extern const char *GetUserSaveDataPath(); + +#ifdef OSX +extern uint64_t GetTickCount(); +#endif // OSX + +#define V_ARRAYSIZE(a) sizeof(a)/sizeof(a[0]) + +#endif // POSIX + +// OUT_Z_ARRAY indicates an output array that will be null-terminated. +#if _MSC_VER >= 1600 + // Include the annotation header file. + #include + #if _MSC_VER >= 1700 + // VS 2012+ + #define OUT_Z_ARRAY _Post_z_ + #else + // VS 2010 + #define OUT_Z_ARRAY _Deref_post_z_ + #endif +#else + // gcc, clang, old versions of VS + #define OUT_Z_ARRAY +#endif + +template void sprintf_safe(OUT_Z_ARRAY char (&pDest)[maxLenInChars], const char *pFormat, ... ) +{ + va_list params; + va_start( params, pFormat ); +#ifdef POSIX + vsnprintf( pDest, maxLenInChars, pFormat, params ); +#else + _vsnprintf( pDest, maxLenInChars, pFormat, params ); +#endif + pDest[maxLenInChars - 1] = '\0'; + va_end( params ); +} + +inline void strncpy_safe( char *pDest, char const *pSrc, size_t maxLen ) +{ + size_t nCount = maxLen; + char *pstrDest = pDest; + const char *pstrSource = pSrc; + + while ( 0 < nCount && 0 != ( *pstrDest++ = *pstrSource++ ) ) + nCount--; + + if ( maxLen > 0 ) + pstrDest[-1] = 0; +} + +#ifdef STEAM_CEG +// Steam DRM header file +#include "cegclient.h" +#else +#define Steamworks_InitCEGLibrary() (true) +#define Steamworks_TermCEGLibrary() +#define Steamworks_TestSecret() +#define Steamworks_SelfCheck() +#endif + diff --git a/external/steamworks/steamworksexample/stdafx_ps3.h b/external/steamworks/steamworksexample/stdafx_ps3.h new file mode 100644 index 0000000..8042859 --- /dev/null +++ b/external/steamworks/steamworksexample/stdafx_ps3.h @@ -0,0 +1,38 @@ +//========= Copyright Valve LLC, All rights reserved. ============ +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + + +// stdafx_ps3.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently on the PS3 platform +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//#define PS3_MTT_DEBUG + +#ifdef PS3_MTT_DEBUG +#include "../external/libmtt/libmtt/libmtt_log.h" +#endif + +extern CellDbgFontConsoleId g_DbgFontConsoleID; \ No newline at end of file diff --git a/external/steamworks/steamworksexample/steam_controller.vdf b/external/steamworks/steamworksexample/steam_controller.vdf new file mode 100644 index 0000000..009e384 --- /dev/null +++ b/external/steamworks/steamworksexample/steam_controller.vdf @@ -0,0 +1,646 @@ +"controller_mappings" +{ + "version" "3" + "title" "#title" + "description" "#description" + "controller_type" "controller_steamcontroller_gordon" + "Timestamp" "1529529957" + "actions" + { + "ship_controls" + { + "title" "Ship Controls" + "legacy_set" "0" + "StickPadGyro" + { + "analog_controls" + { + "title" "#AnalogControls" + "input_mode" "joystick_move" + } + } + "Button" + { + "turn_left" "#TurnLeft" + "turn_right" "#TurnRight" + "fire_lasers" "#FireLasers" + "pause_menu" "#PauseMenu" + "forward_thrust" "#ForwardThrust" + "backward_thrust" "#BackwardThrust" + } + "Layers" + { + "thrust_action_layer" "#ThrustLayer" + } + } + "menu_controls" + { + "title" "#MenuControls" + "legacy_set" "0" + "Button" + { + "menu_up" "#MenuUp" + "menu_down" "#MenuDown" + "menu_left" "#MenuLeft" + "menu_right" "#MenuRight" + "menu_select" "#MenuSelect" + "menu_cancel" "#MenuCancel" + } + } + } + "action_layers" + { + "thrust_action_layer" + { + "title" "#ThrustLayer" + "legacy_set" "1" + "set_layer" "1" + "parent_set_name" "ship_controls" + } + } + "localization" + { + "english" + { + "title" "Space War Action Set Config Sample" + "description" "This is an example configuration for using Steamworks Action Sets." + "AnalogControls" "Analog Controls" + "TurnLeft" "Turn Left" + "TurnRight" "Turn Right" + "FireLasers" "Fire Lasers" + "PauseMenu" "Pause Menu" + "BackwardThrust" "Backward Thrust" + "MenuControls" "Menu Controls" + "MenuUp" "Menu Up" + "MenuDown" "Menu Down" + "MenuLeft" "Menu Left" + "MenuRight" "Menu Right" + "MenuSelect" "Menu Select" + "ThrustLayer" "Thrust Layer" + } + } + "group" + { + "id" "0" + "mode" "four_buttons" + "inputs" + { + } + "settings" + { + "button_size" "17988" + "button_dist" "19988" + } + } + "group" + { + "id" "1" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "2" + "mode" "trigger" + "inputs" + { + "edge" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action ship_controls fire_lasers" + } + "settings" + { + "haptic_intensity" "2" + } + } + } + } + } + } + "group" + { + "id" "3" + "mode" "four_buttons" + "inputs" + { + "button_a" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action menu_controls menu_select" + } + } + } + } + "button_b" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action menu_controls menu_cancel" + } + } + } + } + } + "settings" + { + "button_size" "17992" + "button_dist" "19992" + } + } + "group" + { + "id" "4" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "5" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "6" + "mode" "dpad" + "inputs" + { + "dpad_north" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action menu_controls menu_up" + } + } + } + } + "dpad_south" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action menu_controls menu_down" + } + } + } + } + "dpad_east" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action menu_controls menu_right" + } + } + } + } + "dpad_west" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action menu_controls menu_left" + } + } + } + } + } + "settings" + { + "edge_binding_radius" "24995" + "analog_emulation_period" "29" + } + } + "group" + { + "id" "7" + "mode" "dpad" + "inputs" + { + } + "settings" + { + "edge_binding_radius" "24995" + "analog_emulation_period" "29" + } + } + "group" + { + "id" "8" + "mode" "joystick_move" + "inputs" + { + } + "settings" + { + "virtual_mode" "1" + "edge_binding_radius" "24997" + "sensitivity" "98" + } + } + "group" + { + "id" "9" + "mode" "joystick_move" + "inputs" + { + } + "settings" + { + "virtual_mode" "1" + "edge_binding_radius" "24997" + "sensitivity" "98" + } + } + "group" + { + "id" "10" + "mode" "joystick_move" + "inputs" + { + } + "settings" + { + "virtual_mode" "1" + "edge_binding_radius" "24996" + "sensitivity" "98" + } + } + "group" + { + "id" "11" + "mode" "four_buttons" + "inputs" + { + } + } + "group" + { + "id" "12" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "13" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "14" + "mode" "four_buttons" + "inputs" + { + } + } + "group" + { + "id" "15" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "16" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "17" + "mode" "four_buttons" + "inputs" + { + } + } + "group" + { + "id" "18" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "19" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "20" + "mode" "four_buttons" + "inputs" + { + } + } + "group" + { + "id" "21" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "22" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "23" + "mode" "four_buttons" + "inputs" + { + } + } + "group" + { + "id" "24" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "25" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "26" + "mode" "joystick_move" + "inputs" + { + } + "settings" + { + "virtual_mode" "1" + "edge_binding_radius" "24999" + "sensitivity" "99" + } + "gameactions" + { + "ship_controls" "analog_controls" + } + } + "group" + { + "id" "35" + "mode" "four_buttons" + "inputs" + { + "button_a" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action ship_controls fire_lasers, Fire Lasers" + } + } + } + } + } + "settings" + { + "layer" "1" + } + } + "group" + { + "id" "36" + "mode" "trigger" + "inputs" + { + } + "settings" + { + "layer" "1" + } + } + "group" + { + "id" "37" + "mode" "trigger" + "inputs" + { + } + "settings" + { + "layer" "1" + } + } + "group" + { + "id" "38" + "mode" "joystick_move" + "inputs" + { + } + "settings" + { + "layer" "1" + } + "gameactions" + { + "ship_controls" "analog_controls" + } + } + "group" + { + "id" "39" + "mode" "joystick_move" + "inputs" + { + } + "settings" + { + "layer" "1" + } + } + "group" + { + "id" "27" + "mode" "switches" + "inputs" + { + "button_escape" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action ship_controls pause_menu" + } + } + } + } + } + } + "group" + { + "id" "28" + "mode" "switches" + "inputs" + { + } + } + "group" + { + "id" "29" + "mode" "switches" + "inputs" + { + } + } + "group" + { + "id" "30" + "mode" "switches" + "inputs" + { + } + } + "group" + { + "id" "31" + "mode" "switches" + "inputs" + { + } + } + "group" + { + "id" "32" + "mode" "switches" + "inputs" + { + } + } + "group" + { + "id" "33" + "mode" "switches" + "inputs" + { + } + } + "group" + { + "id" "34" + "mode" "switches" + "inputs" + { + } + "settings" + { + "layer" "1" + } + } + "preset" + { + "id" "0" + "name" "ship_controls" + "group_source_bindings" + { + "27" "switch active" + "0" "button_diamond active" + "1" "left_trigger active" + "2" "right_trigger active" + "7" "joystick inactive" + "10" "joystick inactive" + "26" "joystick active" + "8" "left_trackpad inactive" + "9" "right_trackpad active" + } + } + "preset" + { + "id" "1" + "name" "menu_controls" + "group_source_bindings" + { + "28" "switch active" + "3" "button_diamond active" + "4" "left_trigger active" + "5" "right_trigger active" + "6" "joystick active" + } + } + "preset" + { + "id" "2" + "name" "thrust_action_layer" + "group_source_bindings" + { + "34" "switch active" + "35" "button_diamond active" + "36" "left_trigger active" + "37" "right_trigger active" + "38" "joystick active" + "39" "right_trackpad active" + } + } + "settings" + { + } +} diff --git a/external/steamworks/steamworksexample/steam_input_manifest.vdf b/external/steamworks/steamworksexample/steam_input_manifest.vdf new file mode 100644 index 0000000..c6073c4 --- /dev/null +++ b/external/steamworks/steamworksexample/steam_input_manifest.vdf @@ -0,0 +1,95 @@ +"Action Manifest" +{ + "configurations" + { + "controller_xboxone" + { + "0" + { + "path" "xbox_controller.vdf" + } + } + "controller_steamcontroller_gordon" + { + "0" + { + "path" "steam_controller.vdf" + } + } + } + "actions" + { + "ship_controls" + { + "title" "Ship Controls" + "legacy_set" "0" + "StickPadGyro" + { + "analog_controls" + { + "title" "#AnalogControls" + "input_mode" "joystick_move" + } + } + "Button" + { + "turn_left" "#TurnLeft" + "turn_right" "#TurnRight" + "fire_lasers" "#FireLasers" + "pause_menu" "#PauseMenu" + "forward_thrust" "#ForwardThrust" + "backward_thrust" "#BackwardThrust" + } + "Layers" + { + "thrust_action_layer" "#ThrustLayer" + } + } + "menu_controls" + { + "title" "#MenuControls" + "legacy_set" "0" + "Button" + { + "menu_up" "#MenuUp" + "menu_down" "#MenuDown" + "menu_left" "#MenuLeft" + "menu_right" "#MenuRight" + "menu_select" "#MenuSelect" + "menu_cancel" "#MenuCancel" + } + } + } + "action_layers" + { + "thrust_action_layer" + { + "title" "#ThrustLayer" + "legacy_set" "1" + "set_layer" "1" + "parent_set_name" "ship_controls" + } + } + "localization" + { + "english" + { + "title" "Space War Action Set Config Sample" + "description" "This is an example configuration for using Steamworks Action Sets." + "AnalogControls" "Analog Controls" + "TurnLeft" "Turn Left" + "TurnRight" "Turn Right" + "FireLasers" "Fire Lasers" + "PauseMenu" "Pause Menu" + "ForwardThrust" "Forward Thrust" + "BackwardThrust" "Backward Thrust" + "MenuControls" "Menu Controls" + "MenuUp" "Menu Up" + "MenuDown" "Menu Down" + "MenuLeft" "Menu Left" + "MenuRight" "Menu Right" + "MenuSelect" "Menu Select" + "ThrustLayer" "Thrust Layer" + } + } +} diff --git a/external/steamworks/steamworksexample/steamworksexample.xcodeproj/project.pbxproj b/external/steamworks/steamworksexample/steamworksexample.xcodeproj/project.pbxproj new file mode 100644 index 0000000..12cd619 --- /dev/null +++ b/external/steamworks/steamworksexample/steamworksexample.xcodeproj/project.pbxproj @@ -0,0 +1,591 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 503C6CB61268F34200B66E3B /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 503C6CB51268F34200B66E3B /* Cocoa.framework */; }; + 503C6D0F1268F49F00B66E3B /* BaseMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6CD91268F49F00B66E3B /* BaseMenu.cpp */; }; + 503C6D121268F49F00B66E3B /* gameengineosx.mm in Sources */ = {isa = PBXBuildFile; fileRef = 503C6CE01268F49F00B66E3B /* gameengineosx.mm */; }; + 503C6D131268F49F00B66E3B /* glstringosx.mm in Sources */ = {isa = PBXBuildFile; fileRef = 503C6CE21268F49F00B66E3B /* glstringosx.mm */; }; + 503C6D141268F49F00B66E3B /* Leaderboards.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6CE31268F49F00B66E3B /* Leaderboards.cpp */; }; + 503C6D151268F49F00B66E3B /* Lobby.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6CE51268F49F00B66E3B /* Lobby.cpp */; }; + 503C6D161268F49F00B66E3B /* Main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6CE71268F49F00B66E3B /* Main.cpp */; }; + 503C6D171268F49F00B66E3B /* MainMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6CE81268F49F00B66E3B /* MainMenu.cpp */; }; + 503C6D191268F49F00B66E3B /* p2pauth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6CED1268F49F00B66E3B /* p2pauth.cpp */; }; + 503C6D1A1268F49F00B66E3B /* PhotonBeam.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6CEF1268F49F00B66E3B /* PhotonBeam.cpp */; }; + 503C6D1B1268F49F00B66E3B /* QuitMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6CF11268F49F00B66E3B /* QuitMenu.cpp */; }; + 503C6D1C1268F49F00B66E3B /* RemoteStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6CF31268F49F00B66E3B /* RemoteStorage.cpp */; }; + 503C6D1D1268F49F00B66E3B /* ServerBrowser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6CF51268F49F00B66E3B /* ServerBrowser.cpp */; }; + 503C6D1E1268F49F00B66E3B /* Ship.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6CF81268F49F00B66E3B /* Ship.cpp */; }; + 503C6D1F1268F49F00B66E3B /* SpaceWarClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6CFB1268F49F00B66E3B /* SpaceWarClient.cpp */; }; + 503C6D201268F49F00B66E3B /* SpaceWarEntity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6CFD1268F49F00B66E3B /* SpaceWarEntity.cpp */; }; + 503C6D221268F49F00B66E3B /* SpaceWarServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6D011268F49F00B66E3B /* SpaceWarServer.cpp */; }; + 503C6D231268F49F00B66E3B /* StarField.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6D031268F49F00B66E3B /* StarField.cpp */; }; + 503C6D241268F49F00B66E3B /* StatsAndAchievements.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6D051268F49F00B66E3B /* StatsAndAchievements.cpp */; }; + 503C6D251268F49F00B66E3B /* stdafx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6D071268F49F00B66E3B /* stdafx.cpp */; }; + 503C6D261268F49F00B66E3B /* Sun.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6D091268F49F00B66E3B /* Sun.cpp */; }; + 503C6D271268F49F00B66E3B /* VectorEntity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6D0B1268F49F00B66E3B /* VectorEntity.cpp */; }; + 503C6D281268F49F00B66E3B /* voicechat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503C6D0D1268F49F00B66E3B /* voicechat.cpp */; }; + 503C6DAC1268FE1000B66E3B /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 503C6DAA1268FE1000B66E3B /* OpenAL.framework */; }; + 503C6DAD1268FE1000B66E3B /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 503C6DAB1268FE1000B66E3B /* OpenGL.framework */; }; + 503C6DB41269002800B66E3B /* libsteam_api.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 503C6DB31269002800B66E3B /* libsteam_api.dylib */; }; + 504EDCBC126901EC00F96D63 /* libsteam_api.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 503C6DB31269002800B66E3B /* libsteam_api.dylib */; }; + 504EDCC21269026C00F96D63 /* steam_appid.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 504EDCC01269025A00F96D63 /* steam_appid.txt */; }; + 50D642871461EF3200A5739B /* clanchatroom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D642851461EF3200A5739B /* clanchatroom.cpp */; }; + 50E77DEB1362190C000FC072 /* cglmbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E77DD11362190C000FC072 /* cglmbuffer.cpp */; }; + 50E77DEC1362190C000FC072 /* cglmfbo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E77DD31362190C000FC072 /* cglmfbo.cpp */; }; + 50E77DED1362190C000FC072 /* cglmprogram.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E77DD51362190C000FC072 /* cglmprogram.cpp */; }; + 50E77DEE1362190C000FC072 /* cglmquery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E77DD71362190C000FC072 /* cglmquery.cpp */; }; + 50E77DEF1362190C000FC072 /* cglmtex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E77DD91362190C000FC072 /* cglmtex.cpp */; }; + 50E77DF01362190C000FC072 /* dx9asmtogl2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E77DDB1362190C000FC072 /* dx9asmtogl2.cpp */; }; + 50E77DF11362190C000FC072 /* dxabstract.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E77DDD1362190C000FC072 /* dxabstract.cpp */; }; + 50E77DF21362190C000FC072 /* glmgr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E77DE11362190C000FC072 /* glmgr.cpp */; }; + 50E77DF31362190C000FC072 /* glmgrbasics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E77DE31362190C000FC072 /* glmgrbasics.cpp */; }; + 50E77DF41362190C000FC072 /* glmgrcocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 50E77DE51362190C000FC072 /* glmgrcocoa.mm */; }; + 50E77DF51362190C000FC072 /* glmgrext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E77DE61362190C000FC072 /* glmgrext.cpp */; }; + 50E77DF61362190C000FC072 /* mathlite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E77DE91362190C000FC072 /* mathlite.cpp */; }; + 50E77DF813621991000FC072 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50E77DF713621991000FC072 /* IOKit.framework */; }; + 840B387019BB91C50084B9F1 /* htmlsurface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 840B386E19BB91C50084B9F1 /* htmlsurface.cpp */; }; + 975820DB2765BE3900093F91 /* ItemStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 975820DA2765BE3900093F91 /* ItemStore.cpp */; }; + 97919DA62C22281400272343 /* timeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97919DA52C22281400272343 /* timeline.cpp */; }; + A4B5A0FD24906974000E9151 /* RemotePlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A4B5A0FC24906974000E9151 /* RemotePlay.cpp */; }; + A4B5A10424906A0E000E9151 /* SimpleProtobuf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A4B5A10324906A0E000E9151 /* SimpleProtobuf.cpp */; }; + BA60B6B81A82EDD200F4AC4F /* Friends.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BA60B6B41A82EDD200F4AC4F /* Friends.cpp */; }; + BA60B6B91A82EDD200F4AC4F /* Inventory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BA60B6B61A82EDD200F4AC4F /* Inventory.cpp */; }; + F323060928947C1800E66D30 /* OverlayExamples.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F323060828947C1800E66D30 /* OverlayExamples.cpp */; }; + F803305119087F9200344590 /* musicplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F803305019087F9200344590 /* musicplayer.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 504EDCBB126901D200F96D63 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 6; + files = ( + 504EDCC21269026C00F96D63 /* steam_appid.txt in CopyFiles */, + 504EDCBC126901EC00F96D63 /* libsteam_api.dylib in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 503C6CB21268F34200B66E3B /* steamworksexample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = steamworksexample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 503C6CB51268F34200B66E3B /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + 503C6CD91268F49F00B66E3B /* BaseMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseMenu.cpp; sourceTree = ""; }; + 503C6CDA1268F49F00B66E3B /* BaseMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseMenu.h; sourceTree = ""; }; + 503C6CDD1268F49F00B66E3B /* GameEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameEngine.h; sourceTree = ""; }; + 503C6CDF1268F49F00B66E3B /* gameengineosx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gameengineosx.h; sourceTree = ""; }; + 503C6CE01268F49F00B66E3B /* gameengineosx.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = gameengineosx.mm; sourceTree = ""; }; + 503C6CE11268F49F00B66E3B /* glstringosx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = glstringosx.h; sourceTree = ""; }; + 503C6CE21268F49F00B66E3B /* glstringosx.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = glstringosx.mm; sourceTree = ""; }; + 503C6CE31268F49F00B66E3B /* Leaderboards.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Leaderboards.cpp; sourceTree = ""; }; + 503C6CE41268F49F00B66E3B /* Leaderboards.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Leaderboards.h; sourceTree = ""; }; + 503C6CE51268F49F00B66E3B /* Lobby.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Lobby.cpp; sourceTree = ""; }; + 503C6CE61268F49F00B66E3B /* Lobby.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Lobby.h; sourceTree = ""; }; + 503C6CE71268F49F00B66E3B /* Main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Main.cpp; sourceTree = ""; }; + 503C6CE81268F49F00B66E3B /* MainMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainMenu.cpp; sourceTree = ""; }; + 503C6CE91268F49F00B66E3B /* MainMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainMenu.h; sourceTree = ""; }; + 503C6CEA1268F49F00B66E3B /* Messages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Messages.h; sourceTree = ""; }; + 503C6CED1268F49F00B66E3B /* p2pauth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = p2pauth.cpp; sourceTree = ""; }; + 503C6CEE1268F49F00B66E3B /* p2pauth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = p2pauth.h; sourceTree = ""; }; + 503C6CEF1268F49F00B66E3B /* PhotonBeam.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PhotonBeam.cpp; sourceTree = ""; }; + 503C6CF01268F49F00B66E3B /* PhotonBeam.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PhotonBeam.h; sourceTree = ""; }; + 503C6CF11268F49F00B66E3B /* QuitMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QuitMenu.cpp; sourceTree = ""; }; + 503C6CF21268F49F00B66E3B /* QuitMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuitMenu.h; sourceTree = ""; }; + 503C6CF31268F49F00B66E3B /* RemoteStorage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteStorage.cpp; sourceTree = ""; }; + 503C6CF41268F49F00B66E3B /* RemoteStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteStorage.h; sourceTree = ""; }; + 503C6CF51268F49F00B66E3B /* ServerBrowser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServerBrowser.cpp; sourceTree = ""; }; + 503C6CF61268F49F00B66E3B /* ServerBrowser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServerBrowser.h; sourceTree = ""; }; + 503C6CF71268F49F00B66E3B /* ServerBrowserMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServerBrowserMenu.h; sourceTree = ""; }; + 503C6CF81268F49F00B66E3B /* Ship.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Ship.cpp; sourceTree = ""; }; + 503C6CF91268F49F00B66E3B /* Ship.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Ship.h; sourceTree = ""; }; + 503C6CFA1268F49F00B66E3B /* SpaceWar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpaceWar.h; sourceTree = ""; }; + 503C6CFB1268F49F00B66E3B /* SpaceWarClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpaceWarClient.cpp; sourceTree = ""; }; + 503C6CFC1268F49F00B66E3B /* SpaceWarClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpaceWarClient.h; sourceTree = ""; }; + 503C6CFD1268F49F00B66E3B /* SpaceWarEntity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpaceWarEntity.cpp; sourceTree = ""; }; + 503C6CFE1268F49F00B66E3B /* SpaceWarEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpaceWarEntity.h; sourceTree = ""; }; + 503C6CFF1268F49F00B66E3B /* SpaceWarRes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpaceWarRes.h; sourceTree = ""; }; + 503C6D011268F49F00B66E3B /* SpaceWarServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpaceWarServer.cpp; sourceTree = ""; }; + 503C6D021268F49F00B66E3B /* SpaceWarServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpaceWarServer.h; sourceTree = ""; }; + 503C6D031268F49F00B66E3B /* StarField.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StarField.cpp; sourceTree = ""; }; + 503C6D041268F49F00B66E3B /* StarField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StarField.h; sourceTree = ""; }; + 503C6D051268F49F00B66E3B /* StatsAndAchievements.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StatsAndAchievements.cpp; sourceTree = ""; }; + 503C6D061268F49F00B66E3B /* StatsAndAchievements.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatsAndAchievements.h; sourceTree = ""; }; + 503C6D071268F49F00B66E3B /* stdafx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stdafx.cpp; sourceTree = ""; }; + 503C6D081268F49F00B66E3B /* stdafx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdafx.h; sourceTree = ""; }; + 503C6D091268F49F00B66E3B /* Sun.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Sun.cpp; sourceTree = ""; }; + 503C6D0A1268F49F00B66E3B /* Sun.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Sun.h; sourceTree = ""; }; + 503C6D0B1268F49F00B66E3B /* VectorEntity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VectorEntity.cpp; sourceTree = ""; }; + 503C6D0C1268F49F00B66E3B /* VectorEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VectorEntity.h; sourceTree = ""; }; + 503C6D0D1268F49F00B66E3B /* voicechat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = voicechat.cpp; sourceTree = ""; }; + 503C6D0E1268F49F00B66E3B /* voicechat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = voicechat.h; sourceTree = ""; }; + 503C6DAA1268FE1000B66E3B /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; + 503C6DAB1268FE1000B66E3B /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; + 503C6DB31269002800B66E3B /* libsteam_api.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsteam_api.dylib; path = ../redistributable_bin/osx/libsteam_api.dylib; sourceTree = ""; }; + 504EDCB4126900D600F96D63 /* steamworksexample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "steamworksexample-Info.plist"; path = "osx/steamworksexample-Info.plist"; sourceTree = ""; }; + 504EDCC01269025A00F96D63 /* steam_appid.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = steam_appid.txt; path = osx/steam_appid.txt; sourceTree = ""; }; + 50D642851461EF3200A5739B /* clanchatroom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = clanchatroom.cpp; sourceTree = ""; }; + 50D642861461EF3200A5739B /* clanchatroom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clanchatroom.h; sourceTree = ""; }; + 50E77DD11362190C000FC072 /* cglmbuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cglmbuffer.cpp; path = ../glmgr/cglmbuffer.cpp; sourceTree = ""; }; + 50E77DD21362190C000FC072 /* cglmbuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cglmbuffer.h; path = ../glmgr/cglmbuffer.h; sourceTree = ""; }; + 50E77DD31362190C000FC072 /* cglmfbo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cglmfbo.cpp; path = ../glmgr/cglmfbo.cpp; sourceTree = ""; }; + 50E77DD41362190C000FC072 /* cglmfbo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cglmfbo.h; path = ../glmgr/cglmfbo.h; sourceTree = ""; }; + 50E77DD51362190C000FC072 /* cglmprogram.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cglmprogram.cpp; path = ../glmgr/cglmprogram.cpp; sourceTree = ""; }; + 50E77DD61362190C000FC072 /* cglmprogram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cglmprogram.h; path = ../glmgr/cglmprogram.h; sourceTree = ""; }; + 50E77DD71362190C000FC072 /* cglmquery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cglmquery.cpp; path = ../glmgr/cglmquery.cpp; sourceTree = ""; }; + 50E77DD81362190C000FC072 /* cglmquery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cglmquery.h; path = ../glmgr/cglmquery.h; sourceTree = ""; }; + 50E77DD91362190C000FC072 /* cglmtex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cglmtex.cpp; path = ../glmgr/cglmtex.cpp; sourceTree = ""; }; + 50E77DDA1362190C000FC072 /* cglmtex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cglmtex.h; path = ../glmgr/cglmtex.h; sourceTree = ""; }; + 50E77DDB1362190C000FC072 /* dx9asmtogl2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dx9asmtogl2.cpp; path = ../glmgr/dx9asmtogl2.cpp; sourceTree = ""; }; + 50E77DDC1362190C000FC072 /* dx9asmtogl2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dx9asmtogl2.h; path = ../glmgr/dx9asmtogl2.h; sourceTree = ""; }; + 50E77DDD1362190C000FC072 /* dxabstract.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dxabstract.cpp; path = ../glmgr/dxabstract.cpp; sourceTree = ""; }; + 50E77DDE1362190C000FC072 /* dxabstract.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dxabstract.h; path = ../glmgr/dxabstract.h; sourceTree = ""; }; + 50E77DDF1362190C000FC072 /* glmdebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glmdebug.h; path = ../glmgr/glmdebug.h; sourceTree = ""; }; + 50E77DE01362190C000FC072 /* glmdisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glmdisplay.h; path = ../glmgr/glmdisplay.h; sourceTree = ""; }; + 50E77DE11362190C000FC072 /* glmgr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glmgr.cpp; path = ../glmgr/glmgr.cpp; sourceTree = ""; }; + 50E77DE21362190C000FC072 /* glmgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glmgr.h; path = ../glmgr/glmgr.h; sourceTree = ""; }; + 50E77DE31362190C000FC072 /* glmgrbasics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glmgrbasics.cpp; path = ../glmgr/glmgrbasics.cpp; sourceTree = ""; }; + 50E77DE41362190C000FC072 /* glmgrbasics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glmgrbasics.h; path = ../glmgr/glmgrbasics.h; sourceTree = ""; }; + 50E77DE51362190C000FC072 /* glmgrcocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = glmgrcocoa.mm; path = ../glmgr/glmgrcocoa.mm; sourceTree = ""; }; + 50E77DE61362190C000FC072 /* glmgrext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glmgrext.cpp; path = ../glmgr/glmgrext.cpp; sourceTree = ""; }; + 50E77DE71362190C000FC072 /* glmgrext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glmgrext.h; path = ../glmgr/glmgrext.h; sourceTree = ""; }; + 50E77DE81362190C000FC072 /* imageformat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imageformat.h; path = ../glmgr/imageformat.h; sourceTree = ""; }; + 50E77DE91362190C000FC072 /* mathlite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mathlite.cpp; path = ../glmgr/mathlite.cpp; sourceTree = ""; }; + 50E77DEA1362190C000FC072 /* mathlite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mathlite.h; path = ../glmgr/mathlite.h; sourceTree = ""; }; + 50E77DF713621991000FC072 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; + 840B386E19BB91C50084B9F1 /* htmlsurface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = htmlsurface.cpp; sourceTree = ""; }; + 840B386F19BB91C50084B9F1 /* htmlsurface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = htmlsurface.h; sourceTree = ""; }; + 975820DA2765BE3900093F91 /* ItemStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ItemStore.cpp; sourceTree = ""; }; + 975820DD2765BE5000093F91 /* ItemStore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ItemStore.h; sourceTree = ""; }; + 97919DA42C22280B00272343 /* timeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = timeline.h; sourceTree = ""; }; + 97919DA52C22281400272343 /* timeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = timeline.cpp; sourceTree = ""; }; + A46ECF6D26BE389800985AA7 /* steamworksexample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = steamworksexample.entitlements; path = osx/steamworksexample.entitlements; sourceTree = ""; }; + A4B5A0FC24906974000E9151 /* RemotePlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemotePlay.cpp; sourceTree = ""; }; + A4B5A0FE2490698A000E9151 /* RemotePlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemotePlay.h; sourceTree = ""; }; + A4B5A10224906A0E000E9151 /* SimpleProtobuf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleProtobuf.h; sourceTree = ""; }; + A4B5A10324906A0E000E9151 /* SimpleProtobuf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleProtobuf.cpp; sourceTree = ""; }; + BA60B6B41A82EDD200F4AC4F /* Friends.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Friends.cpp; sourceTree = ""; }; + BA60B6B51A82EDD200F4AC4F /* Friends.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Friends.h; sourceTree = ""; }; + BA60B6B61A82EDD200F4AC4F /* Inventory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Inventory.cpp; sourceTree = ""; }; + BA60B6B71A82EDD200F4AC4F /* Inventory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Inventory.h; sourceTree = ""; }; + F323060828947C1800E66D30 /* OverlayExamples.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OverlayExamples.cpp; sourceTree = ""; }; + F323060A28947C2C00E66D30 /* OverlayExamples.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverlayExamples.h; sourceTree = ""; }; + F803304F19087DA600344590 /* musicplayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = musicplayer.h; sourceTree = ""; }; + F803305019087F9200344590 /* musicplayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = musicplayer.cpp; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 503C6CAF1268F34200B66E3B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 50E77DF813621991000FC072 /* IOKit.framework in Frameworks */, + 503C6DB41269002800B66E3B /* libsteam_api.dylib in Frameworks */, + 503C6DAC1268FE1000B66E3B /* OpenAL.framework in Frameworks */, + 503C6DAD1268FE1000B66E3B /* OpenGL.framework in Frameworks */, + 503C6CB61268F34200B66E3B /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 503C6CA31268F34200B66E3B = { + isa = PBXGroup; + children = ( + 503C6D291268F4EE00B66E3B /* Headers */, + 503C6CAB1268F34200B66E3B /* Source */, + 503C6CAC1268F34200B66E3B /* Resources */, + 503C6CAD1268F34200B66E3B /* Frameworks */, + 503C6CB31268F34200B66E3B /* Products */, + ); + sourceTree = ""; + }; + 503C6CAB1268F34200B66E3B /* Source */ = { + isa = PBXGroup; + children = ( + 50E77DCF136218F5000FC072 /* glmgr */, + 503C6CD91268F49F00B66E3B /* BaseMenu.cpp */, + 50D642851461EF3200A5739B /* clanchatroom.cpp */, + BA60B6B41A82EDD200F4AC4F /* Friends.cpp */, + 503C6CE01268F49F00B66E3B /* gameengineosx.mm */, + 503C6CE21268F49F00B66E3B /* glstringosx.mm */, + 840B386E19BB91C50084B9F1 /* htmlsurface.cpp */, + BA60B6B61A82EDD200F4AC4F /* Inventory.cpp */, + 975820DA2765BE3900093F91 /* ItemStore.cpp */, + 503C6CE31268F49F00B66E3B /* Leaderboards.cpp */, + 503C6CE51268F49F00B66E3B /* Lobby.cpp */, + 503C6CE71268F49F00B66E3B /* Main.cpp */, + 503C6CE81268F49F00B66E3B /* MainMenu.cpp */, + F803305019087F9200344590 /* musicplayer.cpp */, + F323060828947C1800E66D30 /* OverlayExamples.cpp */, + 503C6CED1268F49F00B66E3B /* p2pauth.cpp */, + 503C6CEF1268F49F00B66E3B /* PhotonBeam.cpp */, + 503C6CF11268F49F00B66E3B /* QuitMenu.cpp */, + A4B5A0FC24906974000E9151 /* RemotePlay.cpp */, + 503C6CF31268F49F00B66E3B /* RemoteStorage.cpp */, + 503C6CF51268F49F00B66E3B /* ServerBrowser.cpp */, + 503C6CF81268F49F00B66E3B /* Ship.cpp */, + A4B5A10324906A0E000E9151 /* SimpleProtobuf.cpp */, + 503C6CFB1268F49F00B66E3B /* SpaceWarClient.cpp */, + 503C6CFD1268F49F00B66E3B /* SpaceWarEntity.cpp */, + 503C6D011268F49F00B66E3B /* SpaceWarServer.cpp */, + 503C6D031268F49F00B66E3B /* StarField.cpp */, + 503C6D051268F49F00B66E3B /* StatsAndAchievements.cpp */, + 503C6D071268F49F00B66E3B /* stdafx.cpp */, + 503C6D091268F49F00B66E3B /* Sun.cpp */, + 97919DA52C22281400272343 /* timeline.cpp */, + 503C6D0B1268F49F00B66E3B /* VectorEntity.cpp */, + 503C6D0D1268F49F00B66E3B /* voicechat.cpp */, + ); + name = Source; + sourceTree = ""; + }; + 503C6CAC1268F34200B66E3B /* Resources */ = { + isa = PBXGroup; + children = ( + A46ECF6D26BE389800985AA7 /* steamworksexample.entitlements */, + 504EDCC01269025A00F96D63 /* steam_appid.txt */, + 504EDCB4126900D600F96D63 /* steamworksexample-Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 503C6CAD1268F34200B66E3B /* Frameworks */ = { + isa = PBXGroup; + children = ( + 50E77DF713621991000FC072 /* IOKit.framework */, + 503C6DAA1268FE1000B66E3B /* OpenAL.framework */, + 503C6DAB1268FE1000B66E3B /* OpenGL.framework */, + 503C6DB31269002800B66E3B /* libsteam_api.dylib */, + 503C6CB51268F34200B66E3B /* Cocoa.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 503C6CB31268F34200B66E3B /* Products */ = { + isa = PBXGroup; + children = ( + 503C6CB21268F34200B66E3B /* steamworksexample.app */, + ); + name = Products; + sourceTree = ""; + }; + 503C6D291268F4EE00B66E3B /* Headers */ = { + isa = PBXGroup; + children = ( + 503C6CDA1268F49F00B66E3B /* BaseMenu.h */, + 50D642861461EF3200A5739B /* clanchatroom.h */, + BA60B6B51A82EDD200F4AC4F /* Friends.h */, + 503C6CDD1268F49F00B66E3B /* GameEngine.h */, + 503C6CDF1268F49F00B66E3B /* gameengineosx.h */, + 503C6CE11268F49F00B66E3B /* glstringosx.h */, + 840B386F19BB91C50084B9F1 /* htmlsurface.h */, + BA60B6B71A82EDD200F4AC4F /* Inventory.h */, + 975820DD2765BE5000093F91 /* ItemStore.h */, + 503C6CE41268F49F00B66E3B /* Leaderboards.h */, + 503C6CE61268F49F00B66E3B /* Lobby.h */, + 503C6CE91268F49F00B66E3B /* MainMenu.h */, + 503C6CEA1268F49F00B66E3B /* Messages.h */, + F803304F19087DA600344590 /* musicplayer.h */, + F323060A28947C2C00E66D30 /* OverlayExamples.h */, + 503C6CEE1268F49F00B66E3B /* p2pauth.h */, + 503C6CF01268F49F00B66E3B /* PhotonBeam.h */, + 503C6CF21268F49F00B66E3B /* QuitMenu.h */, + A4B5A0FE2490698A000E9151 /* RemotePlay.h */, + 503C6CF41268F49F00B66E3B /* RemoteStorage.h */, + 503C6CF61268F49F00B66E3B /* ServerBrowser.h */, + 503C6CF71268F49F00B66E3B /* ServerBrowserMenu.h */, + 503C6CF91268F49F00B66E3B /* Ship.h */, + A4B5A10224906A0E000E9151 /* SimpleProtobuf.h */, + 503C6CFA1268F49F00B66E3B /* SpaceWar.h */, + 503C6CFC1268F49F00B66E3B /* SpaceWarClient.h */, + 503C6CFE1268F49F00B66E3B /* SpaceWarEntity.h */, + 503C6CFF1268F49F00B66E3B /* SpaceWarRes.h */, + 503C6D021268F49F00B66E3B /* SpaceWarServer.h */, + 503C6D041268F49F00B66E3B /* StarField.h */, + 503C6D061268F49F00B66E3B /* StatsAndAchievements.h */, + 503C6D081268F49F00B66E3B /* stdafx.h */, + 503C6D0A1268F49F00B66E3B /* Sun.h */, + 97919DA42C22280B00272343 /* timeline.h */, + 503C6D0C1268F49F00B66E3B /* VectorEntity.h */, + 503C6D0E1268F49F00B66E3B /* voicechat.h */, + ); + name = Headers; + sourceTree = ""; + }; + 50E77DCF136218F5000FC072 /* glmgr */ = { + isa = PBXGroup; + children = ( + 50E77DD11362190C000FC072 /* cglmbuffer.cpp */, + 50E77DD21362190C000FC072 /* cglmbuffer.h */, + 50E77DD31362190C000FC072 /* cglmfbo.cpp */, + 50E77DD41362190C000FC072 /* cglmfbo.h */, + 50E77DD51362190C000FC072 /* cglmprogram.cpp */, + 50E77DD61362190C000FC072 /* cglmprogram.h */, + 50E77DD71362190C000FC072 /* cglmquery.cpp */, + 50E77DD81362190C000FC072 /* cglmquery.h */, + 50E77DD91362190C000FC072 /* cglmtex.cpp */, + 50E77DDA1362190C000FC072 /* cglmtex.h */, + 50E77DDB1362190C000FC072 /* dx9asmtogl2.cpp */, + 50E77DDC1362190C000FC072 /* dx9asmtogl2.h */, + 50E77DDD1362190C000FC072 /* dxabstract.cpp */, + 50E77DDE1362190C000FC072 /* dxabstract.h */, + 50E77DDF1362190C000FC072 /* glmdebug.h */, + 50E77DE01362190C000FC072 /* glmdisplay.h */, + 50E77DE11362190C000FC072 /* glmgr.cpp */, + 50E77DE21362190C000FC072 /* glmgr.h */, + 50E77DE31362190C000FC072 /* glmgrbasics.cpp */, + 50E77DE41362190C000FC072 /* glmgrbasics.h */, + 50E77DE51362190C000FC072 /* glmgrcocoa.mm */, + 50E77DE61362190C000FC072 /* glmgrext.cpp */, + 50E77DE71362190C000FC072 /* glmgrext.h */, + 50E77DE81362190C000FC072 /* imageformat.h */, + 50E77DE91362190C000FC072 /* mathlite.cpp */, + 50E77DEA1362190C000FC072 /* mathlite.h */, + ); + name = glmgr; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 503C6CB11268F34200B66E3B /* steamworksexample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 503C6CC91268F34200B66E3B /* Build configuration list for PBXNativeTarget "steamworksexample" */; + buildPhases = ( + 503C6CAE1268F34200B66E3B /* Sources */, + 503C6CAF1268F34200B66E3B /* Frameworks */, + 503C6CB01268F34200B66E3B /* Resources */, + 504EDCBB126901D200F96D63 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = steamworksexample; + productName = steamworksexample; + productReference = 503C6CB21268F34200B66E3B /* steamworksexample.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 503C6CA51268F34200B66E3B /* Project object */ = { + isa = PBXProject; + attributes = { + }; + buildConfigurationList = 503C6CA81268F34200B66E3B /* Build configuration list for PBXProject "steamworksexample" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + English, + en, + ); + mainGroup = 503C6CA31268F34200B66E3B; + productRefGroup = 503C6CB31268F34200B66E3B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 503C6CB11268F34200B66E3B /* steamworksexample */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 503C6CB01268F34200B66E3B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 503C6CAE1268F34200B66E3B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 840B387019BB91C50084B9F1 /* htmlsurface.cpp in Sources */, + 503C6D0F1268F49F00B66E3B /* BaseMenu.cpp in Sources */, + F803305119087F9200344590 /* musicplayer.cpp in Sources */, + 503C6D121268F49F00B66E3B /* gameengineosx.mm in Sources */, + 503C6D131268F49F00B66E3B /* glstringosx.mm in Sources */, + 503C6D141268F49F00B66E3B /* Leaderboards.cpp in Sources */, + 503C6D151268F49F00B66E3B /* Lobby.cpp in Sources */, + A4B5A0FD24906974000E9151 /* RemotePlay.cpp in Sources */, + 503C6D161268F49F00B66E3B /* Main.cpp in Sources */, + 503C6D171268F49F00B66E3B /* MainMenu.cpp in Sources */, + 503C6D191268F49F00B66E3B /* p2pauth.cpp in Sources */, + 503C6D1A1268F49F00B66E3B /* PhotonBeam.cpp in Sources */, + 503C6D1B1268F49F00B66E3B /* QuitMenu.cpp in Sources */, + 503C6D1C1268F49F00B66E3B /* RemoteStorage.cpp in Sources */, + 503C6D1D1268F49F00B66E3B /* ServerBrowser.cpp in Sources */, + 503C6D1E1268F49F00B66E3B /* Ship.cpp in Sources */, + 503C6D1F1268F49F00B66E3B /* SpaceWarClient.cpp in Sources */, + 503C6D201268F49F00B66E3B /* SpaceWarEntity.cpp in Sources */, + 503C6D221268F49F00B66E3B /* SpaceWarServer.cpp in Sources */, + 503C6D231268F49F00B66E3B /* StarField.cpp in Sources */, + 503C6D241268F49F00B66E3B /* StatsAndAchievements.cpp in Sources */, + 503C6D251268F49F00B66E3B /* stdafx.cpp in Sources */, + 503C6D261268F49F00B66E3B /* Sun.cpp in Sources */, + 503C6D271268F49F00B66E3B /* VectorEntity.cpp in Sources */, + 503C6D281268F49F00B66E3B /* voicechat.cpp in Sources */, + 50E77DEB1362190C000FC072 /* cglmbuffer.cpp in Sources */, + 50E77DEC1362190C000FC072 /* cglmfbo.cpp in Sources */, + F323060928947C1800E66D30 /* OverlayExamples.cpp in Sources */, + 50E77DED1362190C000FC072 /* cglmprogram.cpp in Sources */, + BA60B6B91A82EDD200F4AC4F /* Inventory.cpp in Sources */, + 975820DB2765BE3900093F91 /* ItemStore.cpp in Sources */, + 50E77DEE1362190C000FC072 /* cglmquery.cpp in Sources */, + 50E77DEF1362190C000FC072 /* cglmtex.cpp in Sources */, + A4B5A10424906A0E000E9151 /* SimpleProtobuf.cpp in Sources */, + 50E77DF01362190C000FC072 /* dx9asmtogl2.cpp in Sources */, + 50E77DF11362190C000FC072 /* dxabstract.cpp in Sources */, + 50E77DF21362190C000FC072 /* glmgr.cpp in Sources */, + 50E77DF31362190C000FC072 /* glmgrbasics.cpp in Sources */, + 50E77DF41362190C000FC072 /* glmgrcocoa.mm in Sources */, + 50E77DF51362190C000FC072 /* glmgrext.cpp in Sources */, + 97919DA62C22281400272343 /* timeline.cpp in Sources */, + BA60B6B81A82EDD200F4AC4F /* Friends.cpp in Sources */, + 50E77DF61362190C000FC072 /* mathlite.cpp in Sources */, + 50D642871461EF3200A5739B /* clanchatroom.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 503C6CC71268F34200B66E3B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_ENTITLEMENTS = osx/steamworksexample.entitlements; + ENABLE_HARDENED_RUNTIME = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + DEBUG, + GL_SILENCE_DEPRECATION, + ); + "GCC_PREPROCESSOR_DEFINITIONS[arch=*]" = ( + POSIX, + OSX, + GL_SILENCE_DEPRECATION, + ); + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = NO; + MACOSX_DEPLOYMENT_TARGET = 10.11; + OTHER_CODE_SIGN_FLAGS = "--deep"; + SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = ../public; + }; + name = Debug; + }; + 503C6CC81268F34200B66E3B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_ENTITLEMENTS = osx/steamworksexample.entitlements; + ENABLE_HARDENED_RUNTIME = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + "GCC_PREPROCESSOR_DEFINITIONS[arch=*]" = ( + POSIX, + OSX, + ); + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = NO; + MACOSX_DEPLOYMENT_TARGET = 10.11; + OTHER_CODE_SIGN_FLAGS = "--deep"; + SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = ../public; + }; + name = Release; + }; + 503C6CCA1268F34200B66E3B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; + CLANG_LINK_OBJC_RUNTIME = NO; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + INFOPLIST_FILE = "osx/steamworksexample-Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ( + ../lib/osx32/release, + "\"$(SRCROOT)/../lib/osx32/release\"", + ../lib/osx/release, + "\"$(SRCROOT)/../lib/osx/release\"", + ../redistributable_bin/osx/, + ); + PRODUCT_BUNDLE_IDENTIFIER = com.valvesoftware.steam.steamworksexample; + PRODUCT_NAME = steamworksexample; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 503C6CCB1268F34200B66E3B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; + CLANG_LINK_OBJC_RUNTIME = NO; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + INFOPLIST_FILE = "osx/steamworksexample-Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ( + ../lib/osx32/debug, + "\"$(SRCROOT)/../lib/osx32/release\"", + ../lib/osx/debug, + "\"$(SRCROOT)/../lib/osx/release\"", + ../redistributable_bin/osx/, + ); + PRODUCT_BUNDLE_IDENTIFIER = com.valvesoftware.steam.steamworksexample; + PRODUCT_NAME = steamworksexample; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 503C6CA81268F34200B66E3B /* Build configuration list for PBXProject "steamworksexample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 503C6CC71268F34200B66E3B /* Debug */, + 503C6CC81268F34200B66E3B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 503C6CC91268F34200B66E3B /* Build configuration list for PBXNativeTarget "steamworksexample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 503C6CCA1268F34200B66E3B /* Debug */, + 503C6CCB1268F34200B66E3B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 503C6CA51268F34200B66E3B /* Project object */; +} diff --git a/external/steamworks/steamworksexample/timeline.cpp b/external/steamworks/steamworksexample/timeline.cpp new file mode 100644 index 0000000..670c705 --- /dev/null +++ b/external/steamworks/steamworksexample/timeline.cpp @@ -0,0 +1,121 @@ +//====== Copyright © 1996-2023 Valve Corporation, All rights reserved. ======= +// +// Purpose: Class for adding to the Game Recording Timeline for different game states +// +//============================================================================= + +#include "stdafx.h" +#include "timeline.h" +#include "SpaceWarClient.h" + +extern uint32 Plat_GetTicks(); + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +CTimeline::CTimeline( IGameEngine *pGameEngine ) : + m_pGameEngine( pGameEngine ), + m_GameID( SteamUtils()->GetAppID() ), + m_bInGame( false ) +{ + SteamTimeline()->SetTimelineGameMode( k_ETimelineGameMode_Menus ); + m_ulSessionCounter = 0; + m_ulInGameStartTime = 0; + m_unLastTimestampIndexDisplayed = 0; +} + + +//----------------------------------------------------------------------------- +// Purpose: Game state has changed +//----------------------------------------------------------------------------- +void CTimeline::OnGameStateChange( EClientGameState eNewState ) +{ + bool bInGameNow = false; + switch ( eNewState ) + { + case k_EClientGameWaitingForPlayers: + case k_EClientGameActive: + case k_EClientGameQuitMenu: + case k_EClientGameDraw: + case k_EClientGameWinner: + bInGameNow = true; + break; + + case k_EClientStatsAchievements: + case k_EClientGameStartServer: + case k_EClientGameMenu: + case k_EClientGameExiting: + case k_EClientGameInstructions: + case k_EClientGameConnecting: + case k_EClientGameConnectionFailure: + case k_EClientFindInternetServers: + default: + break; + } + + // change the timeline bar from gray to blue and add a timeline range covering the game session + if ( m_bInGame != bInGameNow ) + { + if ( bInGameNow ) + { + SteamTimeline()->SetTimelineGameMode( k_ETimelineGameMode_Playing ); + + m_unSessionStart = Plat_GetTicks(); + + // start timers for adding timeline timestamps + m_ulInGameStartTime = m_pGameEngine->GetGameTickCount(); + m_unLastTimestampIndexDisplayed = 0; + } + else + { + SteamTimeline()->SetTimelineGameMode( k_ETimelineGameMode_Menus ); + + uint32 unSessionEnd = Plat_GetTicks(); + uint32 unSessionDuration = unSessionEnd - m_unSessionStart; + + float flDurationSeconds = (float)unSessionDuration / 1000.f; + float flStartOffsetSeconds = -flDurationSeconds; + + SteamTimeline()->AddRangeTimelineEvent( "In Match", nullptr, "steam_starburst", 100, flStartOffsetSeconds, flDurationSeconds, k_ETimelineEventClipPriority_None ); + } + + m_bInGame = bInGameNow; + } + + // add a highlight marker every time the player wins + if ( eNewState == k_EClientGameWinner && SpaceWarClient()->BLocalPlayerWonLastGame() ) + { + SteamTimeline()->AddInstantaneousTimelineEvent( "Winner!", "You won a round!", "steam_attack", 10, 0, k_ETimelineEventClipPriority_Standard ); + } + else if ( eNewState == k_EClientGameDraw ) + { + SteamTimeline()->AddInstantaneousTimelineEvent( "Draw", "This round was a draw.", "steam_defend", 5, 0, k_ETimelineEventClipPriority_None ); + } +} + +//----------------------------------------------------------------------------- +// Purpose: Run a frame. Does not need to run at full frame rate. +//----------------------------------------------------------------------------- +void CTimeline::RunFrame() +{ + if ( m_bInGame ) + { + // every 5 minutes, add a new timeline timestamp in the form of "05:00", "10:00", etc. + // Note: we use 5 minutes here for demo purposes, but if appropriate for your game, you + // might want to choose a larger interval to keep the Timeline less cluttered for users + const uint32 k_unMinutesBetweenTimestamps = 5; + const uint64 k_unMaxTimeToDisplayIndex = 95 / k_unMinutesBetweenTimestamps; + + uint64 ulSinceStartMS = m_pGameEngine->GetGameTickCount() - m_ulInGameStartTime; + uint32 unTimestampIndex = (int)( ulSinceStartMS / (k_unMinutesBetweenTimestamps * 60 * 1000) ); + if ( unTimestampIndex > 0 && unTimestampIndex > m_unLastTimestampIndexDisplayed && unTimestampIndex <= k_unMaxTimeToDisplayIndex ) + { + // max string length is "95:00" + char rgchBuffer[ 6 ]; + sprintf_safe( rgchBuffer, "%02d:00", unTimestampIndex * k_unMinutesBetweenTimestamps ); + SteamTimeline()->SetTimelineTooltip( rgchBuffer, 0 ); + + m_unLastTimestampIndexDisplayed = unTimestampIndex; + } + } +} diff --git a/external/steamworks/steamworksexample/timeline.h b/external/steamworks/steamworksexample/timeline.h new file mode 100644 index 0000000..f21fc2d --- /dev/null +++ b/external/steamworks/steamworksexample/timeline.h @@ -0,0 +1,33 @@ +//====== Copyright © 1996-2023 Valve Corporation, All rights reserved. ======= +// +// Purpose: Class for adding to the Game Recording Timeline for different game states +// +//============================================================================= + +#ifndef TIMELINE_H +#define TIMELINE_H + +#include "SpaceWar.h" +#include "GameEngine.h" + + +class CTimeline +{ +public: + CTimeline( IGameEngine *pGameEngine ); + + void RunFrame(); + void OnGameStateChange( EClientGameState eNewState ); + +private: + CGameID m_GameID; + IGameEngine *m_pGameEngine; + + bool m_bInGame; + uint64 m_ulInGameStartTime; + uint32 m_unLastTimestampIndexDisplayed; + uint64 m_ulSessionCounter; + uint32 m_unSessionStart; +}; + +#endif // TIMELINE_H diff --git a/external/steamworks/steamworksexample/voicechat.cpp b/external/steamworks/steamworksexample/voicechat.cpp new file mode 100644 index 0000000..eb1ca18 --- /dev/null +++ b/external/steamworks/steamworksexample/voicechat.cpp @@ -0,0 +1,243 @@ +//========= Copyright © 1996-2010, Valve LLC, All rights reserved. ============ +// +// Purpose:Class for P2P voice chat +// +// $NoKeywords: $ +//============================================================================= + +#include "stdafx.h" +#include "voicechat.h" + + +CVoiceChat::CVoiceChat( IGameEngine *pGameEngine ) +{ + m_pGameEngine = pGameEngine; + m_bIsActive = false; + m_ulLastTimeTalked = 0; + m_hVoiceLoopback = 0; +} + + +CVoiceChat::~CVoiceChat() +{ + m_pGameEngine = NULL; +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CVoiceChat::RunFrame() +{ + if ( m_bIsActive ) + { + // read local microphone input + uint32 nBytesAvailable = 0; + EVoiceResult res = SteamUser()->GetAvailableVoice( &nBytesAvailable, NULL, 0 ); + + if ( res == k_EVoiceResultOK && nBytesAvailable > 0 ) + { + uint32 nBytesWritten = 0; + MsgVoiceChatData_t msg; + + // don't send more then 1 KB at a time + uint8 buffer[ 1024+sizeof(msg) ]; + + res = SteamUser()->GetVoice( true, buffer+sizeof(msg), 1024, &nBytesWritten, false, NULL, 0, NULL, 0 ); + + if ( res == k_EVoiceResultOK && nBytesWritten > 0 ) + { + // assemble message. note that we don't fill in the SteamID + // here. The server will know who sent + msg.SetDataLength( nBytesWritten ); + memcpy( buffer, &msg, sizeof(msg) ); + + // Send a message to the server with the data, server will broadcast this data on to all other clients. + SteamNetworkingSockets()->SendMessageToConnection( m_hConnServer, buffer, sizeof(msg)+nBytesWritten, k_nSteamNetworkingSend_UnreliableNoDelay, nullptr ); + + m_ulLastTimeTalked = m_pGameEngine->GetGameTickCount(); + + // if local voice loopback is enabled, play it back now + if ( m_hVoiceLoopback != 0 ) + { + // Uncompress the voice data, buffer holds up to 1 second of data + uint32 numUncompressedBytes = 0; + const uint8* pVoiceData = (const uint8*) buffer; + pVoiceData += sizeof(MsgVoiceChatData_t); + + res = SteamUser()->DecompressVoice( pVoiceData , nBytesWritten, + m_ubUncompressedVoice, sizeof( m_ubUncompressedVoice ), &numUncompressedBytes, VOICE_OUTPUT_SAMPLE_RATE ); + + if ( res == k_EVoiceResultOK && numUncompressedBytes > 0 ) + { + m_pGameEngine->AddVoiceData( m_hVoiceLoopback, m_ubUncompressedVoice, numUncompressedBytes ); + } + } + } + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CVoiceChat::HandleVoiceChatData( const void *pMessage ) +{ + const MsgVoiceChatData_t *pMsgVoiceData = (const MsgVoiceChatData_t *) pMessage; + CSteamID fromSteamID = pMsgVoiceData->GetSteamID(); + + std::map< uint64, VoiceChatConnection_t >::iterator iter; + iter = m_MapConnections.find( fromSteamID.ConvertToUint64() ); + if (iter == m_MapConnections.end()) + return; + + VoiceChatConnection_t &chatClient = iter->second; + chatClient.ulLastReceiveVoiceTime = m_pGameEngine->GetGameTickCount(); + + // Uncompress the voice data, buffer holds up to 1 second of data + uint8 pbUncompressedVoice[ VOICE_OUTPUT_SAMPLE_RATE * BYTES_PER_SAMPLE ]; + uint32 numUncompressedBytes = 0; + const uint8* pVoiceData = (const uint8*) pMessage; + pVoiceData += sizeof(MsgVoiceChatData_t); + + EVoiceResult res = SteamUser()->DecompressVoice( pVoiceData , pMsgVoiceData->GetDataLength(), + pbUncompressedVoice, sizeof( pbUncompressedVoice ), &numUncompressedBytes, VOICE_OUTPUT_SAMPLE_RATE ); + + if ( res == k_EVoiceResultOK && numUncompressedBytes > 0 ) + { + // play it again Sam + if ( chatClient.hVoiceChannel == 0 ) + { + chatClient.hVoiceChannel = m_pGameEngine->HCreateVoiceChannel(); + } + + m_pGameEngine->AddVoiceData( chatClient.hVoiceChannel, pbUncompressedVoice, numUncompressedBytes ); + } +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CVoiceChat::MarkAllPlayersInactive() +{ + std::map< uint64, VoiceChatConnection_t >::iterator iter; + for( iter = m_MapConnections.begin(); iter != m_MapConnections.end(); ++iter ) + { + iter->second.bActive = false; + } +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CVoiceChat::MarkPlayerAsActive( CSteamID steamID ) +{ + if ( !m_bIsActive ) + return; + + if ( m_SteamIDLocalUser == steamID ) + return; + + std::map< uint64, VoiceChatConnection_t >::iterator iter; + iter = m_MapConnections.find( steamID.ConvertToUint64() ); + if ( iter != m_MapConnections.end() ) + { + // player already has a session object, no new object created + iter->second.bActive = true; + return; + } + + /*char szText[100]; + sprintf_safe(szText, "CVoiceChat::AddPlayerToSession: %s.\n", SteamFriends()->GetFriendPersonaName( steamID ) ); + OutputDebugString( szText ); */ + + VoiceChatConnection_t session; + session.ulLastReceiveVoiceTime = 0; + session.hVoiceChannel = 0; + session.bActive = true; + + m_MapConnections[ steamID.ConvertToUint64() ] = session; + + return; +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +bool CVoiceChat::IsPlayerTalking( CSteamID steamID ) +{ + + if ( steamID == m_SteamIDLocalUser ) + { + // thats ourself + if ( m_ulLastTimeTalked + 250 > m_pGameEngine->GetGameTickCount() ) + return true; + } + else + { + std::map< uint64, VoiceChatConnection_t >::iterator iter; + iter = m_MapConnections.find( steamID.ConvertToUint64() ); + if ( iter != m_MapConnections.end() ) + { + if ( (iter->second.ulLastReceiveVoiceTime + 250) > m_pGameEngine->GetGameTickCount() ) + { + // user talked less then 250msec ago, assume still active + return true; + } + } + } + + return false; +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +bool CVoiceChat::StartVoiceChat() +{ + if ( !m_bIsActive ) + { + m_SteamIDLocalUser = SteamUser()->GetSteamID(); + + SteamUser()->StartVoiceRecording(); + + m_bIsActive = true; + + // here you can enable optional local voice loopback: + // m_hVoiceLoopback = m_pGameEngine->HCreateVoiceChannel(); + } + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CVoiceChat::StopVoiceChat() +{ + if ( m_bIsActive ) + { + std::map< uint64, VoiceChatConnection_t >::iterator iter; + for( iter = m_MapConnections.begin(); iter != m_MapConnections.end(); ++iter ) + { + CSteamID steamID( iter->first ); + m_pGameEngine->DestroyVoiceChannel( iter->second.hVoiceChannel ); + } + + m_MapConnections.clear(); + + if ( m_hVoiceLoopback ) + { + m_pGameEngine->DestroyVoiceChannel( m_hVoiceLoopback ); + m_hVoiceLoopback = 0; + } + + SteamUser()->StopVoiceRecording(); + + m_bIsActive = false; + } +} diff --git a/external/steamworks/steamworksexample/voicechat.h b/external/steamworks/steamworksexample/voicechat.h new file mode 100644 index 0000000..482b092 --- /dev/null +++ b/external/steamworks/steamworksexample/voicechat.h @@ -0,0 +1,60 @@ +//========= Copyright © 1996-2010, Valve LLC, All rights reserved. ============ +// +// Purpose: Class for P2P voice chat +// +// $NoKeywords: $ +//============================================================================= + +#ifndef VOICE_CHAT_H +#define VOICE_CHAT_H + +#include "GameEngine.h" +#include "SpaceWar.h" +#include "Messages.h" +#include "steam/isteamnetworkingsockets.h" + +typedef struct VoiceChatConnection_s +{ + uint64 ulLastReceiveVoiceTime; + HGAMEVOICECHANNEL hVoiceChannel; // engine voice channel for this player + bool bActive; +} VoiceChatConnection_t; + +class CVoiceChat +{ +public: + + CVoiceChat( IGameEngine *pGameEngine ); + ~CVoiceChat(); + + bool StartVoiceChat(); + void StopVoiceChat(); + + // chat control + void MarkAllPlayersInactive(); + void MarkPlayerAsActive( CSteamID steamID ); + + bool IsPlayerTalking( CSteamID steamID ); + + // chat engine + void RunFrame(); + void HandleVoiceChatData( const void *pMessage ); + + HSteamNetConnection m_hConnServer; + +private: + + // Pointer to engine instance (so we can play sound) + IGameEngine *m_pGameEngine; + + // map of voice chat sessions with other players + std::map< uint64, VoiceChatConnection_t > m_MapConnections; + + CSteamID m_SteamIDLocalUser; // ourself + bool m_bIsActive; // is voice chat system active + uint64 m_ulLastTimeTalked; // last time we've talked ourself + HGAMEVOICECHANNEL m_hVoiceLoopback; + uint8 m_ubUncompressedVoice[ VOICE_OUTPUT_SAMPLE_RATE * BYTES_PER_SAMPLE ]; // too big for the stack +}; + +#endif \ No newline at end of file diff --git a/external/steamworks/steamworksexample/win64/debug/steam_appid.txt b/external/steamworks/steamworksexample/win64/debug/steam_appid.txt new file mode 100644 index 0000000..7ad8022 --- /dev/null +++ b/external/steamworks/steamworksexample/win64/debug/steam_appid.txt @@ -0,0 +1 @@ +480 \ No newline at end of file diff --git a/external/steamworks/steamworksexample/win64/release/steam_appid.txt b/external/steamworks/steamworksexample/win64/release/steam_appid.txt new file mode 100644 index 0000000..7ad8022 --- /dev/null +++ b/external/steamworks/steamworksexample/win64/release/steam_appid.txt @@ -0,0 +1 @@ +480 \ No newline at end of file diff --git a/external/steamworks/steamworksexample/xbox_controller.vdf b/external/steamworks/steamworksexample/xbox_controller.vdf new file mode 100644 index 0000000..1e56507 --- /dev/null +++ b/external/steamworks/steamworksexample/xbox_controller.vdf @@ -0,0 +1,716 @@ +"controller_mappings" +{ + "version" "3" + "revision" "8" + "title" "#title" + "description" "#description" + "controller_type" "controller_xboxone" + "major_revision" "0" + "minor_revision" "0" + "Timestamp" "1559770832" + "actions" + { + "ship_controls" + { + "title" "Ship Controls" + "legacy_set" "0" + "StickPadGyro" + { + "analog_controls" + { + "title" "#AnalogControls" + "input_mode" "joystick_move" + } + } + "Button" + { + "turn_left" "#TurnLeft" + "turn_right" "#TurnRight" + "fire_lasers" "#FireLasers" + "pause_menu" "#PauseMenu" + "forward_thrust" "#ForwardThrust" + "backward_thrust" "#BackwardThrust" + } + "Layers" + { + "thrust_action_layer" "#ThrustLayer" + } + } + "menu_controls" + { + "title" "#MenuControls" + "legacy_set" "0" + "Button" + { + "menu_up" "#MenuUp" + "menu_down" "#MenuDown" + "menu_left" "#MenuLeft" + "menu_right" "#MenuRight" + "menu_select" "#MenuSelect" + "menu_cancel" "#MenuCancel" + } + } + } + "action_layers" + { + "thrust_action_layer" + { + "title" "#ThrustLayer" + "legacy_set" "1" + "set_layer" "1" + "parent_set_name" "ship_controls" + } + } + "localization" + { + "english" + { + "title" "Space War Action Set Config Sample" + "description" "This is an example configuration for using Steamworks Action Sets." + "AnalogControls" "Analog Controls" + "TurnLeft" "Turn Left" + "TurnRight" "Turn Right" + "FireLasers" "Fire Lasers" + "PauseMenu" "Pause Menu" + "BackwardThrust" "Backward Thrust" + "MenuControls" "Menu Controls" + "MenuUp" "Menu Up" + "MenuDown" "Menu Down" + "MenuLeft" "Menu Left" + "MenuRight" "Menu Right" + "MenuSelect" "Menu Select" + "ThrustLayer" "Thrust Layer" + } + } + "group" + { + "id" "0" + "mode" "four_buttons" + "inputs" + { + } + "settings" + { + "button_size" "17988" + "button_dist" "19988" + } + } + "group" + { + "id" "1" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "2" + "mode" "trigger" + "inputs" + { + "edge" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action ship_controls fire_lasers" + } + "settings" + { + "haptic_intensity" "2" + } + } + } + } + } + } + "group" + { + "id" "3" + "mode" "four_buttons" + "inputs" + { + "button_a" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action menu_controls menu_select" + } + } + } + } + "button_b" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action menu_controls menu_cancel" + } + } + } + } + } + "settings" + { + "button_size" "17992" + "button_dist" "19992" + } + } + "group" + { + "id" "4" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "5" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "6" + "mode" "dpad" + "inputs" + { + "dpad_north" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action menu_controls menu_up" + } + } + } + } + "dpad_south" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action menu_controls menu_down" + } + } + } + } + "dpad_east" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action menu_controls menu_right" + } + } + } + } + "dpad_west" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action menu_controls menu_left" + } + } + } + } + } + "settings" + { + "requires_click" "0" + "edge_binding_radius" "24995" + "analog_emulation_period" "29" + } + } + "group" + { + "id" "7" + "mode" "dpad" + "inputs" + { + } + "settings" + { + "requires_click" "0" + "edge_binding_radius" "24995" + "analog_emulation_period" "29" + } + } + "group" + { + "id" "8" + "mode" "joystick_move" + "inputs" + { + } + "settings" + { + "virtual_mode" "1" + "edge_binding_radius" "24997" + "sensitivity" "98" + } + } + "group" + { + "id" "9" + "mode" "joystick_move" + "inputs" + { + } + "settings" + { + "virtual_mode" "1" + "edge_binding_radius" "24997" + "sensitivity" "98" + } + } + "group" + { + "id" "10" + "mode" "joystick_move" + "inputs" + { + } + "settings" + { + "virtual_mode" "1" + "edge_binding_radius" "24996" + "sensitivity" "98" + } + } + "group" + { + "id" "11" + "mode" "four_buttons" + "inputs" + { + } + } + "group" + { + "id" "12" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "13" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "14" + "mode" "four_buttons" + "inputs" + { + } + } + "group" + { + "id" "15" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "16" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "17" + "mode" "four_buttons" + "inputs" + { + } + } + "group" + { + "id" "18" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "19" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "20" + "mode" "four_buttons" + "inputs" + { + } + } + "group" + { + "id" "21" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "22" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "23" + "mode" "four_buttons" + "inputs" + { + } + } + "group" + { + "id" "24" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "25" + "mode" "trigger" + "inputs" + { + } + } + "group" + { + "id" "26" + "mode" "joystick_move" + "inputs" + { + } + "settings" + { + "virtual_mode" "1" + "edge_binding_radius" "24999" + "sensitivity" "99" + } + "gameactions" + { + "ship_controls" "analog_controls" + } + } + "group" + { + "id" "35" + "mode" "four_buttons" + "inputs" + { + "button_a" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action ship_controls fire_lasers, Fire Lasers" + } + } + } + } + } + "settings" + { + "layer" "1" + } + } + "group" + { + "id" "36" + "mode" "trigger" + "inputs" + { + } + "settings" + { + "layer" "1" + } + } + "group" + { + "id" "37" + "mode" "trigger" + "inputs" + { + } + "settings" + { + "layer" "1" + } + } + "group" + { + "id" "38" + "mode" "joystick_move" + "inputs" + { + } + "settings" + { + "layer" "1" + } + "gameactions" + { + "ship_controls" "analog_controls" + } + } + "group" + { + "id" "39" + "mode" "joystick_move" + "inputs" + { + } + "settings" + { + "layer" "1" + } + } + "group" + { + "id" "40" + "mode" "dpad" + "inputs" + { + "dpad_north" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action menu_controls menu_up, Menu Up" + } + } + } + } + "dpad_south" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action menu_controls menu_down, Menu Down" + } + } + } + } + "dpad_east" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action menu_controls menu_right, Menu Right" + } + } + } + } + "dpad_west" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action menu_controls menu_left, Menu Left" + } + } + } + } + } + "settings" + { + "requires_click" "0" + } + } + "group" + { + "id" "27" + "mode" "switches" + "inputs" + { + "button_escape" + { + "activators" + { + "Full_Press" + { + "bindings" + { + "binding" "game_action ship_controls pause_menu" + } + } + } + } + } + } + "group" + { + "id" "28" + "mode" "switches" + "inputs" + { + } + } + "group" + { + "id" "29" + "mode" "switches" + "inputs" + { + } + } + "group" + { + "id" "30" + "mode" "switches" + "inputs" + { + } + } + "group" + { + "id" "31" + "mode" "switches" + "inputs" + { + } + } + "group" + { + "id" "32" + "mode" "switches" + "inputs" + { + } + } + "group" + { + "id" "33" + "mode" "switches" + "inputs" + { + } + } + "group" + { + "id" "34" + "mode" "switches" + "inputs" + { + } + "settings" + { + "layer" "1" + } + } + "preset" + { + "id" "0" + "name" "ship_controls" + "group_source_bindings" + { + "27" "switch active" + "0" "button_diamond active" + "1" "left_trigger active" + "2" "right_trigger active" + "7" "joystick inactive" + "10" "joystick inactive" + "26" "joystick active" + "8" "dpad inactive" + "9" "right_joystick active" + } + } + "preset" + { + "id" "1" + "name" "menu_controls" + "group_source_bindings" + { + "28" "switch active" + "3" "button_diamond active" + "4" "left_trigger active" + "5" "right_trigger active" + "6" "joystick active" + "40" "dpad active" + } + } + "preset" + { + "id" "2" + "name" "thrust_action_layer" + "group_source_bindings" + { + "34" "switch active" + "35" "button_diamond active" + "36" "left_trigger active" + "37" "right_trigger active" + "38" "joystick active" + "39" "right_joystick active" + } + } + "settings" + { + } +} diff --git a/external/steamworks/tools/ContentBuilder/builder/steamcmd.exe b/external/steamworks/tools/ContentBuilder/builder/steamcmd.exe new file mode 100644 index 0000000..eab93fb Binary files /dev/null and b/external/steamworks/tools/ContentBuilder/builder/steamcmd.exe differ diff --git a/external/steamworks/tools/ContentBuilder/builder_linux/linux32/crashhandler.so b/external/steamworks/tools/ContentBuilder/builder_linux/linux32/crashhandler.so new file mode 100644 index 0000000..99837ee Binary files /dev/null and b/external/steamworks/tools/ContentBuilder/builder_linux/linux32/crashhandler.so differ diff --git a/external/steamworks/tools/ContentBuilder/builder_linux/linux32/libstdc++.so.6 b/external/steamworks/tools/ContentBuilder/builder_linux/linux32/libstdc++.so.6 new file mode 100644 index 0000000..fa12047 Binary files /dev/null and b/external/steamworks/tools/ContentBuilder/builder_linux/linux32/libstdc++.so.6 differ diff --git a/external/steamworks/tools/ContentBuilder/builder_linux/linux32/steamcmd b/external/steamworks/tools/ContentBuilder/builder_linux/linux32/steamcmd new file mode 100644 index 0000000..13d6050 Binary files /dev/null and b/external/steamworks/tools/ContentBuilder/builder_linux/linux32/steamcmd differ diff --git a/external/steamworks/tools/ContentBuilder/builder_linux/linux32/steamerrorreporter b/external/steamworks/tools/ContentBuilder/builder_linux/linux32/steamerrorreporter new file mode 100644 index 0000000..3ae5201 Binary files /dev/null and b/external/steamworks/tools/ContentBuilder/builder_linux/linux32/steamerrorreporter differ diff --git a/external/steamworks/tools/ContentBuilder/builder_linux/steamcmd.sh b/external/steamworks/tools/ContentBuilder/builder_linux/steamcmd.sh new file mode 100644 index 0000000..d1a022e --- /dev/null +++ b/external/steamworks/tools/ContentBuilder/builder_linux/steamcmd.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +STEAMROOT="$(cd "${0%/*}" && echo $PWD)" +STEAMEXE=`basename "$0" .sh` + +UNAME=`uname` +if [ "$UNAME" == "Linux" ]; then + PLATFORM=linux32 + export LD_LIBRARY_PATH="$STEAMROOT/$PLATFORM:$LD_LIBRARY_PATH" +else # if [ "$UNAME" == "Darwin" ]; then + PLATFORM=osx32 + export DYLD_LIBRARY_PATH="$STEAMROOT/$PLATFORM:$DYLD_LIBRARY_PATH" +fi + +ulimit -n 2048 + +MAGIC_RESTART_EXITCODE=42 + +if [ "$DEBUGGER" == "gdb" ] || [ "$DEBUGGER" == "cgdb" ]; then + ARGSFILE=$(mktemp $USER.steam.gdb.XXXX) + + # Set the LD_PRELOAD varname in the debugger, and unset the global version. + if [ "$LD_PRELOAD" ]; then + echo set env LD_PRELOAD=$LD_PRELOAD >> "$ARGSFILE" + echo show env LD_PRELOAD >> "$ARGSFILE" + unset LD_PRELOAD + fi + + $DEBUGGER -x "$ARGSFILE" "$STEAMROOT/$PLATFORM/$STEAMEXE" "$@" + rm "$ARGSFILE" +else + $DEBUGGER "$STEAMROOT/$PLATFORM/$STEAMEXE" "$@" +fi + +STATUS=$? + +if [ $STATUS -eq $MAGIC_RESTART_EXITCODE ]; then + exec "$0" "$@" +fi +exit $STATUS diff --git a/external/steamworks/tools/ContentBuilder/builder_osx/crashhandler.dylib b/external/steamworks/tools/ContentBuilder/builder_osx/crashhandler.dylib new file mode 100644 index 0000000..20cf99e Binary files /dev/null and b/external/steamworks/tools/ContentBuilder/builder_osx/crashhandler.dylib differ diff --git a/external/steamworks/tools/ContentBuilder/builder_osx/steamcmd b/external/steamworks/tools/ContentBuilder/builder_osx/steamcmd new file mode 100644 index 0000000..44abf88 Binary files /dev/null and b/external/steamworks/tools/ContentBuilder/builder_osx/steamcmd differ diff --git a/external/steamworks/tools/ContentBuilder/builder_osx/steamcmd.sh b/external/steamworks/tools/ContentBuilder/builder_osx/steamcmd.sh new file mode 100644 index 0000000..76530a2 --- /dev/null +++ b/external/steamworks/tools/ContentBuilder/builder_osx/steamcmd.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +STEAMROOT="$(cd "${0%/*}" && echo $PWD)" +STEAMCMD=`basename "$0" .sh` + +UNAME=`uname` +if [ "$UNAME" == "Linux" ]; then + STEAMEXE="${STEAMROOT}/linux32/${STEAMCMD}" + PLATFORM="linux32" + export LD_LIBRARY_PATH="$STEAMROOT/$PLATFORM:$LD_LIBRARY_PATH" +else # if [ "$UNAME" == "Darwin" ]; then + STEAMEXE="${STEAMROOT}/${STEAMCMD}" + if [ ! -x ${STEAMEXE} ]; then + STEAMEXE="${STEAMROOT}/Steam.AppBundle/Steam/Contents/MacOS/${STEAMCMD}" + fi + export DYLD_LIBRARY_PATH="$STEAMROOT:$DYLD_LIBRARY_PATH" + export DYLD_FRAMEWORK_PATH="$STEAMROOT:$DYLD_FRAMEWORK_PATH" +fi + +ulimit -n 2048 + +MAGIC_RESTART_EXITCODE=42 + +if [ "$DEBUGGER" == "gdb" ] || [ "$DEBUGGER" == "cgdb" ]; then + ARGSFILE=$(mktemp $USER.steam.gdb.XXXX) + + # Set the LD_PRELOAD varname in the debugger, and unset the global version. + if [ "$LD_PRELOAD" ]; then + echo set env LD_PRELOAD=$LD_PRELOAD >> "$ARGSFILE" + echo show env LD_PRELOAD >> "$ARGSFILE" + unset LD_PRELOAD + fi + + $DEBUGGER -x "$ARGSFILE" "$STEAMEXE" "$@" + rm "$ARGSFILE" +else + $DEBUGGER "$STEAMEXE" "$@" +fi + +STATUS=$? + +if [ $STATUS -eq $MAGIC_RESTART_EXITCODE ]; then + exec "$0" "$@" +fi +exit $STATUS diff --git a/engine/net.cpp b/external/steamworks/tools/ContentBuilder/content/your game content lives here.txt similarity index 100% rename from engine/net.cpp rename to external/steamworks/tools/ContentBuilder/content/your game content lives here.txt diff --git a/external/steamworks/tools/ContentBuilder/output/for build logs and intermediate files.txt b/external/steamworks/tools/ContentBuilder/output/for build logs and intermediate files.txt new file mode 100644 index 0000000..e69de29 diff --git a/external/steamworks/tools/ContentBuilder/readme.txt b/external/steamworks/tools/ContentBuilder/readme.txt new file mode 100644 index 0000000..e305ec2 --- /dev/null +++ b/external/steamworks/tools/ContentBuilder/readme.txt @@ -0,0 +1 @@ +run_build.bat shows how to run a Steam content build for AppID 1000 which has one depot 1001. diff --git a/external/steamworks/tools/ContentBuilder/run_build.bat b/external/steamworks/tools/ContentBuilder/run_build.bat new file mode 100644 index 0000000..c090cdf --- /dev/null +++ b/external/steamworks/tools/ContentBuilder/run_build.bat @@ -0,0 +1 @@ +builder\steamcmd.exe +login account password +run_app_build ..\scripts\simple_app_build.vdf +quit diff --git a/external/steamworks/tools/ContentBuilder/scripts/app_build_1000.vdf b/external/steamworks/tools/ContentBuilder/scripts/app_build_1000.vdf new file mode 100644 index 0000000..33c1275 --- /dev/null +++ b/external/steamworks/tools/ContentBuilder/scripts/app_build_1000.vdf @@ -0,0 +1,17 @@ +"AppBuild" +{ + "AppID" "1000" // Your AppID + "Desc" "Your build description here" // internal description for this build + "Preview" "1" // make this a preview build only, nothing is uploaded + "Local" "..\..\ContentServer\htdocs" // put content on local content server instead of uploading to Steam + "SetLive" "AlphaTest" // set this build live on beta branch AlphaTest + "ContentRoot" "..\content\" // content root folder relative to this script file + "BuildOutput" "D:\build_output\" // put build cache and log files on different drive for better performance + "verbose" "0" // spew more build details in console + "Depots" + { + // file mapping instructions for each depot are in separate script files + "1001" "depot_build_1001.vdf" + "1002" "depot_build_1002.vdf" + } +} \ No newline at end of file diff --git a/external/steamworks/tools/ContentBuilder/scripts/depot_build_1001.vdf b/external/steamworks/tools/ContentBuilder/scripts/depot_build_1001.vdf new file mode 100644 index 0000000..cc5baa0 --- /dev/null +++ b/external/steamworks/tools/ContentBuilder/scripts/depot_build_1001.vdf @@ -0,0 +1,20 @@ +"DepotBuild" +{ + // Set your assigned depot ID here + "DepotID" "1001" + + // include all files recursivley + "FileMapping" + { + // This can be a full path, or a path relative to ContentRoot + "LocalPath" "*" + + // This is a path relative to the install folder of your game + "DepotPath" "." + + // If LocalPath contains wildcards, setting this means that all + // matching files within subdirectories of LocalPath will also + // be included. + "Recursive" "1" + } +} diff --git a/external/steamworks/tools/ContentBuilder/scripts/depot_build_1002.vdf b/external/steamworks/tools/ContentBuilder/scripts/depot_build_1002.vdf new file mode 100644 index 0000000..8140e48 --- /dev/null +++ b/external/steamworks/tools/ContentBuilder/scripts/depot_build_1002.vdf @@ -0,0 +1,40 @@ +"DepotBuild" +{ + "DepotID" "1002" + + "ContentRoot" "D:\content\depot1002" // override ContentRoot from app build script + + "FileMapping" + { + // all source files and folders in ".\bin" will be mapped into folder ".\executables" in depot + "LocalPath" "bin\*" + "DepotPath" "executables\" + "Recursive" "1" // include all subfolders + } + + "FileMapping" + { + // override audio files in \\audio with German versions + "LocalPath" "localization\german\audio\*" + "DepotPath" "audio\" + } + + "FileMapping" + { + // copy install script for german version into depot root folder + "LocalPath" "localization\german\german_installscript.vdf" + "DepotPath" "." + } + + "FileExclusion" "bin\server.exe" // exclude this file + "FileExclusion" "*.pdb" // exclude all .PDB files everywhere + "FileExclusion" "bin\tools*" // exclude all files under bin/tools/ + + "InstallScript" "localization\german\german_installscript.vdf" + + "FileProperties" + { + "LocalPath" "bin\setup.cfg" + "Attributes" "userconfig" // this file will be modified during runtime + } +} \ No newline at end of file diff --git a/external/steamworks/tools/ContentBuilder/scripts/simple_app_build.vdf b/external/steamworks/tools/ContentBuilder/scripts/simple_app_build.vdf new file mode 100644 index 0000000..2c11936 --- /dev/null +++ b/external/steamworks/tools/ContentBuilder/scripts/simple_app_build.vdf @@ -0,0 +1,23 @@ +"AppBuild" +{ + "AppID" "1000" // your AppID + "Desc" "This is a simple build script" // internal description for this build + "verbose" "0" // spew more build details in console + "preview" "0" // make this a preview build only, nothing is uploaded + + "ContentRoot" "..\content\" // root content folder, relative to location of this file + "BuildOutput" "..\output\" // build output folder for build logs and build cache files + + "Depots" + { + "1001" // your DepotID + { + "FileMapping" + { + "LocalPath" "*" // all files from contentroot folder + "DepotPath" "." // mapped into the root of the depot + "recursive" "1" // include all subfolders + } + } + } +} \ No newline at end of file diff --git a/external/steamworks/tools/ContentPrep.zip b/external/steamworks/tools/ContentPrep.zip new file mode 100644 index 0000000..cf7b256 Binary files /dev/null and b/external/steamworks/tools/ContentPrep.zip differ diff --git a/external/steamworks/tools/ContentServer/htdocs/index.html b/external/steamworks/tools/ContentServer/htdocs/index.html new file mode 100644 index 0000000..d297936 --- /dev/null +++ b/external/steamworks/tools/ContentServer/htdocs/index.html @@ -0,0 +1,7 @@ + +

Steam Local Content Server

+ +To download Steam content from this local content server, add "@localcontentserver [thishostname]" to the steam_dev.cfg right next to Steam.exe
+Browse local content here
+For more information, see the SteamWorks SDK documentation
+ \ No newline at end of file diff --git a/external/steamworks/tools/ContentServer/mongoose-3.1.exe b/external/steamworks/tools/ContentServer/mongoose-3.1.exe new file mode 100644 index 0000000..465541a Binary files /dev/null and b/external/steamworks/tools/ContentServer/mongoose-3.1.exe differ diff --git a/external/steamworks/tools/ContentServer/mongoose-license.txt b/external/steamworks/tools/ContentServer/mongoose-license.txt new file mode 100644 index 0000000..6cdfd69 --- /dev/null +++ b/external/steamworks/tools/ContentServer/mongoose-license.txt @@ -0,0 +1,16 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/external/steamworks/tools/ContentServer/mongoose.conf b/external/steamworks/tools/ContentServer/mongoose.conf new file mode 100644 index 0000000..30e6a4c --- /dev/null +++ b/external/steamworks/tools/ContentServer/mongoose.conf @@ -0,0 +1,30 @@ +# Mongoose web server configuration file. +# Lines starting with '#' and empty lines are ignored. +# For detailed description of every option, visit +# http://code.google.com/p/mongoose/wiki/MongooseManual + +# cgi_pattern **.cgi$|**.pl$|**.php$ +# cgi_environment +# put_delete_passwords_file +# cgi_interpreter +# protect_uri +# authentication_domain mydomain.com +# ssi_pattern **.shtml$|**.shtm$ +# access_log_file +# ssl_chain_file +# global_passwords_file +# index_files index.html,index.htm,index.cgi +# access_control_list +# max_request_size 16384 +# extra_mime_types +# ssl_certificate +# num_threads 10 +# run_as_user +# url_rewrite_patterns + +document_root D:\ContentServer\htdocs +listening_ports 80 +enable_directory_listing yes +enable_keep_alive yes +error_log_file error.log + diff --git a/external/steamworks/tools/SteamPipeGUI.zip b/external/steamworks/tools/SteamPipeGUI.zip new file mode 100644 index 0000000..3bbbd2c Binary files /dev/null and b/external/steamworks/tools/SteamPipeGUI.zip differ diff --git a/external/steamworks/tools/codesigning/build_steam_signatures_file.py b/external/steamworks/tools/codesigning/build_steam_signatures_file.py new file mode 100644 index 0000000..1ca3cbe --- /dev/null +++ b/external/steamworks/tools/codesigning/build_steam_signatures_file.py @@ -0,0 +1,241 @@ +import os +import io +import sys +import re + +# wrapper for print +def printw( message ): + print( message ) + +try: + import Crypto + from Crypto.Signature import PKCS1_v1_5 + from Crypto.Hash import SHA + from Crypto.PublicKey import RSA +except Exception as e: + printw( "Missing required module: "+str(e) ) + sys.exit( -1 ) + +try: + import zlib +except Exception as e: + printw( "Missing required module: "+str(e) ) + sys.exit( -1 ) + +try: + import hashlib +except Exception as e: + printw( "Missing required module: "+str(e) ) + sys.exit( -1 ) + +try: + import ctypes +except Exception as e: + printw( "Missing required module: "+str(e) ) + sys.exit( -1 ) + + +def usage(): + printw( "usage to verify a signaturefile:"+ sys.argv[0]+ " signaturefile publickeyfile" ) + printw( "usage to write a new signaturefile:"+ sys.argv[0]+ " signaturefile publickeyfile privatekeyfile newfilename" ) + printw( "" ) + +def readkeyfile( publickeyfilename ): + # read the public key file. + rawkey = open(publickeyfilename, mode='rb').read() + # import as an RSA key + key = RSA.importKey(rawkey) + return key + +def signmessage_add_digest( message, privatekeyfile ): + key = RSA.importKey(open( privatekeyfile, mode='rb' ).read()) + h = SHA.new(message) + signer = PKCS1_v1_5.new(key) + signature = signer.sign(h) + sighex = signature.encode("hex") + return "DIGEST:"+sighex.upper()+"\r\n" + +def checkdigest( signaturefilename, key ): + with open(signaturefilename, mode='rb') as file: + fileContent = file.read() + + # find the start of the digest + idxtodigest = fileContent.find('DIGEST:') + if idxtodigest == 0: + return 0 + + # the message is everything else + message = fileContent[0:idxtodigest] + + digestpart = fileContent[idxtodigest+7:] + digestpart = digestpart.replace("\r\n","") + signature = digestpart.decode("hex") + + try: + h = SHA.new(message) + verifier = PKCS1_v1_5.new(key) + if not verifier.verify(h, signature): + return 0 + except Exception as e: + printw( "could not verify signature: "+str(e) ) + return message + +def crchex( crc32 ): + crc32b = ctypes.c_uint32(crc32).value + crc32hex = hex(crc32b).upper().replace("0X","").replace("L","") + lenhex = len(crc32hex) + # pad to 8 chars with leading 0s + padding = 8 - lenhex + while padding: + crc32hex = "0"+crc32hex + padding = padding - 1 + # byte swap + crc32hex_reverse = crc32hex[6:8]+crc32hex[4:6]+crc32hex[2:4]+crc32hex[0:2] + return crc32hex_reverse + +def parsehashes( message, pathto ): + # now verify all the file hashes + newmessage = "" + lines = message.split("\r\n") + for line in lines: + if len(line) == 0: + break + # parse the line, should be 5 parts + # filename "~SHA1" sha1 ";CRC:" crc32 + parts=re.split(';|:|~',line) + if len(parts) != 5: + printw( "The file format is unexpected line:"+line ) + break + if parts[1] != "SHA1" or parts[3] != "CRC": + printw( "The file format is unexpected line:"+line ) + break + + hashprovided = parts[2] + crcprovided = parts[4] + onefile = parts[0] + onefile = onefile.replace("...\\","") + onefilepath = os.path.join( pathto, onefile ) + try: + with open(onefilepath, mode='rb') as file: + targetcontent = file.read() + except: + printw( "could not open: "+onefilepath ) + continue + + # compute sha1 of file + mm = hashlib.sha1() + mm.update(targetcontent) + newhash = mm.hexdigest().upper() + # compute crc32 of file + crc32 = zlib.crc32(targetcontent) + crc32hex = crchex(crc32) + if ( newhash == hashprovided.upper() and + crc32hex == crcprovided.upper() ): + printw( "The hashes are correct for "+onefile ) + else: + printw( "The hashes are different for "+onefile+" sha: "+newhash+" "+hashprovided.upper()+" CRC "+crc32hex+" "+crcprovided.upper() ) + # accumulate new hashes + linenew = "...\\"+onefile+"~SHA1:"+newhash+";CRC:"+crc32hex+"\r\n" + newmessage += linenew + + return newmessage + +def signatures_need_update( signaturefilename, publickeyfilename ): + + if not os.path.exists( signaturefilename ): + printw( "Signature file does not exist" ) + sys.stdout.flush() + return False + + pathto = os.path.split(signaturefilename)[0] + + if not os.path.exists( publickeyfilename ): + printw( "Public key file does not exist" ) + sys.stdout.flush() + return False + + key = readkeyfile( publickeyfilename ) + + message = checkdigest( signaturefilename, key ) + if len(message) == 0: + printw( "failed to parse signature file " ) + return False + + newmessage = parsehashes( message, pathto ) + if len(newmessage) == 0: + printw( "failed to parse hashes in signature data " ) + return False + return newmessage != message + + +def write_new_signature_file( signaturefilename, publickeyfilename, privatekeyfilename, newsignaturefilename ): + + if not os.path.exists( signaturefilename ): + printw( "Signature file does not exist" ) + sys.stdout.flush() + return -1 + + pathto = os.path.split(signaturefilename)[0] + + if not os.path.exists( publickeyfilename ): + printw( "Public key file does not exist" ) + sys.stdout.flush() + return -2 + + if not os.path.exists( privatekeyfilename ): + printw( "Private key file does not exist" ) + sys.stdout.flush() + return -3 + + if os.path.exists( newsignaturefilename ) and not os.access( newsignaturefilename, os.W_OK ): + printw( "new signatures file not writeable " ) + sys.stdout.flush() + return -4 + + key = readkeyfile( publickeyfilename ) + + message = checkdigest( signaturefilename, key ) + if len(message) == 0: + printw( "failed to parse old signature file " ) + return -5 + + newmessage = parsehashes( message, pathto ) + if len(newmessage) == 0: + printw( "failed to create new signature data " ) + return -6 + + with open( newsignaturefilename, mode='wb') as file: + file.write( newmessage ) + hexdigest = signmessage_add_digest( newmessage, privatekeyfilename ) + file.write( hexdigest ) + + printw( "new signatures file written successfully " ) + sys.stdout.flush() + return 0 + + +def main(): + + if len( sys.argv ) != 5 and len( sys.argv ) != 3: + usage() + sys.exit(2) + + # common args + signaturefilename = sys.argv[1] + publickeyfilename = sys.argv[2] + + if len( sys.argv ) == 5: + # only if writing a new file + privatekeyfilename = sys.argv[3] + newsignaturefilename = sys.argv[4] + write_new_signature_file( signaturefilename, publickeyfilename, privatekeyfilename, newsignaturefilename ) + else: + if signatures_need_update( signaturefilename, publickeyfilename ): + printw( "Some signatures did not match" ) + else: + printw( "All signatures matched" ) + + +if __name__ == '__main__': + main() + diff --git a/external/steamworks/tools/codesigning/steam_modulesigning.public b/external/steamworks/tools/codesigning/steam_modulesigning.public new file mode 100644 index 0000000..9c901a2 Binary files /dev/null and b/external/steamworks/tools/codesigning/steam_modulesigning.public differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/481_depotcache_1.csd b/external/steamworks/tools/goldmaster/disk_assets/481_depotcache_1.csd new file mode 100644 index 0000000..c43e06e Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/481_depotcache_1.csd differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/481_depotcache_1.csm b/external/steamworks/tools/goldmaster/disk_assets/481_depotcache_1.csm new file mode 100644 index 0000000..19700fd Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/481_depotcache_1.csm differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/Setup.exe b/external/steamworks/tools/goldmaster/disk_assets/Setup.exe new file mode 100644 index 0000000..2473500 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/Setup.exe differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/SteamRetailInstaller.dmg b/external/steamworks/tools/goldmaster/disk_assets/SteamRetailInstaller.dmg new file mode 100644 index 0000000..d5b0812 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/SteamRetailInstaller.dmg differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/SteamSetup.exe b/external/steamworks/tools/goldmaster/disk_assets/SteamSetup.exe new file mode 100644 index 0000000..0d5e3b4 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/SteamSetup.exe differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/autorun.inf b/external/steamworks/tools/goldmaster/disk_assets/autorun.inf new file mode 100644 index 0000000..cc5de7a --- /dev/null +++ b/external/steamworks/tools/goldmaster/disk_assets/autorun.inf @@ -0,0 +1,4 @@ +[autorun] +OPEN=SETUP.EXE +ICON=ICON.ICO + diff --git a/external/steamworks/tools/goldmaster/disk_assets/icon.ico b/external/steamworks/tools/goldmaster/disk_assets/icon.ico new file mode 100644 index 0000000..3e890dd Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/icon.ico differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/click.wav b/external/steamworks/tools/goldmaster/disk_assets/resources/click.wav new file mode 100644 index 0000000..670b30e Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/click.wav differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/eula.rtf b/external/steamworks/tools/goldmaster/disk_assets/resources/eula.rtf new file mode 100644 index 0000000..30979d6 --- /dev/null +++ b/external/steamworks/tools/goldmaster/disk_assets/resources/eula.rtf @@ -0,0 +1,26 @@ +{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fcharset0 Times;}{\f1\froman\fcharset0 Times New Roman;}{\f2\fswiss\fcharset0 Arial;}} +{\colortbl ;\red0\green0\blue0;} +{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\nowidctlpar\fi720\qc\b\f0\fs20 YOU SHOULD CAREFULLY READ THE ENTIRE FOLLOWING LICENSE AGREEMENT BEFORE INSTALLING THIS SOFTWARE PROGRAM. THIS AGREEMENT CONTAINS IMPORTANT TERMS THAT AFFECT YOUR LEGAL RIGHTS. BY INSTALLING THE SOFTWARE PROGRAM, YOU AGREE TO BE BOUND BY THE TERMS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, PLEASE DO NOT INSTALL THIS SOFTWARE PROGRAM.\par + \par +\pard\nowidctlpar\sa120\qj\tx360\tx720\b0 The software application(s) (the \ldblquote\ul Program\ulnone\rdblquote ), and any and all copies of the Program are the copyrighted work of Valve Corporation (\ldblquote\ul Valve\ulnone\rdblquote ) or its suppliers. All rights reserved, except as expressly stated herein. The Program is provided solely for installation by end users according to the terms of this License Agreement. All use of the Program is governed by the terms of the Steam Agreement as described below. Any use, reproduction or redistribution of the Program not in accordance with the terms of the License Agreement and the Steam Agreement is expressly prohibited.\par +\pard\nowidctlpar\qc\ul\b\f1 LICENSE AGREEMENT\par +\pard\nowidctlpar\par +\pard\nowidctlpar\qj\tx360\ulnone\b0\tab 1. \ul Limited Installation License\ulnone . \par +\par +\pard\nowidctlpar\fi720\qj\tx360 A. Valve hereby grants, and by installing the Program you thereby accept, a limited, non-exclusive license and right to install one (1) copy of the Program on a computer. In order to use the Program you will have to obtain an account with the Steam service and accept the terms of the \f0 Steam subscriber agreement (\ldblquote\ul Steam Agreement\ulnone\rdblquote )\f1 . \f0 By installing the Program, you agree that your future use of the Program will be subject to the terms of the Steam Agreement. A copy of the Steam Agreement is available at \ul www.steampowered.com/agreement.\ulnone \f1 The Steam Agreement will be displayed to you when you obtain an account with the Steam service. The Program is licensed, not sold. Your license confers no title or ownership in the Program or copies thereof.\par +\pard\nowidctlpar\qj\tx360\par +\pard\nowidctlpar\fi720 B. \f0 You may not, in whole or in part: copy, photocopy, reproduce, translate, reverse engineer\cf1 (with the exception of specific circumstances where such act is permitted by law)\cf0 , derive source code, modify, disassemble, decompile, or create derivative works based on the Program; remove any proprietary notices or labels on the Program; or attempt in any manner to circumvent any security measures designed to control access to the Program. The Program is licensed to you as a single product. Its component parts may not be separated for use on more than one computer. You may not sell, grant a security interest in or transfer reproductions of the Program to other parties in any way, nor to rent, lease or license the Program to others without the prior written consent of Valve.\f1\par +\pard\nowidctlpar\sa120\qj\tx360\tx720\f0\tab\par +\tab 2. \ul Ownership\ulnone . All title, ownership rights and intellectual property rights in and to the Program and any and all copies thereof (including but not limited to any titles, computer code, themes, objects, characters, character names, stories, dialog, catch phrases, locations, concepts, artwork, animations, sounds, musical compositions, audio-visual effects, methods of operation, moral rights, any related documentation, and \ldblquote applets\rdblquote incorporated into the Program) are owned by Valve or its licensors. The Program is protected by the copyright laws of the United States, international copyright treaties and conventions and other laws. All rights are reserved. The Program contains certain licensed materials and Valve\rquote s licensors may protect their rights in the event of any violation of this Agreement.\par +\tab 3. \ul Termination\ulnone . This License Agreement is effective until terminated. You may terminate the License Agreement at any time by destroying the Program. Valve may, at its discretion, terminate this License Agreement in the event that you fail to comply with the terms and conditions contained herein. This License Agreement shall automatically terminate in the event that you fail to comply with the terms and conditions contained herein. In such event, you must immediately destroy the Program. The provisions of Sections 2, 3, and 5-8 will survive any termination of the Agreement. \par +\tab 4. \ul Export Controls\ulnone . The Program may not be re-exported, downloaded or otherwise exported into (or to a national or resident of) any country to which the U.S. has embargoed goods, or to anyone on the U.S. Treasury Department\rquote s list of Specially Designated Nationals or the U.S. Commerce Department\rquote s Table of Denial Orders. By installing the Program, you are agreeing to the foregoing and you are representing and warranting that you are not located in, under the control of, or a national or resident of any such country or on any such list.\par +\pard\nowidctlpar\fi360\qj\tx8100\f1 5. \ul Limited Warranty\ulnone . The entire risk arising out of use or performance of the Program and any printed material(s) remains with the User.\f2 \f1 EXCEPT AS PROVIDED ABOVE, \caps The Program and ANY PRINTED MATERIAL(s) are provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties of merchantability, fitness for a particular purpose, or noninfringement. \caps0 ANY WARRANTY AGAINST INFRINGEMENT THAT MAY BE PROVIDED IN SECTION 2-312(3) OF THE UNIFORM COMMERCIAL CODE AND/OR IN ANY OTHER COMPARABLE STATE STATUTE IS EXPRESSLY DISCLAIMED. Some states/jurisdictions do not allow the exclusion or limitation of implied warranties, so the above limitations may not apply to you.\par +\pard\nowidctlpar\qj\tx360\tx720\f0\fs18\par +\pard\nowidctlpar\qj\tx360\f1\tab 6. \ul\fs20 Limitation of Liability\ulnone . VALVE, ITS SUPPLIERS AND DISTRIBUTORS SHALL NOT BE LIABLE IN ANY WAY FOR LOSS OR DAMAGE OF ANY KIND RESULTING FROM THE USE OF THE PROGRAM INCLUDING, BUT NOT LIMITED TO, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES. ANY WARRANTY AGAINST INFRINGEMENT THAT MAY BE PROVIDED IN SECTION 2-312(3) OF THE UNIFORM COMMERCIAL CODE AND/OR IN ANY OTHER COMPARABLE STATE STATUTE IS EXPRESSLY DISCLAIMED. \caps Valve CANNOT AND WILL NOT BE RESPONSIBLE FOR ANY SOFTWARE OR HARDWARE FAILURES OR ANY OTHER EVENT WHICH MAY RESULT IN A LOSS OF DATA OR DISRUPTION OF SERVICE. \caps0 Some states/jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so the above limitations may not apply. \par +\pard\nowidctlpar\qj\par +\pard\nowidctlpar\sa120\qj\tx360\tab 7. \ul Equitable Remedies\ulnone . You hereby agree that Valve would be irreparably damaged if the terms of this License Agreement were not specifically enforced, and therefore you agree that Valve shall be entitled to appropriate equitable remedies with respect to breaches of this License Agreement, in addition to such other remedies as Valve may otherwise have available to it under applicable laws. In the event any litigation is brought by either party in connection with this License Agreement, the prevailing party in such litigation shall be entitled to recover from the other party all the costs, attorneys\rquote fees and other expenses incurred by such prevailing party in the litigation.\par +\tab 8. \ul Miscellaneous\ulnone .\cf1 The terms of this paragraph do not apply to European Union consumers in the sense of Art. 5 of the Convention on the Law Applicable to Contractual Obligations opened for signature in Rome on 19 June 1980 (Rome Convention, 80/934/EEC) and national legislation based thereon.\cf0 You agree that this Agreement shall be deemed to have been made and executed in the State of Washington, and any dispute arising hereunder shall be resolved in accordance with the law of Washington. You agree that any claim asserted in any legal proceeding by you against Valve shall only be commenced and maintained in any state or federal court located in King County, Washington, and you agree to submit to the exclusive jurisdiction of those courts. In any dispute arising under this Agreement, the prevailing party will be entitled to attorneys' fees and expenses. This License Agreement may be amended, altered or modified only by an instrument in writing, specifying such amendment, alteration or modification, executed by both you and Valve. In the event that any provision of this License Agreement shall be held by a court or other tribunal of competent jurisdiction to be unenforceable, such provision will be enforced to the maximum extent permissible and the remaining portions of this License Agreement shall remain in full force and effect. This License Agreement and the Steam Agreement constitute and contain the entire agreement between the parties with respect to the subject matter hereof and supersede any prior oral or written agreements.\par +You hereby acknowledge that you have read and understand the foregoing License Agreement and agree that the action of installing the Program is an acknowledgment of your agreement to be bound by the terms and conditions of the License Agreement contained herein.\par +\par +} + \ No newline at end of file diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/hover.wav b/external/steamworks/tools/goldmaster/disk_assets/resources/hover.wav new file mode 100644 index 0000000..c1ecd70 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/hover.wav differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/launch.wav b/external/steamworks/tools/goldmaster/disk_assets/resources/launch.wav new file mode 100644 index 0000000..9bb36f8 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/launch.wav differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/readme.txt b/external/steamworks/tools/goldmaster/disk_assets/resources/readme.txt new file mode 100644 index 0000000..7ec22d3 --- /dev/null +++ b/external/steamworks/tools/goldmaster/disk_assets/resources/readme.txt @@ -0,0 +1,74 @@ +Steam Retail Setup File Overview: +--------------------------------- + +root\Setup.exe : + The main splash screen setup application launched when the customer inserts + the disc. Setup detects the current installation state and displays a simple + menu to install/play/reinstall or uninstall the game. Setup first loads + setup_default.ini, then the setup_.ini for the language chosen by + the user, then all other resource files are loaded based on the current + language configuration. Setup.exe itself does not require admin rights. + +root\SteamService.exe : + Helper application to run all additional 3rd party installers from a single + elevated process under Vista. If you don't need to run 3rd party installers, + this executable can be removed. + +root\SteamSetup.exe + Used to install Steam on the users machine. + +root\autorun.inf : + Tells Windows to run Setup.exe when user inserts disc + +root\splash.tga : + Image displayed by Steam while installing files from disk (392x165 pixel) + +root\setup.ini : + This is the first config file loaded by Setup regardless the chosen + language. This file configures any language independent settings for this + game like AppID or menu appearance. The syntax is "parameter" "value", a full + list of configuration parameters is given later. + +root\resources\setup_.ini : + These files configure Setup for the chosen language. The files are Unicode + encoded. They are loaded after setup_default.ini and can override any + configuration value for this language. Usually they don't need modification. + Currently supported language names are: english, german, french, italian, + korean, spanish, schinese, tchinese, russian, thai, japanese, portuguese, + polish, danish, dutch, finnish, norwegian, swedish, hungarian, czech + +root\resources\eula.rtf : + The end user license agreement shown before the user installs the game. + This file is optional. If you have localized versions of this file, + name them eula_.rtf + +root\resources\setup.bmp : + The Setup background image as 640x480 pixel BMP file. If you have + localized versions of this file, name them setup_.bmp + +root\resources\click.wav : + Played when a button is click. Delete file to play no sound. + +root\resources\hover.wav : + Played when a mouse hovers over a button. Delete file to play no sound. + +root\resources\launch.wav : + Played when Setup starts. File can be deleted. + + +Setup_*.ini configuration values: +------------------------------- + +"Game" : game name as it appears in the Setup menu +"AppID" : Steam AppID for this game +"Language" : overrides current language, usually not needed +"RequiredSize" : Required free disc space in KB +"URL" : target web URL for technical support button +"FontName" : menu Windows font like "Impact" or "Arial" +"FontHeight" : menu font height, eg "24" +"MenuPos" : menu X and Y coordinates, eg "100 100" +"MenuStyle" : menu text style, 0 = align left, 1 = center, 2 = right +"ColorDefault" : default menu text color in RGB, eg "255 0 255" +"ColorHover" : menu text color for mouse hover event +"ColorDown" : menu text color for mouse pressed event + diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup.bmp b/external/steamworks/tools/goldmaster/disk_assets/resources/setup.bmp new file mode 100644 index 0000000..3cd9546 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup.bmp differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_arabic.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_arabic.ini new file mode 100644 index 0000000..745789b Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_arabic.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_brazilian.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_brazilian.ini new file mode 100644 index 0000000..09cda9f Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_brazilian.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_bulgarian.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_bulgarian.ini new file mode 100644 index 0000000..30c4568 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_bulgarian.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_czech.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_czech.ini new file mode 100644 index 0000000..3511fa3 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_czech.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_danish.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_danish.ini new file mode 100644 index 0000000..cc89449 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_danish.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_dutch.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_dutch.ini new file mode 100644 index 0000000..1dd25f1 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_dutch.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_english.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_english.ini new file mode 100644 index 0000000..3be6d37 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_english.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_finnish.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_finnish.ini new file mode 100644 index 0000000..3d2b1e0 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_finnish.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_french.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_french.ini new file mode 100644 index 0000000..3632431 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_french.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_german.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_german.ini new file mode 100644 index 0000000..440343b Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_german.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_greek.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_greek.ini new file mode 100644 index 0000000..95e81fc Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_greek.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_hungarian.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_hungarian.ini new file mode 100644 index 0000000..b5e230c Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_hungarian.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_italian.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_italian.ini new file mode 100644 index 0000000..6165070 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_italian.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_japanese.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_japanese.ini new file mode 100644 index 0000000..d90b162 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_japanese.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_koreana.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_koreana.ini new file mode 100644 index 0000000..813ee8c Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_koreana.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_norwegian.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_norwegian.ini new file mode 100644 index 0000000..b34c286 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_norwegian.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_polish.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_polish.ini new file mode 100644 index 0000000..7bbb335 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_polish.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_portuguese.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_portuguese.ini new file mode 100644 index 0000000..d5b55dc Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_portuguese.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_romanian.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_romanian.ini new file mode 100644 index 0000000..65a12a7 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_romanian.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_russian.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_russian.ini new file mode 100644 index 0000000..9c0b29b Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_russian.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_schinese.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_schinese.ini new file mode 100644 index 0000000..cd85639 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_schinese.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_spanish.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_spanish.ini new file mode 100644 index 0000000..6cc1a41 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_spanish.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_swedish.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_swedish.ini new file mode 100644 index 0000000..28b60f1 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_swedish.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_tchinese.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_tchinese.ini new file mode 100644 index 0000000..5b4812a Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_tchinese.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_thai.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_thai.ini new file mode 100644 index 0000000..45bad3c Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_thai.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_turkish.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_turkish.ini new file mode 100644 index 0000000..0345bcf Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_turkish.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/resources/setup_ukrainian.ini b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_ukrainian.ini new file mode 100644 index 0000000..eaee2bc Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/resources/setup_ukrainian.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/setup.ini b/external/steamworks/tools/goldmaster/disk_assets/setup.ini new file mode 100644 index 0000000..1f866e8 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/setup.ini differ diff --git a/external/steamworks/tools/goldmaster/disk_assets/sku.sis b/external/steamworks/tools/goldmaster/disk_assets/sku.sis new file mode 100644 index 0000000..5e82a4f --- /dev/null +++ b/external/steamworks/tools/goldmaster/disk_assets/sku.sis @@ -0,0 +1,27 @@ +"sku" +{ + "name" "Steamworks Spacewar" + "disks" "1" + "disk" "1" + "backup" "0" + "contenttype" "3" + "apps" + { + "0" "480" + } + "depots" + { + "0" "481" + } + "manifests" + { + "481" "8382873932604653347" + } + "chunkstores" + { + "481" + { + "1" "841424" + } + } +} diff --git a/external/steamworks/tools/goldmaster/disk_assets/splash.tga b/external/steamworks/tools/goldmaster/disk_assets/splash.tga new file mode 100644 index 0000000..a2d38e4 Binary files /dev/null and b/external/steamworks/tools/goldmaster/disk_assets/splash.tga differ diff --git a/external/steamworks/tools/goldmaster/project_example.bat b/external/steamworks/tools/goldmaster/project_example.bat new file mode 100644 index 0000000..d0c7e4e --- /dev/null +++ b/external/steamworks/tools/goldmaster/project_example.bat @@ -0,0 +1,2 @@ +steam.exe -login -build_installer sku_project_example.txt +@type logs\backup_log.txt \ No newline at end of file diff --git a/external/steamworks/tools/goldmaster/sku_project_example.txt b/external/steamworks/tools/goldmaster/sku_project_example.txt new file mode 100644 index 0000000..36c87b0 --- /dev/null +++ b/external/steamworks/tools/goldmaster/sku_project_example.txt @@ -0,0 +1,12 @@ +"sku" +{ + "name" "Steamworks Spacewar" + "appID" "480" + "disk_size_mb" 4700 + + "included_depots" + { + "1" "481" + // "2" "482" more depots if needed + } +} diff --git a/external/steamworks/tools/linux/README.md b/external/steamworks/tools/linux/README.md new file mode 100644 index 0000000..bf38431 --- /dev/null +++ b/external/steamworks/tools/linux/README.md @@ -0,0 +1,57 @@ +## Building Spacewars (steamworksexample) for Linux + +All native executables built for Steam for Linux should be built using the Steam for Linux runtime SDK. + +For a complete developer guide regarding the Steam for Linux runtime, see [3]. For bugs and feature requests regarding the Steam for Linux runtime, see [4]. + +## Setup + +Download, configure and open a shell in one of the Steam for Linux runtime SDKs. See [1] for details. + +``` +toolbox create -i registry.gitlab.steamos.cloud/steamrt/scout/sdk scout +toolbox enter scout +``` + +NOTE: You may also use the newer Linux runtime SDK for sniper. See [2]. + +## Build + +Enter the toolbox shell, go to the `steamworksexample/` folder and build: + +``` +timo@eta-carinae ~/D/sdk> pwd +/home/timo/Downloads/sdk +timo@eta-carinae ~/D/sdk> toolbox enter scout +[timo@toolbox sdk]$ cd steamworksexample/ +[timo@toolbox steamworksexample]$ make +g++ -g -DPOSIX -DSDL -I/usr/include/SDL2 -D_REENTRANT -DGNUC -O0 -std=c++0x -Wno-invalid-offsetof -I/home/timo/Downloads/sdk/steamworksexample/../public -DDEBUG -c BaseMenu.cpp -o debug/BaseMenu.o -MD -MF debug/BaseMenu.dep +[..] +``` + +Use `make CONFIG=RELEASE` for a release build. + +Use `ARCH=32` to build a 32 bit binary (do not use the legacy 32 bit scout SDK image, do this in the normal toolbox 64 bit container). + +## Run + +NOTE: You should not attempt to run out of your docker/podman/toolbox shell. Although it may work in some cases. + +The Steam client should be running. The test program will initialize the Steamworks API on startup. + +Launch with the `SteamworksExample.sh` script: + +``` +timo@eta-carinae ~/D/s/s/debug> pwd +/home/timo/Downloads/sdk/steamworksexample/debug +timo@eta-carinae ~/D/s/s/debug> ./SteamworksExample.sh +[S_API] SteamAPI_Init(): Loaded '/home/timo/steam/main/client/linux64/steamclient.so' OK. +Setting breakpad minidump AppID = 480 +``` + +## Reference + +1. [Steam for Linux runtime - scout SDK](https://gitlab.steamos.cloud/steamrt/scout/sdk) +2. [Steam for Linux runtime - scout SDK](https://gitlab.steamos.cloud/steamrt/sniper/sdk) +3. [Steam Linux Runtime - guide for game developers](https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/main/docs/slr-for-game-developers.md) +4. [Steam Linux Runtime on github](https://github.com/ValveSoftware/steam-runtime) diff --git a/external/windows/GameNetworkingSockets.exp b/external/windows/GameNetworkingSockets.exp new file mode 100644 index 0000000..08a6bd3 Binary files /dev/null and b/external/windows/GameNetworkingSockets.exp differ diff --git a/external/windows/GameNetworkingSockets.lib b/external/windows/GameNetworkingSockets.lib new file mode 100644 index 0000000..18e799f Binary files /dev/null and b/external/windows/GameNetworkingSockets.lib differ diff --git a/external/windows/GameNetworkingSockets_s.lib b/external/windows/GameNetworkingSockets_s.lib new file mode 100644 index 0000000..231b740 Binary files /dev/null and b/external/windows/GameNetworkingSockets_s.lib differ diff --git a/fgui/__build.cpp b/fgui/__build.cpp new file mode 100644 index 0000000..5e0fc68 --- /dev/null +++ b/fgui/__build.cpp @@ -0,0 +1,32 @@ +#include "helper.h" +#include "c.h" +#include "ld.h" +#include "tier1/utlstring.h" +#include "tier1/commandline.h" + +CUtlVector fgui_CompiledFiles = { + "fgui/fgui.cpp", + "fgui/widget.cpp", + "fgui/rectangle.cpp", + "fgui/label.cpp", +}; +CUtlString fgui_lib; + +int fgui_build() +{ + CCProject compileProject = {}; + CLDProject ldProject = {}; + + compileProject.m_szName = "fgui"; + compileProject.files = fgui_CompiledFiles; + compileProject.includeDirectories = all_IncludeDirectories; + compileProject.bFPIC = true; + ldProject = compileProject.Compile(); + ldProject.linkType = ELINK_STATIC_LIBRARY; + + CUtlString outputProject = ldProject.Link(); + fgui_lib = outputProject; + + return 0; +}; +DECLARE_BUILD_STAGE(fgui, fgui_build); diff --git a/fgui/fgui.cpp b/fgui/fgui.cpp index 7f3e91c..f3b3867 100644 --- a/fgui/fgui.cpp +++ b/fgui/fgui.cpp @@ -1 +1,139 @@ -#include "fgui/fgui.h" \ No newline at end of file +#include "fgui/fgui.h" +#include "filesystem.h" +#include "rendering.h" +#include "tier1/utlvector.h" +#include "fgui/widget.h" + + +IGraphicsPipeline *fgui_RectPipeline; +IGraphicsPipeline *fgui_TextPipeline; + +void IFGUI::Init( void ) +{ + +} + +void IFGUI::Frame( void ) +{ + +} + +CUtlVector fgui_widgets; +void IFGUI::AppendWidget( CFGUI_Widget *pWidget ) +{ + fgui_widgets.AppendTail(pWidget); +} + +void IFGUI::DestroyWidget( CFGUI_Widget *pWidget ) +{ + +} + +void IFGUI::SetRectColor( float r, float g, float b, float a ) +{ + +} + +void IFGUI::DrawRect( int32_t iPosX, int32_t iPosY, uint32_t uSizeX, uint32_t uSizeY ) +{ + +} + +CUtlVector fgui_fonts; +CFont *fgui_pCurrentFont; + +CFont *IFGUI::LoadFont( CUtlString szFontPath ) +{ + for (auto &font: fgui_fonts) + { + if (font->szName == szFontPath) + return font; + }; + CFont *pFont = new CFont; + pFont->szName = szFontPath; + pFont->pTexture = ITextureManager::LoadTexture(CUtlString("%s.png", szFontPath.GetString())); + FileHandle_t f = IFileSystem::Open(CUtlString("%s.fontdata", szFontPath.GetString()), IFILE_READ); + CUtlBuffer b = IFileSystem::Size(f)+1; + IFileSystem::Read(f, b.GetMemory(), IFileSystem::Size(f)); + IFileSystem::Close(f); + char cCharacterSet[256] = {}; + uint32_t nElementsWidth; + uint32_t nElementsHeight; + V_sscanf(b, "%u %u %255s", &nElementsWidth, &nElementsHeight, cCharacterSet); + V_printf("%i %i\n", nElementsWidth, nElementsHeight); + return pFont; +} + +void IFGUI::SetTextFont( CFont *pFont ) +{ + +} + +void IFGUI::SetTextPos( float x, float y ) +{ + +} + +void IFGUI::SetTextColor( float r, float g, float b, float a ) +{ + +} + +void IFGUI::DrawText( CUtlString psz ) +{ + +} + +class CFGUI_Rendering: public IRenderingPipelineStep +{ +public: + virtual void Init() override; + virtual void Frame( float fDelta ) override; + virtual void Deinit() override; +}; +DECLARE_UI_RENDERING_STAGE(CFGUI_Rendering, fgui_rendering); + +void CFGUI_Rendering::Init() +{ + fgui_RectPipeline = IRenderer::CreateGraphicsPipeline( + { + {"gfx/fgui_rect_vert.shader", SHADER_TYPE_VERTEX}, + {"gfx/fgui_rect_frag.shader", SHADER_TYPE_FRAGMENT}, + }, + {}, + 24, + 8, + {{0,0,EVertexFormat::VERTEX_FORMAT_X32Y32}}, + {EImageFormat::IMAGE_FORMAT_R8G8B8A8}, + true + ); + fgui_TextPipeline = IRenderer::CreateGraphicsPipeline( + { + {"gfx/fgui_text_vert.shader", SHADER_TYPE_VERTEX}, + {"gfx/fgui_text_frag.shader", SHADER_TYPE_FRAGMENT}, + }, + { + {SHADER_INPUT_TYPE_TEXTURES, 0}, + }, + 25, + 8, + {{0,0,EVertexFormat::VERTEX_FORMAT_X32Y32}}, + {EImageFormat::IMAGE_FORMAT_R8G8B8A8}, + true + ); +}; + +void CFGUI_Rendering::Frame( float fDelta ) +{ + IRenderer::ResetState(); + IRenderer::SetDepthMode(DEPTH_MODE_LESS); + for (auto &widget: fgui_widgets) + { + widget->Draw(); + } +}; + +void CFGUI_Rendering::Deinit() +{ + +}; diff --git a/fgui/label.cpp b/fgui/label.cpp new file mode 100644 index 0000000..b784020 --- /dev/null +++ b/fgui/label.cpp @@ -0,0 +1,38 @@ +#include "fgui/label.h" +#include "fgui/fgui.h" + +CFGUI_Label::CFGUI_Label() +{ + +} + +void CFGUI_Label::SetFont( CUtlString font ) +{ + IFGUI::LoadFont(font); +} + +void CFGUI_Label::SetLabel( CUtlString text ) +{ + m_szText = text; +} + +void CFGUI_Label::SetLabelSize( uint32_t nSize ) +{ + +} + +void CFGUI_Label::Event( FGUI_Event_t event ) +{ + +} + +void CFGUI_Label::Draw() +{ + IFGUI::SetTextColor(1, 1, 1, 1); + IFGUI::DrawText(m_szText); +} + +CFGUI_Label::~CFGUI_Label() +{ + +} diff --git a/fgui/rectangle.cpp b/fgui/rectangle.cpp new file mode 100644 index 0000000..e69de29 diff --git a/fgui/widget.cpp b/fgui/widget.cpp new file mode 100644 index 0000000..6ebb140 --- /dev/null +++ b/fgui/widget.cpp @@ -0,0 +1,30 @@ +#include "fgui/widget.h" +#include "fgui/fgui.h" + +CFGUI_Widget::CFGUI_Widget() +{ + IFGUI::AppendWidget(this); +} + +CFGUI_Widget::~CFGUI_Widget() +{ + +} + +void CFGUI_Widget::SetPosition( int32_t nX, int32_t nY ) +{ + m_iPosition[0] = nX; + m_iPosition[1] = nY; +} + +void CFGUI_Widget::SetSize( uint32_t nX, uint32_t nY ) +{ + m_iSize[0] = nX; + m_iSize[1] = nY; +} + +void CFGUI_Widget::SetParent( CFGUI_Widget *pParent ) +{ + +} + diff --git a/fpc/library/ld.cpp b/fpc/library/ld.cpp index af1ca3b..25e76ae 100644 --- a/fpc/library/ld.cpp +++ b/fpc/library/ld.cpp @@ -100,6 +100,7 @@ CUtlString CLDProject::Link( void ) if (m_target.kernel == TARGET_KERNEL_LINUX) { args.AppendTail("-rdynamic"); + args.AppendTail("-Wl,--whole-archive"); } if (linkType == ELINK_DYNAMIC_LIBRARY) { @@ -111,6 +112,10 @@ CUtlString CLDProject::Link( void ) { args.AppendTail("-Wl,--no-whole-archive"); } + if (m_target.kernel == TARGET_KERNEL_LINUX) + { + args.AppendTail("-Wl,--no-whole-archive"); + } for (auto lib: libraries) { args.AppendTail("-l"); diff --git a/funnyassets/__build.cpp b/funnyassets/__build.cpp index d4ed5ac..b2c1543 100644 --- a/funnyassets/__build.cpp +++ b/funnyassets/__build.cpp @@ -36,10 +36,15 @@ int assets_build() IFileSystem2::CopyDirectory(CUtlString("build/funnygame/assets"), "funnyassets/maps"); IFileSystem2::CopyDirectory(CUtlString("build/funnygame/assets"), "funnyassets/gfx"); + IFileSystem2::CopyDirectory(CUtlString("build/funnygame/assets"), "funnyassets/fonts"); IFileSystem2::CopyDirectory(CUtlString("build/funnygame/assets"), "funnyassets/textures"); IFileSystem2::CopyDirectory(CUtlString("build/funnygame/assets"), "funnyassets/materials"); build_shader("mesh_frag"); build_shader("mesh_vert"); + build_shader("fgui_rect_frag"); + build_shader("fgui_rect_vert"); + build_shader("fgui_text_frag"); + build_shader("fgui_text_vert"); CUtlVector python_args = { "build/tools/makepak64.py", CUtlString("build/funnygame/assets"), diff --git a/funnyassets/_rtt/gfx/bricks.png b/funnyassets/_rtt/gfx/bricks.png deleted file mode 100644 index 93e734e..0000000 Binary files a/funnyassets/_rtt/gfx/bricks.png and /dev/null differ diff --git a/funnyassets/_rtt/gfx/brush_frag.spv b/funnyassets/_rtt/gfx/brush_frag.spv deleted file mode 100644 index 95d7a20..0000000 Binary files a/funnyassets/_rtt/gfx/brush_frag.spv and /dev/null differ diff --git a/funnyassets/_rtt/gfx/brush_vert.spv b/funnyassets/_rtt/gfx/brush_vert.spv deleted file mode 100644 index e9f6f1a..0000000 Binary files a/funnyassets/_rtt/gfx/brush_vert.spv and /dev/null differ diff --git a/funnyassets/_rtt/gfx/mesh_frag.spv b/funnyassets/_rtt/gfx/mesh_frag.spv deleted file mode 100644 index 060bbd1..0000000 Binary files a/funnyassets/_rtt/gfx/mesh_frag.spv and /dev/null differ diff --git a/funnyassets/_rtt/gfx/mesh_vert.spv b/funnyassets/_rtt/gfx/mesh_vert.spv deleted file mode 100644 index 73c788a..0000000 Binary files a/funnyassets/_rtt/gfx/mesh_vert.spv and /dev/null differ diff --git a/funnyassets/_rtt/maps/test_map.fmap b/funnyassets/_rtt/maps/test_map.fmap deleted file mode 100644 index 1948727..0000000 Binary files a/funnyassets/_rtt/maps/test_map.fmap and /dev/null differ diff --git a/funnyassets/_rtt/materials/brick.fmat b/funnyassets/_rtt/materials/brick.fmat deleted file mode 100644 index fa0f0da..0000000 --- a/funnyassets/_rtt/materials/brick.fmat +++ /dev/null @@ -1,2 +0,0 @@ -parent rtt_simple_pbr -albedo textures/bricks.png diff --git a/funnyassets/_rtt/textures/bricks.png b/funnyassets/_rtt/textures/bricks.png deleted file mode 100644 index 620b6b1..0000000 Binary files a/funnyassets/_rtt/textures/bricks.png and /dev/null differ diff --git a/funnyassets/default.cfg b/funnyassets/default.cfg index 6a9b8bd..d5ff6cf 100644 --- a/funnyassets/default.cfg +++ b/funnyassets/default.cfg @@ -3,3 +3,4 @@ bind a +left; bind d +right; bind w +forward; bind s +back; +bind o connect 127.0.0.1; diff --git a/funnyassets/fonts/IBMPlexMono-Regular.fontdata b/funnyassets/fonts/IBMPlexMono-Regular.fontdata new file mode 100644 index 0000000..81c969b --- /dev/null +++ b/funnyassets/fonts/IBMPlexMono-Regular.fontdata @@ -0,0 +1,2 @@ +12 8 !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgijklmnopqrstuvwxyz{|}~ + diff --git a/funnyassets/fonts/IBMPlexMono-Regular.png b/funnyassets/fonts/IBMPlexMono-Regular.png new file mode 100644 index 0000000..dfef87f Binary files /dev/null and b/funnyassets/fonts/IBMPlexMono-Regular.png differ diff --git a/funnyassets/fonts/IBMPlexMono-Regular.ttf b/funnyassets/fonts/IBMPlexMono-Regular.ttf new file mode 100644 index 0000000..81ca3dc Binary files /dev/null and b/funnyassets/fonts/IBMPlexMono-Regular.ttf differ diff --git a/funnyassets/gfx_shaders/fgui_rect_frag.slang b/funnyassets/gfx_shaders/fgui_rect_frag.slang new file mode 100644 index 0000000..cecec1c --- /dev/null +++ b/funnyassets/gfx_shaders/fgui_rect_frag.slang @@ -0,0 +1,11 @@ +#include "fgui_rect_shared.slang" + +[shader("fragment")] +float4 _main( + VertexOutput input, + uint triid: SV_PrimitiveID, +) : SV_TARGET +{ + return float4(0.2,0.2,0.2,1); +} + diff --git a/funnyassets/gfx_shaders/fgui_rect_shared.slang b/funnyassets/gfx_shaders/fgui_rect_shared.slang new file mode 100644 index 0000000..f8e2bc1 --- /dev/null +++ b/funnyassets/gfx_shaders/fgui_rect_shared.slang @@ -0,0 +1,17 @@ +#pragma once + +struct VertexOutput +{ + float4 position: SV_Position; +} +#include "shader_base.h" + +DECLARE_CONSTANTS() +{ + int2 resolution; + uint2 size; + int2 position; +}; + + + diff --git a/funnyassets/gfx_shaders/fgui_rect_vert.slang b/funnyassets/gfx_shaders/fgui_rect_vert.slang new file mode 100644 index 0000000..86256aa --- /dev/null +++ b/funnyassets/gfx_shaders/fgui_rect_vert.slang @@ -0,0 +1,17 @@ +#include "fgui_rect_shared.slang" + +struct VertexInput +{ + float2 position: POSITION; +}; + +[shader("vertex")] +VertexOutput _main( + VertexInput input, +) +{ + VertexOutput output; + output.position = float4((input.position*size+position)/resolution*2-1, 0, 1.0f); + FIX_VERTEX_POSITION(output.position); + return output; +} diff --git a/funnyassets/gfx_shaders/fgui_text_frag.slang b/funnyassets/gfx_shaders/fgui_text_frag.slang new file mode 100644 index 0000000..fd9f931 --- /dev/null +++ b/funnyassets/gfx_shaders/fgui_text_frag.slang @@ -0,0 +1,11 @@ +#include "fgui_text_shared.slang" + +[shader("fragment")] +float4 _main( + VertexOutput input, + uint triid: SV_PrimitiveID, +) : SV_TARGET +{ + return float4(0.2,0.2,0.2,1); +} + diff --git a/funnyassets/gfx_shaders/fgui_text_shared.slang b/funnyassets/gfx_shaders/fgui_text_shared.slang new file mode 100644 index 0000000..c5185f9 --- /dev/null +++ b/funnyassets/gfx_shaders/fgui_text_shared.slang @@ -0,0 +1,18 @@ +#pragma once + +struct VertexOutput +{ + float4 position: SV_Position; +} +#include "shader_base.h" + +DECLARE_CONSTANTS() +{ + int2 resolution; + uint2 size; + int2 position; + int8_t character; +}; + +DECLARE_TEXTURES(0); + diff --git a/funnyassets/gfx_shaders/fgui_text_vert.slang b/funnyassets/gfx_shaders/fgui_text_vert.slang new file mode 100644 index 0000000..083ed3e --- /dev/null +++ b/funnyassets/gfx_shaders/fgui_text_vert.slang @@ -0,0 +1,18 @@ +#include "fgui_text_shared.slang" + +struct VertexInput +{ + float2 position: POSITION; + float2 uv: TEXCOORD0; +}; + +[shader("vertex")] +VertexOutput _main( + VertexInput input, +) +{ + VertexOutput output; + output.position = float4((input.position*size+position)/resolution*2-1, 0, 1.0f); + FIX_VERTEX_POSITION(output.position); + return output; +} diff --git a/funnyassets/gfx_shaders/mesh_shared.slang b/funnyassets/gfx_shaders/mesh_shared.slang index 79a4d13..5307b0c 100644 --- a/funnyassets/gfx_shaders/mesh_shared.slang +++ b/funnyassets/gfx_shaders/mesh_shared.slang @@ -1,12 +1,10 @@ -#pragma once -#include "shader_base.h" - struct VertexOutput { float4 position: SV_Position; float2 uv: TEXCOORD0; }; +#include "shader_base.h" DECLARE_CONSTANTS() { float4x4 modelMatrix; diff --git a/funnyassets/gfx_shaders/mesh_vert.slang b/funnyassets/gfx_shaders/mesh_vert.slang index 4e39994..0673228 100644 --- a/funnyassets/gfx_shaders/mesh_vert.slang +++ b/funnyassets/gfx_shaders/mesh_vert.slang @@ -1,4 +1,3 @@ -#include "shader_base.h" #include "mesh_shared.slang" struct VertexInput @@ -14,6 +13,7 @@ VertexOutput _main( { VertexOutput output; output.position = mul(projection, mul(modelMatrix, float4(input.position,1))); + FIX_VERTEX_POSITION(output.position); output.uv = input.uv; return output; } diff --git a/funnyassets/gfx_shaders/shader_base.h b/funnyassets/gfx_shaders/shader_base.h index dda2fbd..519b119 100644 --- a/funnyassets/gfx_shaders/shader_base.h +++ b/funnyassets/gfx_shaders/shader_base.h @@ -18,7 +18,16 @@ ParameterBlock g_textures3 : register(t24); \ ParameterBlock g_textures4 : register(t25); \ ParameterBlock g_textures5 : register(t26); \ ParameterBlock g_textures6 : register(t27); \ -ParameterBlock g_textures7 : register(t28); +ParameterBlock g_textures7 : register(t28); \ +float4 SampleTexture(uint32_t binding, float2 uv) \ +{ \ + SamplerState sampler = mlGetSampler(); \ + uint8_t textureArray = 0; \ + uint8_t textureSamplerArray = (binding >> 16) & 0xFF; \ + uint8_t textureSampler = (binding >> 8) & 0xFF; \ + uint8_t textureIndex = 1; \ + return g_textures0.textures[1].Sample(sampler, uv); \ +}; void _mlGetSampler() { @@ -32,16 +41,6 @@ SamplerState mlGetSampler() _mlGetSampler(); }; -float4 SampleTexture(uint32_t binding, float2 uv) -{ - SamplerState sampler = mlGetSampler(); - uint8_t textureArray = 0; - uint8_t textureSamplerArray = (binding >> 16) & 0xFF; - uint8_t textureSampler = (binding >> 8) & 0xFF; - uint8_t textureIndex = 1; - return g_textures0.textures[1].Sample(sampler, uv); -}; - #define DECLARE_CBUFFER(b) \ [[vk::binding(b)]] cbuffer cbuffer_##b : register(t##b) @@ -49,16 +48,16 @@ float4 SampleTexture(uint32_t binding, float2 uv) [[vk::push_constant]] \ cbuffer cbuffer_constants : register(t29) +#define FIX_VERTEX_POSITION(g) g = float4(g.x, -g.y, g.z, g.w); #elif defined(__SPIRV__) #define DECLARE_TEXTURES(b) \ [[vk::binding(b)]] \ -Sampler2D g_textures[]; - -float4 SampleTexture(uint32_t binding, float2 uv) -{ - return g_textures[binding].Sample(uv); +Sampler2D g_textures[]; \ +float4 SampleTexture(uint32_t binding, float2 uv) \ +{ \ + return g_textures[binding].Sample(uv); \ }; #define DECLARE_CBUFFER(b) \ @@ -70,16 +69,21 @@ cbuffer cbuffer_##b [[vk::binding(b)]] \ r -#define DECLARE_CONSTANTS() \ +#define DECLARE_CONSTANTS() [[vk::push_constant]] \ cbuffer cbuffer_constants +#define FIX_VERTEX_POSITION(x) + #else #define DECLARE_TEXTURES() float4 SampleTexture(uint32_t binding, float2 uv); -#define DECLARE_CBUFFER() cbuffer cbuffer_constats -#define DECLARE_DATA() cbuffer cbuffer_constats -#define DECLARE_CONSTANTS() cbuffer cbuffer_constats +#define DECLARE_CBUFFER() cbuffer cbuffer_constants +#define DECLARE_DATA() cbuffer cbuffer_constants +#define DECLARE_CONSTANTS() cbuffer cbuffer_constants +#define FIX_VERTEX_POSITION(x) #endif #endif + + diff --git a/funnyassets/maps/test_map.fmap b/funnyassets/maps/test_map.fmap index e162591..52b14e9 100644 Binary files a/funnyassets/maps/test_map.fmap and b/funnyassets/maps/test_map.fmap differ diff --git a/funnyassets/raw_maps/dust.map b/funnyassets/raw_maps/dust.map index 9229bc2..45c6ac6 100644 --- a/funnyassets/raw_maps/dust.map +++ b/funnyassets/raw_maps/dust.map @@ -261851,3 +261851,8 @@ "classname" "info_player_start" "origin" "10 -50 3" } + +{ +"classname" "info_player_start" +"origin" "10 -52 3" +} diff --git a/game/client/milmoba/player.cpp b/game/client/milmoba/player.cpp index c077a12..9640c79 100644 --- a/game/client/milmoba/player.cpp +++ b/game/client/milmoba/player.cpp @@ -4,6 +4,8 @@ #include "engine.h" #include "rendering.h" #include "input.h" +#include "fgui/widget.h" +#include "fgui/label.h" class C_MOBAPlayer: public C_BaseEntity { @@ -18,10 +20,13 @@ void C_MOBAPlayer::Precache() { } - +CFGUI_Label *pText = new CFGUI_Label(); void C_MOBAPlayer::Spawn() { - + pText->SetFont("fonts/IBMPlexMono-Regular"); + pText->SetPosition(100, 100); + pText->SetLabelSize(15); + pText->SetLabel("Hello, world!"); }; void C_MOBAPlayer::Destroy() @@ -34,11 +39,11 @@ void C_MOBAPlayer::Think( float fDelta ) float y = g_fAxisValues[AXIS_MOUSE_Y]; float fPitch = glm_rad(x); float fYaw = glm_rad(y); - glm_mat4_identity(g_cameraView); - glm_rotate_z(g_cameraView, fYaw, g_cameraView); - glm_rotate_y(g_cameraView, fPitch, g_cameraView); - if (g_localClient.pBasePlayer == pEntity) + if (g_localClient->pBasePlayer == pEntity) { + glm_mat4_identity(g_cameraView); + glm_rotate_z(g_cameraView, fYaw, g_cameraView); + glm_rotate_y(g_cameraView, fPitch, g_cameraView); g_cameraView[3][0] = pEntity->m_position[0]; g_cameraView[3][1] = pEntity->m_position[1]; g_cameraView[3][2] = pEntity->m_position[2]+0.7; diff --git a/game/server/game.cpp b/game/server/game.cpp index b2bbff2..015530d 100644 --- a/game/server/game.cpp +++ b/game/server/game.cpp @@ -7,11 +7,15 @@ #include "stdio.h" #include "tier0/lib.h" -CGameMode testMode; +class CTestGameMode: public CGameMode +{ + +}; +DECLARE_GAME_MODE(CTestGameMode, test_gamemode) DLL_EXPORT void IGame_Load() { ILevel::LoadLevel("maps/test_map"); - IGameModeManager::StartGameMode(&testMode); + IGameModeManager::StartGameMode("test_gamemode"); return; }; diff --git a/game/server/milmoba/player.cpp b/game/server/milmoba/player.cpp index 21382b5..7a2a24f 100644 --- a/game/server/milmoba/player.cpp +++ b/game/server/milmoba/player.cpp @@ -7,6 +7,7 @@ #include "engine.h" #include "input.h" #include "math3d.h" +#include "networking.h" #include "physics.h" #include "physics_gen.h" @@ -23,6 +24,7 @@ public: virtual void Destroy( void ) override; virtual void ReadParameter( const char *szName, const char *szValue ) override; virtual void Think( float fDelta ) override; + virtual void Sync( void *pData, uint32_t nDataSize ) override; void Accelerate( void ); void AirAccelerate( void ); @@ -73,7 +75,6 @@ void CMOBAPlayer::Precache() void CMOBAPlayer::Spawn() { - }; @@ -157,24 +158,89 @@ void CMOBAPlayer::PlayerMove( void ) void CMOBAPlayer::Think( float fDelta ) { - float x = g_fAxisValues[AXIS_MOUSE_X]; - float y = g_fAxisValues[AXIS_MOUSE_Y]; - fPitch = glm_rad(x); - fYaw = glm_rad(y); + if (INetworking::IsClient()) + { + if (g_localClient->pBasePlayer == this) { + float x = g_fAxisValues[AXIS_MOUSE_X]; + float y = g_fAxisValues[AXIS_MOUSE_Y]; + fPitch = glm_rad(x); + fYaw = glm_rad(y); + } + } m_fDelta = fDelta; PlayerMove(); }; -void PlayerForward(int argc, char **argv) {if (g_localClient.pBasePlayer) ((CMOBAPlayer*)g_localClient.pBasePlayer)->bIsForward = true;}; -void PlayerForwardUp(int argc, char **argv) {if (g_localClient.pBasePlayer) ((CMOBAPlayer*)g_localClient.pBasePlayer)->bIsForward = false;}; -void PlayerBack(int argc, char **argv) {if (g_localClient.pBasePlayer) ((CMOBAPlayer*)g_localClient.pBasePlayer)->bIsBack = true;}; -void PlayerBackUp(int argc, char **argv) {if (g_localClient.pBasePlayer) ((CMOBAPlayer*)g_localClient.pBasePlayer)->bIsBack = false;}; -void PlayerLeft(int argc, char **argv) {if (g_localClient.pBasePlayer) ((CMOBAPlayer*)g_localClient.pBasePlayer)->bIsLeft = true;}; -void PlayerLeftUp(int argc, char **argv) {if (g_localClient.pBasePlayer) ((CMOBAPlayer*)g_localClient.pBasePlayer)->bIsLeft = false;}; -void PlayerRight(int argc, char **argv) {if (g_localClient.pBasePlayer) ((CMOBAPlayer*)g_localClient.pBasePlayer)->bIsRight = true;}; -void PlayerRightUp(int argc, char **argv) {if (g_localClient.pBasePlayer) ((CMOBAPlayer*)g_localClient.pBasePlayer)->bIsRight = false;}; +void CMOBAPlayer::Sync( void *pData, uint32_t nDataSize ) +{ + + struct PlayerMovement_t: public PacketPlayer_t + { + bool bIsForward; + bool bIsBack; + bool bIsLeft; + bool bIsRight; + float fPitch; + float fYaw; + }; + + // Send data + if ( pData == NULL ) + { + PlayerMovement_t movement = { + .bIsForward = bIsForward, + .bIsBack = bIsBack, + .bIsLeft = bIsLeft, + .bIsRight = bIsRight, + .fPitch = fPitch, + .fYaw = fYaw, + }; + movement.type = PACKET_TYPE_PLAYER_MOVEMENT; + if (INetworking::IsClient()) + { + if (g_localClient->pBasePlayer != this) + return; + INetworking::SendData(&movement, sizeof(PlayerMovement_t), 0, MESSAGE_MODE_RELIABLE); + } else { + for (auto &client: g_clients) + { + if (client->pBasePlayer == this) + { + movement.playerHandle = client->playerHandle; + break; + } + } + INetworking::SendDataEverybodyExcept(&movement, sizeof(PlayerMovement_t), this, MESSAGE_MODE_RELIABLE); + } + return; + } + + Packet_t *pPacket = (Packet_t*)pData; + if (pPacket->type == PACKET_TYPE_PLAYER_MOVEMENT) + { + if (nDataSize != sizeof(PlayerMovement_t)) + return; + + PlayerMovement_t *pMovement = (PlayerMovement_t*)pPacket; + bIsForward = pMovement->bIsForward; + bIsBack = pMovement->bIsBack; + bIsLeft = pMovement->bIsLeft; + bIsRight = pMovement->bIsRight; + fPitch = pMovement->fPitch; + fYaw = pMovement->fYaw; + }; +}; + +void PlayerForward(int argc, char **argv) {if (g_localClient->pBasePlayer) ((CMOBAPlayer*)g_localClient->pBasePlayer)->bIsForward = true;}; +void PlayerForwardUp(int argc, char **argv) {if (g_localClient->pBasePlayer) ((CMOBAPlayer*)g_localClient->pBasePlayer)->bIsForward = false;}; +void PlayerBack(int argc, char **argv) {if (g_localClient->pBasePlayer) ((CMOBAPlayer*)g_localClient->pBasePlayer)->bIsBack = true;}; +void PlayerBackUp(int argc, char **argv) {if (g_localClient->pBasePlayer) ((CMOBAPlayer*)g_localClient->pBasePlayer)->bIsBack = false;}; +void PlayerLeft(int argc, char **argv) {if (g_localClient->pBasePlayer) ((CMOBAPlayer*)g_localClient->pBasePlayer)->bIsLeft = true;}; +void PlayerLeftUp(int argc, char **argv) {if (g_localClient->pBasePlayer) ((CMOBAPlayer*)g_localClient->pBasePlayer)->bIsLeft = false;}; +void PlayerRight(int argc, char **argv) {if (g_localClient->pBasePlayer) ((CMOBAPlayer*)g_localClient->pBasePlayer)->bIsRight = true;}; +void PlayerRightUp(int argc, char **argv) {if (g_localClient->pBasePlayer) ((CMOBAPlayer*)g_localClient->pBasePlayer)->bIsRight = false;}; ConCommand moveForwardCmd("+forward", PlayerForward, 0); ConCommand moveForwardUpCmd("-forward", PlayerForwardUp, 0); diff --git a/ios_deploy/funnygame/funnygame.xcodeproj/project.xcworkspace/xcuserdata/kotofyt.xcuserdatad/UserInterfaceState.xcuserstate b/ios_deploy/funnygame/funnygame.xcodeproj/project.xcworkspace/xcuserdata/kotofyt.xcuserdatad/UserInterfaceState.xcuserstate index a03d888..de7aee8 100644 Binary files a/ios_deploy/funnygame/funnygame.xcodeproj/project.xcworkspace/xcuserdata/kotofyt.xcuserdatad/UserInterfaceState.xcuserstate and b/ios_deploy/funnygame/funnygame.xcodeproj/project.xcworkspace/xcuserdata/kotofyt.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ios_deploy/funnygame/funnygame.xcodeproj/xcuserdata/kotofyt.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/ios_deploy/funnygame/funnygame.xcodeproj/xcuserdata/kotofyt.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 294e578..011b72b 100644 --- a/ios_deploy/funnygame/funnygame.xcodeproj/xcuserdata/kotofyt.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/ios_deploy/funnygame/funnygame.xcodeproj/xcuserdata/kotofyt.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -3,4 +3,22 @@ uuid = "EDF5B860-98F6-4431-91A7-5DEA7965C560" type = "1" version = "2.0"> + + + + + + diff --git a/launcher/__build.cpp b/launcher/__build.cpp index 605f59a..dba3ce2 100644 --- a/launcher/__build.cpp +++ b/launcher/__build.cpp @@ -30,6 +30,7 @@ int launcher_build() ldProject.objects.AppendTail((CObject){rapier_lib}); ldProject.objects.AppendTail((CObject){engine_lib}); ldProject.objects.AppendTail((CObject){server_lib}); + ldProject.objects.AppendTail((CObject){fgui_lib}); ldProject.objects.AppendTail((CObject){client_lib}); if (Target_t::DefaultTarget().kernel == TARGET_KERNEL_IOS) { diff --git a/launcher/launcher.cpp b/launcher/launcher.cpp index bde1d22..cd0db92 100644 --- a/launcher/launcher.cpp +++ b/launcher/launcher.cpp @@ -1,5 +1,6 @@ #include "string.h" #include "stdio.h" +#include "tier0/platform.h" #include "unistd.h" #include "dlfcn.h" #include "libgen.h" @@ -29,6 +30,7 @@ static char szLauncherPath[MAX_PATH]; static char szEnginePath[MAX_PATH]; static char szTier0Path[MAX_PATH]; +static char szSteamPath[MAX_PATH]; void *pEngineLib = NULL; void *pTier0Lib = NULL; @@ -45,6 +47,7 @@ int main( int argc, char **argv ) { snprintf(szEnginePath, MAX_PATH, "%s/libengine.so", szLauncherPath); snprintf(szTier0Path, MAX_PATH, "%s/libtier0.so", szLauncherPath); + snprintf(szSteamPath, MAX_PATH, "%s/libsteam_api.so", szLauncherPath); #endif #ifdef __APPLE__ uint32_t pathSize = sizeof(szLauncherPath); @@ -55,6 +58,8 @@ int main( int argc, char **argv ) { snprintf(szEnginePath, MAX_PATH, "%s/libengine.dylib", szLauncherPath2); snprintf(szTier0Path, MAX_PATH, "%s/libtier0.dylib", szLauncherPath2); #endif + if ( !dlopen(szSteamPath, RTLD_NOW )) + printf("Failed to open steam\n"); pTier0Lib = dlopen(szTier0Path, RTLD_NOW | RTLD_GLOBAL); if ( !pTier0Lib ) { printf("Failed to open libtier0\n"); diff --git a/public/baseentity.h b/public/baseentity.h index 6a1ffe9..1904f93 100644 --- a/public/baseentity.h +++ b/public/baseentity.h @@ -7,7 +7,11 @@ class CBaseEntity; class C_BaseEntity; - +enum EPredictionMode { + PREDICTION_MODE_CREATED, + PREDICTION_MODE_DESTROYED, + PREDICTION_MODE_NONE, +}; //----------------------------------------------------------------------------- // Base server entity class. // It is updated every 1/tickrate (64) of a second. Does not require special @@ -22,6 +26,7 @@ public: virtual void Destroy( void ) = 0; virtual void ReadParameter( const char *szName, const char *szValue ); virtual void Think( float fDelta ) = 0; + virtual void Sync( void *pData, uint32_t nDataSize ) = 0; void SetPosition( vec3 position ); void SetRotationEuler( vec3 euler ); void SetRotationQuat( vec4 quaternion ); @@ -32,6 +37,9 @@ public: mat3 m_matrix; vec3 m_position; vec3 m_scale; + + uint64_t m_id; + EPredictionMode m_prediction; }; @@ -46,7 +54,7 @@ public: const char *m_szName; const char *m_szClass; EntityRegistryFn m_pfn; - ClientEntityRegistryFn m_pClientfn; + ClientEntityRegistryFn m_pClientfn = 0; }; @@ -56,7 +64,7 @@ CBaseEntity *__entity_alloc_##name() \ { \ return new class; \ }; \ -GLOBAL_USED CEntityRegistry __entity_##name##_registry(#name, #class, __entity_alloc_##name); \ +CEntityRegistry __entity_##name##_registry(#name, #class, __entity_alloc_##name); \ //----------------------------------------------------------------------------- @@ -93,7 +101,7 @@ C_BaseEntity *__c_entity_alloc_##server() \ C_EntityRegistry __c_entity_##server##_registry(#server, __c_entity_alloc_##server); \ -extern CUtlSelfReferencingVector g_entities; +extern CUtlVector g_entities; extern CUtlVector g_RegisteredEntities; diff --git a/public/brush.h b/public/brush.h index 6440c30..cbc82be 100644 --- a/public/brush.h +++ b/public/brush.h @@ -32,6 +32,7 @@ public: virtual void ReadParameter( const char *szName, const char *szValue ) override; virtual void Destroy( void ) override; virtual void Think( float fDelta ) override; + virtual void Sync( void *pData, uint32_t nDataSize ) override; CUtlVector m_mesh; Collider *m_collider; diff --git a/public/engine.h b/public/engine.h index 348cead..cf829b4 100644 --- a/public/engine.h +++ b/public/engine.h @@ -16,7 +16,7 @@ public: static void Shutdown(); }; -extern IIClient g_localClient; +extern IIClient *g_localClient; extern CUtlVector g_clients; @@ -26,8 +26,10 @@ public: static CBaseEntity *SpawnEntity( const char *szName ); static void InitEntity(CBaseEntity *pEntity); static void DestroyEntity( CBaseEntity *pEntity ); - static void ConnectClient( IIClient *pClient); - static void DisconnectClient( IIClient *pClient); + static void ConnectClient( IIClient *pClient ); + static void DisconnectClient( IIClient *pClient ); + static void DisconnectClient( uint64_t playerID ); + static void DisconnectClientByHandle( uint32_t playerHandle ); }; diff --git a/public/fgui/button.h b/public/fgui/button.h new file mode 100644 index 0000000..b3e1ed9 --- /dev/null +++ b/public/fgui/button.h @@ -0,0 +1 @@ +#include "widget.h" diff --git a/public/fgui/fgui.h b/public/fgui/fgui.h index 4f6d236..d22a384 100644 --- a/public/fgui/fgui.h +++ b/public/fgui/fgui.h @@ -1,27 +1,43 @@ #ifndef FGUI_H #define FGUI_H +#include "rendering.h" #include "tier0/platform.h" +#include "tier1/utlstring.h" -abstract_class fgui +class CFGUI_Widget; + +struct FGUI_Event_t { - struct Color_t - { - float r; - float g; - float b; - }; - /* every position is resized to some degree of 1280x720 */ - struct Vector_t - { - float x; - float y; - }; - static void Init( void ); - static void Frame( void ); - static void Rectangle( Vector_t posPx, Vector_t posFl, Vector_t sizePx, Vector_t sizeFl ); - static void Text( const char *psz, uint32_t nSize, Vector_t pos, Vector_t color ); }; -#endif \ No newline at end of file +class CFont +{ +public: + CUtlString szName; + ITexture *pTexture; + uint32_t glyphWidth; + uint32_t glyphHeight; + char cCharacterSet[256]; +}; + +interface IFGUI +{ +public: + static void Init( void ); + static void Frame( void ); + static void AppendWidget( CFGUI_Widget *pWidget ); + static void DestroyWidget( CFGUI_Widget *pWidget ); + + static void SetRectColor( float r, float g, float b, float a ); + static void DrawRect( int32_t iPosX, int32_t iPosY, uint32_t uSizeX, uint32_t uSizeY ); + + static CFont *LoadFont( CUtlString szFontPath ); + static void SetTextFont( CFont *pFont ); + static void SetTextPos( float x, float y ); + static void SetTextColor( float r, float g, float b, float a ); + static void DrawText( CUtlString psz ); +}; + +#endif diff --git a/public/fgui/label.h b/public/fgui/label.h new file mode 100644 index 0000000..3b53de2 --- /dev/null +++ b/public/fgui/label.h @@ -0,0 +1,26 @@ +#ifndef FGUI_LABEL_H +#define FGUI_LABEL_H +#include "widget.h" +#include "tier1/utlstring.h" +#include "rendering.h" + +class CFGUI_Label: public CFGUI_Widget +{ +public: + CFGUI_Label(); + ~CFGUI_Label(); + + CUtlString m_szText; + float m_fLabelColor[3]; + + void SetFont( CUtlString font ); + void SetLabel( CUtlString text ); + void SetLabelSize( uint32_t nSize ); + + virtual void Event( FGUI_Event_t event ) override; + virtual void Draw() override; + + uint32_t m_fGlyphSize[2]; +}; + +#endif diff --git a/public/fgui/widget.h b/public/fgui/widget.h new file mode 100644 index 0000000..e032d5b --- /dev/null +++ b/public/fgui/widget.h @@ -0,0 +1,28 @@ +#ifndef FGUI_WIDGET_H +#define FGUI_WIDGET_H + +#include "tier0/platform.h" +#include "fgui.h" + +class CFGUI_Widget +{ +public: + CFGUI_Widget(); + CFGUI_Widget(CFGUI_Widget *pParent); + ~CFGUI_Widget(); + + void SetPosition( int32_t nX, int32_t nY ); + void SetSize( uint32_t nX, uint32_t nY ); + void SetParent( CFGUI_Widget *pParent ); + + virtual void Event( FGUI_Event_t event ) = 0; + virtual void Draw() = 0; + + static void SetDefaultParent(CFGUI_Widget *pParent); + + int32_t m_iPosition[2]; + uint32_t m_iSize[2]; + CFGUI_Widget *m_pParent; +}; + +#endif diff --git a/public/fgui_compositor/window.h b/public/fgui_compositor/window.h new file mode 100644 index 0000000..e69de29 diff --git a/public/gamemode.h b/public/gamemode.h index 56b1461..edf649a 100644 --- a/public/gamemode.h +++ b/public/gamemode.h @@ -16,9 +16,28 @@ interface IGameModeManager public: static void Init( void ); static void Frame( void ); - static void StartGameMode(CGameMode *pGameMode); - static CGameMode *GetCurrentMode( void ); - static void RestartCurrentMode( void ); + + static void StartGameMode( const char *szName ); + static const char *GetCurrentGameMode( void ); + static CGameMode *GetCurrentGameModeClass( void ); + static void RestartCurrentGameMode( void ); }; +typedef CGameMode*(*GameModeRegistryFn)(); +class CGameModeRegistry +{ +public: + CGameModeRegistry( const char *szName, GameModeRegistryFn pfn ); + const char *m_szName; + GameModeRegistryFn m_pfn; +}; + +#define DECLARE_GAME_MODE( class, name ) \ +CGameMode *__gamemode_alloc_##name() \ +{ \ + return new class; \ +}; \ +CGameModeRegistry __gamemode_##name##_registry(#name, __gamemode_alloc_##name); \ + + #endif diff --git a/public/net.h b/public/net.h deleted file mode 100644 index 9d0e592..0000000 --- a/public/net.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef NET_H -#define NET_H - -#include "tier0/platform.h" - -interface INet -{ - -}; - -#endif diff --git a/public/networking.h b/public/networking.h new file mode 100644 index 0000000..77960ce --- /dev/null +++ b/public/networking.h @@ -0,0 +1,71 @@ +#ifndef NET_H +#define NET_H + +#include "steam/steam_api.h" +#include "steam/isteamnetworkingsockets.h" +#include "tier0/platform.h" +#include "tier1/commandline.h" + +abstract_class IIClient; +class CBasePlayer; + +enum EPacketType +{ + PACKET_TYPE_CREATE_ENTITTY = 0, + PACKET_TYPE_DESTROY_ENTITTY = 1, + PACKET_TYPE_ENTITY_UPDATE = 2, + + // Player can only send this + PACKET_TYPE_PLAYER_MOVEMENT = 3, + + PACKET_TYPE_PLAYER_JOIN = 4, + PACKET_TYPE_PLAYER_LEAVE = 5, + + PACKET_TYPE_GAMEMODE_START = 6, + PACKET_TYPE_GAMEMODE_END = 7, +}; + +struct Packet_t +{ + uint32_t type; +}; +struct PacketPlayer_t: public Packet_t +{ + uint64_t playerID; + uint32_t playerHandle; +}; +struct PacketGameMode_t: public Packet_t +{ + char szName[256]; +}; + +enum EMessageMode +{ + MESSAGE_MODE_UNRELIABLE, + MESSAGE_MODE_RELIABLE, +}; + + +interface INetworking +{ +public: + static void Init(); + static void Deinit(); + static void Frame(); + static void SendData( void *pData, uint32_t nSize, IIClient *pClient, EMessageMode messageMode ); + static void SendDataEverybody( void *pData, uint32_t nSize, EMessageMode messageMode ); + static void SendDataEverybodyExcept( void *pData, uint32_t nSize, IIClient *pClient, EMessageMode messageMode ); + static void SendDataEverybodyExcept( void *pData, uint32_t nSize, CBasePlayer *pClient, EMessageMode messageMode ); + static void ProcessPacket( void *pData, uint32_t nSize, IIClient *pClient ); + + static void CreateServer(); + static void GetServerInfo(); + static void JoinServer( const char *szIP ); + static void ClientConnectedCallback( SteamNetConnectionStatusChangedCallback_t *pCallback ); + + static bool IsServer(); + static bool IsClient(); + static bool IsConnected(); +}; + +#endif diff --git a/public/playerstart.h b/public/playerstart.h index cfc24fd..fa298cb 100644 --- a/public/playerstart.h +++ b/public/playerstart.h @@ -13,6 +13,7 @@ public: virtual void ReadParameter( const char *szName, const char *szValue ) override; virtual void Destroy( void ) override; virtual void Think( float fDelta ) override; + virtual void Sync( void *pData, uint32_t nDataSize ) override; virtual void RoundEnd( void ); virtual void RoundStart( IIClient *pClient ); diff --git a/public/rendering.h b/public/rendering.h index 2bdf6de..00f56c1 100644 --- a/public/rendering.h +++ b/public/rendering.h @@ -27,7 +27,7 @@ enum EImageFormat IMAGE_FORMAT_R32G32B32A32, IMAGE_FORMAT_DEPTH, - IMAGE_FORMAT_RENDERING = IMAGE_FORMAT_R8G8B8A8, + IMAGE_FORMAT_WINDOW, }; enum EImageUsage @@ -240,6 +240,8 @@ abstract_class ITexture { public: const char *szName; + uint32_t x; + uint32_t y; uint32_t id; }; @@ -352,6 +354,10 @@ public: static IImage *GetOutputImage(); }; +extern char g_bConfigNotify; +extern uint32_t g_nWindowWidth; +extern uint32_t g_nWindowHeight; + abstract_class IRenderingPipelineStep { public: diff --git a/public/server.h b/public/server.h index 8abd4aa..2fdd9fa 100644 --- a/public/server.h +++ b/public/server.h @@ -2,6 +2,7 @@ #define SERVER_H #include "tier0/platform.h" +#include "networking.h" interface IServer { @@ -17,6 +18,7 @@ abstract_class IIClient { public: uint64_t playerID; + uint32_t playerHandle; CBasePlayer *pBasePlayer; }; diff --git a/public/tier0/network.h b/public/tier0/network.h new file mode 100644 index 0000000..e437b83 --- /dev/null +++ b/public/tier0/network.h @@ -0,0 +1,12 @@ +#ifndef TIER0_NETWORK_H +#define TIER0_NETWORK_H + +#include "platform.h" +#include "steam/isteamnetworkingsockets.h" +#include "arpa/inet.h" + + +PLATFORM_INTERFACE void Net_Init(); +PLATFORM_INTERFACE void Net_Deinit(); + +#endif diff --git a/public/tier1/commandline.h b/public/tier1/commandline.h index 5b85624..2d48509 100644 --- a/public/tier1/commandline.h +++ b/public/tier1/commandline.h @@ -10,7 +10,7 @@ public: static void CreateCommandLine( int argc, char **argv ); static bool CheckParam( const char *psz ); - static char *ParamValue( const char* psz ); + static char *ParamValue( const char* psz, const char *szDefaultValue = 0 ); static void AddParam( char *psz ); static void RemoveParam( char *psz ); diff --git a/public/tier1/utlvector.h b/public/tier1/utlvector.h index a57b7a0..e84c31f 100644 --- a/public/tier1/utlvector.h +++ b/public/tier1/utlvector.h @@ -27,8 +27,11 @@ public: void AppendAt( size_t nIndex, const T *data, size_t n ); void RemoveHead(); + void RemoveHead( size_t n ); void RemoveTail(); + void RemoveTail( size_t n ); void RemoveAt( size_t nIndex ); + void RemoveAt( size_t nIndex, size_t n ); T *GetData( void ); size_t GetSize( void ); @@ -121,10 +124,17 @@ void CUtlVector::AppendHead( const T &data ) template void CUtlVector::AppendHead( const T *pData, size_t n ) { - size_t prevSize = m_data.GetSize(); - m_data.Resize(prevSize+n, n); - for ( size_t i = 0; i < n; i++ ) + size_t nOldSize = m_nSize; + m_data.Resize(m_nSize+n); + for (size_t i = nOldSize; i > 0; --i) + { + new (&m_data[i + n - 1]) T(m_data[i - 1]); + m_data[i - 1].~T(); + } + for (size_t i = 0; i < n; ++i) + { new (&m_data[i]) T(pData[i]); + } m_nSize+=n; } @@ -152,23 +162,71 @@ void CUtlVector::AppendAt( size_t nIndex, const T &data ) template void CUtlVector::AppendAt( size_t nIndex, const T *pData, size_t n ) { - + size_t nOldSize = m_nSize; + m_data.Resize(m_nSize+n); + for (size_t i = nOldSize; i > nIndex; --i) + { + new (&m_data[i + n - 1]) T(m_data[i - 1]); + m_data[i - 1].~T(); + } + for (size_t i = 0; i < n; ++i) + { + new (&m_data[nIndex + i]) T(pData[i]); + } + m_nSize+=n; } template void CUtlVector::RemoveHead() { - m_nSize--; + RemoveHead( 1 ); +} +template +void CUtlVector::RemoveHead( size_t n ) +{ + RemoveAt(0, n); } template void CUtlVector::RemoveTail() { - m_nSize--; + RemoveTail( 1 ); +} +template +void CUtlVector::RemoveTail( size_t n ) +{ + if (n > m_nSize) + n = m_nSize; + m_data.Resize(m_nSize-n); + m_nSize -= n; } template void CUtlVector::RemoveAt( size_t nIndex ) { - m_nSize--; + RemoveAt( nIndex, 1 ); +} +template +void CUtlVector::RemoveAt( size_t nIndex, size_t n ) +{ + if ( nIndex >= m_nSize ) + { + return; + } + if ( nIndex + n > m_nSize ) + { + n = m_nSize - nIndex; + } + for ( size_t i = nIndex; i < nIndex + n; i++ ) + { + m_data[i].~T(); + } + + size_t nElementsToMove = m_nSize - (nIndex + n); + for ( size_t i = 0; i < nElementsToMove; i++ ) + { + new (&m_data[nIndex + i]) T(m_data[nIndex + n + i]); + m_data[nIndex + n + i].~T(); + } + m_nSize -= n; } template diff --git a/tier0/__build.cpp b/tier0/__build.cpp index abc2e55..f839f94 100644 --- a/tier0/__build.cpp +++ b/tier0/__build.cpp @@ -8,6 +8,7 @@ CUtlVector tier0_CompiledFiles = { "tier0/lib.cpp", "tier0/mem.cpp", "tier0/platform.cpp", + "tier0/network.cpp", }; int tier0_build() diff --git a/tier0/network.cpp b/tier0/network.cpp new file mode 100644 index 0000000..9808862 --- /dev/null +++ b/tier0/network.cpp @@ -0,0 +1,18 @@ +#include "tier0/network.h" +#include "steam/isteamnetworkingsockets.h" +#include "steam/isteamnetworkingutils.h" +#include "steam/steamnetworkingtypes.h" +#include "tier1/commandline.h" + + + +void Net_Init() +{ + +} + +void Net_Deinit() +{ + +} + diff --git a/tier1/commandline.cpp b/tier1/commandline.cpp index a70fde2..794b501 100644 --- a/tier1/commandline.cpp +++ b/tier1/commandline.cpp @@ -19,19 +19,17 @@ bool ICommandLine::CheckParam( const char *psz ) return false; } -char *ICommandLine::ParamValue( const char *psz ) +char *ICommandLine::ParamValue( const char *psz, const char *szDefaultValue ) { int i = 0; for (auto szParam: cl_params) { i++; if (i>=cl_params.GetSize()) - { - return 0; - } + break; if (!V_strcmp(szParam, psz)) return cl_params[i]; } - return 0; + return (char*)szDefaultValue; } void ICommandLine::AddParam( char *psz ) diff --git a/tier1/utlstring.cpp b/tier1/utlstring.cpp index 46773ad..7323533 100644 --- a/tier1/utlstring.cpp +++ b/tier1/utlstring.cpp @@ -77,6 +77,10 @@ char *CUtlString::GetString( void ) { return m_data.GetData(); } +size_t CUtlString::GetLenght( void ) +{ + return V_strlen(GetString()); +} CUtlString::operator char*( void ) {