Index: trunk/src/opengl/glu/glu32.rc
===================================================================
--- trunk/src/opengl/glu/glu32.rc	(revision 2699)
+++ trunk/src/opengl/glu/glu32.rc	(revision 2699)
@@ -0,0 +1,41 @@
+/* $Id: glu32.rc,v 1.1 2000-02-09 13:44:31 sandervl Exp $ */
+
+#include "winuser.h"
+#include "odinrsrc.h"
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version (based on NT 4 SP3)
+//
+
+1 VERSIONINFO
+ FILEVERSION ODIN_FILEVERSION
+ PRODUCTVERSION ODIN_PRODUCTVERSION
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0xaL
+ FILEOS 0x10001L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904E4"
+        BEGIN
+            VALUE "Comments", "Odin32 System Dll\0"
+            VALUE "CompanyName", "Silicon Graphics, Inc\0"
+            VALUE "FileDescription", "OpenGL Utility Library DLL\0"
+            VALUE "FileVersion", "4.00\0"
+            VALUE "InternalName", "glu32\0"
+            VALUE "LegalCopyright", "Copyright (C) 2000 Silicon Graphics, Inc\0"
+            VALUE "LegalTrademarks", "Copryright (C) Silicon Graphics, Inc\0"
+            VALUE "OriginalFilename", "glu32\0"
+            VALUE "ProductName", "Odin32 - GLU32\0"
+            VALUE "ProductVersion", "4.00\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+	VALUE "Translation", 0x409, 0x04E4
+    END
+END
Index: trunk/src/opengl/glu/initterm.cpp
===================================================================
--- trunk/src/opengl/glu/initterm.cpp	(revision 2697)
+++ 	(revision )
@@ -1,113 +1,0 @@
-/* $Id: initterm.cpp,v 1.1 2000-02-09 08:50:55 jeroen Exp $ */
-
-/*
- * DLL entry point
- *
- * Copyright 1998 Sander van Leeuwen
- * Copyright 1998 Peter Fitzsimmons
- *
- *
- * Project Odin Software License can be found in LICENSE.TXT
- *
- */
-
-/*-------------------------------------------------------------*/
-/* INITERM.C -- Source for a custom dynamic link library       */
-/*              initialization and termination (_DLL_InitTerm) */
-/*              function.                                      */
-/*                                                             */
-/* When called to perform initialization, this sample function */
-/* gets storage for an array of integers, and initializes its  */
-/* elements with random integers.  At termination time, it     */
-/* frees the array.  Substitute your own special processing.   */
-/*-------------------------------------------------------------*/
-
-
-/* Include files */
-#define  INCL_DOSMODULEMGR
-#define  INCL_DOSPROCESS
-#include <os2wrap.h>                   /* Odin32 OS/2 api wrappers         */
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <odin.h>
-#include <win32type.h>
-#include <odinlx.h>
-#include <misc.h>                      /* PLF Wed  98-03-18 23:18:15       */
-
-extern "C" {
-void CDECL _ctordtorInit( void );
-void CDECL _ctordtorTerm( void );
-}
-
-/*-------------------------------------------------------------------*/
-/* A clean up routine registered with DosExitList must be used if    */
-/* runtime calls are required and the runtime is dynamically linked. */
-/* This will guarantee that this clean up routine is run before the  */
-/* library DLL is terminated.                                        */
-/*-------------------------------------------------------------------*/
-static void APIENTRY cleanup(ULONG reason);
-
-
-/****************************************************************************/
-/* _DLL_InitTerm is the function that gets called by the operating system   */
-/* loader when it loads and frees this DLL for each process that accesses   */
-/* this DLL.  However, it only gets called the first time the DLL is loaded */
-/* and the last time it is freed for a particular process.  The system      */
-/* linkage convention MUST be used because the operating system loader is   */
-/* calling this function.                                                   */
-/****************************************************************************/
-unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long
-                                   ulFlag)
-{
-   size_t i;
-   APIRET rc;
-
-   /*-------------------------------------------------------------------------*/
-   /* If ulFlag is zero then the DLL is being loaded so initialization should */
-   /* be performed.  If ulFlag is 1 then the DLL is being freed so            */
-   /* termination should be performed.                                        */
-   /*-------------------------------------------------------------------------*/
-
-   switch (ulFlag) {
-      case 0 :
-         _ctordtorInit();
-
-         CheckVersionFromHMOD(PE2LX_VERSION, hModule);/* PLF Wed  98-03-18 05:28:48*/
-
-         /*******************************************************************/
-         /* A DosExitList routine must be used to clean up if runtime calls */
-         /* are required and the runtime is dynamically linked.             */
-         /*******************************************************************/
-
-         if(RegisterLxDll(hModule, 0, 0) == FALSE)
-                return 0UL;
-
-         rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);
-         if(rc)
-                return 0UL;
-         break;
-
-      case 1 :
-         UnregisterLxDll(hModule);
-         break;
-
-      default  :
-         return 0UL;
-   }
-
-   /***********************************************************/
-   /* A non-zero value must be returned to indicate success.  */
-   /***********************************************************/
-   return 1UL;
-}
-
-
-static void APIENTRY cleanup(ULONG ulReason)
-{
-   _ctordtorTerm();
-
-   DosExitList(EXLST_EXIT, cleanup);
-
-   return ;
-}
Index: trunk/src/opengl/glu/makefile
===================================================================
--- trunk/src/opengl/glu/makefile	(revision 2697)
+++ trunk/src/opengl/glu/makefile	(revision 2699)
@@ -1,3 +1,3 @@
-# $Id: makefile,v 1.3 2000-02-09 12:08:31 bird Exp $
+# $Id: makefile,v 1.4 2000-02-09 13:44:32 sandervl Exp $
 #
 # PD-Win32
@@ -33,5 +33,4 @@
 
 SOURCES = \
-  initterm.cpp \
   nurbs\interface\bezierEval.cpp \
   nurbs\interface\bezierPatch.cpp \
@@ -223,5 +222,6 @@
 
 OBJS = \
-  initterm.obj \
+  $(PDWIN32_LIB)/dllentry.obj \
+  resource.obj \
   nurbs\interface\bezierEval.obj \
   nurbs\interface\bezierPatch.obj \
@@ -314,5 +314,5 @@
   util\registry.obj
 
-$(TARGET).DLL: $(SOURCES) initterm.obj $(TARGET).lrf $(TARGET).def
+$(TARGET).DLL: $(SOURCES) resource.obj $(TARGET).lrf $(TARGET).def
     cd util
     $(MAKE_CMD)
@@ -344,6 +344,11 @@
         $(IMPDEF) $** $@
 
+resource.asm: $(TARGET).rc
+    $(RC) $(RCFLAGS) -o resource.asm $(TARGET).rc
+
+resource.obj: resource.asm
+
 clean:
-        $(RM) *.obj *.dll *.lib *.lrf
+        $(RM) *.obj *.dll *.lib *.lrf *exp.def resource.asm
         $(RM) $(PDWIN32_BIN)\$(TARGET).dll
         $(RM) $(PDWIN32_LIB)\$(TARGET).lib
Index: trunk/src/opengl/glut/Makefile
===================================================================
--- trunk/src/opengl/glut/Makefile	(revision 2697)
+++ trunk/src/opengl/glut/Makefile	(revision 2699)
@@ -1,3 +1,3 @@
-# $Id: Makefile,v 1.3 2000-02-09 12:08:32 bird Exp $
+# $Id: Makefile,v 1.4 2000-02-09 13:44:32 sandervl Exp $
 #
 # PD-Win32 API
@@ -39,5 +39,5 @@
        glut_tr24.obj glut_util.obj glut_vidresize.obj glut_warp.obj glut_win.obj \
        glut_winmisc.obj win32_glx.obj win32_menu.obj win32_util.obj win32_winproc.obj \
-       win32_x11.obj initterm.obj glut_term.obj
+       win32_x11.obj glut_term.obj $(PDWIN32_LIB)/dllentry.obj resource.obj
 
 all     : $(TARGET).DLL
@@ -53,4 +53,9 @@
 $(TARGET)exp.def: $(TARGET).def
         $(IMPDEF) $** $@
+
+resource.asm: $(TARGET).rc
+    $(RC) $(RCFLAGS) -o resource.asm $(TARGET).rc
+
+resource.obj: resource.asm
 
 win32_glx.obj: win32_glx.c os2_glx.h
@@ -111,8 +116,6 @@
 $(PDWIN32_LIB)\WINMM.LIB
 $(PDWIN32_LIB)\KERNEL32.LIB
-$(PDWIN32_LIB)\PMWINX.LIB
 $(PDWIN32_LIB)\GDI32.LIB
 $(PDWIN32_LIB)\USER32.LIB
-$(PDWIN32_LIB)\OPENGL32.LIB
 $(PDWIN32_LIB)\GLU32.LIB
 $(PDWIN32_LIB)\OPENGL32.LIB
@@ -122,5 +125,5 @@
 
 clean:
-        $(RM) *.obj *.lib *.dll *.map *.lrf
+        $(RM) *.obj *.lib *.dll *.map *.lrf *exp.def resource.asm
         $(RM) $(PDWIN32_BIN)\$(TARGET).dll
         $(RM) $(PDWIN32_LIB)\$(TARGET).lib
Index: trunk/src/opengl/glut/glut32.rc
===================================================================
--- trunk/src/opengl/glut/glut32.rc	(revision 2699)
+++ trunk/src/opengl/glut/glut32.rc	(revision 2699)
@@ -0,0 +1,40 @@
+/* $Id: glut32.rc,v 1.1 2000-02-09 13:44:32 sandervl Exp $ */
+
+#include "winuser.h"
+#include "odinrsrc.h"
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+//
+
+1 VERSIONINFO
+ FILEVERSION ODIN_FILEVERSION
+ PRODUCTVERSION ODIN_PRODUCTVERSION
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0xaL
+ FILEOS 0x10001L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904E4"
+        BEGIN
+            VALUE "Comments", "Odin32 System Dll\0"
+            VALUE "CompanyName", "\0"
+            VALUE "FileDescription", "OpenGL Utility Library DLL\0"
+            VALUE "FileVersion", "4.00\0"
+            VALUE "InternalName", "glut32\0"
+            VALUE "LegalCopyright", "Copyright (C) 2000 Mark J. Kilgard, Nate Robins & others\0"
+            VALUE "LegalTrademarks", "Copryright (C) Mark J. Kilgard, Nate Robins & others\0"
+            VALUE "OriginalFilename", "glut32\0"
+            VALUE "ProductName", "Odin32 - GLUT32\0"
+            VALUE "ProductVersion", "4.00\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+	VALUE "Translation", 0x409, 0x04E4
+    END
+END
Index: trunk/src/opengl/glut/initterm.cpp
===================================================================
--- trunk/src/opengl/glut/initterm.cpp	(revision 2697)
+++ 	(revision )
@@ -1,114 +1,0 @@
-/* $Id: initterm.cpp,v 1.2 2000-02-09 08:46:20 jeroen Exp $ */
-
-/*
- * DLL entry point
- *
- * Copyright 1998 Sander van Leeuwen
- * Copyright 1998 Peter Fitzsimmons
- *
- *
- * Project Odin Software License can be found in LICENSE.TXT
- *
- */
-
-/*-------------------------------------------------------------*/
-/* INITERM.C -- Source for a custom dynamic link library       */
-/*              initialization and termination (_DLL_InitTerm) */
-/*              function.                                      */
-/*                                                             */
-/* When called to perform initialization, this sample function */
-/* gets storage for an array of integers, and initializes its  */
-/* elements with random integers.  At termination time, it     */
-/* frees the array.  Substitute your own special processing.   */
-/*-------------------------------------------------------------*/
-
-
-/* Include files */
-#define  INCL_DOSMODULEMGR
-#define  INCL_DOSPROCESS
-#include <os2wrap.h>                   /* Odin32 OS/2 api wrappers         */
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <odin.h>
-#include <win32type.h>
-#include <odinlx.h>
-#include <misc.h>                      /* PLF Wed  98-03-18 23:18:15       */
-
-extern "C" {
-void CDECL _ctordtorInit( void );
-void CDECL _ctordtorTerm( void );
-}
-
-BOOL WINAPI Glut32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID ImpLoad);
-
-/*-------------------------------------------------------------------*/
-/* A clean up routine registered with DosExitList must be used if    */
-/* runtime calls are required and the runtime is dynamically linked. */
-/* This will guarantee that this clean up routine is run before the  */
-/* library DLL is terminated.                                        */
-/*-------------------------------------------------------------------*/
-static void APIENTRY cleanup(ULONG reason);
-
-/****************************************************************************/
-/* _DLL_InitTerm is the function that gets called by the operating system   */
-/* loader when it loads and frees this DLL for each process that accesses   */
-/* this DLL.  However, it only gets called the first time the DLL is loaded */
-/* and the last time it is freed for a particular process.  The system      */
-/* linkage convention MUST be used because the operating system loader is   */
-/* calling this function.                                                   */
-/****************************************************************************/
-unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long
-                                   ulFlag)
-{
-   size_t i;
-   APIRET rc;
-
-   /*-------------------------------------------------------------------------*/
-   /* If ulFlag is zero then the DLL is being loaded so initialization should */
-   /* be performed.  If ulFlag is 1 then the DLL is being freed so            */
-   /* termination should be performed.                                        */
-   /*-------------------------------------------------------------------------*/
-
-   switch (ulFlag) {
-      case 0 :
-         _ctordtorInit();
-
-         CheckVersionFromHMOD(PE2LX_VERSION, hModule);/* PLF Wed  98-03-18 05:28:48*/
-
-         /*******************************************************************/
-         /* A DosExitList routine must be used to clean up if runtime calls */
-         /* are required and the runtime is dynamically linked.             */
-         /*******************************************************************/
-
-         if(RegisterLxDll(hModule, Glut32LibMain, 0) == FALSE)
-                return 0UL;
-
-         rc = DosExitList(0x000F0000|EXLST_ADD, cleanup);
-         if(rc)
-                return 0UL;
-         break;
-
-      case 1 :
-         UnregisterLxDll(hModule);
-         break;
-
-      default  :
-         return 0UL;
-   }
-
-   /***********************************************************/
-   /* A non-zero value must be returned to indicate success.  */
-   /***********************************************************/
-   return 1UL;
-}
-
-
-static void APIENTRY cleanup(ULONG ulReason)
-{
-   _ctordtorTerm();
-
-   DosExitList(EXLST_EXIT, cleanup);
-
-   return ;
-}
Index: trunk/src/opengl/initterm.cpp
===================================================================
--- trunk/src/opengl/initterm.cpp	(revision 2697)
+++ trunk/src/opengl/initterm.cpp	(revision 2699)
@@ -1,3 +1,3 @@
-/* $Id: initterm.cpp,v 1.2 2000-02-01 19:41:55 sandervl Exp $ */
+/* $Id: initterm.cpp,v 1.3 2000-02-09 13:44:30 sandervl Exp $ */
 
 /*
@@ -33,4 +33,5 @@
 #include <odin.h>
 #include <win32type.h>
+#include <winconst.h>
 #include <odinlx.h>
 #include <misc.h>                      /* PLF Wed  98-03-18 23:18:15       */
@@ -41,15 +42,30 @@
 void CDECL _ctordtorInit( void );
 void CDECL _ctordtorTerm( void );
+
+ //Win32 resource table (produced by wrc)
+ extern DWORD _Resource_PEResTab;
 }
 
-/*-------------------------------------------------------------------*/
-/* A clean up routine registered with DosExitList must be used if    */
-/* runtime calls are required and the runtime is dynamically linked. */
-/* This will guarantee that this clean up routine is run before the  */
-/* library DLL is terminated.                                        */
-/*-------------------------------------------------------------------*/
-static void APIENTRY cleanup(ULONG reason);
+//******************************************************************************
+//******************************************************************************
+BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
+{
+   switch (fdwReason)
+   {
+   case DLL_PROCESS_ATTACH:
+	mod_init();
+	return TRUE;
 
+   case DLL_THREAD_ATTACH:
+   case DLL_THREAD_DETACH:
+	return TRUE;
 
+   case DLL_PROCESS_DETACH:
+   	mod_cleanup();
+   	_ctordtorTerm();
+	return TRUE;
+   }
+   return FALSE;
+}
 /****************************************************************************/
 /* _DLL_InitTerm is the function that gets called by the operating system   */
@@ -83,12 +99,7 @@
          /*******************************************************************/
 
-         if(RegisterLxDll(hModule, 0, 0) == FALSE)
+         if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE)
                 return 0UL;
 
-         rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);
-         if(rc)
-                return 0UL;
-
-         mod_init();
          break;
 
@@ -106,14 +117,2 @@
    return 1UL;
 }
-
-
-static void APIENTRY cleanup(ULONG ulReason)
-{
-   mod_cleanup();
-
-   _ctordtorTerm();
-
-   DosExitList(EXLST_EXIT, cleanup);
-
-   return ;
-}
Index: trunk/src/opengl/makefile
===================================================================
--- trunk/src/opengl/makefile	(revision 2697)
+++ trunk/src/opengl/makefile	(revision 2699)
@@ -1,3 +1,3 @@
-# $Id: makefile,v 1.4 2000-02-09 12:08:31 bird Exp $
+# $Id: makefile,v 1.5 2000-02-09 13:44:31 sandervl Exp $
 #
 # PD-Win32 API
@@ -35,5 +35,5 @@
 TARGET3 = glut\glut32
 
-OBJS1=  opengl32.obj initterm.obj
+OBJS1=  opengl32.obj initterm.obj resource.obj
 
 all: $(TARGET1).dll $(TARGET1).lib \
@@ -43,5 +43,5 @@
 $(TARGET1).dll: $(OBJS1) $(TARGET1).def
         $(LD) $(LDFLAGS) -Fm -Fe$@ $(OBJS1) $(TARGET1).def \
-              $(PDWIN32_LIB)/pmwinx.lib $(PDWIN32_LIB)/kernel32.lib \
+              $(PDWIN32_LIB)/gdi32.lib $(PDWIN32_LIB)/kernel32.lib \
               $(PDWIN32_LIB)/user32.lib $(PDWIN32_LIB)/odincrt.lib \
               OS2386.LIB $(RTLLIB_O)
@@ -55,4 +55,9 @@
 $(TARGET1)exp.def: $(TARGET1).def
         $(IMPDEF) $** $@
+
+resource.asm: $(TARGET1).rc
+    $(RC) $(RCFLAGS) -o resource.asm $(TARGET1).rc
+
+resource.obj: resource.asm
 
 $(TARGET2).dll:
@@ -70,5 +75,5 @@
 
 clean:
-        $(RM) *.obj *.lib *.dll *.map
+        $(RM) *.obj *.lib *.dll *.map resource.asm *exp.def
         $(RM) $(PDWIN32_BIN)\$(TARGET1).dll
         $(RM) $(PDWIN32_LIB)\$(TARGET1).lib
Index: trunk/src/opengl/opengl32.def
===================================================================
--- trunk/src/opengl/opengl32.def	(revision 2697)
+++ trunk/src/opengl/opengl32.def	(revision 2699)
@@ -1,3 +1,3 @@
-;/* $Id: opengl32.def,v 1.4 2000-02-09 08:50:54 jeroen Exp $ */
+;/* $Id: opengl32.def,v 1.5 2000-02-09 13:44:31 sandervl Exp $ */
 LIBRARY OPENGL32 INITINSTANCE
 
@@ -5,9 +5,4 @@
 
 IMPORTS
-   GetPixelFormat=GDI32.GetPixelFormat
-   DescribePixelFormat=GDI32.DescribePixelFormat
-   ChoosePixelFormat=GDI32.ChoosePixelFormat
-   SetPixelFormat=GDI32.SetPixelFormat
-   SwapBuffers=GDI32.SwapBuffers
    OS2glAccum=OPENGL.glAccum
    OS2glAlphaFunc=OPENGL.glAlphaFunc
@@ -369,9 +364,10 @@
 
 EXPORTS
-   GetPixelFormat
-   SetPixelFormat
-   ChoosePixelFormat
-   DescribePixelFormat
-   SwapBuffers
+   GetPixelFormat            = _GetPixelFormat@4
+   SetPixelFormat            = _SetPixelFormat@12
+   ChoosePixelFormat         = _ChoosePixelFormat@8
+   DescribePixelFormat       = _DescribePixelFormat@16
+   SwapBuffers               = _SwapBuffers@4
+
 ; NOTE: The Glmf** functions are NT specific. The are used to generate an
 ; enhanced meta-file in which OpenGL commands are stored.
Index: trunk/src/opengl/opengl32.rc
===================================================================
--- trunk/src/opengl/opengl32.rc	(revision 2699)
+++ trunk/src/opengl/opengl32.rc	(revision 2699)
@@ -0,0 +1,41 @@
+/* $Id: opengl32.rc,v 1.1 2000-02-09 13:44:31 sandervl Exp $ */
+
+#include "winuser.h"
+#include "odinrsrc.h"
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version (based on NT 4 SP3)
+//
+
+1 VERSIONINFO
+ FILEVERSION ODIN_FILEVERSION
+ PRODUCTVERSION ODIN_PRODUCTVERSION
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0xaL
+ FILEOS 0x10001L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904E4"
+        BEGIN
+            VALUE "Comments", "Odin32 System Dll\0"
+            VALUE "CompanyName", "Odin Team\0"
+            VALUE "FileDescription", "OpenGL Client DLL\0"
+            VALUE "FileVersion", "4.00\0"
+            VALUE "InternalName", "opengl32\0"
+            VALUE "LegalCopyright", "Copyright (C) 1999-2000\0"
+            VALUE "LegalTrademarks", "\0"
+            VALUE "OriginalFilename", "opengl32\0"
+            VALUE "ProductName", "Odin32 - OPENGL32\0"
+            VALUE "ProductVersion", "4.00\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+	VALUE "Translation", 0x409, 0x04E4
+    END
+END
