tag:blogger.com,1999:blog-3464110495317252246.post3465554759613028819..comments2023-04-03T06:21:56.542-07:00Comments on Programmer's Ranch: SDL2: Displaying text with SDL_ttfDaniel D'Agostinohttp://www.blogger.com/profile/03674104019613318379noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-3464110495317252246.post-14953240199725179382018-06-14T04:33:55.593-07:002018-06-14T04:33:55.593-07:00Thanks this helped alotThanks this helped alotAnonymoushttps://www.blogger.com/profile/08635552752371529282noreply@blogger.comtag:blogger.com,1999:blog-3464110495317252246.post-3744776984539935292017-07-18T16:29:44.962-07:002017-07-18T16:29:44.962-07:00This is by far the only tutorial that helped me. V...This is by far the only tutorial that helped me. Very useful and instructions are clear, easy to follow. Thank you for this!Anonymoushttps://www.blogger.com/profile/09546668416025258204noreply@blogger.comtag:blogger.com,1999:blog-3464110495317252246.post-74574272301866543982014-07-14T14:35:21.197-07:002014-07-14T14:35:21.197-07:00Check out the SDL2 Migration Guide:
https://wiki.l...Check out the SDL2 Migration Guide:<br />https://wiki.libsdl.org/MigrationGuide#If_your_game_wants_to_blit_surfaces_to_the_screen<br /><br />The paragraph at the end of this section says:<br /><br />"At this point, your 1.2 game had a bunch of SDL_Surfaces, which it would SDL_BlitSurface() to the screen surface to compose the final framebuffer, and eventually SDL_Flip() to the screen. For SDL 2.0, you have a bunch of SDL_Textures, that you will SDL_RenderCopy() to your Renderer to compose the final framebuffer, and eventually SDL_RenderPresent() to the screen. It's that simple. If these textures never need modification, you might find your framerate has just gone through the roof, too."<br /><br />So... yes, you'd RenderCopy() all your textures in a loop, but then do just one single RenderPresent() at the end.Daniel D'Agostinohttps://www.blogger.com/profile/03674104019613318379noreply@blogger.comtag:blogger.com,1999:blog-3464110495317252246.post-70947554113018033892014-07-13T21:39:24.670-07:002014-07-13T21:39:24.670-07:00Hello!
I'd like to know what I should do when...Hello!<br /><br />I'd like to know what I should do when using multiple Textures or sprites in a script. I can see you have used a RenderCopy call for that one texture. But surely when adding multiple textures, this becomes more complicated. The RenderCopy call takes only one. Would you need to nest a second while loop in the main loop, and iterate though a list or sequence of all existing sprites to render them? <br /><br />Sorry for asking so many questions. Unisunghttps://www.blogger.com/profile/18049827055238033524noreply@blogger.comtag:blogger.com,1999:blog-3464110495317252246.post-63989203880495086542014-07-12T10:17:51.574-07:002014-07-12T10:17:51.574-07:00Oh, I'm using a Python Wrapper for SDL2. So my...Oh, I'm using a Python Wrapper for SDL2. So my syntax is different. I posted the question on Stack Overflow last night, and it's been addressed here: http://stackoverflow.com/questions/24709312/pysdl2-renderer-or-window-surface-for-handling-colors-and-text/24710884#24710884Unisunghttps://www.blogger.com/profile/18049827055238033524noreply@blogger.comtag:blogger.com,1999:blog-3464110495317252246.post-2206851784067823262014-07-12T08:30:12.461-07:002014-07-12T08:30:12.461-07:00What is this window.refresh you mention? May be be...What is this window.refresh you mention? May be because of that. Can you send me your code so that I can take a look at it?Daniel D'Agostinohttps://www.blogger.com/profile/03674104019613318379noreply@blogger.comtag:blogger.com,1999:blog-3464110495317252246.post-28863386899781523692014-07-11T20:40:01.025-07:002014-07-11T20:40:01.025-07:00Hey, how do you deal with this when you've got...Hey, how do you deal with this when you've got a background to the Window? I've got a Window with a White background, and in my Event (while) loop, I keep calling Window.refresh and RenderPresent one after the other. This creates a flickering in my screen. Unisunghttps://www.blogger.com/profile/18049827055238033524noreply@blogger.com