Wiki Page Content

Differences between revisions 2 and 3
Revision 2 as of 2010-01-10 19:10:38
Size: 535
Editor: SheenaSmith
Comment: added DRAFT to top for removal after page is edited
Revision 3 as of 2010-08-30 05:39:08
Size: 449
Editor: SheenaSmith
Comment: update content (w/ Sam); remove 'draft' note
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
||<tablewidth="100%"style="color: rgb(255, 0, 0); text-align: center;">DRAFT||
Line 16: Line 15:
{{{#!highlight cpp
You can add your code example here
}}}
<<Include(SDL_RenderClear, , , from="== Code Examples ==", to="== Remarks ==")>>
Line 23: Line 20:
== Related Functions ==

SDL_RenderPresent

Use this function to update the screen with rendering performed.

Syntax

void SDL_RenderPresent(void)

Code Examples

#include "SDL.h"

int main(int argc, char* argv[])
{
        SDL_Window* window;
        SDL_Renderer* renderer;

        /* Initialize SDL. */
        if (SDL_Init(SDL_INIT_VIDEO) < 0)
                return 1;

        /* Create the window where we will draw. */
        window = SDL_CreateWindow("SDL_RenderClear",
                        SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
                        512, 512,
                        0);

        /* We must call SDL_CreateRenderer in order for draw calls to affect this window. */
        renderer = SDL_CreateRenderer(window, -1, 0);

        /* Select the color for drawing. It is set to red here. */
        SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255);

        /* Clear the entire screen to our selected color. */
        SDL_RenderClear(renderer);

        /* Up until now everything was drawn behind the scenes.
           This will show the new, red contents of the window. */
        SDL_RenderPresent(renderer);

        /* Give us time to see the window. */
        SDL_Delay(5000);

        /* Always be sure to clean up */
        SDL_Quit();
        return 0;
}

Remarks

You can add useful comments here


CategoryAPI, CategoryVideo

None: SDL_RenderPresent (last edited 2015-02-19 20:26:23 by PhilippWiesemann)

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