SDL Digest, Vol 79, Issue 69

Hi all,
I am trying to render a bmp file by using SDL 2.0.0 :

  1. Create the window by using : SDL_CreateWindow
  2. Load bmp file to SDL_Surface : SDL_LoadBMP
  3. Create a renderer : SDL_CreateRenderer

Now the problem is i don’t want to create SDL_Texture, I want to render
SDL_Surface directly to window by using SDL_RenderPresent,
But i am not able to figure out any way to do this.
Kindly provide some solution.

ThanksOn Mon, Jul 22, 2013 at 8:43 PM, wrote:

Send SDL mailing list submissions to
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:

  1. Re: SDL 2.0 init video fails, help! (Anthony Walter)
  2. Re: best method to create surfaces/textures (Jared Maddox)
  3. Re: (SDL2) Why is event timestamp not propagated from OS?
    (Jared Maddox)
  4. Re: Cocoa gurus: Bugzilla #1825…? (Eric Wing)
  5. Re: Playing multiple music by SDL2_mixer (Eric Wing)
  6. Re: Cocoa gurus: Bugzilla #1825…? (brada)
  7. Re: Cocoa gurus: Bugzilla #1825…? (brada)
  8. SDL2 RC tarballs packaged into rpm: core, image, ttf, smpeg,
    mixer, net (Juan Manuel B. C.)

Message: 1
Date: Sun, 21 Jul 2013 19:54:51 -0400
From: Anthony Walter
To: sdl
Subject: Re: [SDL] SDL 2.0 init video fails, help!
Message-ID:
<
CAHmPLWW4so1psHKvQ1XDBOK+9Lm0vvQzuRKWcya6Jmo2Ntjiag at mail.gmail.com>
Content-Type: text/plain; charset=“iso-8859-1”

This seems to have fixed it:

sudo apt-get build-dep libsdl1.2
-------------- next part --------------
An HTML attachment was scrubbed…
URL: <
http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130721/e82a4250/attachment-0001.htm


Message: 2
Date: Sun, 21 Jul 2013 19:58:15 -0500
From: Jared Maddox
To: sdl at lists.libsdl.org
Subject: Re: [SDL] best method to create surfaces/textures
Message-ID:
<
CABXS6_kbQ_1Qsei28k7krcERZPAreZJbSH3n_2SJ7Zo2_rzJrA at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Date: Sun, 21 Jul 2013 05:19:05 -0700
To: sdl at lists.libsdl.org
Subject: Re: [SDL] best method to create surfaces/textures
Message-ID: <1374409145.m2f.38161 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”

Just wondering, did I ask a silly question above? It’s had a lot of views
but no answers yet …

Views? Out of curiosity, are you using the forum? Most of the actual
activity seems to be on the mailinglist, and while the mailinglist and
the forum are automatically coordinated with each other, every once in
a while there does seem to be some bug in the system.

Date: Sun, 21 Jul 2013 20:13:35 -0300
From: Sik the hedgehog <sik.the.hedgehog at gmail.com>
To: sdl at lists.libsdl.org
Subject: Re: [SDL] best method to create surfaces/textures
Message-ID:
<
CAEyBR+UGAnw4yQD5dFRPXvbfXeJy+r84obE2PGWDhOuo0bNj+g at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

2013/7/21, neoaggelos :

And, NO, rendering a texture on a texture is not supported.

Wait what, wouldn’t that render SDL_SetRenderTarget pointless?

Yes, which makes me wonder what neo is basing that statement on.
Perhaps the intended meaning was “you can only render to renderers,
not to windows or textures”?


Message: 3
Date: Sun, 21 Jul 2013 20:13:13 -0500
From: Jared Maddox
To: sdl at lists.libsdl.org
Subject: Re: [SDL] (SDL2) Why is event timestamp not propagated from
OS?
Message-ID:
<CABXS6_mozUEF8VEXbCAz61FgyCjrt2WEfqOT7NJfm=
W8UU_m_w at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Date: Sat, 20 Jul 2013 08:49:11 -0700
From: “sts1hvnx”
To: sdl at lists.libsdl.org
Subject: Re: [SDL] (SDL2) Why is event timestamp not propagated from
OS?
Message-ID: <1374335350.m2f.38154 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”

Rainer Deyke wrote:

… If this works, t_offset should converge on a stable and correct
value.

I like it (though I detect a few minor mistakes in your code, such as
putting this in SDL_PumpEvents instead of SDL_PushEvent). I think this
would work well.

Some thoughts:

  1. I like having separate os_timestamp and sdl_timestamp. This way, if
    the
    application programmer wanted accurate event-event time differences, they
    could use the os_timestamp, and if they wanted accurate event-GetTicks
    time
    differences, they could use the sdl_timestamp. However, including both
    timestamps in SDL2’s event data structures would require changing their
    layout. Is this still a possibility at this late date?

I think that would depend on whether the SDL_Event copy function winds
up in the linker-stub or the dynamic-library:

  1. If it winds up in the dynamic library then we would need to add
    another set of event functions, so that the ABI didn’t get broken (the
    alternative is that you screw around with the contents of the stack,
    or wherever else you declared the event instance at);
  2. If it winds up in the linker-stub then the program will always be
    using the same copy function because it carries it around with itself,
    thereby causing anything added at the end of the current event
    structure to simply be ignored.

As for adding data members, as long as they go at the end of the
structure there shouldn’t ever be a problem inside of the structure
itself. That having been said, it would be nice to have a structure
member that carries the actual size of the event, so that e.g.
libraries that care about the extra data can know if it’s there or
not. Thus, if another set of event functions have to be added, perhaps
make them use a wrapper structure consisting of a size followed by the
actual SDL_Event instance?


Message: 4
Date: Sun, 21 Jul 2013 18:35:43 -0700
From: Eric Wing
To: SDL Development List
Subject: Re: [SDL] Cocoa gurus: Bugzilla #1825…?
Message-ID:
<
CA+Q62MAXHv8Jh4hGaqVyO7UdOtUBpnv6MjSwNxkDJEFWc2-YHQ at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

I don’t have a solution, but I isolated the cause. I updated the bug
information with what I found.

Thanks,
Eric

On 7/20/13, Ryan C. Gordon wrote:

Any Cocoa hackers out there that can give us some insight on this bug?

 http://bugzilla.libsdl.org/show_bug.cgi?id=1825

Basically: Closing a window in an SDL app doesn’t make the next
application window down in the z-order the key window. It’s not clear if
there’s some action we should have taken but failed to, or something
we’re doing that confuses Cocoa. Even the app’s “About” dialog won’t
bring the focus back to our app windows when you close it.

I’ve never seen another Mac OS X app that works like that, and Google
doesn’t even find discussion about window focus handling at all, which
means this is probably something usually automated that we threw a
wrench in.

It’s probably something simple, but I’ve run out of Google luck. Anyone
have any insight?

Thanks,
–ryan.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/


Message: 5
Date: Sun, 21 Jul 2013 18:42:08 -0700
From: Eric Wing
To: SDL Development List
Subject: Re: [SDL] Playing multiple music by SDL2_mixer
Message-ID:
<
CA+Q62MD2ACxwgG17u_Vpw7enrJDG5CfZ+APUKC3kAeP6dfHBkg at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

On 7/19/13, Sik the hedgehog <sik.the.hedgehog at gmail.com> wrote:

Isn’t the whole point of the music API that you would play only one
music at once?

Actually, no. Music cross-fading is one example, But the fundamental
problem is the API is misnamed. It is the distinction between streamed
and preloaded sounds that is important, not music vs. sound effects.

The most basic case that hits this problem is when you need both music
and (long) speech.

This was the motivating factor that led me to write ALmixer and do
away with the music vs. sound effects dichotomy and the split API.

http://playcontrol.net/opensource/ALmixer/

Thanks,
Eric

Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/


Message: 6
Date: Mon, 22 Jul 2013 07:13:55 -0700
From: “brada”
To: sdl at lists.libsdl.org
Subject: Re: [SDL] Cocoa gurus: Bugzilla #1825…?
Message-ID: <1374502435.m2f.38177 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”

Eric, [NSApp updateWindows] is useless by default. the NSWindow
implementation of update does nothing but post a notification.

you may be onto something with the runloop tho. I vaguely recall having
this problem with a game (an SDL 1.2 game at that) that was implementing
its own runloop; IIRC i worked around the problem by pigybacking on the
default runloop. I can try building that app with SDL2 and see if it still
works.

you can get an in-order-list of windows (sans some special windows) with
[NSApp orderedWindows] if it will help you work around the problem manually.

-------------- next part --------------
An HTML attachment was scrubbed…
URL: <
http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130722/cf8914cd/attachment-0001.htm


Message: 7
Date: Mon, 22 Jul 2013 07:34:00 -0700
From: “brada”
To: sdl at lists.libsdl.org
Subject: Re: [SDL] Cocoa gurus: Bugzilla #1825…?
Message-ID: <1374503640.m2f.38178 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”

one thing you are probably missing (i know erics sample code is) you need
to call [NSApp finishLaunching] before starting a runloop.

this article ("
http://www.cocoawithlove.com/2009/01/demystifying-nsapplication-by.html")
may provide some insight into the problem

-------------- next part --------------
An HTML attachment was scrubbed…
URL: <
http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130722/8025054a/attachment-0001.htm


Message: 8
Date: Mon, 22 Jul 2013 02:58:27 +0200
From: “Juan Manuel B. C.”
To: sdl
Subject: [SDL] SDL2 RC tarballs packaged into rpm: core, image, ttf,
smpeg, mixer, net
Message-ID:
Content-Type: text/plain; charset=“utf-8”

Meat:
URL: http://juanmabcblog.blogspot.com.es/2013/07/SDL2RCRPMS.html

Now for the fun part,

Stuff:
SDL2-2.0.0-1.i686.rpm
SDL2-debuginfo-2.0.0-1.i686.rpm
SDL2-devel-2.0.0-1.i686.rpm
SDL2_image-2.0.0-1.i686.rpm
SDL2_image-debuginfo-2.0.0-1.i686.rpm
SDL2_image-devel-2.0.0-1.i686.rpm
SDL2_mixer-2.0.0-1.i686.rpm
SDL2_mixer-debuginfo-2.0.0-1.i686.rpm
SDL2_mixer-devel-2.0.0-1.i686.rpm
SDL2_net-2.0.0-1.i686.rpm
SDL2_net-debuginfo-2.0.0-1.i686.rpm
SDL2_net-devel-2.0.0-1.i686.rpm
SDL2_ttf-2.0.12-1.i686.rpm
SDL2_ttf-debuginfo-2.0.12-1.i686.rpm
SDL2_ttf-devel-2.0.12-1.i686.rpm
smpeg2-2.0.0-1.i686.rpm
smpeg2-debuginfo-2.0.0-1.i686.rpm
smpeg2-devel-2.0.0-1.i686.rpm
SDL2-2.0.0-1.src.rpm
SDL2_image-2.0.0-1.src.rpm
SDL2_mixer-2.0.0-1.src.rpm
SDL2_net-2.0.0-1.src.rpm
SDL2_ttf-2.0.12-1.src.rpm
smpeg2-2.0.0-1.src.rpm

Complains:

  • some packages (i think all except core, have minor RPATH issues)
  • .txt is non standard compliant for README, COPYING, NEWS, … default
    packaging rules

Kudos:

  • Except from that minor issues all compiled and packaged nicely in no much
    time.

Details:

  • QA_CHECK_RPATHS=1
  • case “${QA_CHECK_RPATHS:-}” in
  • /usr/lib/rpm/check-rpaths

  • WARNING: ‘check-rpaths’ detected a broken RPATH and will cause ‘rpmbuild’
  •      to fail. To ignore these errors, you can set the '$QA_RPATHS'
    
  •      environment variable which is a bitmask allowing the values
    
  •      below. The current value of QA_RPATHS is 0x0000.
    
  • 0x0001 … standard RPATHs (e.g. /usr/lib); such RPATHs are a minor
  •           issue but are introducing redundant searchpaths without
    
  •           providing a benefit. They can also cause errors in multilib
    
  •           environments.
    
  • 0x0002 … invalid RPATHs; these are RPATHs which are neither absolute
  •           nor relative filenames and can therefore be a SECURITY risk
    
  • 0x0004 … insecure RPATHs; these are relative RPATHs which are a
  •           SECURITY risk
    
  • 0x0008 … the special ‘$ORIGIN’ RPATHs are appearing after other
  •           RPATHs; this is just a minor issue but usually unwanted
    
  • 0x0010 … the RPATH is empty; there is no reason for such RPATHs
  •           and they cause unneeded work while loading libraries
    
  • 0x0020 … an RPATH references ‘…’ of an absolute path; this will
    break
  •           the functionality when the path before '..' is a symlink
    
  • Examples:
    • to ignore standard and empty RPATHs, execute ‘rpmbuild’ like
  • $ QA_RPATHS=$[ 0x0001|0x0010 ] rpmbuild my-package.src.rpm
    • to check existing files, set $RPM_BUILD_ROOT and execute check-rpaths
      like
  • $ RPM_BUILD_ROOT= /usr/lib/rpm/check-rpaths

ERROR 0001: file ‘/usr/lib/libSDL2_image-2.0.so.0.0.0’ contains a
standard
rpath ‘/usr/lib’ in [/usr/lib]
error: Bad exit status from /var/tmp/rpm-tmp.8SXp6e (%install)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.8SXp6e (%install)



SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

End of SDL Digest, Vol 79, Issue 68


This is a major difference between SDL 1.2 and SDL 2.0. An SDL_Surface is
just a simple container for pixel data in RAM. You need to use a container
that an SDL_Renderer can use. That would be an SDL_Texture. Check out the
SDL_RenderCopy code example:
http://wiki.libsdl.org/moin.fcg/SDL_RenderCopy

Jonny DOn Mon, Jul 22, 2013 at 1:07 PM, Nitin Jain wrote:

Hi all,
I am trying to render a bmp file by using SDL 2.0.0 :

  1. Create the window by using : SDL_CreateWindow
  2. Load bmp file to SDL_Surface : SDL_LoadBMP
  3. Create a renderer : SDL_CreateRenderer

Now the problem is i don’t want to create SDL_Texture, I want to render
SDL_Surface directly to window by using SDL_RenderPresent,
But i am not able to figure out any way to do this.
Kindly provide some solution.

Thanks

OR, if someone wants so much to use the old BlitSurface() way, you can avoid using SDL_Renderer completely and get an ordinary SDL_Surface from the created window.

See the documentation for SDL_GetWindowSurface(), SDL_UpdateWindowRect(), AND, if you want to use the Render API to draw graphics also see SDL_CreateSoftwareRenderer().

[avoid the wiki, see the header files for documentation instead.]
SDL_GetWindowSurface(): SDL_video.h – Line 684
SDL_UpdateWindowSurface(): SDL_video.h – Line 694
SDL_CreateSoftwareRenderer(): SDL_render.h – Line 201

Hope it helps,On Mon, Jul 22, 2013 at 1:07 PM, Nitin Jain <nitz2407 at gmail.com (nitz2407 at gmail.com)> wrote:

Hi all,

I am trying to render a bmp file by using SDL 2.0.0 :

  1. Create the window by using : SDL_CreateWindow
  2. Load bmp file to SDL_Surface : SDL_LoadBMP
  3. Create a renderer : SDL_CreateRenderer

Now the problem is i don’t want to create SDL_Texture, I want to render SDL_Surface directly to window by using SDL_RenderPresent,
But i am not able to figure out any way to do this.
Kindly provide some solution.
?

Thanks


C is the God’s Programming Language

Don’t avoid the wiki! Fix it!

Jonny DOn Mon, Jul 22, 2013 at 2:45 PM, neoaggelos wrote:

**
OR, if someone wants so much to use the old BlitSurface() way, you can
avoid using SDL_Renderer completely and get an ordinary SDL_Surface from
the created window.

See the documentation for SDL_GetWindowSurface(), SDL_UpdateWindowRect(),
AND, if you want to use the Render API to draw graphics also see
SDL_CreateSoftwareRenderer().

[avoid the wiki, see the header files for documentation instead.]
SDL_GetWindowSurface(): SDL_video.h – Line 684
SDL_UpdateWindowSurface(): SDL_video.h – Line 694
SDL_CreateSoftwareRenderer(): SDL_render.h – Line 201

Hope it helps,

On Mon, Jul 22, 2013 at 1:07 PM, Nitin Jain <> wrote:

Quote:

Hi all,

I am trying to render a bmp file by using SDL 2.0.0 :

  1. Create the window by using : SDL_CreateWindow
  2. Load bmp file to SDL_Surface : SDL_LoadBMP
  3. Create a renderer : SDL_CreateRenderer

Now the problem is i don’t want to create SDL_Texture, I want to render
SDL_Surface directly to window by using SDL_RenderPresent,
But i am not able to figure out any way to do this.
Kindly provide some solution.

Thanks


C is the God’s Programming Language


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Yup, that sounds better :slight_smile:

Jonny D wrote:> Don’t avoid the wiki! ?Fix it!

Jonny D

On Mon, Jul 22, 2013 at 2:45 PM, neoaggelos <@Aggelos_Kolaitis (@Aggelos_Kolaitis)> wrote:

  OR, if someone wants so much to use the old BlitSurface() way, you can avoid using SDL_Renderer completely and get an ordinary SDL_Surface from the created window.

See the documentation for SDL_GetWindowSurface(), SDL_UpdateWindowRect(), AND, if you want to use the Render API to draw graphics also see SDL_CreateSoftwareRenderer().

[avoid the wiki, see the header files for documentation instead.]
SDL_GetWindowSurface(): SDL_video.h – Line 684
SDL_UpdateWindowSurface(): SDL_video.h – Line 694
SDL_CreateSoftwareRenderer(): SDL_render.h – Line 201

Hope it helps,

On Mon, Jul 22, 2013 at 1:07 PM, Nitin Jain <> wrote:

Quote:

Hi all,

I am trying to render a bmp file by using SDL 2.0.0 :

  1. Create the window by using : SDL_CreateWindow
  2. Load bmp file to SDL_Surface : SDL_LoadBMP
  3. Create a renderer : SDL_CreateRenderer

Now the problem is i don’t want to create SDL_Texture, I want to render SDL_Surface directly to window by using SDL_RenderPresent,
But i am not able to figure out any way to do this.
Kindly provide some solution.
?

Thanks

C is the God’s Programming Language


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)


C is the God’s Programming Language