-
Notifications
You must be signed in to change notification settings - Fork 0
/
sdl2.cpp
53 lines (47 loc) · 1.15 KB
/
sdl2.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* =========================================================================
*
* FileName: sdl2.cpp
*
* Description:
*
* Version: 1.0
* Created: 2017-11-25 10:53:37
* Last Modified: 2017-12-09 13:58:44
* Revision: none
* Compiler: gcc
*
* Author: zt ()
* Organization:
*
* =========================================================================
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stddef.h>
#include <errno.h>
#include <unistd.h>
#include <iostream>
#include <memory>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <SDL2/SDL.h>
int main()
{
SDL_Window* window = 0;
SDL_Renderer* render = 0;
SDL_Init ( SDL_INIT_EVERYTHING );
window = SDL_CreateWindow ( "hello", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_SHOWN );
render = SDL_CreateRenderer ( window, -1, 0 );
SDL_SetRenderDrawColor ( render, 0, 255, 0, 255 );
SDL_RenderClear ( render );
SDL_RenderPresent ( render );
SDL_Delay ( 5000 );
SDL_DestroyWindow ( window );
SDL_DestroyRenderer ( render );
SDL_Quit();
return 0;
}