[SDL] How do I apply a shader to a texture?
renesd at gmail.com
Fri Apr 30 06:24:34 PDT 2010
You'd also want texture coordinates returned. So that SDL is able to do
optimizations like texture packing in the background.
On Fri, Apr 30, 2010 at 1:54 PM, Pavel Kanzelsberger <kanzels at gmail.com>wrote:
> well basically I'm using SDL 1.3 because of textures and for all basic
> stuff like UI elements in a window are done using SDL functions. But for
> special textures that need shaders I have my own code.
> Then SDL 1.3 supports multiple windows and 1.2 doesn't, SDL 1.3 supports
> complex language text composition and input while 1.2 doesn't etc.
> But basically I agree with you that SDL 1.3 should somehow let you get the
> OpenGL texture if you need to perform some other GL operations on that
> texture... something like:
> GLuint *SDL_GetTextureHandle (SDL_TextureID *texture);
> On 30.4.2010, at 13:53, Johannes Kroll wrote:
>> On Fri, 30 Apr 2010 09:10:00 +0200
>> Pavel Kanzelsberger <kanzels at gmail.com> wrote:
>>> yes SDL textures are opaque types and could probably differ on various
>>> platforms. What I did was I wrote my own functions for creating
>>> textures, copying them to the screen and so on. That allows me to
>>> attach shaders or fragment programs to my textures.
>> Given that OpenGL is already cross-platform, and looking at the extra
>> effort you've done in this case... Is it really worth using the texture
>> management functions etc. of SDL 1.3?
>> Why not just use SDL 1.2 + GL? I always found that to work quite good.
>> If 1.3 should be useful, it has to be complete, which would include
>> lots of complex stuff like cross-platform (and cross-API) shader
>> support, some efficient way of cross-platform, cross-API
>> render-to-texture, and so on. But I guess SDL will never try to reach
>> that level of completeness. Such a library would be huge.
>> I'm kind of wondering where SDL is going - what's the point of using an
>> SDL with 3D functions if you still have to drop down to the native API
>> level for the more advanced stuff (which breaks the portability SDL
>> SDL mailing list
>> SDL at lists.libsdl.org
> Pavel Kanzelsberger
> E-Mail: pavel at kanzelsberger.com
> Jabber: kanzelsberger at jabber.org, ICQ: 20990633
> SDL mailing list
> SDL at lists.libsdl.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SDL