openMSX
Public Member Functions | Static Public Member Functions | List of all members
openmsx::GLImage Class Reference

#include <GLImage.hh>

Public Member Functions

 GLImage (const std::string &filename)
 
 GLImage (SDLSurfacePtr image)
 
 GLImage (const std::string &filename, float scaleFactor)
 
 GLImage (const std::string &filename, gl::ivec2 size)
 
 GLImage (gl::ivec2 size, uint32_t rgba)
 
 GLImage (gl::ivec2 size, std::span< const uint32_t, 4 > rgba, int borderSize, uint32_t borderRGBA)
 
void draw (gl::ivec2 pos, uint8_t alpha=255)
 
void draw (gl::ivec2 pos, uint8_t r, uint8_t g, uint8_t b, uint8_t alpha)
 
gl::ivec2 getSize () const
 

Static Public Member Functions

static void checkSize (gl::ivec2 size)
 Performs a sanity check on image size.
 

Detailed Description

Definition at line 19 of file GLImage.hh.

Constructor & Destructor Documentation

◆ GLImage() [1/6]

openmsx::GLImage::GLImage ( const std::string &  filename)
explicit

Definition at line 75 of file GLImage.cc.

◆ GLImage() [2/6]

openmsx::GLImage::GLImage ( SDLSurfacePtr  image)
explicit

Definition at line 131 of file GLImage.cc.

◆ GLImage() [3/6]

openmsx::GLImage::GLImage ( const std::string &  filename,
float  scaleFactor 
)

Definition at line 80 of file GLImage.cc.

References checkSize(), and gl::trunc().

◆ GLImage() [4/6]

openmsx::GLImage::GLImage ( const std::string &  filename,
gl::ivec2  size 
)

Definition at line 87 of file GLImage.cc.

References checkSize().

◆ GLImage() [5/6]

openmsx::GLImage::GLImage ( gl::ivec2  size,
uint32_t  rgba 
)

Definition at line 94 of file GLImage.cc.

References checkSize(), and xrange().

◆ GLImage() [6/6]

openmsx::GLImage::GLImage ( gl::ivec2  size,
std::span< const uint32_t, 4 >  rgba,
int  borderSize,
uint32_t  borderRGBA 
)

Definition at line 108 of file GLImage.cc.

References checkSize(), and xrange().

Member Function Documentation

◆ checkSize()

void openmsx::GLImage::checkSize ( gl::ivec2  size)
static

Performs a sanity check on image size.

Throws MSXException if width or height is excessively large. Negative image sizes are valid and flip the image.

Definition at line 23 of file GLImage.cc.

Referenced by GLImage(), GLImage(), GLImage(), and GLImage().

◆ draw() [1/2]

void openmsx::GLImage::draw ( gl::ivec2  pos,
uint8_t  alpha = 255 
)
inline

Definition at line 30 of file GLImage.hh.

References draw().

Referenced by draw().

◆ draw() [2/2]

void openmsx::GLImage::draw ( gl::ivec2  pos,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  alpha 
)

◆ getSize()

gl::ivec2 openmsx::GLImage::getSize ( ) const
inline

Definition at line 36 of file GLImage.hh.


The documentation for this class was generated from the following files: