[2.0.4]-How To Clip Standard SDL2 Drawing Area?

Hi,

I’ve been away a very long time…but I have returned to SDL2.
Is there a way to clip the standard SDL2 drawing area?
I wish to make a 4 player simultaneous game with 4 separate player screens.
How can I clip the SDL2 drawing area when drawing each individual player screen?
(all 4 player screens would be on one large game window)
Thanks!------------------------
JeZxLee
JessePalser <AT> GMail <DOT> com
16BitSoft Inc.
Video Game Design Studio
www.16BitSoft.com

JeZ-l-Lee wrote:

Hi,

I’ve been away a very long time…but I have returned to SDL2.
Is there a way to clip the standard SDL2 drawing area?
I wish to make a 4 player simultaneous game with 4 separate player screens.
How can I clip the SDL2 drawing area when drawing each individual player screen?
(all 4 player screens would be on one large game window)
Thanks!
Hi Again,

Would: “SDL_RenderSetViewport()” do the above?
https://wiki.libsdl.org/SDL_RenderSetViewport?highlight=(\bCategoryRender\b)|(CategoryEnum)|(CategoryStruct)
I don’t have a running alpha version to test it yet.
(will be using a modified version of the “TetriCrisis 4 110% A.I. Turbo” game engine)
Thanks!

Here is the title screen logo:
[Image: http://16bitsoft.com/images/stuff/Combat2601-Logo-A0.png ]
(made in Microsoft Office 2013 Publisher exported to NeoPaint 5)------------------------
JeZxLee
JessePalser <AT> GMail <DOT> com
16BitSoft Inc.
Video Game Design Studio
www.16BitSoft.com

SDL_RenderSetViewport() function will indeed do what you want. Check out this tutorial for more information: http://lazyfoo.net/tutorials/SDL/09_the_viewport/index.php

If you want clipping instead of a viewport, use SDL_RenderSetClipRect():
https://wiki.libsdl.org/SDL_RenderSetClipRect

Jonny DOn Sun, Jun 19, 2016 at 4:38 PM, Naith wrote:

SDL_RenderSetViewport() function will indeed do what you want. Check out
this tutorial for more information:
http://lazyfoo.net/tutorials/SDL/09_the_viewport/index.php


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org