SDL
2.0
|
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include "SDL.h"
#include "SDL_stdinc.h"
#include "SDL_opengl.h"
Go to the source code of this file.
Functions | |
void | draw () |
void | save_surface_to_bmp () |
void | loop () |
int | main (int argc, char *argv[]) |
Variables | |
static SDL_Renderer * | renderer = NULL |
static SDL_Window * | window = NULL |
static int | done = SDL_FALSE |
static int | frame_number = 0 |
static int | width = 640 |
static int | height = 480 |
static int | max_frames = 200 |
void draw | ( | ) |
Definition at line 36 of file testoffscreen.c.
References frame_number, SDL_Rect::h, renderer, SDL_RenderClear, SDL_RenderFillRect, SDL_RenderPresent, SDL_SetRenderDrawColor, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by loop().
void loop | ( | ) |
Definition at line 77 of file testoffscreen.c.
References done, draw(), save_surface_to_bmp(), SDL_PollEvent, SDL_QUIT, and SDL_TRUE.
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 101 of file testoffscreen.c.
References done, frames, loop(), max_frames, NULL, renderer, SDL_CreateRenderer, SDL_CreateWindow, SDL_DestroyRenderer, SDL_DestroyWindow, SDL_FALSE, SDL_GetError, SDL_GetTicks(), SDL_Log, SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, SDL_LogSetPriority, SDL_Quit, SDL_RenderClear, SDL_VideoInit, and SDL_WINDOWPOS_UNDEFINED.
void save_surface_to_bmp | ( | ) |
Definition at line 55 of file testoffscreen.c.
References frame_number, NULL, renderer, SDL_CreateRGBSurface, SDL_FreeSurface, SDL_GetWindowID, SDL_GetWindowPixelFormat, SDL_PixelFormatEnumToMasks, SDL_RenderReadPixels, SDL_SaveBMP, and SDL_snprintf.
Referenced by loop().
|
static |
Definition at line 29 of file testoffscreen.c.
|
static |
Definition at line 30 of file testoffscreen.c.
Referenced by draw(), and save_surface_to_bmp().
|
static |
Definition at line 32 of file testoffscreen.c.
|
static |
Definition at line 33 of file testoffscreen.c.
Referenced by main().
|
static |
Definition at line 27 of file testoffscreen.c.
Referenced by draw(), main(), and save_surface_to_bmp().
|
static |
Definition at line 31 of file testoffscreen.c.
|
static |
Definition at line 28 of file testoffscreen.c.