SDL 1.2 only.
sdl at lists.libsdl.org
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
or, via email, send a message with subject or body ‘help’ to
sdl-request at lists.libsdl.org
You can reach the person managing the list at
sdl-owner at lists.libsdl.org
When replying, please edit your Subject line so it is more specific
than “Re: Contents of SDL digest…”
Today’s Topics:
- Layered Surfaces (Durama)
- Re: Layered Surfaces (Kenneth Bull)
- Re: Layered Surfaces (David Olofson)
- Re: Rotating iPhone to landscape, mouse messed up? (Ian Mallett)
- Re: Rotating iPhone to landscape, mouse messed up? (Ken Rogoway)
Message: 1
Date: Fri, 05 Nov 2010 14:20:27 -0700
From: “Durama”
To: sdl at lists.libsdl.org
Subject: [SDL] Layered Surfaces
Message-ID: <1288992027.m2f.25936 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”
I’ve been trying every possible way to do this and I cant seem to find a way that works. What I want to do is have a surface I draw multiple other surfaces to. For example my surfaces are…
(I’m using all PNG images)
SDL_Surface* player;
SDL_Surface* layers[7];
SDL_Surface* screen;
I have screen set up correct I know this for a fact because I have it working for the rest of the game.
At this point I try to apply the seven layers in order onto the player surface. Then once I do that apply it to the screen and flip it.
However the program always crashes. I assume its a problem with trying to apply the multiple surfaces to the player surface.
-------------- next part --------------
An HTML attachment was scrubbed…
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20101105/b6b01a43/attachment-0001.htm
Message: 2
Date: Fri, 5 Nov 2010 17:41:32 -0400
From: Kenneth Bull
To: sdl at lists.libsdl.org
Subject: Re: [SDL] Layered Surfaces
Message-ID:
<AANLkTiktvyyvb=S+K83XuJtU7KCM-m1XFdjHJXnFe1rJ at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
On 5 November 2010 17:20, Durama wrote:
I’ve been trying every possible way to do this and I cant seem to find a way
that works. What I want to do is have a surface I draw multiple other
surfaces to. For example my surfaces are…
(I’m using all PNG images)
SDL_Surface* player;
SDL_Surface* layers[7];
SDL_Surface* screen;
I have screen set up correct I know this for a fact because I have it
working for the rest of the game.
At this point I try to apply the seven layers in order onto the player
surface. Then once I do that apply it to the screen and flip it.
However the program always crashes. I assume its a problem with trying to
apply the multiple surfaces to the player surface.
You will need to post more code for us to see what might be causing the crash.
This seems like a very inefficient way of doing things though… As I
understand it, you’re blitting your sprites (or whatever) to each
layer, then blitting each layer (which is most likely the size of the
entire screen) to the player surface, which you’re then blitting to
the screen (instead of using SDL’s double buffering mechanism).
That’s at least 8 more very large blits than you actually need.
Message: 3
Date: Fri, 5 Nov 2010 22:48:42 +0100
From: David Olofson
To: sdl at lists.libsdl.org
Subject: Re: [SDL] Layered Surfaces
Message-ID: <201011052248.42418.david at olofson.net>
Content-Type: text/plain; charset=“iso-8859-15”
On Friday 05 November 2010, at 22.20.27, “Durama” wrote:
I’ve been trying every possible way to do this and I cant seem to find a
way that works. What I want to do is have a surface I draw multiple other
surfaces to. For example my surfaces are…
(I’m using all PNG images)
SDL_Surface* player;
SDL_Surface* layers[7];
SDL_Surface* screen;
I have screen set up correct I know this for a fact because I have it
working for the rest of the game.
One fundamental rule of programming: The fact that some code works in a
particular situation does not mean that the code is correct.
At this point I try to apply the seven layers in order onto the player
surface. Then once I do that apply it to the screen and flip it. However
the program always crashes.
Why? Where?
Without some debugger output or some code to look at, I don’t think there’s
much point even trying to make a guess as to what’s going on.
I assume its a problem with trying to apply
the multiple surfaces to the player surface.
That, however, I would pretty much rule out directly, unless you’re using
custom blitter code, or bypassing the “official” SDL API. SDL blitters will
clip off-surface areas and all, so at worst, all a mistake there will give you
is an incorrect result on your screen.
Are you getting NULL or corrupt pointers in somewhere? Any other code that
might be corrupting data?
–
//David Olofson - Consultant, Developer, Artist, Open Source Advocate
.— Games, examples, libraries, scripting, sound, music, graphics —.
| http://olofson.net http://olofsonarcade.com http://kobodeluxe.com |
’---------------------------------------------------------------------’
-------------- next part --------------
An HTML attachment was scrubbed…
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20101105/773e86ad/attachment-0001.htm
Message: 4
Date: Fri, 5 Nov 2010 16:15:34 -0600
From: Ian Mallett
To: sdl
Subject: Re: [SDL] Rotating iPhone to landscape, mouse messed up?
Message-ID:
<AANLkTikXo-=FO5PtX+VN6TLhUzDCwtVVtkTo3TFquc-+ at mail.gmail.com>
Content-Type: text/plain; charset=“iso-8859-1”
Hi,
I cannot profess knowledge about how iPhone development works, but you might
try rotating the modelview matrix by 90 instead of the projection matrix.
Put it directly after the glLoadIdentity() call. This should rotate your
world instead of doing something weird.
This isn’t really an SDL question though. Next time, ask some OpenGL
specific mailing list.
Thanks,
Ian
-------------- next part --------------
An HTML attachment was scrubbed…
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20101105/94c41ee5/attachment-0001.htm
Message: 5
Date: Fri, 5 Nov 2010 17:18:14 -0500
From: “Ken Rogoway”
To: “‘SDL Development List’”
Subject: Re: [SDL] Rotating iPhone to landscape, mouse messed up?
Message-ID: 062501cb7d37$57d23ba0$0776b2e0$@com
Content-Type: text/plain; charset=“us-ascii”
Actually Ian, this is a SDL question for a couple of reasons.
-
Handling Landscape mode has been on the iPhone task list for some
time.
-
One of the issues the poster listed was that his mouse input was
wrong. That should be handled by SDL, and is not an OpenGL issue.
Ken Rogoway
From: sdl-bounces at lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On
Behalf Of Ian Mallett
Sent: Friday, November 05, 2010 5:16 PM
To: sdl
Subject: Re: [SDL] Rotating iPhone to landscape, mouse messed up?
Hi,
I cannot profess knowledge about how iPhone development works, but you might
try rotating the modelview matrix by 90 instead of the projection matrix.
Put it directly after the glLoadIdentity() call. This should rotate your
world instead of doing something weird.
This isn’t really an SDL question though. Next time, ask some OpenGL
specific mailing list.
Thanks,
Ian
-------------- next part --------------
An HTML attachment was scrubbed…
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20101105/301f2806/attachment.htm
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
End of SDL Digest, Vol 47, Issue 10