Browse Source

fixed OpenGL to build for MorphOS and hopefully did not break anything in the process

git-svn-id: trunk@25521 -
Károly Balogh 12 years ago
parent
commit
81b6e1b9d9
2 changed files with 8 additions and 9 deletions
  1. 2 2
      packages/opengl/fpmake.pp
  2. 6 7
      packages/opengl/src/glu.pp

+ 2 - 2
packages/opengl/fpmake.pp

@@ -17,7 +17,7 @@ begin
     P.Directory:=ADirectory;
     P.Directory:=ADirectory;
 {$endif ALLPACKAGES}
 {$endif ALLPACKAGES}
     P.Version:='2.7.1';
     P.Version:='2.7.1';
-    P.OSes:=AllUnixOSes+[Win32,Win64]-[Android];
+    P.OSes:=AllUnixOSes+[Win32,Win64]+[MorphOS]-[Android];
 
 
     P.Dependencies.Add('x11',AllUnixOSes-[darwin,iphonesim]);
     P.Dependencies.Add('x11',AllUnixOSes-[darwin,iphonesim]);
     if Defaults.CPU<>arm then
     if Defaults.CPU<>arm then
@@ -27,7 +27,7 @@ begin
     P.IncludePath.Add('src');
     P.IncludePath.Add('src');
 
 
     T:=P.Targets.AddImplicitUnit('freeglut.pp',AllOSes-[morphos]);
     T:=P.Targets.AddImplicitUnit('freeglut.pp',AllOSes-[morphos]);
-    T:=P.Targets.AddUnit('glext.pp');
+    T:=P.Targets.AddUnit('glext.pp',AllOSes-[morphos]);
     T:=P.Targets.AddUnit('gl.pp');
     T:=P.Targets.AddUnit('gl.pp');
     T:=P.Targets.AddUnit('glu.pp');
     T:=P.Targets.AddUnit('glu.pp');
     T:=P.Targets.AddUnit('glut.pp');
     T:=P.Targets.AddUnit('glut.pp');

+ 6 - 7
packages/opengl/src/glu.pp

@@ -65,8 +65,8 @@ uses
   {$ENDIF}
   {$ENDIF}
   {$ENDIF}
   {$ENDIF}
   GL;
   GL;
-  
-Const                      
+
+Const
 {$IFDEF Windows}
 {$IFDEF Windows}
   GLU_Lib = 'glu32.dll';
   GLU_Lib = 'glu32.dll';
 {$ELSE}
 {$ELSE}
@@ -79,7 +79,9 @@ Const
 {$IFDEF haiku}
 {$IFDEF haiku}
   GLU_LIB = 'libGLU.so';
   GLU_LIB = 'libGLU.so';
 {$ELSE}
 {$ELSE}
-{$ifndef MorphOS}
+{$ifdef MorphOS}
+  GLU_LIB = 'tinygl.library';
+{$else}
   GLU_LIB = 'libGLU.so.1';
   GLU_LIB = 'libGLU.so.1';
 {$endif}
 {$endif}
 {$ENDIF}
 {$ENDIF}
@@ -429,7 +431,6 @@ implementation
 
 
   procedure Freeglu;
   procedure Freeglu;
     begin
     begin
-{$IFNDEF MORPHOS}
      if (hlib <> 0) then
      if (hlib <> 0) then
       FreeLibrary(hlib);
       FreeLibrary(hlib);
       gluBeginCurve:=nil;
       gluBeginCurve:=nil;
@@ -491,13 +492,11 @@ implementation
       gluTessVertex:=nil;
       gluTessVertex:=nil;
       gluUnProject:=nil;
       gluUnProject:=nil;
       gluUnProject4:=nil;
       gluUnProject4:=nil;
-{$ENDIF MORPHOS}
     end;
     end;
 
 
 
 
   procedure Loadglu(lib : pchar);
   procedure Loadglu(lib : pchar);
     begin
     begin
-{$IFDNDEF MORPHOS}
       Freeglu;
       Freeglu;
       hlib:=LoadLibrary(lib);
       hlib:=LoadLibrary(lib);
       if hlib=0 then
       if hlib=0 then
@@ -562,7 +561,6 @@ implementation
       pointer(gluTessVertex):=GetProcAddress(hlib,'gluTessVertex');
       pointer(gluTessVertex):=GetProcAddress(hlib,'gluTessVertex');
       pointer(gluUnProject):=GetProcAddress(hlib,'gluUnProject');
       pointer(gluUnProject):=GetProcAddress(hlib,'gluUnProject');
       pointer(gluUnProject4):=GetProcAddress(hlib,'gluUnProject4');
       pointer(gluUnProject4):=GetProcAddress(hlib,'gluUnProject4');
-{$ENDIF MORPHOS}
     end;
     end;
 
 
 
 
@@ -570,4 +568,5 @@ initialization
   LoadGLu(GLU_LIB);
   LoadGLu(GLU_LIB);
 finalization
 finalization
   Freeglu;
   Freeglu;
+{$ENDIF MORPHOS}
 end.
 end.