#include <SDL2/SDL.h>
int main() {
SDL_Init(SDL_INIT_VIDEO);
SDL_Window* window = SDL_CreateWindow("Heart Drawing", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, SDL_WINDOW_SHOWN);
SDL_Renderer* renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255); // ตั้งสีเป็นแดง
// วาดรูปหัวใจ
SDL_RenderDrawLine(renderer, 400, 300, 300, 400);
SDL_RenderDrawLine(renderer, 300, 400, 400, 500);
SDL_RenderDrawLine(renderer, 400, 500, 500, 400);
SDL_RenderDrawLine(renderer, 500, 400, 400, 300);
SDL_RenderPresent(renderer);
SDL_Delay(5000); // รอเวลา 5 วินาที
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}
⛏🤛🏼