Using both a GLContext and the Render API together |
Using both a GLContext and the Render API together |
Sam Lantinga
|
If you're using OpenGL and just want to load textures you shouldn't use the renderer, you should write your own OpenGL loading code. It's pretty straightforward and easy relative to the rest of the code you'll be writing.
The texture binding API was added for rare cases that I'll let other people explain. On Fri, Aug 9, 2013 at 12:22 PM, neoaggelos wrote:
|
|||||||||||||
|
Using both a GLContext and the Render API together |
gabomdq
|
2013/8/9 neoaggelos
What's currently in SDL_GL_BindTexture is a middle ground of sorts between the "load the texture yourself" camp, and the "lets's bloat this thing with features" camp Seriously though, I was the one that made that function. I use the SDL_Render* functions in my engine, and I integrate a couple of libraries which render via OpenGL (libRocket, the Spine runtime). Given that I'm already bringing in SDL, SDL_image, etc, I felt it was appropriate to save some time and effort and not re invent the wheel to load a few textures and set up a few shaders. Eventually, SDL_GL_BindTexture evolved into SDL_RenderGeometry http://bugzilla.libsdl.org/show_bug.cgi?id=1734 . I don't know if this patch will ever land in the official repo, perhaps it'll take a SDL_Render "spin off" (a satellite library of sorts) for things like this to be accepted. Regarding the "just get the index of the texture as a GLuint" part, if you look at the implementation on the three GL backends, you'll see that's not quite enough. -- Gabriel. |
|||||||||||||
|
Using both a GLContext and the Render API together |
john skaller
Guest
|
On 10/08/2013, at 9:18 AM, Gabriel Jacobo wrote:
I think this is a good compromise .. because I have a use for it myself I'm writing a text editor and currently I just TTF to create a surface and blit it to the window surface with a software renderer. However it would be more efficient to pre-load the character set into the GPU. So I will change my code to bind textures, still using the software renderer, then switch to hardware rendering. Without this functionality in SDL I could not follow such a nice migration path. Good for "Agile" (whatever that is The API I miss is filling triangles (more generally polygons). -- john skaller http://felix-lang.org _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|