1 lesson
This commit is contained in:
BIN
testSDL/Lesson1/hello.bmp
Normal file
BIN
testSDL/Lesson1/hello.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 900 KiB |
25
testSDL/Lesson1/main.cpp
Normal file
25
testSDL/Lesson1/main.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <SDL2/SDL.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
if (SDL_Init(SDL_INIT_EVERYTHING) != 0 )
|
||||
{
|
||||
cout << "SDL_Init error\n";
|
||||
return 1;
|
||||
}
|
||||
SDL_Window* window = SDL_CreateWindow("Hello World!", 100, 100, 640, 480, SDL_WINDOW_SHOWN);
|
||||
if (window == nullptr)
|
||||
{
|
||||
cout << "Window create error\n";
|
||||
return 1;
|
||||
}
|
||||
SDL_Renderer* renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED || SDL_RENDERER_PRESENTVSYNC);
|
||||
if (renderer == nullptr)
|
||||
{
|
||||
cout << "Renderer error\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user