Jonathan Dearborn
2013-04-07 23:44:55 UTC
Even if SDL_UpdateTexture() says that it is slow, I would try it anyway.
You might get a decent speed boost if you don't have to create texture
memory each frame. If you were using OpenGL, I'd say the same thing about
glTexSubImage2D().
Jonny D
You might get a decent speed boost if you don't have to create texture
memory each frame. If you were using OpenGL, I'd say the same thing about
glTexSubImage2D().
Jonny D
You might be interested in this<http://wiki.libsdl.org/moin.fcg/SDL_CreateSoftwareRenderer?highlight=%28%5CbCategoryRender%5Cb%29%7C%28CategoryEnum%29%7C%28CategoryStruct%29%7C%28SGFunctions%29>
.
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
.
I'm working on porting my Wolfenstein 3D source port from SDL1 over to
SDL2. One thing that isn't clear in the migration guide is how to handle
8-bit software rendering with SDL2.
Currently I have a 8-bit off screen surface which the engine renders to.
Previously I would just call SDL_BlitSurface to bring it on screen and
then finally SDL_Flip. Now it seems I have to use
SDL_CreateTextureFromSurface, SDL_RenderCopy, SDL_RenderPresent, and
finally SDL_DestroyTexture. On the surface this seems a lot less
efficient, but it could very well be what SDL1 was doing the whole time any
way since the performance seems to be roughly the same.
Is this the correct way to do things or is there a way I can reuse a
texture between frames? The other solutions I could think of are to either
write my own 8-bit to 32-bit code and use a streaming texture, possibly
avoiding the SDL_Surface altogether. I could also blit to an intermediate
surface to do the conversion and hope that the texture's pitch matches the
surface pitch and memcpy.
- Blzut3
______________________________**_________________
SDL mailing list
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.org<http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org>
_______________________________________________SDL2. One thing that isn't clear in the migration guide is how to handle
8-bit software rendering with SDL2.
Currently I have a 8-bit off screen surface which the engine renders to.
Previously I would just call SDL_BlitSurface to bring it on screen and
then finally SDL_Flip. Now it seems I have to use
SDL_CreateTextureFromSurface, SDL_RenderCopy, SDL_RenderPresent, and
finally SDL_DestroyTexture. On the surface this seems a lot less
efficient, but it could very well be what SDL1 was doing the whole time any
way since the performance seems to be roughly the same.
Is this the correct way to do things or is there a way I can reuse a
texture between frames? The other solutions I could think of are to either
write my own 8-bit to 32-bit code and use a streaming texture, possibly
avoiding the SDL_Surface altogether. I could also blit to an intermediate
surface to do the conversion and hope that the texture's pitch matches the
surface pitch and memcpy.
- Blzut3
______________________________**_________________
SDL mailing list
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.org<http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org>
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org