2013-09-15 20:54:01 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS
|
|
|
|
* FILE: dll/opengl/opengl32/dllmain.c
|
|
|
|
* PURPOSE: OpenGL32 DLL
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "opengl32.h"
|
|
|
|
|
|
|
|
BOOL WINAPI
|
|
|
|
DllMain(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved)
|
|
|
|
{
|
|
|
|
switch ( Reason )
|
|
|
|
{
|
|
|
|
case DLL_PROCESS_ATTACH:
|
2014-07-28 13:03:10 +00:00
|
|
|
/* Initialize Context list */
|
|
|
|
InitializeListHead(&ContextListHead);
|
|
|
|
/* no break */
|
2013-09-15 20:54:01 +00:00
|
|
|
case DLL_THREAD_ATTACH:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DLL_THREAD_DETACH:
|
2014-07-28 13:03:10 +00:00
|
|
|
/* Set NULL context for this thread */
|
|
|
|
wglMakeCurrent(NULL, NULL);
|
|
|
|
break;
|
2013-09-15 20:54:01 +00:00
|
|
|
case DLL_PROCESS_DETACH:
|
|
|
|
/* Clean up */
|
2014-07-28 13:03:10 +00:00
|
|
|
if (!Reserved)
|
|
|
|
{
|
|
|
|
/* The process is not shutting down: release everything */
|
|
|
|
wglMakeCurrent(NULL, NULL);
|
|
|
|
IntDeleteAllContexts();
|
|
|
|
IntDeleteAllICDs();
|
|
|
|
}
|
2013-09-15 20:54:01 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
2014-07-28 13:03:10 +00:00
|
|
|
}
|