| CRM64Pro GDK v0.19.0 A free cross-platform game development kit built on top of SDL 3.0

Loading...
Searching...
No Matches
GFX
Graphics modules

## Description

GFX module providing generic graphics primitives, visual effects and utilities [v26.07.0].

### Overview

The GFX module provides a collection of generic graphics methods for drawing primitives, immediate visual effects and performing color conversions. Drawing methods are optimized for real-time effects when rendering to screens. When rendering to images, primitives write to the source surface and cached textures are synchronized lazily before the next screen render. Public packed color parameters use logical RGBA order: 0xRRGGBBAA. This is independent from SDL internal surface and texture formats such as SDL_PIXELFORMAT_ARGB8888. setSurfacePixel() and getSurfacePixel() are low-level SDL helpers and use the target SDL_Surface pixel format, not 0xRRGGBBAA.

### Key features

- Pixel operations: Direct pixel access on images and screens
- Line primitives: Horizontal, vertical and arbitrary line drawing
- Shape primitives: Rectangles, round rectangles, circles, ellipses and polygons
- Fill modes: Outlined and filled variants for all shapes
- Visual effects: Cached additive glow, radial glow, flash, custom Image/Sprite glow and 2D lightmap point/spot light helpers with occluders
- Color conversion: Multiple color space transformations

### Pixel operations

Get pixel | Read individual pixel color from an image or screen
Set pixel | Write individual pixel color to an image or screen

### Drawing primitives

Lines | Horizontal line, vertical line and arbitrary line
Rectangle | Outlined and filled rectangle
Round rectangle | Outlined and filled rectangle with rounded corners
Circle | Outlined and filled circle
Ellipse | Outlined and filled ellipse
Polygon | Outlined and filled polygon with arbitrary vertices

### Color conversions

RGB ↔ HSV | Red-Green-Blue to Hue-Saturation-Value
RGB ↔ YUV | Red-Green-Blue to Luminance-Chrominance
RGB ↔ YCC | Red-Green-Blue to Luminance-Chroma

### Performance considerations

Screen target | Fast enough for real-time effects
Image target | Writes the source surface and marks cached textures dirty. Texture upload happens lazily before the next screen render

### Best practices

- Prefer rendering to screens over images for real-time drawing effects
- Use horizontal and vertical line methods when applicable, they are faster than arbitrary lines
- Batch image-target drawing before rendering the image to merge dirty regions and reduce setup cost
- Use glow helpers for decorative emissive effects; they do not illuminate scene objects or cast shadows
- Use beginLighting(), drawLight()/drawSpotLight() and endLighting() after world rendering to apply 2D lightmap lighting before UI rendering
- Leverage color conversions for dynamic color manipulation effects (e.g., HSV for hue shifting)
- Pre-render complex shapes to images during loading rather than drawing them every frame
- Access the module exclusively through Main::gfx()

Note
  The GFX module is a singleton, automatically created once Main is instantiated. You can get a reference to this module using Main::gfx() method.
  The GFX module is automatically released when Main::terminate() is called. At this time, any resource still loaded will be released, avoiding resource leaks.

## Classes
class | CRM64Pro::GFX
| GFX class. More...

## Functions
bool | CRM64Pro::GFX::info (Sint32 iMode=0) override
| Request GFX module information.
bool | CRM64Pro::GFX::beginLighting (Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA=255, Sint32 idRes=0)
| Start a 2D lightmap rendering pass.
bool | CRM64Pro::GFX::addLightOccluderRect (float fX1, float fY1, float fX2, float fY2)
| Add a rectangular light occluder to the active lighting pass.
bool | CRM64Pro::GFX::addLightOccluderSegment (float fX1, float fY1, float fX2, float fY2)
| Add a segment light occluder to the active lighting pass.
bool | CRM64Pro::GFX::addLightOccluderCircle (float fX, float fY, float fRadius)
| Add a circular light occluder to the active lighting pass.
bool | CRM64Pro::GFX::addLightOccluderPolygon (const float *fVX, const float *fVY, Sint32 iNV)
| Add a polygon light occluder to the active lighting pass.
bool | CRM64Pro::GFX::drawLight (float fX, float fY, float fRadius, Uint32 iColor, float fIntensity=1.0f, bool bUseOccluders=true)
| Draw a point light into the active lighting pass.
bool | CRM64Pro::GFX::drawLight (float fX, float fY, float fRadius, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, float fIntensity=1.0f, bool bUseOccluders=true)
| Draw a point light into the active lighting pass.
bool | CRM64Pro::GFX::drawSpotLight (float fX, float fY, float fRadius, float fDirection, float fAngle, Uint32 iColor, float fIntensity=1.0f, bool bUseOccluders=true)
| Draw a spot light into the active lighting pass.
bool | CRM64Pro::GFX::drawSpotLight (float fX, float fY, float fRadius, float fDirection, float fAngle, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, float fIntensity=1.0f, bool bUseOccluders=true)
| Draw a spot light into the active lighting pass.
bool | CRM64Pro::GFX::endLighting ()
| Finish the active 2D lightmap rendering pass.
bool | CRM64Pro::GFX::setSurfacePixel (float fX, float fY, Uint32 iColor, SDL_Surface *pSurface)
| Draw a pixel in a surface.
Uint32 | CRM64Pro::GFX::getSurfacePixel (float fX, float fY, SDL_Surface *pSurface) const
| Get a pixel color from a surface.
bool | CRM64Pro::GFX::setPixel (float fX, float fY, Uint32 iColor, Sint32 idRes=0)
| Draw a pixel.
bool | CRM64Pro::GFX::setPixel (float fX, float fY, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
| Draw a pixel.
Uint32 | CRM64Pro::GFX::getPixel (float fX, float fY, Sint32 idRes=0) const
| Get a pixel color.
bool | CRM64Pro::GFX::lineH (float fX1, float fX2, float fY, Uint32 iColor, Sint32 idRes=0)
| Draw a horizontal line.
bool | CRM64Pro::GFX::lineH (float fX1, float fX2, float fY, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
| Draw a horizontal line.
bool | CRM64Pro::GFX::lineV (float fX, float fY1, float fY2, Uint32 iColor, Sint32 idRes=0)
| Draw a vertical line.
bool | CRM64Pro::GFX::lineV (float fX, float fY1, float fY2, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
| Draw a vertical line.
bool | CRM64Pro::GFX::line (float fX1, float fY1, float fX2, float fY2, Uint32 iColor, Sint32 idRes=0)
| Draw a line.
bool | CRM64Pro::GFX::line (float fX1, float fY1, float fX2, float fY2, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
| Draw a line.
bool | CRM64Pro::GFX::rect (float fX1, float fY1, float fX2, float fY2, Uint32 iColor, Sint32 idRes=0)
| Draw an outlined rectangle.
bool | CRM64Pro::GFX::rect (float fX1, float fY1, float fX2, float fY2, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
| Draw an outlined rectangle.
bool | CRM64Pro::GFX::rectFilled (float fX1, float fY1, float fX2, float fY2, Uint32 iColor, Sint32 idRes=0)
| Draw a filled rectangle.
bool | CRM64Pro::GFX::rectFilled (float fX1, float fY1, float fX2, float fY2, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
| Draw a filled rectangle.
bool | CRM64Pro::GFX::rectRound (float fX1, float fY1, float fX2, float fY2, float fRad, Uint32 iColor, Sint32 idRes=0)
| Draw a round outlined rectangle.
bool | CRM64Pro::GFX::rectRound (float fX1, float fY1, float fX2, float fY2, float fRad, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
| Draw a round outlined rectangle.
bool | CRM64Pro::GFX::rectFilledRound (float fX1, float fY1, float fX2, float fY2, float fRad, Uint32 iColor, Sint32 idRes=0)
| Draw a round filled rectangle.
bool | CRM64Pro::GFX::rectFilledRound (float fX1, float fY1, float fX2, float fY2, float fRad, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
| Draw a round filled rectangle.
bool | CRM64Pro::GFX::arc (float fX, float fY, float fRad, float fStart, float fEnd, Uint32 iColor, Sint32 idRes=0)
| Draw an arc.
bool | CRM64Pro::GFX::arc (float fX, float fY, float fRad, float fStart, float fEnd, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
| Draw an arc.
bool | CRM64Pro::GFX::circle (float fX, float fY, float fRad, Uint32 iColor, Sint32 idRes=0)
| Draw an outlined circle.
bool | CRM64Pro::GFX::circle (float fX, float fY, float fRad, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
| Draw an outlined circle.
bool | CRM64Pro::GFX::circleFilled (float fX, float fY, float fRad, Uint32 iColor, Sint32 idRes=0)
| Draw a filled circle.
bool | CRM64Pro::GFX::circleFilled (float fX, float fY, float fRad, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
| Draw a filled circle.
bool | CRM64Pro::GFX::drawGlow (float fX, float fY, float fRadius, Uint32 iColor, float fIntensity=1.0f, Sint32 idRes=0)
| Draw a soft additive glow.
bool | CRM64Pro::GFX::drawGlow (float fX, float fY, float fRadius, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, float fIntensity=1.0f, Sint32 idRes=0)
| Draw a soft additive glow.
bool | CRM64Pro::GFX::drawRadialGlow (float fX, float fY, float fInnerRadius, float fOuterRadius, Uint32 iColor, float fIntensity=1.0f, Sint32 idRes=0)
| Draw a soft additive radial glow with a solid inner radius.
bool | CRM64Pro::GFX::drawRadialGlow (float fX, float fY, float fInnerRadius, float fOuterRadius, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, float fIntensity=1.0f, Sint32 idRes=0)
| Draw a soft additive radial glow with a solid inner radius.
bool | CRM64Pro::GFX::drawFlash (float fX, float fY, float fRadius, Uint32 iColor, float fIntensity=1.0f, Sint32 idRes=0)
| Draw a short hot-center additive flash.
bool | CRM64Pro::GFX::drawFlash (float fX, float fY, float fRadius, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, float fIntensity=1.0f, Sint32 idRes=0)
| Draw a short hot-center additive flash.
bool | CRM64Pro::GFX::drawGlowImage (Sint32 idImage, float fX, float fY, float fScale, Uint32 iColor, float fIntensity=1.0f, Sint32 idRes=0)
| Draw an image as a tinted additive glow.
bool | CRM64Pro::GFX::drawGlowImage (Sint32 idImage, float fX, float fY, float fScale, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, float fIntensity=1.0f, Sint32 idRes=0)
| Draw an image as a tinted additive glow.
bool | CRM64Pro::GFX::drawGlowSprite (Sint32 idSprite, float fX, float fY, float fScale, Uint32 iColor, float fIntensity=1.0f, Sint32 idRes=0)
| Draw the current sprite frame as a tinted additive glow.
bool | CRM64Pro::GFX::drawGlowSprite (Sint32 idSprite, float fX, float fY, float fScale, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, float fIntensity=1.0f, Sint32 idRes=0)
| Draw the current sprite frame as a tinted additive glow.
bool | CRM64Pro::GFX::ellipse (float fX, float fY, float fRadX, float fRadY, Uint32 iColor, Sint32 idRes=0)
| Draw an outlined ellipse.
bool | CRM64Pro::GFX::ellipse (float fX, float fY, float fRadX, float fRadY, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
| Draw an outlined ellipse.
bool | CRM64Pro::GFX::ellipseFilled (float fX, float fY, float fRadX, float fRadY, Uint32 iColor, Sint32 idRes=0)
| Draw a filled ellipse.
bool | CRM64Pro::GFX::ellipseFilled (float fX, float fY, float fRadX, float fRadY, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
| Draw a filled ellipse.
bool | CRM64Pro::GFX::polygon (const float *fVX, const float *fVY, Sint32 iNV, Uint32 iColor, Sint32 idRes=0)
| Draw an outlined polygon.
bool | CRM64Pro::GFX::polygon (const float *fVX, const float *fVY, Sint32 iNV, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
| Draw an outlined polygon.
bool | CRM64Pro::GFX::polygonFilled (const float *fVX, const float *fVY, Sint32 iNV, Uint32 iColor, Sint32 idRes=0)
| Draw a filled polygon.
bool | CRM64Pro::GFX::polygonFilled (const float *fVX, const float *fVY, Sint32 iNV, Uint8 iR, Uint8 iG, Uint8 iB, Uint8 iA, Sint32 idRes=0)
| Draw a filled polygon.
bool | CRM64Pro::GFX::rgbToHSV (Uint8 iR, Uint8 iG, Uint8 iB, float *fH, float *fS, float *fV)
| Color conversion from RGB to HSV.
bool | CRM64Pro::GFX::hsvToRGB (float fH, float fS, float fV, Uint8 *iR, Uint8 *iG, Uint8 *iB)
| Color conversion from HSV to RGB.
bool | CRM64Pro::GFX::rgbToYUV (Uint8 iR, Uint8 iG, Uint8 iB, Uint8 *iY, Uint8 *iU, Uint8 *iV)
| Color conversion from RGB to YUV.
bool | CRM64Pro::GFX::yuvToRGB (Uint8 iY, Uint8 iU, Uint8 iV, Uint8 *iR, Uint8 *iG, Uint8 *iB)
| Color conversion from YUV to RGB.
bool | CRM64Pro::GFX::rgbToYCC (Uint8 iR, Uint8 iG, Uint8 iB, Uint8 *iY, Uint8 *iCb, Uint8 *iCr)
| Color conversion from RGB to YCC.
bool | CRM64Pro::GFX::yccToRGB (Uint8 iY, Uint8 iCb, Uint8 iCr, Uint8 *iR, Uint8 *iG, Uint8 *iB)
| Color conversion from YCC to RGB.

## Function Documentation

## ◆ info()

bool CRM64Pro::GFX::info | ( | Sint32 | iMode = 0 | ) |
| override

Request GFX module information.

Writes information to the default log.

Parameters

  iMode | Reserved for future use. Pass 0.

Returns
  true on success, or false on failure.

## ◆ beginLighting()

bool CRM64Pro::GFX::beginLighting | ( | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA = 255,
|  | Sint32 | idRes = 0 )

Start a 2D lightmap rendering pass.

Creates or reuses a screen-sized lightmap, clears it to the ambient color and redirects rendering to it. Draw the scene first, then call beginLighting(), optionally add light occluders, drawLight() or drawSpotLight() for each light and endLighting().

Parameters

  iR | Ambient red component. Lower values darken the scene.
  iG | Ambient green component. Lower values darken the scene.
  iB | Ambient blue component. Lower values darken the scene.
  iA | Ambient alpha stored in the lightmap. It does not affect the current MOD composite.
  idRes | a valid screen handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

Note
  Image targets are not supported by the lightmap pass in this version.
  Lighting modulates already-rendered scene content. It is different from glow helpers, which are decorative additive overlays and do not affect scene brightness.
  gfx.beginLighting(32, 32, 40);
  gfx.addLightOccluderRect(100.0f, 100.0f, 180.0f, 160.0f);
  gfx.drawLight(x, y, 180.0f, 255, 220, 160, 255);
  gfx.endLighting();

## ◆ addLightOccluderRect()

bool CRM64Pro::GFX::addLightOccluderRect | ( | float | fX1,
|  | float | fY1,
|  | float | fX2,
|  | float | fY2 )

Add a rectangular light occluder to the active lighting pass.

Parameters

  fX1 | X coordinate of the first rectangle corner.
  fY1 | Y coordinate of the first rectangle corner.
  fX2 | X coordinate of the opposite rectangle corner.
  fY2 | Y coordinate of the opposite rectangle corner.

Returns
  true on success, or false on failure.

Note
  Must be called between beginLighting() and endLighting(). Occluders are cleared by beginLighting().
  Coordinates are in the active render target coordinate space.

## ◆ addLightOccluderSegment()

bool CRM64Pro::GFX::addLightOccluderSegment | ( | float | fX1,
|  | float | fY1,
|  | float | fX2,
|  | float | fY2 )

Add a segment light occluder to the active lighting pass.

Parameters

  fX1 | X coordinate of the segment start.
  fY1 | Y coordinate of the segment start.
  fX2 | X coordinate of the segment end.
  fY2 | Y coordinate of the segment end.

Returns
  true on success, or false on failure.

Note
  Must be called between beginLighting() and endLighting(). Occluders are cleared by beginLighting().
  Coordinates are in the active render target coordinate space.

## ◆ addLightOccluderCircle()

bool CRM64Pro::GFX::addLightOccluderCircle | ( | float | fX,
|  | float | fY,
|  | float | fRadius )

Add a circular light occluder to the active lighting pass.

Parameters

  fX | X coordinate of the circle center.
  fY | Y coordinate of the circle center.
  fRadius | Circle radius in pixels. Must be greater than 0.

Returns
  true on success, or false on failure.

Note
  Must be called between beginLighting() and endLighting(). Occluders are cleared by beginLighting().
  Coordinates are in the active render target coordinate space.

## ◆ addLightOccluderPolygon()

bool CRM64Pro::GFX::addLightOccluderPolygon | ( | const float * | fVX,
|  | const float * | fVY,
|  | Sint32 | iNV )

Add a polygon light occluder to the active lighting pass.

Parameters

  fVX | Array of polygon vertex X coordinates. The array is not modified.
  fVY | Array of polygon vertex Y coordinates. The array is not modified.
  iNV | Number of vertices. Must be greater than or equal to 3.

Returns
  true on success, or false on failure.

Note
  Must be called between beginLighting() and endLighting(). Occluders are cleared by beginLighting().
  Coordinates are in the active render target coordinate space.

## ◆ drawLight() [1/2]

bool CRM64Pro::GFX::drawLight | ( | float | fX,
|  | float | fY,
|  | float | fRadius,
|  | Uint32 | iColor,
|  | float | fIntensity = 1.0f,
|  | bool | bUseOccluders = true )

Draw a point light into the active lighting pass.

Parameters

  fX | X coordinate of the light center.
  fY | Y coordinate of the light center.
  fRadius | Radius in pixels of the light. Must be greater than 0.
  iColor | The color value (0xRRGGBBAA).
  fIntensity | Brightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
  bUseOccluders | true to clip this light against active light occluders, false to ignore them. Default is true.

Returns
  true on success, or false on failure.

Note
  Must be called between beginLighting() and endLighting().
  This is a soft radial point light. Occlusion uses the immediate occluders submitted to the active lighting pass.

## ◆ drawLight() [2/2]

bool CRM64Pro::GFX::drawLight | ( | float | fX,
|  | float | fY,
|  | float | fRadius,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | float | fIntensity = 1.0f,
|  | bool | bUseOccluders = true )

Draw a point light into the active lighting pass.

Parameters

  fX | X coordinate of the light center.
  fY | Y coordinate of the light center.
  fRadius | Radius in pixels of the light. Must be greater than 0.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  fIntensity | Brightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
  bUseOccluders | true to clip this light against active light occluders, false to ignore them. Default is true.

Returns
  true on success, or false on failure.

Note
  Must be called between beginLighting() and endLighting().
  This is a soft radial point light. Occlusion uses the immediate occluders submitted to the active lighting pass.

## ◆ drawSpotLight() [1/2]

bool CRM64Pro::GFX::drawSpotLight | ( | float | fX,
|  | float | fY,
|  | float | fRadius,
|  | float | fDirection,
|  | float | fAngle,
|  | Uint32 | iColor,
|  | float | fIntensity = 1.0f,
|  | bool | bUseOccluders = true )

Draw a spot light into the active lighting pass.

Parameters

  fX | X coordinate of the light origin.
  fY | Y coordinate of the light origin.
  fRadius | Radius in pixels of the light. Must be greater than 0.
  fDirection | Direction in degrees. 0 points right, 90 points down.
  fAngle | Cone angle in degrees. Values greater than or equal to 360 behave like drawLight().
  iColor | The color value (0xRRGGBBAA).
  fIntensity | Brightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
  bUseOccluders | true to clip this light against active light occluders, false to ignore them. Default is true.

Returns
  true on success, or false on failure.

Note
  Must be called between beginLighting() and endLighting().
  This is a soft radial cone light with hard cone edges. Occlusion uses the immediate occluders submitted to the active lighting pass.

## ◆ drawSpotLight() [2/2]

bool CRM64Pro::GFX::drawSpotLight | ( | float | fX,
|  | float | fY,
|  | float | fRadius,
|  | float | fDirection,
|  | float | fAngle,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | float | fIntensity = 1.0f,
|  | bool | bUseOccluders = true )

Draw a spot light into the active lighting pass.

Parameters

  fX | X coordinate of the light origin.
  fY | Y coordinate of the light origin.
  fRadius | Radius in pixels of the light. Must be greater than 0.
  fDirection | Direction in degrees. 0 points right, 90 points down.
  fAngle | Cone angle in degrees. Values greater than or equal to 360 behave like drawLight().
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  fIntensity | Brightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
  bUseOccluders | true to clip this light against active light occluders, false to ignore them. Default is true.

Returns
  true on success, or false on failure.

Note
  Must be called between beginLighting() and endLighting().
  This is a soft radial cone light with hard cone edges. Occlusion uses the immediate occluders submitted to the active lighting pass.

## ◆ endLighting()

bool CRM64Pro::GFX::endLighting | ( |  | ) |

Finish the active 2D lightmap rendering pass.

Returns
  true on success, or false on failure.

Note
  Restores the previous render target and applies the accumulated lightmap over the screen selected by beginLighting().

## ◆ setSurfacePixel()

bool CRM64Pro::GFX::setSurfacePixel | ( | float | fX,
|  | float | fY,
|  | Uint32 | iColor,
|  | SDL_Surface * | pSurface )

Draw a pixel in a surface.

Parameters

  fX | X (horizontal) coordinate of the pixel.
  fY | Y (vertical) coordinate of the pixel.
  iColor | The color value of the pixel to draw, in the SDL_Surface pixel format (not 0xRRGGBBAA).
  pSurface | SDL_Surface pointer.

Returns
  true on success, or false on failure.

Note
  Invalid surfaces or out-of-bounds coordinates return false.
  When used on Image::getSurface(), call Image::markDirty() for the modified rectangle.

## ◆ getSurfacePixel()

Uint32 CRM64Pro::GFX::getSurfacePixel | ( | float | fX,
|  | float | fY,
|  | SDL_Surface * | pSurface ) const

Get a pixel color from a surface.

Parameters

  fX | X (horizontal) coordinate of the pixel.
  fY | Y (vertical) coordinate of the pixel.
  pSurface | SDL_Surface pointer.

Returns
  A Uint32 iValue with the raw pixel value in the SDL_Surface pixel format.

Note
  Invalid surfaces or out-of-bounds coordinates return 0.

## ◆ setPixel() [1/2]

bool CRM64Pro::GFX::setPixel | ( | float | fX,
|  | float | fY,
|  | Uint32 | iColor,
|  | Sint32 | idRes = 0 )

Draw a pixel.

Parameters

  fX | X (horizontal) coordinate of the pixel.
  fY | Y (vertical) coordinate of the pixel.
  iColor | The color value of the pixel to draw (0xRRGGBBAA).
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ setPixel() [2/2]

bool CRM64Pro::GFX::setPixel | ( | float | fX,
|  | float | fY,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | Sint32 | idRes = 0 )

Draw a pixel.

Parameters

  fX | X (horizontal) coordinate of the pixel.
  fY | Y (vertical) coordinate of the pixel.
  iR | The red color value of the pixel to draw.
  iG | The green color value of the pixel to draw.
  iB | The blue color value of the pixel to draw.
  iA | The alpha value of the pixel to draw.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ getPixel()

Uint32 CRM64Pro::GFX::getPixel | ( | float | fX,
|  | float | fY,
|  | Sint32 | idRes = 0 ) const

Get a pixel color.

Parameters

  fX | X (horizontal) coordinate of the pixel.
  fY | Y (vertical) coordinate of the pixel.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  The RGBA pixel value (0xRRGGBBAA), or transparent black (0x00000000) on failure.

Note
  Transparent black is also a valid pixel value, so this method cannot distinguish it from failure.
  When idRes is a screen, this method captures a full screen snapshot for every call and then reads one pixel. This can allocate memory and force a renderer/GPU readback stall. Do not call it in per-pixel loops or frame-critical code.
  For batch image reads, use Image::getSurface() with getSurfacePixel(). For batch screen reads, capture a screen snapshot once and read from that surface.

## ◆ lineH() [1/2]

bool CRM64Pro::GFX::lineH | ( | float | fX1,
|  | float | fX2,
|  | float | fY,
|  | Uint32 | iColor,
|  | Sint32 | idRes = 0 )

Draw a horizontal line.

Parameters

  fX1 | X coordinate of the first point of the line.
  fX2 | X coordinate of the second point of the line.
  fY | Y coordinate of the points of the line.
  iColor | The color value (0xRRGGBBAA).
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ lineH() [2/2]

bool CRM64Pro::GFX::lineH | ( | float | fX1,
|  | float | fX2,
|  | float | fY,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | Sint32 | idRes = 0 )

Draw a horizontal line.

Parameters

  fX1 | X coordinate of the first point of the line.
  fX2 | X coordinate of the second point of the line.
  fY | Y coordinate of the points of the line.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ lineV() [1/2]

bool CRM64Pro::GFX::lineV | ( | float | fX,
|  | float | fY1,
|  | float | fY2,
|  | Uint32 | iColor,
|  | Sint32 | idRes = 0 )

Draw a vertical line.

Parameters

  fX | X coordinate of the points of the line.
  fY1 | Y coordinate of the first point of the line.
  fY2 | Y coordinate of the second point of the line.
  iColor | The color value (0xRRGGBBAA).
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ lineV() [2/2]

bool CRM64Pro::GFX::lineV | ( | float | fX,
|  | float | fY1,
|  | float | fY2,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | Sint32 | idRes = 0 )

Draw a vertical line.

Parameters

  fX | X coordinate of the points of the line.
  fY1 | Y coordinate of the first point of the line.
  fY2 | Y coordinate of the second point of the line.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ line() [1/2]

bool CRM64Pro::GFX::line | ( | float | fX1,
|  | float | fY1,
|  | float | fX2,
|  | float | fY2,
|  | Uint32 | iColor,
|  | Sint32 | idRes = 0 )

Draw a line.

Parameters

  fX1 | X coordinate of the first point of the line.
  fY1 | Y coordinate of the first point of the line.
  fX2 | X coordinate of the second point of the line.
  fY2 | Y coordinate of the second point of the line.
  iColor | The color value (0xRRGGBBAA).
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ line() [2/2]

bool CRM64Pro::GFX::line | ( | float | fX1,
|  | float | fY1,
|  | float | fX2,
|  | float | fY2,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | Sint32 | idRes = 0 )

Draw a line.

Parameters

  fX1 | X coordinate of the first point of the line.
  fY1 | Y coordinate of the first point of the line.
  fX2 | X coordinate of the second point of the line.
  fY2 | Y coordinate of the second point of the line.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ rect() [1/2]

bool CRM64Pro::GFX::rect | ( | float | fX1,
|  | float | fY1,
|  | float | fX2,
|  | float | fY2,
|  | Uint32 | iColor,
|  | Sint32 | idRes = 0 )

Draw an outlined rectangle.

Parameters

  fX1 | X coordinate of the left edge of the rectangle.
  fY1 | Y coordinate of the top edge of the rectangle.
  fX2 | X coordinate of the exclusive right edge of the rectangle.
  fY2 | Y coordinate of the exclusive bottom edge of the rectangle.
  iColor | The color value (0xRRGGBBAA).
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Note
  Rectangle coordinates use SDL/Godot-style exclusive far edges: width = fX2 - fX1 and height = fY2 - fY1.

Returns
  true on success, or false on failure.

## ◆ rect() [2/2]

bool CRM64Pro::GFX::rect | ( | float | fX1,
|  | float | fY1,
|  | float | fX2,
|  | float | fY2,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | Sint32 | idRes = 0 )

Draw an outlined rectangle.

Parameters

  fX1 | X coordinate of the left edge of the rectangle.
  fY1 | Y coordinate of the top edge of the rectangle.
  fX2 | X coordinate of the exclusive right edge of the rectangle.
  fY2 | Y coordinate of the exclusive bottom edge of the rectangle.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Note
  Rectangle coordinates use SDL/Godot-style exclusive far edges: width = fX2 - fX1 and height = fY2 - fY1.

Returns
  true on success, or false on failure.

## ◆ rectFilled() [1/2]

bool CRM64Pro::GFX::rectFilled | ( | float | fX1,
|  | float | fY1,
|  | float | fX2,
|  | float | fY2,
|  | Uint32 | iColor,
|  | Sint32 | idRes = 0 )

Draw a filled rectangle.

Parameters

  fX1 | X coordinate of the left edge of the rectangle.
  fY1 | Y coordinate of the top edge of the rectangle.
  fX2 | X coordinate of the exclusive right edge of the rectangle.
  fY2 | Y coordinate of the exclusive bottom edge of the rectangle.
  iColor | The color value (0xRRGGBBAA).
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Note
  Rectangle coordinates use SDL/Godot-style exclusive far edges: width = fX2 - fX1 and height = fY2 - fY1.

Returns
  true on success, or false on failure.

## ◆ rectFilled() [2/2]

bool CRM64Pro::GFX::rectFilled | ( | float | fX1,
|  | float | fY1,
|  | float | fX2,
|  | float | fY2,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | Sint32 | idRes = 0 )

Draw a filled rectangle.

Parameters

  fX1 | X coordinate of the left edge of the rectangle.
  fY1 | Y coordinate of the top edge of the rectangle.
  fX2 | X coordinate of the exclusive right edge of the rectangle.
  fY2 | Y coordinate of the exclusive bottom edge of the rectangle.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Note
  Rectangle coordinates use SDL/Godot-style exclusive far edges: width = fX2 - fX1 and height = fY2 - fY1.

Returns
  true on success, or false on failure.

## ◆ rectRound() [1/2]

bool CRM64Pro::GFX::rectRound | ( | float | fX1,
|  | float | fY1,
|  | float | fX2,
|  | float | fY2,
|  | float | fRad,
|  | Uint32 | iColor,
|  | Sint32 | idRes = 0 )

Draw a round outlined rectangle.

Parameters

  fX1 | X coordinate of the left edge of the rectangle.
  fY1 | Y coordinate of the top edge of the rectangle.
  fX2 | X coordinate of the exclusive right edge of the rectangle.
  fY2 | Y coordinate of the exclusive bottom edge of the rectangle.
  fRad | Radius in pixels of the corner arc.
  iColor | The color value (0xRRGGBBAA).
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Note
  Rectangle coordinates use SDL/Godot-style exclusive far edges: width = fX2 - fX1 and height = fY2 - fY1.

Returns
  true on success, or false on failure.

## ◆ rectRound() [2/2]

bool CRM64Pro::GFX::rectRound | ( | float | fX1,
|  | float | fY1,
|  | float | fX2,
|  | float | fY2,
|  | float | fRad,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | Sint32 | idRes = 0 )

Draw a round outlined rectangle.

Parameters

  fX1 | X coordinate of the left edge of the rectangle.
  fY1 | Y coordinate of the top edge of the rectangle.
  fX2 | X coordinate of the exclusive right edge of the rectangle.
  fY2 | Y coordinate of the exclusive bottom edge of the rectangle.
  fRad | Radius in pixels of the corner arc.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Note
  Rectangle coordinates use SDL/Godot-style exclusive far edges: width = fX2 - fX1 and height = fY2 - fY1.

Returns
  true on success, or false on failure.

## ◆ rectFilledRound() [1/2]

bool CRM64Pro::GFX::rectFilledRound | ( | float | fX1,
|  | float | fY1,
|  | float | fX2,
|  | float | fY2,
|  | float | fRad,
|  | Uint32 | iColor,
|  | Sint32 | idRes = 0 )

Draw a round filled rectangle.

Parameters

  fX1 | X coordinate of the left edge of the rectangle.
  fY1 | Y coordinate of the top edge of the rectangle.
  fX2 | X coordinate of the exclusive right edge of the rectangle.
  fY2 | Y coordinate of the exclusive bottom edge of the rectangle.
  fRad | Radius in pixels of the corner arc.
  iColor | The color value (0xRRGGBBAA).
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Note
  Rectangle coordinates use SDL/Godot-style exclusive far edges: width = fX2 - fX1 and height = fY2 - fY1.

Returns
  true on success, or false on failure.

## ◆ rectFilledRound() [2/2]

bool CRM64Pro::GFX::rectFilledRound | ( | float | fX1,
|  | float | fY1,
|  | float | fX2,
|  | float | fY2,
|  | float | fRad,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | Sint32 | idRes = 0 )

Draw a round filled rectangle.

Parameters

  fX1 | X coordinate of the left edge of the rectangle.
  fY1 | Y coordinate of the top edge of the rectangle.
  fX2 | X coordinate of the exclusive right edge of the rectangle.
  fY2 | Y coordinate of the exclusive bottom edge of the rectangle.
  fRad | Radius in pixels of the corner arc.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Note
  Rectangle coordinates use SDL/Godot-style exclusive far edges: width = fX2 - fX1 and height = fY2 - fY1.

Returns
  true on success, or false on failure.

## ◆ arc() [1/2]

bool CRM64Pro::GFX::arc | ( | float | fX,
|  | float | fY,
|  | float | fRad,
|  | float | fStart,
|  | float | fEnd,
|  | Uint32 | iColor,
|  | Sint32 | idRes = 0 )

Draw an arc.

Parameters

  fX | X coordinate of the center of the arc.
  fY | Y coordinate of the center of the arc.
  fRad | Radius in pixels of the arc.
  fStart | Starting radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
  fEnd | Ending radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
  iColor | The color value (0xRRGGBBAA).
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ arc() [2/2]

bool CRM64Pro::GFX::arc | ( | float | fX,
|  | float | fY,
|  | float | fRad,
|  | float | fStart,
|  | float | fEnd,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | Sint32 | idRes = 0 )

Draw an arc.

Parameters

  fX | X coordinate of the center of the arc.
  fY | Y coordinate of the center of the arc.
  fRad | Radius in pixels of the arc.
  fStart | Starting radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
  fEnd | Ending radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ circle() [1/2]

bool CRM64Pro::GFX::circle | ( | float | fX,
|  | float | fY,
|  | float | fRad,
|  | Uint32 | iColor,
|  | Sint32 | idRes = 0 )

Draw an outlined circle.

Parameters

  fX | X coordinate of the center of the circle.
  fY | Y coordinate of the center of the circle.
  fRad | Radius in pixels of the circle.
  iColor | The color value (0xRRGGBBAA).
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ circle() [2/2]

bool CRM64Pro::GFX::circle | ( | float | fX,
|  | float | fY,
|  | float | fRad,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | Sint32 | idRes = 0 )

Draw an outlined circle.

Parameters

  fX | X coordinate of the center of the circle.
  fY | Y coordinate of the center of the circle.
  fRad | Radius in pixels of the circle.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ circleFilled() [1/2]

bool CRM64Pro::GFX::circleFilled | ( | float | fX,
|  | float | fY,
|  | float | fRad,
|  | Uint32 | iColor,
|  | Sint32 | idRes = 0 )

Draw a filled circle.

Parameters

  fX | X coordinate of the center of the circle.
  fY | Y coordinate of the center of the circle.
  fRad | Radius in pixels of the circle.
  iColor | The color value (0xRRGGBBAA).
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ circleFilled() [2/2]

bool CRM64Pro::GFX::circleFilled | ( | float | fX,
|  | float | fY,
|  | float | fRad,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | Sint32 | idRes = 0 )

Draw a filled circle.

Parameters

  fX | X coordinate of the center of the circle.
  fY | Y coordinate of the center of the circle.
  fRad | Radius in pixels of the circle.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ drawGlow() [1/2]

bool CRM64Pro::GFX::drawGlow | ( | float | fX,
|  | float | fY,
|  | float | fRadius,
|  | Uint32 | iColor,
|  | float | fIntensity = 1.0f,
|  | Sint32 | idRes = 0 )

Draw a soft additive glow.

Parameters

  fX | X coordinate of the center of the glow.
  fY | Y coordinate of the center of the glow.
  fRadius | Radius in pixels of the glow. Must be greater than 0.
  iColor | The color value (0xRRGGBBAA).
  fIntensity | Brightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

Note
  This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

## ◆ drawGlow() [2/2]

bool CRM64Pro::GFX::drawGlow | ( | float | fX,
|  | float | fY,
|  | float | fRadius,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | float | fIntensity = 1.0f,
|  | Sint32 | idRes = 0 )

Draw a soft additive glow.

Parameters

  fX | X coordinate of the center of the glow.
  fY | Y coordinate of the center of the glow.
  fRadius | Radius in pixels of the glow. Must be greater than 0.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  fIntensity | Brightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

Note
  This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

## ◆ drawRadialGlow() [1/2]

bool CRM64Pro::GFX::drawRadialGlow | ( | float | fX,
|  | float | fY,
|  | float | fInnerRadius,
|  | float | fOuterRadius,
|  | Uint32 | iColor,
|  | float | fIntensity = 1.0f,
|  | Sint32 | idRes = 0 )

Draw a soft additive radial glow with a solid inner radius.

Parameters

  fX | X coordinate of the center of the glow.
  fY | Y coordinate of the center of the glow.
  fInnerRadius | Radius in pixels of the full-intensity core. Must be greater than or equal to 0.
  fOuterRadius | Outer radius in pixels where the glow fades to transparent. Must be greater than 0.
  iColor | The color value (0xRRGGBBAA).
  fIntensity | Brightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

Note
  This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

## ◆ drawRadialGlow() [2/2]

bool CRM64Pro::GFX::drawRadialGlow | ( | float | fX,
|  | float | fY,
|  | float | fInnerRadius,
|  | float | fOuterRadius,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | float | fIntensity = 1.0f,
|  | Sint32 | idRes = 0 )

Draw a soft additive radial glow with a solid inner radius.

Parameters

  fX | X coordinate of the center of the glow.
  fY | Y coordinate of the center of the glow.
  fInnerRadius | Radius in pixels of the full-intensity core. Must be greater than or equal to 0.
  fOuterRadius | Outer radius in pixels where the glow fades to transparent. Must be greater than 0.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  fIntensity | Brightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

Note
  This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

## ◆ drawFlash() [1/2]

bool CRM64Pro::GFX::drawFlash | ( | float | fX,
|  | float | fY,
|  | float | fRadius,
|  | Uint32 | iColor,
|  | float | fIntensity = 1.0f,
|  | Sint32 | idRes = 0 )

Draw a short hot-center additive flash.

Parameters

  fX | X coordinate of the center of the flash.
  fY | Y coordinate of the center of the flash.
  fRadius | Radius in pixels of the flash. Must be greater than 0.
  iColor | The color value (0xRRGGBBAA).
  fIntensity | Brightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

Note
  This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

## ◆ drawFlash() [2/2]

bool CRM64Pro::GFX::drawFlash | ( | float | fX,
|  | float | fY,
|  | float | fRadius,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | float | fIntensity = 1.0f,
|  | Sint32 | idRes = 0 )

Draw a short hot-center additive flash.

Parameters

  fX | X coordinate of the center of the flash.
  fY | Y coordinate of the center of the flash.
  fRadius | Radius in pixels of the flash. Must be greater than 0.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  fIntensity | Brightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

Note
  This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

## ◆ drawGlowImage() [1/2]

bool CRM64Pro::GFX::drawGlowImage | ( | Sint32 | idImage,
|  | float | fX,
|  | float | fY,
|  | float | fScale,
|  | Uint32 | iColor,
|  | float | fIntensity = 1.0f,
|  | Sint32 | idRes = 0 )

Draw an image as a tinted additive glow.

Parameters

  idImage | Image handle used as the glow sprite.
  fX | X coordinate of the center of the glow image.
  fY | Y coordinate of the center of the glow image.
  fScale | Uniform scale applied to the image. Must be greater than 0.
  iColor | The color value (0xRRGGBBAA).
  fIntensity | Brightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

Note
  This method temporarily applies additive blending, color modulation and alpha modulation to the image and restores the original render state before returning.
  This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

## ◆ drawGlowImage() [2/2]

bool CRM64Pro::GFX::drawGlowImage | ( | Sint32 | idImage,
|  | float | fX,
|  | float | fY,
|  | float | fScale,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | float | fIntensity = 1.0f,
|  | Sint32 | idRes = 0 )

Draw an image as a tinted additive glow.

Parameters

  idImage | Image handle used as the glow sprite.
  fX | X coordinate of the center of the glow image.
  fY | Y coordinate of the center of the glow image.
  fScale | Uniform scale applied to the image. Must be greater than 0.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  fIntensity | Brightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

Note
  This method temporarily applies additive blending, color modulation and alpha modulation to the image and restores the original render state before returning.
  This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

## ◆ drawGlowSprite() [1/2]

bool CRM64Pro::GFX::drawGlowSprite | ( | Sint32 | idSprite,
|  | float | fX,
|  | float | fY,
|  | float | fScale,
|  | Uint32 | iColor,
|  | float | fIntensity = 1.0f,
|  | Sint32 | idRes = 0 )

Draw the current sprite frame as a tinted additive glow.

Parameters

  idSprite | Sprite handle used as the glow sprite.
  fX | X coordinate of the sprite position. The current sprite hotspot controls the rendered top-left corner.
  fY | Y coordinate of the sprite position. The current sprite hotspot controls the rendered top-left corner.
  fScale | Uniform scale applied to the sprite. Must be greater than 0.
  iColor | The color value (0xRRGGBBAA).
  fIntensity | Brightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

Note
  This method uses the sprite current animation frame. It temporarily applies additive blending, color modulation and alpha modulation to the assigned image and restores the original render state before returning.
  This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

## ◆ drawGlowSprite() [2/2]

bool CRM64Pro::GFX::drawGlowSprite | ( | Sint32 | idSprite,
|  | float | fX,
|  | float | fY,
|  | float | fScale,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | float | fIntensity = 1.0f,
|  | Sint32 | idRes = 0 )

Draw the current sprite frame as a tinted additive glow.

Parameters

  idSprite | Sprite handle used as the glow sprite.
  fX | X coordinate of the sprite position. The current sprite hotspot controls the rendered top-left corner.
  fY | Y coordinate of the sprite position. The current sprite hotspot controls the rendered top-left corner.
  fScale | Uniform scale applied to the sprite. Must be greater than 0.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  fIntensity | Brightness multiplier clamped to [0.0, 1.0]. Default is 1.0.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

Note
  This method uses the sprite current animation frame. It temporarily applies additive blending, color modulation and alpha modulation to the assigned image and restores the original render state before returning.
  This is a decorative additive effect; it does not illuminate scene objects or cast shadows.

## ◆ ellipse() [1/2]

bool CRM64Pro::GFX::ellipse | ( | float | fX,
|  | float | fY,
|  | float | fRadX,
|  | float | fRadY,
|  | Uint32 | iColor,
|  | Sint32 | idRes = 0 )

Draw an outlined ellipse.

Parameters

  fX | X coordinate of the center of the ellipse.
  fY | Y coordinate of the center of the ellipse.
  fRadX | horizontal radius in pixels of the ellipse.
  fRadY | vertical radius in pixels of the ellipse.
  iColor | The color value (0xRRGGBBAA).
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ ellipse() [2/2]

bool CRM64Pro::GFX::ellipse | ( | float | fX,
|  | float | fY,
|  | float | fRadX,
|  | float | fRadY,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | Sint32 | idRes = 0 )

Draw an outlined ellipse.

Parameters

  fX | X coordinate of the center of the ellipse.
  fY | Y coordinate of the center of the ellipse.
  fRadX | horizontal radius in pixels of the ellipse.
  fRadY | vertical radius in pixels of the ellipse.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ ellipseFilled() [1/2]

bool CRM64Pro::GFX::ellipseFilled | ( | float | fX,
|  | float | fY,
|  | float | fRadX,
|  | float | fRadY,
|  | Uint32 | iColor,
|  | Sint32 | idRes = 0 )

Draw a filled ellipse.

Parameters

  fX | X coordinate of the center of the ellipse.
  fY | Y coordinate of the center of the ellipse.
  fRadX | horizontal radius in pixels of the ellipse.
  fRadY | vertical radius in pixels of the ellipse.
  iColor | The color value (0xRRGGBBAA).
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ ellipseFilled() [2/2]

bool CRM64Pro::GFX::ellipseFilled | ( | float | fX,
|  | float | fY,
|  | float | fRadX,
|  | float | fRadY,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | Sint32 | idRes = 0 )

Draw a filled ellipse.

Parameters

  fX | X coordinate of the center of the ellipse.
  fY | Y coordinate of the center of the ellipse.
  fRadX | horizontal radius in pixels of the ellipse.
  fRadY | vertical radius in pixels of the ellipse.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ polygon() [1/2]

bool CRM64Pro::GFX::polygon | ( | const float * | fVX,
|  | const float * | fVY,
|  | Sint32 | iNV,
|  | Uint32 | iColor,
|  | Sint32 | idRes = 0 )

Draw an outlined polygon.

Parameters

  fVX | Vertex array containing X coordinates of the points of the polygon. The array is not modified.
  fVY | Vertex array containing Y coordinates of the points of the polygon. The array is not modified.
  iNV | Number of points in the vertex array. From a minimum number of 3 up to 31.
  iColor | The color value (0xRRGGBBAA).
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ polygon() [2/2]

bool CRM64Pro::GFX::polygon | ( | const float * | fVX,
|  | const float * | fVY,
|  | Sint32 | iNV,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | Sint32 | idRes = 0 )

Draw an outlined polygon.

Parameters

  fVX | Vertex array containing X coordinates of the points of the polygon. The array is not modified.
  fVY | Vertex array containing Y coordinates of the points of the polygon. The array is not modified.
  iNV | Number of points in the vertex array. From a minimum number of 3 up to 31.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ polygonFilled() [1/2]

bool CRM64Pro::GFX::polygonFilled | ( | const float * | fVX,
|  | const float * | fVY,
|  | Sint32 | iNV,
|  | Uint32 | iColor,
|  | Sint32 | idRes = 0 )

Draw a filled polygon.

Parameters

  fVX | Vertex array containing X coordinates of the points of the polygon. The array is not modified.
  fVY | Vertex array containing Y coordinates of the points of the polygon. The array is not modified.
  iNV | Number of points in the vertex array. From a minimum number of 3 up to 31.
  iColor | The color value (0xRRGGBBAA).
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ polygonFilled() [2/2]

bool CRM64Pro::GFX::polygonFilled | ( | const float * | fVX,
|  | const float * | fVY,
|  | Sint32 | iNV,
|  | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 | iA,
|  | Sint32 | idRes = 0 )

Draw a filled polygon.

Parameters

  fVX | Vertex array containing X coordinates of the points of the polygon. The array is not modified.
  fVY | Vertex array containing Y coordinates of the points of the polygon. The array is not modified.
  iNV | Number of points in the vertex array. From a minimum number of 3 up to 31.
  iR | The red color value.
  iG | The green color value.
  iB | The blue color value.
  iA | The alpha value.
  idRes | a valid screen or image handle. By default it tries to use the default screen.

Returns
  true on success, or false on failure.

## ◆ rgbToHSV()

bool CRM64Pro::GFX::rgbToHSV | ( | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | float * | fH,
|  | float * | fS,
|  | float * | fV )

Color conversion from RGB to HSV.

Parameters

  iR | Red component.
  iG | Green component.
  iB | Blue component.
  fH | non-null pointer to Hue component. Greys use -1.
  fS | non-null pointer to Saturation component in the range [0, 1].
  fV | non-null pointer to Value component in the range [0, 1].

Returns
  true on success, or false on failure.

## ◆ hsvToRGB()

bool CRM64Pro::GFX::hsvToRGB | ( | float | fH,
|  | float | fS,
|  | float | fV,
|  | Uint8 * | iR,
|  | Uint8 * | iG,
|  | Uint8 * | iB )

Color conversion from HSV to RGB.

Parameters

  fH | finite Hue component in degrees. Values are normalized to [0, 360).
  fS | Saturation component in the range [0, 1].
  fV | Value component in the range [0, 1].
  iR | non-null pointer to Red component.
  iG | non-null pointer to Green component.
  iB | non-null pointer to Blue component.

Returns
  true on success, or false on failure.

## ◆ rgbToYUV()

bool CRM64Pro::GFX::rgbToYUV | ( | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 * | iY,
|  | Uint8 * | iU,
|  | Uint8 * | iV )

Color conversion from RGB to YUV.

Parameters

  iR | Red component.
  iG | Green component.
  iB | Blue component.
  iY | non-null pointer to luma component.
  iU | non-null pointer to chrominance U component.
  iV | non-null pointer to chrominance V component.

Returns
  true on success, or false on failure.

## ◆ yuvToRGB()

bool CRM64Pro::GFX::yuvToRGB | ( | Uint8 | iY,
|  | Uint8 | iU,
|  | Uint8 | iV,
|  | Uint8 * | iR,
|  | Uint8 * | iG,
|  | Uint8 * | iB )

Color conversion from YUV to RGB.

Parameters

  iY | luma component.
  iU | chrominance U component.
  iV | chrominance V component.
  iR | non-null pointer to Red component.
  iG | non-null pointer to Green component.
  iB | non-null pointer to Blue component.

Returns
  true on success, or false on failure.

## ◆ rgbToYCC()

bool CRM64Pro::GFX::rgbToYCC | ( | Uint8 | iR,
|  | Uint8 | iG,
|  | Uint8 | iB,
|  | Uint8 * | iY,
|  | Uint8 * | iCb,
|  | Uint8 * | iCr )

Color conversion from RGB to YCC.

Parameters

  iR | Red component.
  iG | Green component.
  iB | Blue component.
  iY | non-null pointer to luma component.
  iCb | non-null pointer to chrominance blue component.
  iCr | non-null pointer to chrominance red component.

Returns
  true on success, or false on failure.

## ◆ yccToRGB()

bool CRM64Pro::GFX::yccToRGB | ( | Uint8 | iY,
|  | Uint8 | iCb,
|  | Uint8 | iCr,
|  | Uint8 * | iR,
|  | Uint8 * | iG,
|  | Uint8 * | iB )

Color conversion from YCC to RGB.

Parameters

  iY | luma component.
  iCb | chrominance blue component.
  iCr | chrominance red component.
  iR | non-null pointer to Red component.
  iG | non-null pointer to Green component.
  iB | non-null pointer to Blue component.

Returns
  true on success, or false on failure.