Wiki Page Content

Differences between revisions 5 and 6
Revision 5 as of 2013-08-25 17:59:58
Size: 673
Comment: Corrected name in header.
Revision 6 as of 2014-01-03 20:53:25
Size: 1373
Editor: RyanGordon
Comment: Added code example and remarks.
Deletions are marked like this. Additions are marked like this.
Line 22: Line 22:
You can add your code example here
    if (SDL_GL_ExtensionSupported("GL_EXT_framebuffer_blit")) {
        draw_to_the_screen_with_framebuffer_blit(); // faster!
    } else {
        draw_to_the_screen_with_a_textured_quad(); // slower!
    }
Line 26: Line 32:
''You can add useful comments here''
Line 28: Line 33:
This function operates on the current GL context; you must have created a context and it must be current before calling this function. Do not assume that all contexts you create will have the same set of extensions available, or that recreating an existing context will offer the same extensions again.

While it's probably not a massive overhead, this function is not an O(1) operation. Check the extensions you care about after creating the GL context and save that information somewhere instead of calling the function every time you need to know.

SDL_GL_ExtensionSupported

Use this function to return true if an OpenGL extension is supported for the current context.

Syntax

SDL_bool SDL_GL_ExtensionSupported(const char* extension)

Function Parameters

extension

the name of the extension to check

Return Value

Returns SDL_TRUE if the extension is supported, SDL_FALSE otherwise.

Code Examples

    if (SDL_GL_ExtensionSupported("GL_EXT_framebuffer_blit")) {
        draw_to_the_screen_with_framebuffer_blit();   // faster!
    } else {
        draw_to_the_screen_with_a_textured_quad();  // slower!
    }

Remarks

This function operates on the current GL context; you must have created a context and it must be current before calling this function. Do not assume that all contexts you create will have the same set of extensions available, or that recreating an existing context will offer the same extensions again.

While it's probably not a massive overhead, this function is not an O(1) operation. Check the extensions you care about after creating the GL context and save that information somewhere instead of calling the function every time you need to know.


CategoryAPI, CategoryVideo

None: SDL_GL_ExtensionSupported (last edited 2016-05-14 22:02:31 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit