|
SDLPainter 0.1.0
QPainter benzeri SDL3 + OpenGL/Vulkan 2D çizim kütüphanesi
|
Ana çizim sınıfı — QPainter'a benzer API. Ayrıntılar...
#include <painter.h>
Public Üye Fonksiyonlar | |
| Painter (SDL_Window *window, RendererBackend backend) | |
| Belirtilen pencere ve backend ile Painter oluştur. | |
| bool | IsValid () const noexcept |
| Renderer başarıyla başlatıldı mı? | |
| void | Begin () |
| Frame başlangıcı — her frame başında çağrılmalı. | |
| void | End () |
| Frame sonu — her frame sonunda çağrılmalı, ekrana sunar. | |
| void | Clear (const Color &color) |
| Ekranı belirtilen renkle temizle. | |
| void | SetPen (const Pen &pen) |
| Aktif kalemi ayarla (çizgi rengi ve kalınlığı). | |
| void | SetBrush (const Brush &brush) |
| Aktif fırçayı ayarla (dolgu rengi). | |
| void | SetFont (std::shared_ptr< Font > font) |
| Aktif fontu ayarla (Phase 4). | |
| void | SetOpacity (float alpha) |
| Global opaklığı ayarla [0.0, 1.0]. | |
| void | DrawLine (float x1, float y1, float x2, float y2) |
| İki nokta arasına çizgi çiz. | |
| void | DrawRect (float x, float y, float w, float h) |
| Dikdörtgen çerçeve çiz (dolgu yok). | |
| void | FillRect (float x, float y, float w, float h) |
| Dikdörtgeni doldur. | |
| void | DrawCircle (float cx, float cy, float radius) |
| Daire çerçeve çiz. | |
| void | FillCircle (float cx, float cy, float radius) |
| Daireyi doldur. | |
| void | DrawEllipse (float cx, float cy, float rx, float ry) |
| Elips çerçeve çiz. | |
| void | FillEllipse (float cx, float cy, float rx, float ry) |
| Elipsi doldur. | |
| void | DrawPolygon (const std::vector< Point > &points) |
| Çok kenarlı kapalı şeklin çerçevesini çiz. | |
| void | FillPolygon (const std::vector< Point > &points) |
| Çok kenarlıyı doldur (ear clipping tessellation). | |
| void | DrawPolyline (const std::vector< Point > &points) |
| Açık çizgi dizisi çiz. | |
| void | DrawImage (const Image &image, float x, float y) |
| Görüntüyü orijinal boyutuyla çiz. | |
| void | DrawImage (const Image &image, const Rect &dest_rect) |
| Görüntüyü hedef dikdörtgene ölçekleyerek çiz. | |
| void | DrawImage (const Image &image, const Rect &src_rect, const Rect &dest_rect) |
| Görüntünün kaynak dikdörtgenini hedef dikdörtgene çiz. | |
| void | DrawText (float x, float y, const std::string &text) |
| Noktaya metin çiz. | |
| void | DrawText (const Rect &rect, const std::string &text, Alignment alignment=Alignment::kLeft) |
| Dikdörtgen içine hizalanmış metin çiz. | |
| void | Save () |
| Mevcut render durumunu stack'e kaydet. | |
| void | Restore () |
| Son kaydedilen durumu geri yükle. | |
| void | Translate (float dx, float dy) |
| Öteleme uygula. | |
| void | Rotate (float angle_degrees) |
| Döndürme uygula (derece). | |
| void | Scale (float sx, float sy) |
| Ölçekleme uygula. | |
| void | ResetTransform () |
| Transform'u birim matrise sıfırla. | |
| void | SetClipRect (const Rect &rect) |
| Scissor kırpma dikdörtgeni ayarla. | |
| void | ClearClip () |
| Kırpma dikdörtgenini kaldır. | |
Ana çizim sınıfı — QPainter'a benzer API.
Painter, SDL penceresi üzerinde 2D çizim yapar. Backend (OpenGL/Vulkan) IRenderer arayüzü üzerinden soyutlanır.