Message-ID: <1378369163.m2f.39136 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”
Gabriel, Jonny D: I understand the need for simplicity, but a bare bones
system that is just one tiny step short of being great seems a bit
disappointing
Like you said, if it’s not “good enough”, people are forced
to write their own glue code or use an external library like yours. SDL 2
could have been a good occasion to actually have one standard implementation
that concentrated the effort. But again, I don’t know the whole story, nor
the design and development policies for SDL, so it’s probably easy for me to
say “it should have been better” 
Technically it could have been done better, but Valve presumably
wanted to use SDL pretty soon (and is currently paying Sam, which
makes things go MUCH faster than when he’s busy job-hunting
), so
an official release was needed. API development won’t stop here, this
is just where things were when the push-to-release was started.> Date: Thu, 05 Sep 2013 08:19:23 +0000
From: “Tenoch” <falzon.noe at gmail.com>
To: sdl at lists.libsdl.org
Subject: Re: [SDL] SDL_RenderCopyEx taking integer arguments…
Date: Thu, 5 Sep 2013 12:26:18 +0200
From: Jonas Kulla
To: SDL Development List
Subject: Re: [SDL] SDL_RenderCopyEx taking integer arguments…
Message-ID:
<CAK0i_72s56+focnRW2NQ9LVkfb9T77LV1kR1rcmtJ4f2UgTPow at mail.gmail.com>
Content-Type: text/plain; charset=“iso-8859-1”
Personally, I was very surprised that SDL 2.0 actually improved and
expanded their surface code,
I was expecting them to just deprecate and remove it to finally make OpenGL
the real and only path
for graphics programming. To me it still feels more like a “toy API” that’s
meant for getting your
feet wet with 2D programming.
Actually, it’s more intended to “reduce the platform specific stuff” a
lot more than to serve as an introduction to graphics. And why would
the surface code get thrown away? As I best recall, it’s actually used
in the software renderer.
Date: Thu, 5 Sep 2013 14:12:27 -0700 (PDT)
From: Mason Wheeler
To: SDL Development List
Subject: Re: [SDL] Mixing opengl and renderer?
Message-ID:
<1378415548.85568.YahooMailNeo at web122502.mail.ne1.yahoo.com>
Content-Type: text/plain; charset=“iso-8859-1”
Yes please.? There are several annoying little hacks I could take out of my
codebase if I had a SDL_PushRenderState() and SDL_PopRenderState(), or a
SDL_DeleteCachedRenderStateData() (needs a better name) at my disposal.
Mason
From: Sam Lantinga
To: SDL Development List
Sent: Thursday, September 5, 2013 12:18 PM
Subject: Re: [SDL] Mixing opengl and renderer?
It seems like that’s something we could do in SDL 2.0.1 if people are
interested.? Adding APIs in a minor revision is fine.
Perhaps something like SDL_InvalidateRenderState() would work as the name?
Date: Thu, 05 Sep 2013 23:01:46 +0000
From: “Sparks”
To: sdl at lists.libsdl.org
Subject: Re: [SDL] Mixing opengl and renderer?
Message-ID: <1378422106.m2f.39164 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”
Mason Wheeler wrote:
Looking at this code, I don’t see any reason why it should be expensive. A
simple linked list-based stack is trivial.
If you need to save all/most openGL states, not to mention all the matrix
modes, it becomes very expensive and if you have redundant state changes, it
becomes really, really messy.
Sure, a linked-list stack is trivial, but, saving & restoring a openGL state
is not a simple process, it must hit the driver to perform the task.
AFAIK the openGL video driver assumes people don’t do redundant state
changes, so when it gets a state change, it marks everything dirty, and it
does work to reset the dirty bit, which takes a long time which is why the
driver guys says don’t do it–ever!
That is why I said, it would be better to leave SDL2 out of this, and
continue to do what it does best (setup windows/screen/input/etc)
Actually, if someone wanted to add a lower-level rendering api for
“extension code” to interface with, then THIS part of it would just be
a matter of copying the data from one instance of a SDL-specific
datastructure, into another. Any time you want to load another state
you hand the appropriate instance to the proper function, it compares
SDL’s current state to the provided state, and changes what it needs
to. Any time you want to set some quirk of the state, you just call
the appropriate SDL function. It might even be possible to make it
work with DirectX, though I don’t know the apis for that and thus
can’t be certain.
The only real caveat with this approach is that code would need to be
written to use it, which might pose some problems with e.g. using Qt
in conjunction with SDL.
It seems to me what we really need is a way to override SDL2’s built in
stuff, and supply our own routines that do whatever (like using shaders on
SDL2’s draw routines),
I do think that some sort of “extension api” (probably as an official
add-on library, and maybe as a “permanent beta”) would be an excellent
idea. However, it would need to be designed.
or just have some kind of built in shader support
that we can turn on/off based on what we are drawing.
Something I’d love to do some day is build a translating-compiler to
take some generic shading language and translate it to whatever target
language (I even know what I’d use for the software renderer: TCC),
but there’s a catch: for shader support to be built-in, it probably
needs to work like how I just described. You’d probably need to write
a translating compiler to translate the SDL shader language to
whichever one your target renderer uses. This might be a small
project… but I wouldn’t want to place any bets.
Then again, it is
just easier to go full openGL to draw everything you need, and leave SDL 2
out of everything except creating the window/screen.
Well, in many ways, that IS it’s primary purpose.
Date: Thu, 5 Sep 2013 21:28:07 -0300
From: Sik the hedgehog <sik.the.hedgehog at gmail.com>
To: Mason Wheeler , SDL Development List
Subject: Re: [SDL] Mixing opengl and renderer?
Message-ID:
<CAEyBR+Ugy68Q=6aNAj4ozrs3P6XB+pKUC2XhgwynQBqToJ9rFw at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Or if you want to avoid all that (no idea how expensive querying the
state is!), you could just make the reset function take which stuff
was invalidated (taking this idea from how GCC handles clobbering with
inline asm, also how I implemented a ResetVideoEx function some days
ago for some framework).
“Take” as in “as a list of arguments”? That would certainly be one approach.
Date: Fri, 6 Sep 2013 11:18:08 +0200
From: Jonas Kulla
To: SDL Development List
Subject: Re: [SDL] SDL_RenderCopyEx taking integer arguments…
Message-ID:
<CAK0i_71xmFS8CNtnd4g2uX21x9ky1uKViCovFirc9DdKKsvAVw at mail.gmail.com>
Content-Type: text/plain; charset=“iso-8859-1”
2013/9/6 Sik the hedgehog <sik.the.hedgehog at gmail.com>
I guess the reason why SDL now has renderer functions is that before
everybody would complain about the fact you always needed to use
something else (which resulted in things like all of those being
redirected to things like SFML and such - though when I looked at SFML
I barfed immediately at how it handled the keyboard… yuck).
Are you referring to the fact that any time you query a key status, SFML
makes a connection and roundtrip to the XServer? =P
And yeah, what SDL had before was even simpler (mostly software blitting).
In wake of the more complex renderer API, I too would be in favor of what
Jonathan described, ie. factoring it out into something like SDL_render.
Too late, and besides which, then people would complain that it isn’t
a graphics library, because you can’t do anything other than image
manipulation (and that only if surfaces got left in). You could point
them over to your fancy SDL_render library that’s been pitched before,
but they’d already have a poor opinion (after all, if you’ve already
written it, then WHY is this FOUNDATIONAL capability not included?),
AND a large number would have already skipped it without visiting the
mailinglist or forums because they didn’t see any mention of graphics
rendering, and thus wrote SDL off as little better than vaporware.
Ideally it would be mentioned on the front page, along with SDL_image,
etc., but not only are none of the other directly-affiliated libraries
given prominent billing, the entire “libraries” page seems to have
floated away in the website redesign.
No, having a restricted capability in SDL is better than not.