Duplicating a surface [SDL]
Forum » Forums / Have Your Question Answered » Duplicating a surface [SDL]
started by: kake_fiskkake_fisk
on: 1257079186|%e %b %Y, %H:%M %Z|agohover
number of posts: 5
rss icon RSS: new posts
Duplicating a surface [SDL]
kake_fiskkake_fisk 1257079186|%e %b %Y, %H:%M %Z|agohover

Is it possible to duplicate the screen surface with SDL?

unfold Duplicating a surface [SDL] by kake_fiskkake_fisk, 1257079186|%e %b %Y, %H:%M %Z|agohover
Re: Duplicating a surface [SDL]
mr glassesmr glasses 1257103829|%e %b %Y, %H:%M %Z|agohover

What about with SFML too? (uni? ;-))

unfold Re: Duplicating a surface [SDL] by mr glassesmr glasses, 1257103829|%e %b %Y, %H:%M %Z|agohover
Re: Duplicating a surface [SDL]
u9u9 1257104764|%e %b %Y, %H:%M %Z|agohover

Again, in SFML it is really beautifully simple.

sf::Image copyOfImage = origImage;

This calls the copy constructor and you end up with a duplicate of the pixel data :) Note: I haven't actually tried it, but this is what i read. I have never had the need to duplicate an image

In SDL… hmm… let me think… You could try converting the surface (to the same format). That should give you a copy.

unfold Re: Duplicating a surface [SDL] by u9u9, 1257104764|%e %b %Y, %H:%M %Z|agohover
Re: Duplicating a surface [SDL]
mr glassesmr glasses 1257104917|%e %b %Y, %H:%M %Z|agohover

cool! Now I know if I ever need it. (I really need to get started on that chat program…:/)

unfold Re: Duplicating a surface [SDL] by mr glassesmr glasses, 1257104917|%e %b %Y, %H:%M %Z|agohover
Re: Duplicating a surface [SDL]
kake_fiskkake_fisk 1257287353|%e %b %Y, %H:%M %Z|agohover

Thanks, SDL_ConvertSurface worked. :)

last edited on 1257287364|%e %b %Y, %H:%M %Z|agohover by kake_fisk + show more
unfold Re: Duplicating a surface [SDL] by kake_fiskkake_fisk, 1257287353|%e %b %Y, %H:%M %Z|agohover
new post