The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
multiple textures and multiple renderers
Vittorio G.
Guest

in a 2 window and 2 renderers program, is it possible to use a single
texture for both renderers?
or is it possible to use a single renderer for both windows?

thanks
Vittorio
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
multiple textures and multiple renderers
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
Not right now.  I'm thinking that it would be useful to share textures between renderers, but as far as I know this is only possible on Direct3D as of Windows Vista, and you still have to have a separate handle to the texture even when you're sharing the same resource.

Does anybody know how/if this is possible to set up?

On Sun, Feb 13, 2011 at 5:01 AM, Vittorio G. wrote:
Quote:
in a 2 window and 2 renderers program, is it possible to use a single
texture for both renderers?
or is it possible to use a single renderer for both windows?

thanks
Vittorio
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org



--
    -Sam Lantinga, Founder and CEO, Galaxy Gameworks
multiple textures and multiple renderers
Kenneth Bull
Guest

On 13 February 2011 13:12, Sam Lantinga wrote:
Quote:
Not right now.  I'm thinking that it would be useful to share textures
between renderers, but as far as I know this is only possible on Direct3D as
of Windows Vista, and you still have to have a separate handle to the
texture even when you're sharing the same resource.

Does anybody know how/if this is possible to set up?

You could swap to system memory and back...

or, follow donBerto's suggestion here:
http://www.devmaster.net/forums/showthread.php?t=7497

Create an OpenGL context for the desktop and change the viewport,
rather than the GL context, for each window. Would involve a lot of
saving/restoring state though, since you'll probably want a separate
state per renderer.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
multiple textures and multiple renderers
Kenneth Bull
Guest

On 13 February 2011 14:09, Kenneth Bull wrote:
Quote:
Create an OpenGL context for the desktop and change the viewport,
rather than the GL context, for each window.  Would involve a lot of
saving/restoring state though, since you'll probably want a separate
state per renderer.

Actually, you could switch that around: bind a new window to an
existing renderer instead of binding a new renderer to a window. So
one renderer could be responsible for multiple windows.

Pretty sure you're still limited to one context per display device though.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
multiple textures and multiple renderers
Kenneth Bull
Guest

On 13 February 2011 14:09, Kenneth Bull wrote:
Quote:
On 13 February 2011 13:12, Sam Lantinga wrote:
Quote:
Not right now.  I'm thinking that it would be useful to share textures
between renderers, but as far as I know this is only possible on Direct3D as
of Windows Vista, and you still have to have a separate handle to the
texture even when you're sharing the same resource.

Does anybody know how/if this is possible to set up?

You could swap to system memory and back...

or, follow donBerto's suggestion here:
http://www.devmaster.net/forums/showthread.php?t=7497

Also, this:
(at the bottom)
http://stackoverflow.com/questions/452806/multiple-windows-in-opengl
http://msdn.microsoft.com/en-us/library/ms537565%28VS.85%29.aspx
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
multiple textures and multiple renderers
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
I know it can be done in OpenGL, but can it be done in Direct3D?

On Sun, Feb 13, 2011 at 11:33 AM, Kenneth Bull wrote:
Quote:
On 13 February 2011 14:09, Kenneth Bull wrote:

Quote:
On 13 February 2011 13:12, Sam Lantinga wrote:
Quote:
Not right now.  I'm thinking that it would be useful to share textures
between renderers, but as far as I know this is only possible on Direct3D as
of Windows Vista, and you still have to have a separate handle to the
texture even when you're sharing the same resource.

Does anybody know how/if this is possible to set up?

You could swap to system memory and back...

or, follow donBerto's suggestion here:
http://www.devmaster.net/forums/showthread.php?t=7497


Also, this:
(at the bottom)
http://stackoverflow.com/questions/452806/multiple-windows-in-opengl
http://msdn.microsoft.com/en-us/library/ms537565%28VS.85%29.aspx

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





--
    -Sam Lantinga, Founder and CEO, Galaxy Gameworks
multiple textures and multiple renderers
Kenneth Bull
Guest

On 13 February 2011 14:46, Sam Lantinga wrote:
Quote:
I know it can be done in OpenGL, but can it be done in Direct3D?

There's this for DirectX 8:
http://www.mvps.org/directx/articles/rendering_to_multiple_windows.htm

Again, you could (probably) use the desktop as the "parent frame".
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
multiple textures and multiple renderers
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
I don't think you can use the desktop.  I wonder if you can do this multiple top level windows anyway.  I also wonder what happens if each window is on a different display, each driven by a different video card.

Hmm, worth looking into, anybody want to volunteer?

On Sun, Feb 13, 2011 at 12:08 PM, Kenneth Bull wrote:
Quote:
On 13 February 2011 14:46, Sam Lantinga wrote:
Quote:
I know it can be done in OpenGL, but can it be done in Direct3D?


There's this for DirectX 8:
http://www.mvps.org/directx/articles/rendering_to_multiple_windows.htm

Again, you could (probably) use the desktop as the "parent frame".

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





--
    -Sam Lantinga, Founder and CEO, Galaxy Gameworks
multiple textures and multiple renderers
Vittorio G.
Guest

On Sun, Feb 13, 2011 at 10:52 PM, Sam Lantinga wrote:
Quote:
I don't think you can use the desktop.  I wonder if you can do this multiple
top level windows anyway.  I also wonder what happens if each window is on a
different display, each driven by a different video card.


before the removal of SDL_SetVideoDisplay i had a system with 3 top
level window each on different display (over 2 gpus)
then... only the last window created displayed anything

Vittorio
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org