Original Post
Hi, Is there a way 'of forcing' SDL to render in another window? That is, does SDL provide a function where we could pass a window handle in? Thanks in advance
Quote:
Original post by Mari_p
Hi,
Is there a way 'of forcing' SDL to render in another window? That is, does SDL provide a function where we could pass a window handle in?
Thanks in advance
Quote:
Original post by lulul
why you want do that? why you don't create window with SDL?
Quote:
Original post by ciroknight
it can't even make its own window frame disappear, for example
Quote:
Original post by Mari_p
Hi,
Is there a way 'of forcing' SDL to render in another window? That is, does SDL provide a function where we could pass a window handle in?
Thanks in advance
Quote:
Original post by ciroknight
However, this shouldn't discourage you, especially if you're just using SDL to render something, then bring it into your program. It's entirely possible to have SDL draw everything to an off-screen buffer, then just grab that buffer and run with it (use it however you like). In theory, depending on the operating system, you could overwrite the pixel data of the other window or widget within a window with the pixel data from the SDL.
The function you're looking for is SDL_CreateRGBSurfaceFrom(), and for reference, the pixel data of an image surface is stored in SDL_Surface->pixels (so you could memcpy it, for example). These are nice to know, because sometimes you'll want to use a buffer you've already drawn something to in software and load it as an SDL_Surface, or if you're wanting to implement a screenshot routine, you can copy the pixel data and save it as a file.
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more