SDL 1.3 Roadmap

I like it! It might be a little bit tricky to implement, but that’s a very convenient API.

Well, I agree with the characteristics described by Mason Wheeler here. So here’s my suggested API. Also taking into consideration what was said about the difference between our suggestion and “Render targets”, we maybe should call them “Render Buffers”?

Code:

// Tells whether or not the renderer supports render buffer - since GL support will require 3.0+ context
bool SDL_RendererSupportsRenderBuffer(SDL_Renderer*);
// Make a render buffer
SDL_RenderBuffer* SDL_CreateRenderBuffer(Uint32 format, int w, int h);
// Get a render buffer from a window (important for the next function)
SDL_RenderBuffer* SDL_GetWindowRenderBuffer(SDL_Window*);
// Set the target to a render buffer, by default it should be the window’s render buffer
SDL_RenderSetTarget(SDL_RenderBuffer*);

This should be enough to work with, right?From: nfries88@yahoo.com (Nathaniel J Fries)
Subject: Re: [SDL] SDL 1.3 Roadmap

Ah! I forgot the one for buffer->buffer/window.
void SDL_RenderCopyBuffer(SDL_RenderBuffer* buffer, const SDL_Rect* srcrect, const SDL_Rect* destrect);
perhaps scaling and blendmodes on RenderBuffers, too?
int SDL_SetRenderBufferScaleMode(SDL_RenderBuffer* buffer, int scalemode);
int SDL_GetRenderBufferScaleMode(SDL_RenderBuffer* buffer, int* scalemode);
int SDL_SetRenderBufferBlendMode(SDL_RenderBuffer* buffer, int blendmode);
int SDL_GetRenderBufferBlendMode(SDL_RenderBuffer* buffer, int* blendmode);

nfries88 wrote:

Ah! I forgot the one for buffer->buffer/window.
int SDL_RenderCopyBuffer(SDL_RenderBuffer* buffer, const SDL_Rect* srcrect, const SDL_Rect* destrect);
perhaps scaling and blendmodes on RenderBuffers, too?
int SDL_SetRenderBufferScaleMode(SDL_RenderBuffer* buffer, int scalemode);
int SDL_GetRenderBufferScaleMode(SDL_RenderBuffer* buffer, int* scalemode);
int SDL_SetRenderBufferBlendMode(SDL_RenderBuffer* buffer, int blendmode);
int SDL_GetRenderBufferBlendMode(SDL_RenderBuffer* buffer, int* blendmode);

Really, though, anything else we could do for renderbuffers would just be the same as for a texture.

Good idea,

Took me some time to understand what you are doing but for a cross platform solution I bet it will work.

BUT

I came up with an iphone specfic solution, Not sure if there is a way to make it generic.

The iphone actually DOES let you create multiple windows, there are a few apps I know of in the app store that take advantage of this fact but not sdl, there are one or two apps that would like to get appstore approval that use this fact to display tv out, ie. display an image on the screen with overlays and everything but another to the tv out cable. Alas, they use undocumented api’s so the authors just have to sit an wait.

But the the fact that the iphone can have several uiwindows but can only have one window as keywindow is an advantage.

You can create the sdl window and the coaca window, complete with tabbars , navigation anything you want . You have to do some notifications and set some keys to try to make it generic but basically each window just takes turns becoming the key window.

There is a game api that uses a similar method,UNITY what it does it when it launches it shows the users a menu system, after the user does the initial setup and is ready to play the game the menu relinquishes control to Unity . When the player is within the unity system and decides to return to the menu system clicking a button sends a notification and sets a key . The notification is handled and the menu frontend once again becomes the key window.

My solution is quite similar to this, but SDL is not quite the black box Unity is, so I have more control over when to swap windows.