Porting an SDL based app, but everything is blue

2 posts / 0 new
Last post
walkero
walkero's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2009-05-03 16:54
Porting an SDL based app, but everything is blue

Hello all,
I am experimenting the last couple of days on porting an application to AmigaOS 4. It is written in C and Lua, and uses SDL 2 for the window and drawing. This is the first port I am doing and especially something that uses SDL.

I managed to make it compile and run, but it is still very premature.
When I run it all the colours are off, and you can see that in the image below. That should be dark grey but it is blue :D

I assume this might have to do with endianess, but I am not sure what to check for. I checked if there is RGB specified somewhere on SDL code, but didn't find anything.

Also, when I resize the window, it seems the graphics are broken.

What I would like for now guys, is to ask you if there are any SDL defines that I should use or if you could point me in the right direction to understand where the problem is.

Thank you in advance.

IMAGE(https://amiga.gr/sites/default/files/galleries/admin/lite_001_20211214.png)

Hans
Hans's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2010-12-09 22:04
Re: Porting an SDL based app, but everything is blue

The blue may be an endianness issue. This typically happens when you put ARGB pixels into a BGRA bitmap; the Alpha channel ends up in Blue, making everything all blue.

The slanted graphics is typical of the rendering code having the wrong bytes per row vs the bitmap itself.

Join the Kea Campus - upgrade your skills; support my work; enjoy the Amiga corner.
https://keasigmadelta.com/ - see more of my work

Log in or register to post comments