Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-06

Graphical differences between Mac OS X on Intel and PowerPC...

8 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Hi all,
I created an Universal Binary on Mac OS X 10.4.11 on an Intel Mac Book. This executes correctly and looks and behaves the way it was designed to work. This application ( GameMaker ) uses OpenGL and SDL for rendering.

I then got hold of a Mac Mini, G4 1.42Gz PowerPC, running 10.4.11. Running exactly the same Universal exe on the Mac Mini produces the correct behaviour, but an incorrect appearance. On the Mac Mini there seems to be serious issues with transparency and an overall pink tinge to the images produced on screen.

1. Has anyone seen this sort of thing before?
2. Could this be an OpenGL driver issue? If so, how do I update drivers on the Mac Mini because "Software Update" does not seem to pick up any new drivers for the graphics card.
3. Would anyone know if this a FPC issue or Lazarus related issue?
4. I've not ruled out the possibility that SDL may be causing this, so am investigating further.
5. Any other suggestions?

If it would help, I can create a bug report and attach a couple of screen-shots if anyone is interested.

Thanks,

Dominique.

Reply by email

Unknown author
to dmitry boyarintsev

Hi Dimtry,
I'll try and do so this evening. But the thing is that if I create the GM project on PowerPC and run it on Intel it looks fine. So my question is once the bitmap is loaded from HD or a stream, shouldn't it be identical once it is in memory regardless of if it is on Intel or PowerPC. Shouldn't the RTL or LCL handle those differences?

Dominique.

dmitry boyarintsev wrote 7 lines
It seems like you have texture pixels byte-order problem. You're trying to use Intel-ordered pixels for PowerPC machine. Could you make a small sample with the bug reproduced? thanks, dmitry

Reply by email

Marc Weustink
to Unknown author
Show quoted text 6 lines
Hi Dimtry, I'll try and do so this evening. But the thing is that if I create the GM project on PowerPC and run it on Intel it looks fine. So my question is once the bitmap is loaded from HD or a stream, shouldn't it be identical once it is in memory regardless of if it is on Intel or PowerPC. Shouldn't the RTL or LCL handle those differences?

The LCL should handle this, but as ong as we don't know what you are doing, we cannot tell what is wrong.

Marc

Reply by email

Unknown author
to Marc Weustink

I've narrowed it down to not being JEDI-SDL with OpenGL as that works fine on both Intel and PowerPC.

All that is left is it being the LCL, or more likely my code.

Dominique.

On Thu, 04 Jun 2009 11:28:12 +0200, Marc Weustink

Show quoted text 14 lines
wrote: > Hi Dimtry, > I'll try and do so this evening. But the thing is that if I create the > GM > project on PowerPC and run it on Intel it looks fine. > So my question is once the bitmap is loaded from HD or a stream, > shouldn't > it be identical once it is in memory regardless of if it is on Intel or > PowerPC. Shouldn't the RTL or LCL handle those differences? The LCL should handle this, but as ong as we don't know what you are doing, we cannot tell what is wrong. Marc

Reply by email

Unknown author
to Marc Weustink: The LCL should handle this, but as ong as we don't know what you are doing, we cannot…

I've narrowed down the surface creation error to the following block...

    {$IFDEF CPUPOWERPC}
    tempSurface := SDL_CreateRGBSurfaceFrom( aWordArray, aWidth, aHeight,
32, aWidth * 4, $FF000000, $00FF0000, $0000FF00, $000000FF );
    {$ENDIF}
    {$IFDEF CPUi386}
    tempSurface := SDL_CreateRGBSurfaceFrom( aWordArray, aWidth, aHeight,
32, aWidth * 4, $000000FF, $0000FF00, $00FF0000, $FF000000 );
    {$ENDIF}
    {$IFDEF CPUARM}
    tempSurface := SDL_CreateRGBSurfaceFrom( aWordArray, aWidth, aHeight,
32, aWidth * 4, $000000FF, $0000FF00, $00FF0000, $FF000000 );
    {$ENDIF}

The only one that works is the line in CPUi386. The CPUPOWERPC displays with the pink glitch I mentioned earlier and I'm not really concerned about CPUARM just yet.

Dominique.

On Thu, 04 Jun 2009 11:28:12 +0200, Marc Weustink

Show quoted text 20 lines
wrote: > Hi Dimtry, > I'll try and do so this evening. But the thing is that if I create the > GM > project on PowerPC and run it on Intel it looks fine. > So my question is once the bitmap is loaded from HD or a stream, > shouldn't > it be identical once it is in memory regardless of if it is on Intel or > PowerPC. Shouldn't the RTL or LCL handle those differences? The LCL should handle this, but as ong as we don't know what you are doing, we cannot tell what is wrong. Marc _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Mattias Gaertner
to Unknown author
Show quoted text 19 lines
I've narrowed down the surface creation error to the following block... {$IFDEF CPUPOWERPC} tempSurface := SDL_CreateRGBSurfaceFrom( aWordArray, aWidth, aHeight, 32, aWidth * 4, $FF000000, $00FF0000, $0000FF00, $000000FF ); {$ENDIF} {$IFDEF CPUi386} tempSurface := SDL_CreateRGBSurfaceFrom( aWordArray, aWidth, aHeight, 32, aWidth * 4, $000000FF, $0000FF00, $00FF0000, $FF000000 ); {$ENDIF} {$IFDEF CPUARM} tempSurface := SDL_CreateRGBSurfaceFrom( aWordArray, aWidth, aHeight, 32, aWidth * 4, $000000FF, $0000FF00, $00FF0000, $FF000000 ); {$ENDIF} The only one that works is the line in CPUi386. The CPUPOWERPC displays with the pink glitch I mentioned earlier and I'm not really concerned about CPUARM just yet.

Please tell how tempSurface is passed to the LCL.

You can see what image format the LCL uses with the following code:

procedure TMainForm.FormCreate(Sender: TObject);
var
  bmp: TBitmap;
  IntfImg: TLazIntfImage;
begin
  bmp:=TBitmap.Create;
  IntfImg:=bmp.CreateIntfImage;
  writeln(IntfImg.DataDescription.AsString);
  IntfImg.Free;
  bmp.Free;
end;

Keep in mind the the format depends on the source. A screen shot may have another format than a memory TBitmap.

Mattias

Show quoted text 33 lines
Dominique. On Thu, 04 Jun 2009 11:28:12 +0200, Marc Weustink wrote: > wrote: >> Hi Dimtry, >> I'll try and do so this evening. But the thing is that if I >> create the GM >> project on PowerPC and run it on Intel it looks fine. >> So my question is once the bitmap is loaded from HD or a stream, >> shouldn't >> it be identical once it is in memory regardless of if it is on >> Intel or PowerPC. Shouldn't the RTL or LCL handle those >> differences? > > The LCL should handle this, but as ong as we don't know what you > are doing, we cannot tell what is wrong. > > Marc > > > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Unknown author
to Mattias Gaertner
  s_w := bbb.Width;
  s_h:= bbb.Height;
  GetMem( s_data, s_h * s_w * 4 );
  ScanLineImage := bbb.CreateIntfImage;
  // Copy the data from the bitmap
  for j := 0 to s_h - 1 do
  begin
    row := ScanLineImage.GetDataLineStart( j );
    for i := 0 to s_w - 1 do
      s_data[ j * s_w + i ] := $ff000000 + $10000 * row[ i ].b + $100 *
row[ i ].g + row[ i ].r;
  end;
  ScanLineImage.Free;

Oh, Maybe I did not make it clear enough. tempSurfaces are used as textures during OpenGL calls.

So after the WordArray is converted to an SDL surface, I use the surface in OpenGL.

Dominique.

Mattias Gaertner wrote 85 lines
On Sun, 07 Jun 2009 06:50:30 -0400 wrote: > I've narrowed down the surface creation error to the following > block... > > {$IFDEF CPUPOWERPC} > tempSurface := SDL_CreateRGBSurfaceFrom( aWordArray, aWidth, > aHeight, 32, aWidth * 4, $FF000000, $00FF0000, $0000FF00, $000000FF ); > {$ENDIF} > {$IFDEF CPUi386} > tempSurface := SDL_CreateRGBSurfaceFrom( aWordArray, aWidth, > aHeight, 32, aWidth * 4, $000000FF, $0000FF00, $00FF0000, $FF000000 ); > {$ENDIF} > {$IFDEF CPUARM} > tempSurface := SDL_CreateRGBSurfaceFrom( aWordArray, aWidth, > aHeight, 32, aWidth * 4, $000000FF, $0000FF00, $00FF0000, $FF000000 ); > {$ENDIF} > > The only one that works is the line in CPUi386. The CPUPOWERPC > displays with the pink glitch I mentioned earlier and I'm not really > concerned about CPUARM just yet. Please tell how tempSurface is passed to the LCL. You can see what image format the LCL uses with the following code: procedure TMainForm.FormCreate(Sender: TObject); var bmp: TBitmap; IntfImg: TLazIntfImage; begin bmp:=TBitmap.Create; IntfImg:=bmp.CreateIntfImage; writeln(IntfImg.DataDescription.AsString); IntfImg.Free; bmp.Free; end; Keep in mind the the format depends on the source. A screen shot may have another format than a memory TBitmap. Mattias > > Dominique. > > On Thu, 04 Jun 2009 11:28:12 +0200, Marc Weustink > > wrote: > > wrote: > >> Hi Dimtry, > >> I'll try and do so this evening. But the thing is that if I > >> create the GM > >> project on PowerPC and run it on Intel it looks fine. > >> So my question is once the bitmap is loaded from HD or a stream, > >> shouldn't > >> it be identical once it is in memory regardless of if it is on > >> Intel or PowerPC. Shouldn't the RTL or LCL handle those > >> differences? > > > > The LCL should handle this, but as ong as we don't know what you > > are doing, we cannot tell what is wrong. > > > > Marc > > > > > > _______________________________________________ > > Lazarus mailing list > > > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email