Browse Source

made templates work

alex 25 years ago
parent
commit
cf21c94a6b

File diff suppressed because it is too large
+ 100 - 1277
packages/opengl/build2/gl_w32d.tem


+ 5 - 9
packages/opengl/build2/gl_w32s.tem

@@ -188,6 +188,11 @@ const
 %GLProcsPS11
 {$ENDIF GL1_1}
 
+{$IFDEF GL1_2}
+%GLProcsPS12
+{$ENDIF GL1_2}
+
+
 // -------------------------------------------------------
 //   GL Extensions
 // -------------------------------------------------------
@@ -207,15 +212,6 @@ const
 {$endif MESA}
 
 
-// -------------------------------------------------------
-//   GL 1.2 Functions
-// -------------------------------------------------------
-
-{$IFDEF GL1_2}
-%GLProcsPS12
-{$ENDIF GL1_2}
-
-
 // =======================================================
 // =======================================================
 

+ 11 - 56
packages/opengl/build2/glut_w32d.tem

@@ -4,14 +4,13 @@ unit GLUT;
 
 interface
 
-uses GL;
-
-{$IFDEF Linux}
-  {$DEFINE gldecl := cdecl}
+{$IFDEF Win32}
+  {$DEFINE glut_dll := }
+  {$DEFINE gldecl := stdcall;}
+  {$DEFINE extdecl := stdcall;}
+  uses windows, GL;
 {$ELSE}
-  {$IFDEF Win32}
-    {$DEFINE gldecl := stdcall}
-  {$ENDIF}
+  {$MESSAGE Unsupported platform.}
 {$ENDIF}
 
 
@@ -27,60 +26,24 @@ var
 
 %GLUTDeclsIF
 
+var
 %GLUTProcsPD
 
 
 implementation
 
-{$IFDEF Linux}
-{$LINKLIB Xmu}
-type
-  HInstance = LongWord;
-
-function dlopen(AFile: PChar; mode: LongInt): Pointer; external 'dl';
-function dlclose(handle: Pointer): LongInt; external 'dl';
-function dlsym(handle: Pointer; name: PChar): Pointer; external 'dl';
-
-function LoadLibrary(name: PChar): HInstance;
-begin
-  Result := LongWord(dlopen(name, $101 {RTLD_GLOBAL or RTLD_LAZY}));
-end;
 
-procedure FreeLibrary(handle: HInstance);
-begin
-  dlclose(Pointer(handle));
-end;
-
-function GetProcAddress(handle: HInstance; name: PChar): Pointer;
-begin
-  Result := dlsym(Pointer(handle), name);
-  if Result = nil then WriteLn('Unresolved: ', name);
-end;
-
-{$ENDIF}
-
-{$IFDEF Win32}
 type
   HInstance = LongWord;
 
-function LoadLibrary(name: PChar): HInstance;
-begin
-  Result := 0;
-end;
-
-procedure FreeLibrary(handle: HInstance);
-begin
-end;
+var
+  libGLUT: HInstance;
 
-function GetProcAddress(handle: HInstance; name: PChar): Pointer;
+function GetProc(handle: HInstance; name: PChar): Pointer;
 begin
-  Result := NIL;
+  Result := GetProcAddress(handle, name);
   if Result = nil then WriteLn('Unresolved: ', name);
 end;
-{$ENDIF}
-
-var
-  libGLUT: HInstance;
 
 function InitGLUTFromLibrary(libname: PChar): Boolean;
 begin
@@ -97,15 +60,7 @@ end;
 
 function InitGLUT: Boolean;
 begin
-{$IFDEF Win32}
   Result := InitGLUTFromLibrary('glut32.dll');
-{$ELSE}
-  {$IFDEF Linux}
-  Result := InitGLUTFromLibrary('libglut.so');
-  {$ELSE}
-    {$ERROR Unsupported platform}
-  {$ENDIF}
-{$ENDIF}
 end;
 
 

+ 3 - 2
packages/opengl/build2/glut_w32s.tem

@@ -21,18 +21,19 @@
  This is necessary for supporting different platforms with different calling
  conventions via a single unit.}
 
-unit GLUT_SL; { version which does statically linking }
+unit GLUT; { version which does statically linking }
 
 
 interface
 
-uses GL_SL;
+uses GL;
 
 {x$DEFINE GLUT_GAME} {enable if you need game mode sub api}
 
 {$IFDEF Win32}
   {$DEFINE glut_dll := external 'glut32.dll'}
   {$DEFINE glut_callback := cdecl}
+  {$DEFINE extdecl := }
 {$ELSE}
   {$MESSAGE Unsupported platform.}
 {$ENDIF}

Some files were not shown because too many files changed in this diff