85#ifndef OLC_PGEX_TRANSFORMEDVIEW_H
86#define OLC_PGEX_TRANSFORMEDVIEW_H
123 virtual void HandlePanAndZoom(
const int nMouseButton = 2,
const float fZoomRate = 0.1f,
const bool bPan =
true,
const bool bZoom =
true);
205 void DrawPolygonDecal(
olc::Decal* decal,
const std::vector<olc::vf2d>&pos,
const std::vector<olc::vf2d>&uv,
const std::vector<olc::Pixel> &tint);
209#if defined(OLC_USING_PGEX_SHADER)
236#ifdef OLC_PGEX_TRANSFORMEDVIEW
237#undef OLC_PGEX_TRANSFORMEDVIEW
406 return Draw({ x, y }, p);
416 DrawLine({ x1, y1 }, { x2, y2 }, p, pattern);
486 DrawSprite({ x, y }, sprite, { scalex, scaley }, flip);
499 olc::vi2d vScreenPixelStart = (vSpritePixelStart).max({0,0});
502 olc::vf2d vPixelStep = 1.0f / vSpriteScaledSize;
504 for (vPixel.
y = vScreenPixelStart.
y; vPixel.
y < vScreenPixelEnd.
y; vPixel.
y++)
506 for (vPixel.
x = vScreenPixelStart.
x; vPixel.
x < vScreenPixelEnd.
x; vPixel.
x++)
518 DrawPartialSprite({ x,y }, sprite, { ox,oy }, { w, h }, { scalex, scaley }, flip);
527 olc::vf2d vSpritePixelStep = 1.0f /
olc::vf2d(
float(sprite->width),
float(sprite->height));
529 olc::vf2d vScreenPixelStep = 1.0f / vSpriteScaledSize;
531 for (vPixel.
y = vStart.
y; vPixel.
y < vEnd.y; vPixel.
y++)
533 for (vPixel.
x = vStart.
x; vPixel.
x < vEnd.x; vPixel.
x++)
535 olc::vf2d vSample = ((
olc::vf2d(vPixel - vStart) * vScreenPixelStep) * size * vSpritePixelStep) +
olc::vf2d(sourcepos) * vSpritePixelStep;
536 pge->
Draw(vPixel, sprite->Sample(vSample.
x, vSample.
y));
552 auto StringPlot = [&col](
const int x,
const int y,
const olc::Pixel& pSource,
const olc::Pixel& pDest)
554 return pSource.r > 1 ? col : pDest;
567 int32_t ox = ((c - 32) % 16) * 8;
568 int32_t oy = ((c - 32) / 16) * 8;
594 std::vector<olc::vf2d> vTransformed(elements);
595 for (uint32_t n = 0; n < elements; n++)
602 std::array<olc::vf2d, 4> vTransformed =
628 std::array<olc::vf2d, 4> vTransformed =
684 std::vector<olc::vf2d> vTransformed(pos.size());
685 for (uint32_t n = 0; n < pos.size(); n++)
692 std::vector<olc::vf2d> vTransformed(pos.size());
693 for (uint32_t n = 0; n < pos.size(); n++)
700 std::vector<olc::vf2d> vTransformed(pos.size());
701 for (uint32_t n = 0; n < pos.size(); n++)
708#if defined (OLC_USING_PGEX_SHADER)
Definition olcPixelGameEngine.h:1113
Definition olcPixelGameEngine.h:1685
static PixelGameEngine * pge
Definition olcPixelGameEngine.h:1697
Definition olcPixelGameEngine.h:1278
void FillRectDecal(const olc::vf2d &pos, const olc::vf2d &size, const olc::Pixel col=olc::WHITE)
void GradientFillRectDecal(const olc::vf2d &pos, const olc::vf2d &size, const olc::Pixel colTL, const olc::Pixel colBL, const olc::Pixel colBR, const olc::Pixel colTR)
void DrawLine(int32_t x1, int32_t y1, int32_t x2, int32_t y2, Pixel p=olc::WHITE, uint32_t pattern=0xFFFFFFFF)
void DrawRect(int32_t x, int32_t y, int32_t w, int32_t h, Pixel p=olc::WHITE)
void DrawExplicitDecal(olc::Decal *decal, const olc::vf2d *pos, const olc::vf2d *uv, const olc::Pixel *col, uint32_t elements=4)
void DrawTriangle(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t x3, int32_t y3, Pixel p=olc::WHITE)
void DrawCircle(int32_t x, int32_t y, int32_t radius, Pixel p=olc::WHITE, uint8_t mask=0xFF)
void DrawPolygonDecal(olc::Decal *decal, const std::vector< olc::vf2d > &pos, const std::vector< olc::vf2d > &uv, const olc::Pixel tint=olc::WHITE)
void DrawRectDecal(const olc::vf2d &pos, const olc::vf2d &size, const olc::Pixel col=olc::WHITE)
void FillCircle(int32_t x, int32_t y, int32_t radius, Pixel p=olc::WHITE)
void DrawDecal(const olc::vf2d &pos, olc::Decal *decal, const olc::vf2d &scale={ 1.0f, 1.0f }, const olc::Pixel &tint=olc::WHITE)
void DrawWarpedDecal(olc::Decal *decal, const olc::vf2d(&pos)[4], const olc::Pixel &tint=olc::WHITE)
void DrawStringDecal(const olc::vf2d &pos, const std::string &sText, const Pixel col=olc::WHITE, const olc::vf2d &scale={ 1.0f, 1.0f })
void FillRect(int32_t x, int32_t y, int32_t w, int32_t h, Pixel p=olc::WHITE)
void DrawStringPropDecal(const olc::vf2d &pos, const std::string &sText, const Pixel col=olc::WHITE, const olc::vf2d &scale={ 1.0f, 1.0f })
void DrawPartialWarpedDecal(olc::Decal *decal, const olc::vf2d(&pos)[4], const olc::vf2d &source_pos, const olc::vf2d &source_size, const olc::Pixel &tint=olc::WHITE)
const olc::vi2d & GetMousePos() const
void DrawPartialDecal(const olc::vf2d &pos, olc::Decal *decal, const olc::vf2d &source_pos, const olc::vf2d &source_size, const olc::vf2d &scale={ 1.0f, 1.0f }, const olc::Pixel &tint=olc::WHITE)
virtual bool Draw(int32_t x, int32_t y, Pixel p=olc::WHITE)
int32_t GetMouseWheel() const
void DrawLineDecal(const olc::vf2d &pos1, const olc::vf2d &pos2, Pixel p=olc::WHITE)
int32_t ScreenWidth() const
void DrawPartialRotatedDecal(const olc::vf2d &pos, olc::Decal *decal, const float fAngle, const olc::vf2d ¢er, const olc::vf2d &source_pos, const olc::vf2d &source_size, const olc::vf2d &scale={ 1.0f, 1.0f }, const olc::Pixel &tint=olc::WHITE)
void DrawRotatedDecal(const olc::vf2d &pos, olc::Decal *decal, const float fAngle, const olc::vf2d ¢er={ 0.0f, 0.0f }, const olc::vf2d &scale={ 1.0f, 1.0f }, const olc::Pixel &tint=olc::WHITE)
int32_t ScreenHeight() const
HWButton GetMouse(uint32_t b) const
void FillTriangle(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t x3, int32_t y3, Pixel p=olc::WHITE)
Pixel::Mode GetPixelMode()
olc::Sprite * GetFontSprite()
void SetPixelMode(Pixel::Mode m)
Definition olcPGEX_Shaders.h:272
void DrawDecal(const olc::vf2d &pos, olc::Decal *decal, const olc::vf2d &scale={ 1.0f, 1.0f }, const olc::Pixel &tint=olc::WHITE)
void DrawPartialDecal(const olc::vf2d &pos, olc::Decal *decal, const olc::vf2d &source_pos, const olc::vf2d &source_size, const olc::vf2d &scale={ 1.0f, 1.0f }, const olc::Pixel &tint=olc::WHITE)
Definition olcPixelGameEngine.h:1071
Pixel Sample(float x, float y) const
int32_t height
Definition olcPixelGameEngine.h:1084
@ NONE
Definition olcPixelGameEngine.h:1086
int32_t width
Definition olcPixelGameEngine.h:1083
Definition olcPixelGameEngine.h:612
v_2d< float > vf2d
Definition olcPixelGameEngine.h:918
static const Pixel WHITE(255, 255, 255)
Definition olcPixelGameEngine.h:948
Mode
Definition olcPixelGameEngine.h:955
constexpr v_2d clamp(const v_2d &v1, const v_2d &v2) const
Definition olcPixelGameEngine.h:726
T x
Definition olcPixelGameEngine.h:623
T y
Definition olcPixelGameEngine.h:625
constexpr v_2d ceil() const
Definition olcPixelGameEngine.h:684
constexpr v_2d floor() const
Definition olcPixelGameEngine.h:678